#[non_exhaustive]pub struct ToolSchema {
pub name: String,
pub description: String,
pub parameters: Value,
}Expand description
A tool advertised to the model: name, description, and JSON-Schema parameters.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringTool name (must match the registered crate::Tool).
description: StringDescription the model uses to decide when to call it.
parameters: ValueJSON Schema for the tool’s input object.
Implementations§
Source§impl ToolSchema
impl ToolSchema
Sourcepub fn new(
name: impl Into<String>,
description: impl Into<String>,
parameters: Value,
) -> Self
pub fn new( name: impl Into<String>, description: impl Into<String>, parameters: Value, ) -> Self
Construct a schema directly (e.g. an embedder computing its own
advertised set outside an crate::Agent, as the CLI’s inspect
does for TR-8/T5’s before/after token measurement). #[non_exhaustive]
blocks the struct-literal form outside this crate, so this is the
supported way in.
Trait Implementations§
Source§impl Clone for ToolSchema
impl Clone for ToolSchema
Source§fn clone(&self) -> ToolSchema
fn clone(&self) -> ToolSchema
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 ToolSchema
impl Debug for ToolSchema
Source§impl PartialEq for ToolSchema
impl PartialEq for ToolSchema
Source§impl Serialize for ToolSchema
impl Serialize for ToolSchema
impl StructuralPartialEq for ToolSchema
Auto Trait Implementations§
impl Freeze for ToolSchema
impl RefUnwindSafe for ToolSchema
impl Send for ToolSchema
impl Sync for ToolSchema
impl Unpin for ToolSchema
impl UnsafeUnpin for ToolSchema
impl UnwindSafe for ToolSchema
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