pub enum ToolChoice {
Any,
Auto,
Tool(String),
None,
}
Expand description
Tool choice determines how the LLM uses available tools. The behavior is standardized across different LLM providers.
Variants§
Any
Model can use any tool, but it must use at least one. This is useful when you want to force the model to use tools.
Auto
Model can use any tool, and may elect to use none. This is the default behavior and gives the model flexibility.
Tool(String)
Model must use the specified tool and only the specified tool. The string parameter is the name of the required tool. This is useful when you want the model to call a specific function.
None
Explicitly disables the use of tools. The model will not use any tools even if they are provided.
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 Default for ToolChoice
impl Default for ToolChoice
Source§fn default() -> ToolChoice
fn default() -> ToolChoice
Returns the “default value” for a type. 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 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