wp-includes/ai-client/class-wp-ai-client-prompt-builder.php:107Fluent builder for constructing AI prompts, returning WP_Error on failure.
Every hook that fires from inside WP_AI_Client_Prompt_Builder, in the order it appears in the class, grouped by the method that fires it.
$builderWordPress\AiClient\Builders\PromptBuilderprivate$errorWP_Error|nullprivate$generating_methodsarray<string,private static$support_check_methodsarray<string,private staticclass WP_AI_Client_Prompt_Builder { /** * Wrapped prompt builder instance from the PHP AI Client SDK. * * @since 7.0.0 * @var PromptBuilder */ private PromptBuilder $builder; /** * WordPress error instance, if any error occurred during method calls. * * @since 7.0.0 * @var WP_Error|null */ private ?WP_Error $error = null; /** * List of methods that generate a result from the prompt. * * Structured as a map for faster lookups. * * @since 7.0.0 * @var array<string, bool> */ private static array $generating_methods = array( 'generate_result' => true, 'generate_text_result' => true, 'generate_image_result' => true, 'generate_speech_result' => true, 'convert_text_to_speech_result' => true, 'generate_video_result' => true, 'generate_text' => true, 'generate_texts' => true, 'generate_image' => true, 'generate_images' => true, 'convert_text_to_speech' => true, 'convert_text_to_speeches' => true, 'generate_speech' => true, 'generate_speeches' => true, 'generate_video' => true, 'generate_videos' => true, ); /** * List of methods that check whether the prompt is supported. * * Structured as a map for faster lookups. * * @since 7.0.0 * @var array<string, bool> */ private static array $support_check_methods = array( 'is_supported' => true, 'is_supported_for_text_generation' => true, 'is_supported_for_image_generation' => true, 'is_supported_for_text_to_speech_conversion' => true, 'is_supported_for_video_generation' => true, 'is_supported_for_speech_generation' => true, 'is_supported_for_music_generation' => true, 'is_supported_for_embedding_generation' => true, ); /** * Constructor. * * @since 7.0.0 * * @param ProviderRegistry $registry The provider registry for finding suitable models. * @param Prompt $prompt Optional. Initial prompt content. * A string for simple text prompts, * a MessagePart or Message object for * structured content, an array for a * message array shape, or a list of * parts or messages for multi-turn * conversations. Default null. */ public function __construct( ProviderRegistry $registry, $prompt = null ) { try {Introduced in 7.0.0. Unchanged from 7.0.4 through 7.1.0.
Signature, return type and hooks compared across 2 parsed releases.
src/wp-includes/ai-client/class-wp-ai-client-prompt-builder.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.