ToolChoice class
Controls how / whether the model selects tools during sampling (spec 2025-11-25 sampling tool calling, SEP-1577).
type is one of auto (model decides), any (must call some tool),
none (no tool call), or tool (must call the named tool — name
required in that case). Round-trips via toJson / fromJson.
Constructors
- ToolChoice({required String type, String? name})
-
const
- ToolChoice.any()
-
const
- ToolChoice.auto()
-
Convenience constructors mirroring the spec's enumerated modes.
const
-
ToolChoice.fromJson(Map<
String, dynamic> json) -
factory
- ToolChoice.none()
-
const
- ToolChoice.tool(String toolName)
-
const
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited