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.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.

Source:<builtin>/anthropic/messages.bamlbytes 12712542

Fields

type

string

"auto", "any", "tool", or "none".

name

string | null

The tool the model must call. Only read when type is "tool".

disable_parallel_tool_use

bool | null

Static methods

function

any

(disable_parallel_tool_use: bool | null = …) -> anthropic.ToolChoice

The model must call one of the tools, its choice which.

function

auto

(disable_parallel_tool_use: bool | null = …) -> anthropic.ToolChoice

The model decides whether to call a tool.

function

none

() -> anthropic.ToolChoice

The model may not call a tool this turn.

function

tool

(name: string, disable_parallel_tool_use: bool | null = …) -> anthropic.ToolChoice

The model must call exactly this tool.