Class Response.ToolChoice
-
- All Implemented Interfaces:
public final class Response.ToolChoice
How the model should select which tool (or tools) to use when generating a response. See the
tools
parameter to see how to specify which tools the model can call.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interface
Response.ToolChoice.Visitor
An 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<ToolChoiceOptions>
options()
Controls which (if any) tool is called by the model. final Optional<ToolChoiceTypes>
types()
Indicates that the model should use a built-in tool to generate a response. final Optional<ToolChoiceFunction>
function()
Use this option to force the model to call a specific function. final Boolean
isOptions()
final Boolean
isTypes()
final Boolean
isFunction()
final ToolChoiceOptions
asOptions()
Controls which (if any) tool is called by the model. final ToolChoiceTypes
asTypes()
Indicates that the model should use a built-in tool to generate a response. final ToolChoiceFunction
asFunction()
Use this option to force the model to call a specific function. final Optional<JsonValue>
_json()
final <T extends Any> T
accept(Response.ToolChoice.Visitor<T> visitor)
final Response.ToolChoice
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static Response.ToolChoice
ofOptions(ToolChoiceOptions options)
Controls which (if any) tool is called by the model. final static Response.ToolChoice
ofTypes(ToolChoiceTypes types)
Indicates that the model should use a built-in tool to generate a response. final static Response.ToolChoice
ofFunction(ToolChoiceFunction function)
Use this option to force the model to call a specific function. -
-
Method Detail
-
options
final Optional<ToolChoiceOptions> options()
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.
-
types
final Optional<ToolChoiceTypes> types()
Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
-
function
final Optional<ToolChoiceFunction> function()
Use this option to force the model to call a specific function.
-
isFunction
final Boolean isFunction()
-
asOptions
final ToolChoiceOptions asOptions()
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.
-
asTypes
final ToolChoiceTypes asTypes()
Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
-
asFunction
final ToolChoiceFunction asFunction()
Use this option to force the model to call a specific function.
-
accept
final <T extends Any> T accept(Response.ToolChoice.Visitor<T> visitor)
-
validate
final Response.ToolChoice validate()
-
ofOptions
final static Response.ToolChoice ofOptions(ToolChoiceOptions options)
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.
-
ofTypes
final static Response.ToolChoice ofTypes(ToolChoiceTypes types)
Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
-
ofFunction
final static Response.ToolChoice ofFunction(ToolChoiceFunction function)
Use this option to force the model to call a specific function.
-
-
-
-