Class RealtimeToolsConfigUnion
-
- All Implemented Interfaces:
public final class RealtimeToolsConfigUnionGive the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceRealtimeToolsConfigUnion.VisitorAn interface that defines how to map each variant of RealtimeToolsConfigUnion to a value of type T.
public final classRealtimeToolsConfigUnion.McpGive the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
Method Summary
Modifier and Type Method Description final Optional<RealtimeFunctionTool>function()final Optional<RealtimeToolsConfigUnion.Mcp>mcp()Give the model access to additional tools via remote Model Context Protocol (MCP) servers. final BooleanisFunction()final BooleanisMcp()final RealtimeFunctionToolasFunction()final RealtimeToolsConfigUnion.McpasMcp()Give the model access to additional tools via remote Model Context Protocol (MCP) servers. final Optional<JsonValue>_json()final <T extends Any> Taccept(RealtimeToolsConfigUnion.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final RealtimeToolsConfigUnionvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static RealtimeToolsConfigUnionofFunction(RealtimeFunctionTool function)final static RealtimeToolsConfigUnionofMcp(RealtimeToolsConfigUnion.Mcp mcp)Give the model access to additional tools via remote Model Context Protocol (MCP) servers. -
-
Method Detail
-
function
final Optional<RealtimeFunctionTool> function()
-
mcp
final Optional<RealtimeToolsConfigUnion.Mcp> mcp()
Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
isFunction
final Boolean isFunction()
-
asFunction
final RealtimeFunctionTool asFunction()
-
asMcp
final RealtimeToolsConfigUnion.Mcp asMcp()
Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
accept
final <T extends Any> T accept(RealtimeToolsConfigUnion.Visitor<T> visitor)
Maps this instance's current variant to a value of type T using the given visitor.
Note that this method is not forwards compatible with new variants from the API, unless visitor overrides Visitor.unknown. To handle variants not known to this version of the SDK gracefully, consider overriding Visitor.unknown:
import com.openai.core.JsonValue; import java.util.Optional; Optional<String> result = realtimeToolsConfigUnion.accept(new RealtimeToolsConfigUnion.Visitor<Optional<String>>() { @Override public Optional<String> visitFunction(RealtimeFunctionTool function) { return Optional.of(function.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final RealtimeToolsConfigUnion validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
ofFunction
final static RealtimeToolsConfigUnion ofFunction(RealtimeFunctionTool function)
-
ofMcp
final static RealtimeToolsConfigUnion ofMcp(RealtimeToolsConfigUnion.Mcp mcp)
Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
-
-
-