Class ChatCompletionToolChoiceOption
-
- All Implemented Interfaces:
public final class ChatCompletionToolChoiceOptionControls which (if any) tool is called by the model.
nonemeans the model will not call any tool and instead generates a message.automeans the model can pick between generating a message or calling one or more tools.requiredmeans the model must call one or more tools. Specifying a particular tool via{"type": "function", "function": {"name": "my_function"}}forces the model to call that tool.noneis the default when no tools are present.autois the default if tools are present.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceChatCompletionToolChoiceOption.VisitorAn interface that defines how to map each variant of ChatCompletionToolChoiceOption to a value of type T.
public final classChatCompletionToolChoiceOption.Autononemeans the model will not call any tool and instead generates a message.automeans the model can pick between generating a message or calling one or more tools.requiredmeans the model must call one or more tools.
-
Method Summary
Modifier and Type Method Description final Optional<ChatCompletionToolChoiceOption.Auto>auto()nonemeans the model will not call any tool and instead generates a message.final Optional<ChatCompletionNamedToolChoice>namedToolChoice()Specifies a tool the model should use. final BooleanisAuto()final BooleanisNamedToolChoice()final ChatCompletionToolChoiceOption.AutoasAuto()nonemeans the model will not call any tool and instead generates a message.final ChatCompletionNamedToolChoiceasNamedToolChoice()Specifies a tool the model should use. final Optional<JsonValue>_json()final <T extends Any> Taccept(ChatCompletionToolChoiceOption.Visitor<T> visitor)final ChatCompletionToolChoiceOptionvalidate()final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static ChatCompletionToolChoiceOptionofAuto(ChatCompletionToolChoiceOption.Auto auto)nonemeans the model will not call any tool and instead generates a message.final static ChatCompletionToolChoiceOptionofNamedToolChoice(ChatCompletionNamedToolChoice namedToolChoice)Specifies a tool the model should use. -
-
Method Detail
-
auto
final Optional<ChatCompletionToolChoiceOption.Auto> auto()
nonemeans the model will not call any tool and instead generates a message.automeans the model can pick between generating a message or calling one or more tools.requiredmeans the model must call one or more tools.
-
namedToolChoice
final Optional<ChatCompletionNamedToolChoice> namedToolChoice()
Specifies a tool the model should use. Use to force the model to call a specific function.
-
isNamedToolChoice
final Boolean isNamedToolChoice()
-
asAuto
final ChatCompletionToolChoiceOption.Auto asAuto()
nonemeans the model will not call any tool and instead generates a message.automeans the model can pick between generating a message or calling one or more tools.requiredmeans the model must call one or more tools.
-
asNamedToolChoice
final ChatCompletionNamedToolChoice asNamedToolChoice()
Specifies a tool the model should use. Use to force the model to call a specific function.
-
accept
final <T extends Any> T accept(ChatCompletionToolChoiceOption.Visitor<T> visitor)
-
validate
final ChatCompletionToolChoiceOption validate()
-
ofAuto
final static ChatCompletionToolChoiceOption ofAuto(ChatCompletionToolChoiceOption.Auto auto)
nonemeans the model will not call any tool and instead generates a message.automeans the model can pick between generating a message or calling one or more tools.requiredmeans the model must call one or more tools.
-
ofNamedToolChoice
final static ChatCompletionToolChoiceOption ofNamedToolChoice(ChatCompletionNamedToolChoice namedToolChoice)
Specifies a tool the model should use. Use to force the model to call a specific function.
-
-
-
-