Class RealtimeResponseCreateParams.Tool
-
- All Implemented Interfaces:
public final class RealtimeResponseCreateParams.ToolGive 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 interfaceRealtimeResponseCreateParams.Tool.VisitorAn interface that defines how to map each variant of Tool to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<RealtimeFunctionTool>realtimeFunction()final Optional<RealtimeResponseCreateMcpTool>realtimeResponseCreateMcp()Give the model access to additional tools via remote Model Context Protocol (MCP) servers. final BooleanisRealtimeFunction()final BooleanisRealtimeResponseCreateMcp()final RealtimeFunctionToolasRealtimeFunction()final RealtimeResponseCreateMcpToolasRealtimeResponseCreateMcp()Give the model access to additional tools via remote Model Context Protocol (MCP) servers. final Optional<JsonValue>_json()final <T extends Any> Taccept(RealtimeResponseCreateParams.Tool.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final RealtimeResponseCreateParams.Toolvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static RealtimeResponseCreateParams.ToolofRealtimeFunction(RealtimeFunctionTool realtimeFunction)final static RealtimeResponseCreateParams.ToolofRealtimeResponseCreateMcp(RealtimeResponseCreateMcpTool realtimeResponseCreateMcp)Give the model access to additional tools via remote Model Context Protocol (MCP) servers. -
-
Method Detail
-
realtimeFunction
final Optional<RealtimeFunctionTool> realtimeFunction()
-
realtimeResponseCreateMcp
final Optional<RealtimeResponseCreateMcpTool> realtimeResponseCreateMcp()
Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
isRealtimeFunction
final Boolean isRealtimeFunction()
-
isRealtimeResponseCreateMcp
final Boolean isRealtimeResponseCreateMcp()
-
asRealtimeFunction
final RealtimeFunctionTool asRealtimeFunction()
-
asRealtimeResponseCreateMcp
final RealtimeResponseCreateMcpTool asRealtimeResponseCreateMcp()
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(RealtimeResponseCreateParams.Tool.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 = tool.accept(new Tool.Visitor<Optional<String>>() { @Override public Optional<String> visitRealtimeFunction(RealtimeFunctionTool realtimeFunction) { return Optional.of(realtimeFunction.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final RealtimeResponseCreateParams.Tool 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.
-
ofRealtimeFunction
final static RealtimeResponseCreateParams.Tool ofRealtimeFunction(RealtimeFunctionTool realtimeFunction)
-
ofRealtimeResponseCreateMcp
final static RealtimeResponseCreateParams.Tool ofRealtimeResponseCreateMcp(RealtimeResponseCreateMcpTool realtimeResponseCreateMcp)
Give the model access to additional tools via remote Model Context Protocol (MCP) servers. Learn more about MCP.
-
-
-
-