Class RealtimeToolChoiceConfig
-
- All Implemented Interfaces:
public final class RealtimeToolChoiceConfigHow 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 interfaceRealtimeToolChoiceConfig.VisitorAn interface that defines how to map each variant of RealtimeToolChoiceConfig to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<ToolChoiceOptions>toolChoiceOptions()Controls which (if any) tool is called by the model. final Optional<ToolChoiceFunction>toolChoiceFunction()Use this option to force the model to call a specific function. final Optional<ToolChoiceMcp>toolChoiceMcp()Use this option to force the model to call a specific tool on a remote MCP server. final BooleanisToolChoiceOptions()final BooleanisToolChoiceFunction()final BooleanisToolChoiceMcp()final ToolChoiceOptionsasToolChoiceOptions()Controls which (if any) tool is called by the model. final ToolChoiceFunctionasToolChoiceFunction()Use this option to force the model to call a specific function. final ToolChoiceMcpasToolChoiceMcp()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(RealtimeToolChoiceConfig.Visitor<T> visitor)final RealtimeToolChoiceConfigvalidate()final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static RealtimeToolChoiceConfigofToolChoiceOptions(ToolChoiceOptions toolChoiceOptions)Controls which (if any) tool is called by the model. final static RealtimeToolChoiceConfigofToolChoiceFunction(ToolChoiceFunction toolChoiceFunction)Use this option to force the model to call a specific function. final static RealtimeToolChoiceConfigofToolChoiceMcp(ToolChoiceMcp toolChoiceMcp)Use this option to force the model to call a specific tool on a remote MCP server. -
-
Method Detail
-
toolChoiceOptions
final Optional<ToolChoiceOptions> toolChoiceOptions()
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.
-
toolChoiceFunction
final Optional<ToolChoiceFunction> toolChoiceFunction()
Use this option to force the model to call a specific function.
-
toolChoiceMcp
final Optional<ToolChoiceMcp> toolChoiceMcp()
Use this option to force the model to call a specific tool on a remote MCP server.
-
isToolChoiceOptions
final Boolean isToolChoiceOptions()
-
isToolChoiceFunction
final Boolean isToolChoiceFunction()
-
isToolChoiceMcp
final Boolean isToolChoiceMcp()
-
asToolChoiceOptions
final ToolChoiceOptions asToolChoiceOptions()
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.
-
asToolChoiceFunction
final ToolChoiceFunction asToolChoiceFunction()
Use this option to force the model to call a specific function.
-
asToolChoiceMcp
final ToolChoiceMcp asToolChoiceMcp()
Use this option to force the model to call a specific tool on a remote MCP server.
-
accept
final <T extends Any> T accept(RealtimeToolChoiceConfig.Visitor<T> visitor)
-
validate
final RealtimeToolChoiceConfig validate()
-
ofToolChoiceOptions
final static RealtimeToolChoiceConfig ofToolChoiceOptions(ToolChoiceOptions toolChoiceOptions)
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.
-
ofToolChoiceFunction
final static RealtimeToolChoiceConfig ofToolChoiceFunction(ToolChoiceFunction toolChoiceFunction)
Use this option to force the model to call a specific function.
-
ofToolChoiceMcp
final static RealtimeToolChoiceConfig ofToolChoiceMcp(ToolChoiceMcp toolChoiceMcp)
Use this option to force the model to call a specific tool on a remote MCP server.
-
-
-
-