Usage
Tracks token usage and request counts for an agent run.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Usage(input?): Usage
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
|
|
Returns
Section titled “Returns”Usage
Properties
Section titled “Properties”inputTokens
Section titled “inputTokens”inputTokens: number;
The number of input tokens used across all requests.
inputTokensDetails
Section titled “inputTokensDetails”inputTokensDetails: Record<string, number>[];
Details about the input tokens used across all requests.
outputTokens
Section titled “outputTokens”outputTokens: number;
The number of output tokens used across all requests.
outputTokensDetails
Section titled “outputTokensDetails”outputTokensDetails: Record<string, number>[];
Details about the output tokens used across all requests.
requests
Section titled “requests”requests: number;
The number of requests made to the LLM API.
totalTokens
Section titled “totalTokens”totalTokens: number;
The total number of tokens sent and received, across all requests.
Methods
Section titled “Methods”add(newUsage): void
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
|
|
Returns
Section titled “Returns”void