pub struct ToolCall {
pub tool_id: ToolName,
pub params: Map<String, Value>,
pub caller_id: Option<String>,
}Expand description
Structured tool invocation from LLM.
Produced by the agent loop when the LLM emits a structured tool call (as opposed to
a legacy fenced code block). Dispatched to ToolExecutor::execute_tool_call.
§Example
use zeph_tools::ToolCall;
use zeph_common::ToolName;
let call = ToolCall {
tool_id: ToolName::new("bash"),
params: {
let mut m = serde_json::Map::new();
m.insert("command".to_owned(), serde_json::Value::String("echo hello".to_owned()));
m
},
caller_id: Some("user-42".to_owned()),
};
assert_eq!(call.tool_id, "bash");Fields§
§tool_id: ToolNameThe tool identifier, matching a value from ToolExecutor::tool_definitions.
params: Map<String, Value>JSON parameters for the tool call, deserialized into the tool’s parameter struct.
caller_id: Option<String>Opaque caller identifier propagated from the channel (user ID, session ID, etc.).
None for system-initiated calls (scheduler, self-learning, internal).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ToolCall
impl RefUnwindSafe for ToolCall
impl Send for ToolCall
impl Sync for ToolCall
impl Unpin for ToolCall
impl UnsafeUnpin for ToolCall
impl UnwindSafe for ToolCall
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