pub struct ToolDefinition {
pub name: ToolName,
pub description: String,
pub parameters: Value,
}Expand description
Minimal tool definition passed to LLM providers.
Decoupled from zeph-tools::ToolDef to avoid cross-crate dependencies.
Providers translate this into their native tool/function format before sending to the API.
§Examples
use zeph_common::types::ToolDefinition;
use zeph_common::ToolName;
let tool = ToolDefinition {
name: ToolName::new("get_weather"),
description: "Return current weather for a city.".into(),
parameters: serde_json::json!({
"type": "object",
"properties": {
"city": { "type": "string" }
},
"required": ["city"]
}),
};
assert_eq!(tool.name, "get_weather");Fields§
§name: ToolNameTool name — must match the name used in the response ToolUseRequest.
description: StringHuman-readable description guiding the model on when to call this tool.
parameters: ValueJSON Schema object describing parameters.
Trait Implementations§
Source§impl Clone for ToolDefinition
impl Clone for ToolDefinition
Source§fn clone(&self) -> ToolDefinition
fn clone(&self) -> ToolDefinition
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 ToolDefinition
impl Debug for ToolDefinition
Source§impl<'de> Deserialize<'de> for ToolDefinition
impl<'de> Deserialize<'de> for ToolDefinition
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 ToolDefinition
impl RefUnwindSafe for ToolDefinition
impl Send for ToolDefinition
impl Sync for ToolDefinition
impl Unpin for ToolDefinition
impl UnsafeUnpin for ToolDefinition
impl UnwindSafe for ToolDefinition
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