Class InputTokenCountParams.ToolChoice
- 
                    
                    - All Implemented Interfaces:
 
 public final class InputTokenCountParams.ToolChoiceHow the model should select which tool (or tools) to use when generating a response. See the toolsparameter to see how to specify which tools the model can call.
- 
                
                    
                    - 
                                
                            
                                Nested Class SummaryNested Classes Modifier and Type Class Description public interfaceInputTokenCountParams.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<ToolChoiceAllowed>allowed()Constrains the tools available to the model to a pre-defined set. final Optional<ToolChoiceTypes>types()Indicates that the model should use a built-in tool to generate a response. 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 Optional<ToolChoiceCustom>custom()Use this option to force the model to call a specific custom tool. final BooleanisOptions()final BooleanisAllowed()final BooleanisTypes()final BooleanisFunction()final BooleanisMcp()final BooleanisCustom()final ToolChoiceOptionsasOptions()Controls which (if any) tool is called by the model. final ToolChoiceAllowedasAllowed()Constrains the tools available to the model to a pre-defined set. final ToolChoiceTypesasTypes()Indicates that the model should use a built-in tool to generate a response. 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 ToolChoiceCustomasCustom()Use this option to force the model to call a specific custom tool. final Optional<JsonValue>_json()final <T extends Any> Taccept(InputTokenCountParams.ToolChoice.Visitor<T> visitor)final InputTokenCountParams.ToolChoicevalidate()final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static InputTokenCountParams.ToolChoiceofOptions(ToolChoiceOptions options)Controls which (if any) tool is called by the model. final static InputTokenCountParams.ToolChoiceofAllowed(ToolChoiceAllowed allowed)Constrains the tools available to the model to a pre-defined set. final static InputTokenCountParams.ToolChoiceofTypes(ToolChoiceTypes types)Indicates that the model should use a built-in tool to generate a response. final static InputTokenCountParams.ToolChoiceofFunction(ToolChoiceFunction function)Use this option to force the model to call a specific function. final static InputTokenCountParams.ToolChoiceofMcp(ToolChoiceMcp mcp)Use this option to force the model to call a specific tool on a remote MCP server. final static InputTokenCountParams.ToolChoiceofCustom(ToolChoiceCustom custom)Use this option to force the model to call a specific custom tool. - 
                    
                    
                    - 
                                
                            
                                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.
 - 
                                        allowedfinal Optional<ToolChoiceAllowed> allowed() Constrains the tools available to the model to a pre-defined set. 
 - 
                                        typesfinal Optional<ToolChoiceTypes> types() Indicates that the model should use a built-in tool to generate a response. Learn more about built-in 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. 
 - 
                                        customfinal Optional<ToolChoiceCustom> custom() Use this option to force the model to call a specific custom tool. 
 - 
                                        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.
 - 
                                        asAllowedfinal ToolChoiceAllowed asAllowed() Constrains the tools available to the model to a pre-defined set. 
 - 
                                        asTypesfinal ToolChoiceTypes asTypes() Indicates that the model should use a built-in tool to generate a response. Learn more about built-in 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. 
 - 
                                        asCustomfinal ToolChoiceCustom asCustom() Use this option to force the model to call a specific custom tool. 
 - 
                                        acceptfinal <T extends Any> T accept(InputTokenCountParams.ToolChoice.Visitor<T> visitor) 
 - 
                                        validatefinal InputTokenCountParams.ToolChoice validate() 
 - 
                                        ofOptionsfinal static InputTokenCountParams.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.
 - 
                                        ofAllowedfinal static InputTokenCountParams.ToolChoice ofAllowed(ToolChoiceAllowed allowed) Constrains the tools available to the model to a pre-defined set. 
 - 
                                        ofTypesfinal static InputTokenCountParams.ToolChoice ofTypes(ToolChoiceTypes types) Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools. 
 - 
                                        ofFunctionfinal static InputTokenCountParams.ToolChoice ofFunction(ToolChoiceFunction function) Use this option to force the model to call a specific function. 
 - 
                                        ofMcpfinal static InputTokenCountParams.ToolChoice ofMcp(ToolChoiceMcp mcp) Use this option to force the model to call a specific tool on a remote MCP server. 
 - 
                                        ofCustomfinal static InputTokenCountParams.ToolChoice ofCustom(ToolChoiceCustom custom) Use this option to force the model to call a specific custom tool. 
 
- 
                                        
 
- 
                                
                            
                                
 
- 
                    
                    
                    
 
-