Class RealtimeToolChoiceConfig
-
- All Implemented Interfaces:
public final class RealtimeToolChoiceConfig
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
RealtimeToolChoiceConfig.Visitor
An 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 Boolean
isToolChoiceOptions()
final Boolean
isToolChoiceFunction()
final Boolean
isToolChoiceMcp()
final ToolChoiceOptions
asToolChoiceOptions()
Controls which (if any) tool is called by the model. final ToolChoiceFunction
asToolChoiceFunction()
Use this option to force the model to call a specific function. final ToolChoiceMcp
asToolChoiceMcp()
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(RealtimeToolChoiceConfig.Visitor<T> visitor)
final RealtimeToolChoiceConfig
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static RealtimeToolChoiceConfig
ofToolChoiceOptions(ToolChoiceOptions toolChoiceOptions)
Controls which (if any) tool is called by the model. final static RealtimeToolChoiceConfig
ofToolChoiceFunction(ToolChoiceFunction toolChoiceFunction)
Use this option to force the model to call a specific function. final static RealtimeToolChoiceConfig
ofToolChoiceMcp(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.
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.
-
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.
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.
-
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.
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.
-
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.
-
-
-
-