pub struct ToolSpec { /* private fields */ }Expand description
The spec for a tool node: one direct tool invocation.
Implementations§
Source§impl ToolSpec
impl ToolSpec
Sourcepub fn new(id: impl Into<String>, tool: impl Into<String>) -> Self
pub fn new(id: impl Into<String>, tool: impl Into<String>) -> Self
Starts a tool spec with its required fields: the node id and the registered tool name.
Sourcepub fn name(self, name: impl Into<String>) -> Self
pub fn name(self, name: impl Into<String>) -> Self
Sets a short display label for this node. Bounds (a 64-character cap,
not empty or all whitespace) are checked by [crate::validate], not
here; see crate::document’s “The optional node display name”
section for why this field, unlike an agent’s own name, is part of
the graph’s content hash.
Sourcepub fn input(self, field: impl Into<String>, source: impl Into<String>) -> Self
pub fn input(self, field: impl Into<String>, source: impl Into<String>) -> Self
Adds one input mapping: a tool input field name to an opaque source reference. Recorded as data; not resolved by this crate.
Sourcepub fn input_schema(self, schema: Value) -> Self
pub fn input_schema(self, schema: Value) -> Self
Declares the JSON Schema for the payload this tool consumes.
Sourcepub fn output_schema(self, schema: Value) -> Self
pub fn output_schema(self, schema: Value) -> Self
Declares the JSON Schema for the payload this tool produces.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ToolSpec
impl RefUnwindSafe for ToolSpec
impl Send for ToolSpec
impl Sync for ToolSpec
impl Unpin for ToolSpec
impl UnsafeUnpin for ToolSpec
impl UnwindSafe for ToolSpec
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