class Usage implements Arrayable, JsonSerializable

Methods

__construct(int $inputTokens = 0, int $outputTokens = 0)

Create token usage data.

int
totalTokens()

Get the total number of input and output tokens.

array
toArray()

Get the instance as an array.

array
jsonSerialize()

Get the JSON serializable representation of the instance.

Details

at line 15
__construct(int $inputTokens = 0, int $outputTokens = 0)

Create token usage data.

Parameters

int $inputTokens
int $outputTokens

at line 24
int totalTokens()

Get the total number of input and output tokens.

Return Value

int

at line 32
array toArray()

Get the instance as an array.

Return Value

array

at line 43
array jsonSerialize()

Get the JSON serializable representation of the instance.

Return Value

array