generate_text(); * * // Explicit values still win: * $result = acai_model_manager_apply_defaults( * wp_ai_client_prompt( 'Be creative.' )->using_temperature( 1.5 ) * )->generate_text(); * * @since 0.0.1 * * @param WP_AI_Client_Prompt_Builder $builder The prompt builder to apply defaults to. * @return WP_AI_Client_Prompt_Builder The same builder instance with defaults applied. */ function acai_model_manager_apply_defaults( WP_AI_Client_Prompt_Builder $builder ): WP_AI_Client_Prompt_Builder { if ( ! class_exists( 'AcrossAI_Model_Manager\\Includes\\Generation_Params' ) ) { return $builder; } $config = AcrossAI_Model_Manager\Includes\Generation_Params::get_model_config(); // using_model_config() merges with the builder's existing config, giving // precedence to values the calling plugin has already set explicitly. $builder->using_model_config( $config ); return $builder; } }