pub enum ToolChoice {
Auto,
Required,
None,
}Expand description
What the model is allowed to do with the supplied tools.
Variants§
Auto
The model decides whether to call a tool.
Required
The model must call a tool. This is enforced by grammar, not by prompt.
None
Tools are visible to the template but must not be called.
Implementations§
Source§impl ToolChoice
impl ToolChoice
Sourcepub fn parse_oaicompat(value: &str) -> Result<Self, ChatError>
pub fn parse_oaicompat(value: &str) -> Result<Self, ChatError>
Parse an OpenAI tool_choice value: "auto", "required" or
"none".
§Errors
Returns ChatError::Failed if llama.cpp does not recognise value.
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ToolChoice
Source§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
impl Eq for ToolChoice
Source§impl PartialEq for ToolChoice
impl PartialEq for ToolChoice
impl StructuralPartialEq for ToolChoice
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