Skip to content

Commit a2d738f

Browse files
committed
Reuse Prompt type from PromptBuilder in WP_AI_Client_Prompt_Builder constructor
1 parent d4b8da5 commit a2d738f

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

src/wp-includes/ai-client/class-wp-ai-client-prompt-builder.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
*
4242
* @since 7.0.0
4343
*
44+
* @phpstan-import-type Prompt from PromptBuilder
45+
*
4446
* @method self with_text(string $text) Adds text to the current message.
4547
* @method self with_file($file, ?string $mimeType = null) Adds a file to the current message.
4648
* @method self with_function_response(FunctionResponse $functionResponse) Adds a function response to the current message.
@@ -165,14 +167,14 @@ class WP_AI_Client_Prompt_Builder {
165167
*
166168
* @since 7.0.0
167169
*
168-
* @param ProviderRegistry $registry The provider registry for finding suitable models.
169-
* @param string|MessagePart|Message|array|list<string|MessagePart|array>|list<Message>|null $prompt Optional. Initial prompt content.
170-
* A string for simple text prompts,
171-
* a MessagePart or Message object for
172-
* structured content, an array for a
173-
* message array shape, or a list of
174-
* parts or messages for multi-turn
175-
* conversations. Default null.
170+
* @param ProviderRegistry $registry The provider registry for finding suitable models.
171+
* @param Prompt $prompt Optional. Initial prompt content.
172+
* A string for simple text prompts,
173+
* a MessagePart or Message object for
174+
* structured content, an array for a
175+
* message array shape, or a list of
176+
* parts or messages for multi-turn
177+
* conversations. Default null.
176178
*/
177179
public function __construct( ProviderRegistry $registry, $prompt = null ) {
178180
try {

0 commit comments

Comments
 (0)