Skip to content

ToolChoiceDict

Union Type

ToolChoiceDict module-attribute

Dictionary form of ToolChoice, setting exactly one variant.

Union Member Types

ToolChoiceAutoDict

Bases: TypedDict

Attributes

auto instance-attribute

(Default). The Model automatically decides if a tool should be called or whether to generate text instead.

ToolChoiceAnyDict

Bases: TypedDict

Attributes

any instance-attribute

The model must request at least one tool (no text is generated).

ToolChoiceToolDict

Bases: TypedDict

Attributes

tool instance-attribute

The Model must request the specified tool. Only supported by Anthropic Claude 3 and Amazon Nova models.