TokenUsage::__construct( int $promptTokens, int $completionTokens, int $totalTokens, int|null $thoughtTokens = null )

In this article

Constructor.

Parameters

$promptTokensintrequired
Number of tokens in the prompt.
$completionTokensintrequired
Number of tokens in the completion, including any thought tokens.
$totalTokensintrequired
Total number of tokens used.
$thoughtTokensint|nulloptional
Number of tokens used for thinking, as a subset of completion tokens.

Default:null

Source

public function __construct(int $promptTokens, int $completionTokens, int $totalTokens, ?int $thoughtTokens = null)
{
    $this->promptTokens = $promptTokens;
    $this->completionTokens = $completionTokens;
    $this->totalTokens = $totalTokens;
    $this->thoughtTokens = $thoughtTokens;
}

Changelog

VersionDescription
0.1.0Introduced.

User Contributed Notes

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