WordPress\AiClient\Results\DTO
TokenUsage::__construct
Constructor.
Method of the class: TokenUsage{}
No Hooks.
Returns
null. Nothing (null).
Usage
$TokenUsage = new TokenUsage(); $TokenUsage->__construct( $promptTokens, $completionTokens, $totalTokens, ?int $thoughtTokens );
- $promptTokens(int) (required)
- Number of tokens in the prompt.
- $completionTokens(int) (required)
- Number of tokens in the completion, including any thought tokens.
- $totalTokens(int) (required)
- Total number of tokens used.
- ?int $thoughtTokens
- .
Default:null
Changelog
| Since 0.1.0 | Introduced. |
TokenUsage::__construct() TokenUsage:: construct code WP 7.0
public function __construct(int $promptTokens, int $completionTokens, int $totalTokens, ?int $thoughtTokens = null)
{
$this->promptTokens = $promptTokens;
$this->completionTokens = $completionTokens;
$this->totalTokens = $totalTokens;
$this->thoughtTokens = $thoughtTokens;
}