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.
MaxTokens.from()
A static factory method that creates a MaxTokens instance from a configuration object with named parameters.
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.