pub enum ToolChoiceParam {
AllowedTools(ToolChoiceAllowed),
Function(ToolChoiceFunction),
Mcp(ToolChoiceMCP),
Custom(ToolChoiceCustom),
ApplyPatch,
Shell,
Hosted(ToolChoiceTypes),
Mode(ToolChoiceOptions),
}response-types only.Variants§
AllowedTools(ToolChoiceAllowed)
Constrains the tools available to the model to a pre-defined set.
Function(ToolChoiceFunction)
Use this option to force the model to call a specific function.
Mcp(ToolChoiceMCP)
Use this option to force the model to call a specific tool on a remote MCP server.
Custom(ToolChoiceCustom)
Use this option to force the model to call a custom tool.
ApplyPatch
Forces the model to call the apply_patch tool when executing a tool call.
Shell
Forces the model to call the function shell tool when a tool call is required.
Hosted(ToolChoiceTypes)
Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.
Mode(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.
Trait Implementations§
Source§impl Clone for ToolChoiceParam
impl Clone for ToolChoiceParam
Source§fn clone(&self) -> ToolChoiceParam
fn clone(&self) -> ToolChoiceParam
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ToolChoiceParam
impl Debug for ToolChoiceParam
Source§impl<'de> Deserialize<'de> for ToolChoiceParam
impl<'de> Deserialize<'de> for ToolChoiceParam
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<ToolChoiceCustom> for ToolChoiceParam
impl From<ToolChoiceCustom> for ToolChoiceParam
Source§fn from(custom: ToolChoiceCustom) -> Self
fn from(custom: ToolChoiceCustom) -> Self
Source§impl From<ToolChoiceFunction> for ToolChoiceParam
impl From<ToolChoiceFunction> for ToolChoiceParam
Source§fn from(function: ToolChoiceFunction) -> Self
fn from(function: ToolChoiceFunction) -> Self
Source§impl From<ToolChoiceMCP> for ToolChoiceParam
impl From<ToolChoiceMCP> for ToolChoiceParam
Source§fn from(mcp: ToolChoiceMCP) -> Self
fn from(mcp: ToolChoiceMCP) -> Self
Source§impl From<ToolChoiceOptions> for ToolChoiceParam
impl From<ToolChoiceOptions> for ToolChoiceParam
Source§fn from(mode: ToolChoiceOptions) -> Self
fn from(mode: ToolChoiceOptions) -> Self
Source§impl From<ToolChoiceTypes> for ToolChoiceParam
impl From<ToolChoiceTypes> for ToolChoiceParam
Source§fn from(tool_type: ToolChoiceTypes) -> Self
fn from(tool_type: ToolChoiceTypes) -> Self
Source§impl PartialEq for ToolChoiceParam
impl PartialEq for ToolChoiceParam
Source§fn eq(&self, other: &ToolChoiceParam) -> bool
fn eq(&self, other: &ToolChoiceParam) -> bool
self and other values to be equal, and is used by ==.