InvocationContextUsage
Defined in: src/agent/invocation-context.ts:29
What the work in an InvocationContext has used: its turns and the token usage of every model call, including nested and auxiliary calls.
Extends
Section titled “Extends”Properties
Section titled “Properties”turnsTaken
Section titled “turnsTaken”turnsTaken: number;Defined in: src/agent/invocation-context.ts:31
Turns taken in this context, including its nested calls.
inputTokens
Section titled “inputTokens”inputTokens: number;Defined in: src/models/streaming.ts:497
Number of tokens in the input (prompt).
Inherited from
Section titled “Inherited from”outputTokens
Section titled “outputTokens”outputTokens: number;Defined in: src/models/streaming.ts:502
Number of tokens in the output (completion).
Inherited from
Section titled “Inherited from”totalTokens
Section titled “totalTokens”totalTokens: number;Defined in: src/models/streaming.ts:507
Total number of tokens (input + output).
Inherited from
Section titled “Inherited from”cacheReadInputTokens?
Section titled “cacheReadInputTokens?”optional cacheReadInputTokens?: number;Defined in: src/models/streaming.ts:513
Number of input tokens read from cache. This can reduce latency and cost.
Inherited from
Section titled “Inherited from”cacheWriteInputTokens?
Section titled “cacheWriteInputTokens?”optional cacheWriteInputTokens?: number;Defined in: src/models/streaming.ts:519
Number of input tokens written to cache. These tokens can be reused in future requests.