pub struct ToolChoice {
pub mode: String,
pub name: Option<String>,
}Expand description
Tool choice mode for sampling requests (SEP-1577)
Controls how the LLM should use the available tools.
Fields§
§mode: StringThe tool choice mode: “auto”, “none”, or “tool”
name: Option<String>Name of the specific tool to use (required when mode is “tool”)
Implementations§
Source§impl ToolChoice
impl ToolChoice
Sourcepub fn auto() -> ToolChoice
pub fn auto() -> ToolChoice
Model decides whether to use tools
Sourcepub fn required() -> ToolChoice
pub fn required() -> ToolChoice
Model must use a tool
Sourcepub fn none() -> ToolChoice
pub fn none() -> ToolChoice
Model should not use tools
Sourcepub fn tool(name: impl Into<String>) -> ToolChoice
pub fn tool(name: impl Into<String>) -> ToolChoice
Force the model to use a specific tool by name
Trait Implementations§
Source§impl Clone for ToolChoice
impl Clone for ToolChoice
Source§fn clone(&self) -> ToolChoice
fn clone(&self) -> ToolChoice
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ToolChoice
impl Debug for ToolChoice
Source§impl<'de> Deserialize<'de> for ToolChoice
impl<'de> Deserialize<'de> for ToolChoice
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolChoice, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolChoice, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for ToolChoice
impl Serialize for ToolChoice
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for ToolChoice
impl RefUnwindSafe for ToolChoice
impl Send for ToolChoice
impl Sync for ToolChoice
impl Unpin for ToolChoice
impl UnsafeUnpin for ToolChoice
impl UnwindSafe for ToolChoice
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more