pub struct DeferredToolCall {
pub tool_name: String,
pub args: Value,
pub tool_call_id: Option<String>,
}Expand description
A tool call that was deferred for approval.
When a tool requires approval (via ToolError::ApprovalRequired),
the call is captured as a DeferredToolCall for later processing.
Fields§
§tool_name: StringName of the tool.
args: ValueArguments for the tool call.
tool_call_id: Option<String>Tool call ID.
Implementations§
Source§impl DeferredToolCall
impl DeferredToolCall
Sourcepub fn with_tool_call_id(self, id: impl Into<String>) -> Self
pub fn with_tool_call_id(self, id: impl Into<String>) -> Self
Set the tool call ID.
Sourcepub fn approve(&self) -> DeferredToolDecision
pub fn approve(&self) -> DeferredToolDecision
Create an approved decision.
Sourcepub fn deny(&self, message: impl Into<String>) -> DeferredToolDecision
pub fn deny(&self, message: impl Into<String>) -> DeferredToolDecision
Create a denied decision.
Sourcepub fn with_result(&self, result: ToolReturn) -> DeferredToolDecision
pub fn with_result(&self, result: ToolReturn) -> DeferredToolDecision
Create a custom result decision.
Trait Implementations§
Source§impl Clone for DeferredToolCall
impl Clone for DeferredToolCall
Source§fn clone(&self) -> DeferredToolCall
fn clone(&self) -> DeferredToolCall
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 DeferredToolCall
impl Debug for DeferredToolCall
Source§impl<'de> Deserialize<'de> for DeferredToolCall
impl<'de> Deserialize<'de> for DeferredToolCall
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
Source§impl FromIterator<DeferredToolCall> for DeferredToolRequests
impl FromIterator<DeferredToolCall> for DeferredToolRequests
Source§fn from_iter<T: IntoIterator<Item = DeferredToolCall>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = DeferredToolCall>>(iter: T) -> Self
Creates a value from an iterator. Read more
Auto Trait Implementations§
impl Freeze for DeferredToolCall
impl RefUnwindSafe for DeferredToolCall
impl Send for DeferredToolCall
impl Sync for DeferredToolCall
impl Unpin for DeferredToolCall
impl UnwindSafe for DeferredToolCall
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