| [ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Source view] [Print] [Project Stats]
WP AI Client: WP_AI_Client_Prompt_Builder class
| File Size: | 290 lines (13 kb) |
| Included or required: | 0 times |
| Referenced: | 0 times |
| Includes or requires: | 0 files |
WP_AI_Client_Prompt_Builder:: (7 methods):
using_abilities()
create_sdk_builder()
get_error_code_prefix()
get_prevented_error_message()
is_prevented_by_filter()
get_generating_methods()
get_support_check_methods()
Class: WP_AI_Client_Prompt_Builder - X-Ref
Fluent builder for constructing AI prompts, returning WP_Error on failure.| using_abilities( ...$abilities ) X-Ref |
| Registers WordPress abilities as function declarations for the AI model. Converts each WP_Ability to a FunctionDeclaration using the wpab__ prefix naming convention and passes them to the underlying prompt builder. return: self The current instance for method chaining. param: WP_Ability|string ...$abilities The abilities to register, either as WP_Ability objects or ability name strings. |
| create_sdk_builder( ProviderRegistry $registry, $prompt ) X-Ref |
| Creates the wrapped prompt builder instance from the PHP AI Client SDK. return: PromptBuilder The SDK prompt builder instance. param: ProviderRegistry $registry The provider registry for finding suitable models. param: Prompt $prompt Initial prompt content, or null. |
| get_error_code_prefix() X-Ref |
| Retrieves the prefix used for WP_Error codes created by this builder. return: string The error code prefix. |
| get_prevented_error_message() X-Ref |
| Retrieves the error message to use when the prompt is prevented by a filter. return: string The translated error message. |
| is_prevented_by_filter() X-Ref |
| Checks whether the prompt is prevented by the `wp_ai_client_prevent_prompt` filter. return: bool Whether the prompt is prevented. |
| get_generating_methods() X-Ref |
| Retrieves the methods that generate a result from the prompt. return: array<string, bool> The generating methods map. |
| get_support_check_methods() X-Ref |
| Retrieves the methods that check whether the prompt is supported. return: array<string, bool> The support check methods map. |
| Generated : Sun Nov 1 08:20:35 2026 | Cross-referenced by PHPXref |