ToolChoiceConfig class

Configures how the model selects which tool (if any) to call.

Constructors

ToolChoiceConfig.auto()
Lets the model decide whether to call a tool.
const
ToolChoiceConfig.name(String functionName)
Named tool choice for specific function
const
ToolChoiceConfig.none()
Disables tool calling entirely.
const
ToolChoiceConfig.required()
Forces the model to call one of the provided tools.
const
ToolChoiceConfig.server(String type)
OpenRouter extension: force a specific server tool by naming it directly.
const

Properties

functionName String?
The name of the function when type is 'function'.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type String
The tool-choice mode (e.g. 'none', 'auto', 'required', 'function').
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → dynamic
Serializes this tool-choice configuration to its JSON representation.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited