anthropic.ToolChoice
How the model may use the tools in the run's toolbox (`tool_choice`). Only sent when the toolbox is non-empty; the default is `auto`.
Reference version
Signature
class anthropic.ToolChoiceHow the model may use the tools in the run's toolbox (tool_choice).
Only sent when the toolbox is non-empty; the default is auto.
Source:<builtin>/anthropic/messages.bamlbytes 1271–2542
Fields
type
string"auto", "any", "tool", or "none".
name
string | nullThe tool the model must call. Only read when type is "tool".
disable_parallel_tool_use
bool | nullStatic methods
function
any
(disable_parallel_tool_use: bool | null = …) -> anthropic.ToolChoiceThe model must call one of the tools, its choice which.
function
auto
(disable_parallel_tool_use: bool | null = …) -> anthropic.ToolChoiceThe model decides whether to call a tool.
function
none
() -> anthropic.ToolChoiceThe model may not call a tool this turn.
function
tool
(name: string, disable_parallel_tool_use: bool | null = …) -> anthropic.ToolChoiceThe model must call exactly this tool.