WordPress\AiClient\Results\DTO

GenerativeAiResult::getJsonSchemapublic staticWP 0.1.0

{@inheritDoc}

Method of the class: GenerativeAiResult{}

No Hooks.

Returns

null. Nothing (null).

Usage

$result = GenerativeAiResult::getJsonSchema(): array;

Changelog

Since 0.1.0 Introduced.

GenerativeAiResult::getJsonSchema() code WP 7.0

public static function getJsonSchema(): array
{
    return ['type' => 'object', 'properties' => [self::KEY_ID => ['type' => 'string', 'description' => 'Unique identifier for this result.'], self::KEY_CANDIDATES => ['type' => 'array', 'items' => \WordPress\AiClient\Results\DTO\Candidate::getJsonSchema(), 'minItems' => 1, 'description' => 'The generated candidates.'], self::KEY_TOKEN_USAGE => \WordPress\AiClient\Results\DTO\TokenUsage::getJsonSchema(), self::KEY_PROVIDER_METADATA => ProviderMetadata::getJsonSchema(), self::KEY_MODEL_METADATA => ModelMetadata::getJsonSchema(), self::KEY_ADDITIONAL_DATA => ['type' => 'object', 'additionalProperties' => \true, 'description' => 'Additional data included in the API response.']], 'required' => [self::KEY_ID, self::KEY_CANDIDATES, self::KEY_TOKEN_USAGE, self::KEY_PROVIDER_METADATA, self::KEY_MODEL_METADATA]];
}