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:507
Number of input tokens, as the model provider counts them (may or may not include cached tokens).
Inherited from
Section titled “Inherited from”outputTokens
Section titled “outputTokens”outputTokens: number;Defined in: src/models/streaming.ts:512
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:517
Total number of tokens processed, including any cached input tokens.
Inherited from
Section titled “Inherited from”cacheReadInputTokens?
Section titled “cacheReadInputTokens?”cacheReadInputTokens?: number;Defined in: src/models/streaming.ts:523
Number of input tokens read from cache. This can reduce latency and cost.
Inherited from
Section titled “Inherited from”cacheWriteInputTokens?
Section titled “cacheWriteInputTokens?”cacheWriteInputTokens?: number;Defined in: src/models/streaming.ts:529
Number of input tokens written to cache. These tokens can be reused in future requests.