pub enum ToolChoice {
Auto,
None,
Required,
Function(String),
}Expand description
The tool_choice values an OpenAI-compatible endpoint understands.
Variants§
Implementations§
Source§impl ToolChoice
impl ToolChoice
Sourcepub fn as_config_str(&self) -> &str
pub fn as_config_str(&self) -> &str
The config form: one string. The three keywords mean what OpenAI means by them;
anything else is a tool name, which is why tool_choice = "read_file" reads the way
a person writes it.
pub fn from_config_str(value: &str) -> ToolChoice
Trait Implementations§
Source§impl Clone for ToolChoice
impl Clone for ToolChoice
Source§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<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ToolChoice
Source§impl PartialEq for ToolChoice
impl PartialEq for ToolChoice
Source§impl Serialize for ToolChoice
impl Serialize for ToolChoice
impl StructuralPartialEq for ToolChoice
Auto Trait Implementations§
impl Forget for ToolChoice
impl Freeze for ToolChoice
impl Move for ToolChoice
impl RefUnwindSafe for ToolChoice
impl Send for ToolChoicewhere
RawVecInner: Send,
impl Sync for ToolChoicewhere
RawVecInner: Sync,
impl Unpin for ToolChoice
impl UnsafeUnpin for ToolChoice
impl UnwindSafe for ToolChoicewhere
RawVecInner: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.