pub enum ToolInputFormat {
JsonSchema {
parameters: Value,
},
Freeform {
syntax: GrammarSyntax,
definition: String,
},
}Expand description
How a tool’s input is specified: a JSON-schema function tool, or a freeform
tool whose raw-text input is constrained by a server-side grammar (OpenAI
Responses custom tools — codex’s apply_patch). Exactly one of the two —
an enum, not optional fields, so invalid states are unrepresentable.
Variants§
JsonSchema
A JSON-schema function tool (every tool today).
Freeform
A freeform tool: raw text constrained by a grammar. On wires without
custom-tool support it degrades to a {"input": string} function tool;
the raw text reaches the tool identically either way.
Trait Implementations§
Source§impl Clone for ToolInputFormat
impl Clone for ToolInputFormat
Source§fn clone(&self) -> ToolInputFormat
fn clone(&self) -> ToolInputFormat
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 moreSource§impl Debug for ToolInputFormat
impl Debug for ToolInputFormat
Source§impl<'de> Deserialize<'de> for ToolInputFormat
impl<'de> Deserialize<'de> for ToolInputFormat
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 ToolInputFormat
impl PartialEq for ToolInputFormat
Source§impl Serialize for ToolInputFormat
impl Serialize for ToolInputFormat
impl StructuralPartialEq for ToolInputFormat
Auto Trait Implementations§
impl Freeze for ToolInputFormat
impl RefUnwindSafe for ToolInputFormat
impl Send for ToolInputFormat
impl Sync for ToolInputFormat
impl Unpin for ToolInputFormat
impl UnsafeUnpin for ToolInputFormat
impl UnwindSafe for ToolInputFormat
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