Package com.anthropic.models
Class ToolChoice
-
- All Implemented Interfaces:
public final class ToolChoiceHow the model should use the provided tools. The model can use a specific tool, any available tool, or decide by itself.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceToolChoice.VisitorAn interface that defines how to map each variant of ToolChoice to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<ToolChoiceAuto>auto()The model will automatically decide whether to use tools. final Optional<ToolChoiceAny>any()The model will use any available tools. final Optional<ToolChoiceTool>tool()The model will use the specified tool with tool_choice.name.final BooleanisAuto()final BooleanisAny()final BooleanisTool()final ToolChoiceAutoasAuto()The model will automatically decide whether to use tools. final ToolChoiceAnyasAny()The model will use any available tools. final ToolChoiceToolasTool()The model will use the specified tool with tool_choice.name.final Optional<JsonValue>_json()final <T extends Any> Taccept(ToolChoice.Visitor<T> visitor)final ToolChoicevalidate()Booleanequals(Object other)IntegerhashCode()StringtoString()final static ToolChoiceofAuto(ToolChoiceAuto auto)The model will automatically decide whether to use tools. final static ToolChoiceofAny(ToolChoiceAny any)The model will use any available tools. final static ToolChoiceofTool(ToolChoiceTool tool)The model will use the specified tool with tool_choice.name.-
-
Method Detail
-
auto
final Optional<ToolChoiceAuto> auto()
The model will automatically decide whether to use tools.
-
any
final Optional<ToolChoiceAny> any()
The model will use any available tools.
-
tool
final Optional<ToolChoiceTool> tool()
The model will use the specified tool with
tool_choice.name.
-
asAuto
final ToolChoiceAuto asAuto()
The model will automatically decide whether to use tools.
-
asAny
final ToolChoiceAny asAny()
The model will use any available tools.
-
asTool
final ToolChoiceTool asTool()
The model will use the specified tool with
tool_choice.name.
-
accept
final <T extends Any> T accept(ToolChoice.Visitor<T> visitor)
-
validate
final ToolChoice validate()
-
ofAuto
final static ToolChoice ofAuto(ToolChoiceAuto auto)
The model will automatically decide whether to use tools.
-
ofAny
final static ToolChoice ofAny(ToolChoiceAny any)
The model will use any available tools.
-
ofTool
final static ToolChoice ofTool(ToolChoiceTool tool)
The model will use the specified tool with
tool_choice.name.
-
-
-
-