| [ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Source view] [Print] [Project Stats]
(no description)
| File Size: | 144 lines (5 kb) |
| Included or required: | 0 times |
| Referenced: | 0 times |
| Includes or requires: | 0 files |
TokenUsage:: (8 methods):
__construct()
getPromptTokens()
getCompletionTokens()
getTotalTokens()
getThoughtTokens()
getJsonSchema()
toArray()
fromArray()
Class: TokenUsage - X-Ref
Represents token usage statistics for an AI operation.| __construct(int $promptTokens, int $completionTokens, int $totalTokens, ?int $thoughtTokens = null) X-Ref |
| Constructor. param: int $promptTokens Number of tokens in the prompt. param: int $completionTokens Number of tokens in the completion, including any thought tokens. param: int $totalTokens Total number of tokens used. param: int|null $thoughtTokens Number of tokens used for thinking, as a subset of completion tokens. |
| getPromptTokens() X-Ref |
| Gets the number of prompt tokens. return: int The prompt token count. |
| getCompletionTokens() X-Ref |
| Gets the number of completion tokens, including any thought tokens. return: int The completion token count. |
| getTotalTokens() X-Ref |
| Gets the total number of tokens. return: int The total token count. |
| getThoughtTokens() X-Ref |
| Gets the number of thought tokens, which is a subset of the completion token count. return: int|null The thought token count or null if not available. |
| getJsonSchema() X-Ref |
| {@inheritDoc} |
| toArray() X-Ref |
| {@inheritDoc} return: TokenUsageArrayShape |
| fromArray(array $array) X-Ref |
| {@inheritDoc} |
| Generated : Sat Jun 13 09:38:55 2026 | Cross-referenced by PHPXref |