Class RealtimeResponseCreateParams.ToolChoice
-
- All Implemented Interfaces:
public final class RealtimeResponseCreateParams.ToolChoiceHow the model chooses tools. Provide one of the string modes or force a specific function/MCP tool.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceRealtimeResponseCreateParams.ToolChoice.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<ToolChoiceOptions>options()Controls which (if any) tool is called by the model. final Optional<ToolChoiceFunction>function()Use this option to force the model to call a specific function. final Optional<ToolChoiceMcp>mcp()Use this option to force the model to call a specific tool on a remote MCP server. final BooleanisOptions()final BooleanisFunction()final BooleanisMcp()final ToolChoiceOptionsasOptions()Controls which (if any) tool is called by the model. final ToolChoiceFunctionasFunction()Use this option to force the model to call a specific function. final ToolChoiceMcpasMcp()Use this option to force the model to call a specific tool on a remote MCP server. final Optional<JsonValue>_json()final <T extends Any> Taccept(RealtimeResponseCreateParams.ToolChoice.Visitor<T> visitor)final RealtimeResponseCreateParams.ToolChoicevalidate()final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static RealtimeResponseCreateParams.ToolChoiceofOptions(ToolChoiceOptions options)Controls which (if any) tool is called by the model. final static RealtimeResponseCreateParams.ToolChoiceofFunction(ToolChoiceFunction function)Use this option to force the model to call a specific function. final static RealtimeResponseCreateParams.ToolChoiceofMcp(ToolChoiceMcp mcp)Use this option to force the model to call a specific tool on a remote MCP server. -
-
Method Detail
-
options
final Optional<ToolChoiceOptions> options()
Controls 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.
-
function
final Optional<ToolChoiceFunction> function()
Use this option to force the model to call a specific function.
-
mcp
final Optional<ToolChoiceMcp> mcp()
Use this option to force the model to call a specific tool on a remote MCP server.
-
isFunction
final Boolean isFunction()
-
asOptions
final ToolChoiceOptions asOptions()
Controls 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.
-
asFunction
final ToolChoiceFunction asFunction()
Use this option to force the model to call a specific function.
-
asMcp
final ToolChoiceMcp asMcp()
Use this option to force the model to call a specific tool on a remote MCP server.
-
accept
final <T extends Any> T accept(RealtimeResponseCreateParams.ToolChoice.Visitor<T> visitor)
-
validate
final RealtimeResponseCreateParams.ToolChoice validate()
-
ofOptions
final static RealtimeResponseCreateParams.ToolChoice ofOptions(ToolChoiceOptions options)
Controls 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.
-
ofFunction
final static RealtimeResponseCreateParams.ToolChoice ofFunction(ToolChoiceFunction function)
Use this option to force the model to call a specific function.
-
ofMcp
final static RealtimeResponseCreateParams.ToolChoice ofMcp(ToolChoiceMcp mcp)
Use this option to force the model to call a specific tool on a remote MCP server.
-
-
-
-