MaxTokens
A class to be used on spawning an agent or decorating an agentic function to control the maximum number of output tokens generated by the underlying model.
The maximum number of output tokens generated over all rounds of inference in a single invocation.Defaults to
null meaning unlimited.The maximum number of output tokens generated in a single round of inference in a single invocation.Defaults to
null meaning unlimited.The maximum number of rounds of inference in a single invocation.Defaults to
null meaning unlimited.Usage
A class outlining the token usage of the underlying model of an agent or agentic function.
The number of input tokens consumed by the model.
The number of output tokens generated by the model.
The total number of tokens processed, not double-counting generated then re-consumed tokens.
The number of input tokens that were served from cache. Defaults to
0.The number of tokens used for internal reasoning / chain-of-thought. Defaults to
0.