SpecificToolChoice class
Model must use the specified tool and only the specified tool. The string parameter is the name of the required tool. This is useful when you want the model to call a specific function.
Maps to:
- OpenAI:
{"type": "function", "function": {"name": "tool_name"}}
- Anthropic:
{"type": "tool", "name": "tool_name"}
or with disable_parallel_tool_use - xAI:
{"type": "function", "function": {"name": "tool_name"}}
- Inheritance
-
- Object
- ToolChoice
- SpecificToolChoice
Constructors
- SpecificToolChoice.new(String toolName, {bool? disableParallelToolUse})
-
const
Properties
- disableParallelToolUse → bool?
-
Whether to disable parallel tool use (Anthropic only)
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- toolName → String
-
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toAnthropicJson(
) → String -
Convert to Anthropic format
override
-
toJson(
) → Map< String, dynamic> -
override
-
toOpenAIJson(
) → Map< String, dynamic> -
Convert to OpenAI format
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
toXAIJson(
) → Map< String, dynamic> -
Convert to xAI format (OpenAI-compatible)
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited