WordPress\AiClient\Results\DTO

TokenUsage::getJsonSchemapublic staticWP 0.1.0

{@inheritDoc}

Method of the class: TokenUsage{}

No Hooks.

Returns

null. Nothing (null).

Usage

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

Changelog

Since 0.1.0 Introduced.

TokenUsage::getJsonSchema() code WP 7.0

public static function getJsonSchema(): array
{
    return ['type' => 'object', 'properties' => [self::KEY_PROMPT_TOKENS => ['type' => 'integer', 'description' => 'Number of tokens in the prompt.'], self::KEY_COMPLETION_TOKENS => ['type' => 'integer', 'description' => 'Number of tokens in the completion, including any thought tokens.'], self::KEY_TOTAL_TOKENS => ['type' => 'integer', 'description' => 'Total number of tokens used.'], self::KEY_THOUGHT_TOKENS => ['type' => 'integer', 'description' => 'Number of tokens used for thinking, as a subset of completion tokens.']], 'required' => [self::KEY_PROMPT_TOKENS, self::KEY_COMPLETION_TOKENS, self::KEY_TOTAL_TOKENS]];
}