pub struct ToolDef {
pub name: String,
pub description: String,
pub parameters: Value,
}Expand description
JSON-Schema description of a callable tool, in OpenAI function-calling shape.
Why: downstream agents (trusty-memory, trusty-search) expose tools like
memory_recall or web_search to the LLM. The OpenAI tool format is the
de-facto common denominator across OpenRouter, Ollama, LM Studio, and
most cloud providers.
What: name and description are passed verbatim; parameters is a
JSON Schema object (typically {"type":"object","properties":{...}}).
Test: tool_def_serializes_as_function checks the wire shape.
Fields§
§name: String§description: String§parameters: ValueTrait Implementations§
Source§impl<'de> Deserialize<'de> for ToolDef
impl<'de> Deserialize<'de> for ToolDef
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
Auto Trait Implementations§
impl Freeze for ToolDef
impl RefUnwindSafe for ToolDef
impl Send for ToolDef
impl Sync for ToolDef
impl Unpin for ToolDef
impl UnsafeUnpin for ToolDef
impl UnwindSafe for ToolDef
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