Reference › AiClient AiClient::generateTextResult ( WordPress\AiClient\Prompt $prompt , WordPress\AiClient\Providers\Models\Contracts\ModelInterface | WordPress\AiClient\Providers\Models\DTO\ModelConfig| null $modelOrConfig = null , WordPress\AiClient\Providers\ProviderRegistry | null $registry = null ): WordPress\AiClient\Results\DTO\GenerativeAiResult
Since 0.1.0
Source wp-includes/php-ai-client/src/AiClient.php:252Parameters Return Uses Source History Generates text using the traditional API approach.
Parameters
$promptWordPress\AiClient\Prompt The prompt content.
$modelOrConfigWordPress\AiClient\Providers\Models\Contracts\ModelInterface | WordPress\AiClient\Providers\Models\DTO\ModelConfig| nulloptional Optional specific model to use, or model configuration for auto-discovery, or null for defaults.Default: null
$registryWordPress\AiClient\Providers\ProviderRegistry | nulloptional Optional custom registry. If null, uses default.Default: null Return
WordPress\AiClient\Results\DTO\GenerativeAiResult The generation result. Uses · 3 \WordPress\AiClient\AiClient::validateModelOrConfigParameter() self::getConfiguredPromptBuilder($prompt, $modelOrConfig, $registry)::generateTextResult() \WordPress\AiClient\AiClient::getConfiguredPromptBuilder() Source View on Trac ↗ View on GitHub ↗
252 public static function generateTextResult ( $prompt , $modelOrConfig = null , ? ProviderRegistry $registry = null ) : GenerativeAiResult 253 { 254 self :: validateModelOrConfigParameter ( $modelOrConfig ) ; 255 return self :: getConfiguredPromptBuilder ( $prompt , $modelOrConfig , $registry ) -> generateTextResult ( ) ; 256 } History Introduced in 0.1.0 . Unchanged from 7.0.4 through 7.1.0.
7.0.4 7.1.0 Signature, return type and hooks compared across 2 parsed releases.
About this page Parsed data Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/php-ai-client/src/AiClient.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. Corrections Something wrong on this page? Report it and it gets fixed in the next regeneration.