pub struct ToolCall {
pub name: String,
pub payload: ToolPayload,
pub source: ToolCallSource,
pub raw_tool_call_id: Option<String>,
}Expand description
A tool invocation request before it has been validated and dispatched.
Contains the tool name, its input payload, and metadata about where the call originated.
Fields§
§name: StringName of the tool to invoke.
payload: ToolPayloadThe input payload for the tool.
source: ToolCallSourceWhere this call originated (direct or REPL).
raw_tool_call_id: Option<String>Optional raw tool-call identifier from the upstream provider.
Implementations§
Source§impl ToolCall
impl ToolCall
Sourcepub fn execution_subject(
&self,
fallback_cwd: &str,
) -> (String, String, &'static str)
pub fn execution_subject( &self, fallback_cwd: &str, ) -> (String, String, &'static str)
Derive the execution subject for this call.
For local shell payloads this returns the shell command and its
working directory; for all other payloads the tool name and the
provided fallback_cwd are returned instead. The third element
of the tuple is a human-readable kind label ("shell" or "tool").
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ToolCall
impl<'de> Deserialize<'de> for ToolCall
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 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