forked from WordPress/wordpress-develop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathai-client.php
More file actions
34 lines (32 loc) · 1.68 KB
/
ai-client.php
File metadata and controls
34 lines (32 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
/**
* WordPress AI Client API.
*
* @package WordPress
* @subpackage AI
* @since 7.0.0
*/
use WordPress\AiClient\AiClient;
/**
* Creates a new AI prompt builder using the default provider registry.
*
* This is the main entry point for generating AI content in WordPress. It returns
* a fluent builder that can be used to configure and execute AI prompts.
*
* The prompt can be provided as a simple string for basic text prompts, or as more
* complex types for advanced use cases like multi-modal content or conversation history.
*
* @since 7.0.0
*
* @param string|MessagePart|Message|array|list<string|MessagePart|array>|list<Message>|null $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.
* @return WP_AI_Client_Prompt_Builder The prompt builder instance.
*/
function wp_ai_client_prompt( $prompt = null ) {
return new WP_AI_Client_Prompt_Builder( AiClient::defaultRegistry(), $prompt );
}