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, decide by itself, or not use tools at all.
-
-
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 Optional<ToolChoiceNone>none()The model will not be allowed to use tools. final BooleanisAuto()final BooleanisAny()final BooleanisTool()final BooleanisNone()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 ToolChoiceNoneasNone()The model will not be allowed to use tools. 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.final static ToolChoiceofNone(ToolChoiceNone none)The model will not be allowed to use tools. -
-
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.
-
none
final Optional<ToolChoiceNone> none()
The model will not be allowed to use tools.
-
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.
-
asNone
final ToolChoiceNone asNone()
The model will not be allowed to use tools.
-
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.
-
ofNone
final static ToolChoice ofNone(ToolChoiceNone none)
The model will not be allowed to use tools.
-
-
-
-