PromptBuilder::generateTexts( int|null $candidateCount = null ): WordPressAiClientBuilderslist<string>

In this article

Generates multiple text candidates from the prompt.

Parameters

$candidateCountint|nulloptional
The number of candidates to generate.

Default:null

Return

WordPressAiClientBuilderslist<string> The generated texts.

Source

public function generateTexts(?int $candidateCount = null): array
{
    if ($candidateCount !== null) {
        $this->usingCandidateCount($candidateCount);
    }
    // Generate text result
    return $this->generateTextResult()->toTexts();
}

Changelog

VersionDescription
0.1.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.