Package com.anthropic.models
Interface ToolChoice.Visitor
-
- All Implemented Interfaces:
public interface ToolChoice.Visitor<T extends Object>An interface that defines how to map each variant of ToolChoice to a value of type T.
-
-
Method Summary
Modifier and Type Method Description abstract TvisitAuto(ToolChoiceAuto auto)The model will automatically decide whether to use tools. abstract TvisitAny(ToolChoiceAny any)The model will use any available tools. abstract TvisitTool(ToolChoiceTool tool)The model will use the specified tool with tool_choice.name.Tunknown(JsonValue json)Maps an unknown variant of ToolChoice to a value of type T. -
-
Method Detail
-
visitAuto
abstract T visitAuto(ToolChoiceAuto auto)
The model will automatically decide whether to use tools.
-
visitAny
abstract T visitAny(ToolChoiceAny any)
The model will use any available tools.
-
visitTool
abstract T visitTool(ToolChoiceTool tool)
The model will use the specified tool with
tool_choice.name.
-
unknown
T unknown(JsonValue json)
Maps an unknown variant of ToolChoice to a value of type T.
An instance of ToolChoice can contain an unknown variant if it was deserialized from data that doesn't match any known variant. For example, if the SDK is on an older version than the API, then the API may respond with new variants that the SDK is unaware of.
-
-
-
-