pub struct ChatCompletionAllowedTools {
pub mode: Mode,
pub tools: Vec<IndexMap<String, Value>>,
}
Expand description
Constrains the tools available to the model to a pre-defined set.
Fields§
§mode: Mode
Constrains the tools available to the model to a pre-defined set.
auto
allows the model to pick from among the allowed tools and generate a
message.
required
requires the model to call one or more of the allowed tools.
tools: Vec<IndexMap<String, Value>>
A list of tool definitions that the model should be allowed to call.
For the Chat Completions API, the list of tool definitions might look like:
[
{ "type": "function", "function": { "name": "get_weather" } },
{ "type": "function", "function": { "name": "get_time" } }
]
```text
Implementations§
Trait Implementations§
Source§impl Clone for ChatCompletionAllowedTools
impl Clone for ChatCompletionAllowedTools
Source§fn clone(&self) -> ChatCompletionAllowedTools
fn clone(&self) -> ChatCompletionAllowedTools
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 ChatCompletionAllowedTools
impl Debug for ChatCompletionAllowedTools
Source§impl<'de> Deserialize<'de> for ChatCompletionAllowedTools
impl<'de> Deserialize<'de> for ChatCompletionAllowedTools
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>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for ChatCompletionAllowedTools
Auto Trait Implementations§
impl Freeze for ChatCompletionAllowedTools
impl RefUnwindSafe for ChatCompletionAllowedTools
impl Send for ChatCompletionAllowedTools
impl Sync for ChatCompletionAllowedTools
impl Unpin for ChatCompletionAllowedTools
impl UnwindSafe for ChatCompletionAllowedTools
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