Class RealtimeResponseCreateParams.ToolChoice
- 
                    
                    - All Implemented Interfaces:
 
 public final class RealtimeResponseCreateParams.ToolChoiceHow the model chooses tools. Provide one of the string modes or force a specific function/MCP tool. 
- 
                
                    
                    - 
                                
                            
                                Nested Class SummaryNested Classes Modifier and Type Class Description public interfaceRealtimeResponseCreateParams.ToolChoice.VisitorAn interface that defines how to map each variant of ToolChoice to a value of type T. 
 - 
                                
                            
                                Method SummaryModifier 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 BooleanisOptions()final BooleanisFunction()final BooleanisMcp()final ToolChoiceOptionsasOptions()Controls which (if any) tool is called by the model. final ToolChoiceFunctionasFunction()Use this option to force the model to call a specific function. final ToolChoiceMcpasMcp()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(RealtimeResponseCreateParams.ToolChoice.Visitor<T> visitor)final RealtimeResponseCreateParams.ToolChoicevalidate()final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static RealtimeResponseCreateParams.ToolChoiceofOptions(ToolChoiceOptions options)Controls which (if any) tool is called by the model. final static RealtimeResponseCreateParams.ToolChoiceofFunction(ToolChoiceFunction function)Use this option to force the model to call a specific function. final static RealtimeResponseCreateParams.ToolChoiceofMcp(ToolChoiceMcp mcp)Use this option to force the model to call a specific tool on a remote MCP server. - 
                    
                    
                    - 
                                
                            
                                Method Detail- 
                                        optionsfinal Optional<ToolChoiceOptions> options() 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.
 - 
                                        functionfinal Optional<ToolChoiceFunction> function() Use this option to force the model to call a specific function. 
 - 
                                        mcpfinal Optional<ToolChoiceMcp> mcp() Use this option to force the model to call a specific tool on a remote MCP server. 
 - 
                                        isFunctionfinal Boolean isFunction() 
 - 
                                        asOptionsfinal ToolChoiceOptions asOptions() 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.
 - 
                                        asFunctionfinal ToolChoiceFunction asFunction() Use this option to force the model to call a specific function. 
 - 
                                        asMcpfinal ToolChoiceMcp asMcp() Use this option to force the model to call a specific tool on a remote MCP server. 
 - 
                                        acceptfinal <T extends Any> T accept(RealtimeResponseCreateParams.ToolChoice.Visitor<T> visitor) 
 - 
                                        validatefinal RealtimeResponseCreateParams.ToolChoice validate() 
 - 
                                        ofOptionsfinal static RealtimeResponseCreateParams.ToolChoice ofOptions(ToolChoiceOptions options) 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.
 - 
                                        ofFunctionfinal static RealtimeResponseCreateParams.ToolChoice ofFunction(ToolChoiceFunction function) Use this option to force the model to call a specific function. 
 - 
                                        ofMcpfinal static RealtimeResponseCreateParams.ToolChoice ofMcp(ToolChoiceMcp mcp) Use this option to force the model to call a specific tool on a remote MCP server. 
 
- 
                                        
 
- 
                                
                            
                                
 
- 
                    
                    
                    
 
-