Class ChatCompletionToolChoiceOption
-
- All Implemented Interfaces:
public final class ChatCompletionToolChoiceOption
Controls which (if any) tool is called by the model.
none
means the model will not call any tool and instead generates a message.auto
means the model can pick between generating a message or calling one or more tools.required
means 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.none
is the default when no tools are present.auto
is the default if tools are present.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interface
ChatCompletionToolChoiceOption.Visitor
public final class
ChatCompletionToolChoiceOption.Deserializer
public final class
ChatCompletionToolChoiceOption.Serializer
public final class
ChatCompletionToolChoiceOption.Auto
none
means the model will not call any tool and instead generates a message.auto
means the model can pick between generating a message or calling one or more tools.required
means the model must call one or more tools.
-
Method Summary
Modifier and Type Method Description final Optional<ChatCompletionToolChoiceOption.Auto>
auto()
none
means the model will not call any tool and instead generates a message.final Optional<ChatCompletionNamedToolChoice>
namedToolChoice()
Specifies a tool the model should use. final Boolean
isAuto()
final Boolean
isNamedToolChoice()
final ChatCompletionToolChoiceOption.Auto
asAuto()
none
means the model will not call any tool and instead generates a message.final ChatCompletionNamedToolChoice
asNamedToolChoice()
Specifies a tool the model should use. final Optional<JsonValue>
_json()
final <T extends Any> T
accept(ChatCompletionToolChoiceOption.Visitor<T> visitor)
final ChatCompletionToolChoiceOption
validate()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static ChatCompletionToolChoiceOption
ofAuto(ChatCompletionToolChoiceOption.Auto auto)
none
means the model will not call any tool and instead generates a message.final static ChatCompletionToolChoiceOption
ofNamedToolChoice(ChatCompletionNamedToolChoice namedToolChoice)
Specifies a tool the model should use. -
-
Method Detail
-
auto
final Optional<ChatCompletionToolChoiceOption.Auto> auto()
none
means the model will not call any tool and instead generates a message.auto
means the model can pick between generating a message or calling one or more tools.required
means 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()
none
means the model will not call any tool and instead generates a message.auto
means the model can pick between generating a message or calling one or more tools.required
means 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)
none
means the model will not call any tool and instead generates a message.auto
means the model can pick between generating a message or calling one or more tools.required
means 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.
-
-
-
-