pub struct ToolChoiceAllowed {
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 Responses API, the list of tool definitions might look like:
[
{ "type": "function", "name": "get_weather" },
{ "type": "mcp", "server_label": "deepwiki" },
{ "type": "image_generation" }
]
```text
Implementations§
Trait Implementations§
Source§impl Clone for ToolChoiceAllowed
impl Clone for ToolChoiceAllowed
Source§fn clone(&self) -> ToolChoiceAllowed
fn clone(&self) -> ToolChoiceAllowed
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 ToolChoiceAllowed
impl Debug for ToolChoiceAllowed
Source§impl<'de> Deserialize<'de> for ToolChoiceAllowed
impl<'de> Deserialize<'de> for ToolChoiceAllowed
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
Source§impl PartialEq for ToolChoiceAllowed
impl PartialEq for ToolChoiceAllowed
Source§impl Serialize for ToolChoiceAllowed
impl Serialize for ToolChoiceAllowed
impl StructuralPartialEq for ToolChoiceAllowed
Auto Trait Implementations§
impl Freeze for ToolChoiceAllowed
impl RefUnwindSafe for ToolChoiceAllowed
impl Send for ToolChoiceAllowed
impl Sync for ToolChoiceAllowed
impl Unpin for ToolChoiceAllowed
impl UnwindSafe for ToolChoiceAllowed
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