Enum Class ToolChoiceEnum
- All Implemented Interfaces:
Serializable
,Comparable<ToolChoiceEnum>
,Constable
,ToolChoiceOption
Defines the possible string values for the 'tool_choice' parameter in a ChatCompletionRequest.
It controls how the model responds to tool calls.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe model is forced to call at least one tool.The model can choose to call a tool or not.The model will not call any tools.The model is forced to call a specific tool (not directly represented by this enum, but this value indicates a tool must be called, potentially specified by an object). -
Method Summary
Modifier and TypeMethodDescriptiongetValue()
Gets the string representation of the tool choice option.static ToolChoiceEnum
Returns the enum constant of this class with the specified name.static ToolChoiceEnum[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
AUTO
The model can choose to call a tool or not. This is the default behavior. -
NONE
The model will not call any tools. -
ANY
The model is forced to call at least one tool. -
REQUIRED
The model is forced to call a specific tool (not directly represented by this enum, but this value indicates a tool must be called, potentially specified by an object). In the context of the enum, it implies a tool must be called. The OpenAPI spec also lists "required" as a string option.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getValue
Gets the string representation of the tool choice option.- Returns:
- The tool choice option as a string.
-