WordPress\AiClient\Providers\Models\TextGeneration\Contracts

TextGenerationOperationModelInterface{}interfaceWP 0.1.0

Interface for models that support asynchronous text generation operations.

Provides methods for initiating long-running text generation tasks.

No Hooks.

Usage

$TextGenerationOperationModelInterface = new TextGenerationOperationModelInterface();
// use class methods

Methods

  1. public generateTextOperation(array $prompt)

Changelog

Since 0.1.0 Introduced.

TextGenerationOperationModelInterface{} code WP 7.0

interface TextGenerationOperationModelInterface
{
    /**
     * Creates a text generation operation.
     *
     * @since 0.1.0
     *
     * @param list<Message> $prompt Array of messages containing the text generation prompt.
     * @return GenerativeAiOperation The initiated text generation operation.
     */
    public function generateTextOperation(array $prompt): GenerativeAiOperation;
}