Class RealtimeSessionCreateResponse.ToolChoice
-
- All Implemented Interfaces:
public final class RealtimeSessionCreateResponse.ToolChoice
How 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 interface
RealtimeSessionCreateResponse.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<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 Boolean
isOptions()
final Boolean
isFunction()
final Boolean
isMcp()
final ToolChoiceOptions
asOptions()
Controls which (if any) tool is called by the model. final ToolChoiceFunction
asFunction()
Use this option to force the model to call a specific function. final ToolChoiceMcp
asMcp()
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> T
accept(RealtimeSessionCreateResponse.ToolChoice.Visitor<T> visitor)
final RealtimeSessionCreateResponse.ToolChoice
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static RealtimeSessionCreateResponse.ToolChoice
ofOptions(ToolChoiceOptions options)
Controls which (if any) tool is called by the model. final static RealtimeSessionCreateResponse.ToolChoice
ofFunction(ToolChoiceFunction function)
Use this option to force the model to call a specific function. final static RealtimeSessionCreateResponse.ToolChoice
ofMcp(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.
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.
-
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.
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.
-
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(RealtimeSessionCreateResponse.ToolChoice.Visitor<T> visitor)
-
validate
final RealtimeSessionCreateResponse.ToolChoice validate()
-
ofOptions
final static RealtimeSessionCreateResponse.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.
-
ofFunction
final static RealtimeSessionCreateResponse.ToolChoice ofFunction(ToolChoiceFunction function)
Use this option to force the model to call a specific function.
-
ofMcp
final static RealtimeSessionCreateResponse.ToolChoice ofMcp(ToolChoiceMcp mcp)
Use this option to force the model to call a specific tool on a remote MCP server.
-
-
-
-