@@ -552,24 +552,36 @@ public static function get_home_pages( $site_description, $content_style, $targe
552
552
),
553
553
'keywords '
554
554
);
555
+
556
+ // Site classification: primary and secondary types
557
+ $ site_classification = self ::get_sitegen_from_cache ( 'siteclassification ' );
558
+ $ primary_type = 'other ' ;
559
+ $ secondary_type = 'other ' ;
560
+ if ( is_array ( $ site_classification ) ) {
561
+ $ primary_type = $ site_classification ['primaryType ' ] ?? 'other ' ;
562
+ $ secondary_type = $ site_classification ['slug ' ] ?? 'other ' ;
563
+ }
564
+
555
565
if ( ! $ generated_content_structures ) {
556
566
$ response = wp_remote_post (
557
- NFD_AI_BASE . 'generatePageContent ' ,
567
+ NFD_CONTENT_GENERATION_BASE . 'page ' ,
558
568
array (
559
569
'headers ' => array (
560
- 'Content-Type ' => 'application/json ' ,
570
+ 'Content-Type ' => 'application/json ' ,
571
+ 'Authorization ' => 'Bearer ' . HiiveConnection::get_auth_token (),
561
572
),
562
573
'timeout ' => 60 ,
563
574
'body ' => wp_json_encode (
564
575
array (
565
- 'hiivetoken ' => HiiveConnection::get_auth_token (),
566
- 'prompt ' => array (
576
+ 'prompt ' => array (
567
577
'site_description ' => $ site_description ,
568
578
'keywords ' => wp_json_encode ( $ keywords ),
569
579
'content_style ' => wp_json_encode ( $ content_style ),
570
580
'target_audience ' => wp_json_encode ( $ target_audience ),
571
581
),
572
- 'page ' => 'home ' ,
582
+ 'page ' => 'home ' ,
583
+ 'primaryType ' => $ primary_type ,
584
+ 'secondaryType ' => $ secondary_type ,
573
585
)
574
586
),
575
587
)
@@ -811,23 +823,34 @@ function ( $key ) use ( $menu_patterns_slugs ) {
811
823
}
812
824
}
813
825
826
+ // Site classification: primary and secondary types
827
+ $ site_classification = self ::get_sitegen_from_cache ( 'siteclassification ' );
828
+ $ primary_type = 'other ' ;
829
+ $ secondary_type = 'other ' ;
830
+ if ( is_array ( $ site_classification ) ) {
831
+ $ primary_type = $ site_classification ['primaryType ' ] ?? 'other ' ;
832
+ $ secondary_type = $ site_classification ['slug ' ] ?? 'other ' ;
833
+ }
834
+
814
835
$ response = wp_remote_post (
815
- NFD_AI_BASE . 'generatePageContent ' ,
836
+ NFD_CONTENT_GENERATION_BASE . 'page ' ,
816
837
array (
817
838
'headers ' => array (
818
- 'Content-Type ' => 'application/json ' ,
839
+ 'Content-Type ' => 'application/json ' ,
840
+ 'Authorization ' => 'Bearer ' . HiiveConnection::get_auth_token (),
819
841
),
820
842
'timeout ' => 60 ,
821
843
'body ' => wp_json_encode (
822
844
array (
823
- 'hiivetoken ' => HiiveConnection::get_auth_token (),
824
- 'prompt ' => array (
845
+ 'prompt ' => array (
825
846
'site_description ' => $ site_description ,
847
+ 'keywords ' => wp_json_encode ( $ keywords ),
826
848
'content_style ' => wp_json_encode ( $ content_style ),
827
849
'target_audience ' => wp_json_encode ( $ target_audience ),
828
850
),
829
- 'page ' => $ page ,
830
- 'keywords ' => wp_json_encode ( $ keywords ),
851
+ 'page ' => $ page ,
852
+ 'primaryType ' => $ primary_type ,
853
+ 'secondaryType ' => $ secondary_type ,
831
854
)
832
855
),
833
856
)
0 commit comments