pub struct ToolRequest {
pub call_id: ToolCallId,
pub tool_name: ToolName,
pub input: Value,
pub session_id: SessionId,
pub turn_id: TurnId,
pub metadata: MetadataMap,
}Expand description
An incoming request to execute a tool.
Created by the agent loop when the model emits a tool-call. The
BasicToolExecutor uses tool_name to look up the Tool in the
registry and forwards this request to Tool::invoke.
Fields§
§call_id: ToolCallIdProvider-assigned identifier for this specific call.
tool_name: ToolNameName of the tool to invoke (must match a registered ToolName).
input: ValueJSON input parsed from the model’s tool-call arguments.
session_id: SessionIdSession that owns this call.
turn_id: TurnIdTurn within the session that triggered this call.
metadata: MetadataMapArbitrary key-value pairs for framework extensions.
Implementations§
Source§impl ToolRequest
impl ToolRequest
Sourcepub fn new(
call_id: impl Into<ToolCallId>,
tool_name: impl Into<ToolName>,
input: Value,
session_id: impl Into<SessionId>,
turn_id: impl Into<TurnId>,
) -> Self
pub fn new( call_id: impl Into<ToolCallId>, tool_name: impl Into<ToolName>, input: Value, session_id: impl Into<SessionId>, turn_id: impl Into<TurnId>, ) -> Self
Builds a tool request with empty metadata.
Sourcepub fn with_metadata(self, metadata: MetadataMap) -> Self
pub fn with_metadata(self, metadata: MetadataMap) -> Self
Replaces the request metadata.
Trait Implementations§
Source§impl Clone for ToolRequest
impl Clone for ToolRequest
Source§fn clone(&self) -> ToolRequest
fn clone(&self) -> ToolRequest
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 ToolRequest
impl Debug for ToolRequest
Source§impl<'de> Deserialize<'de> for ToolRequest
impl<'de> Deserialize<'de> for ToolRequest
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 PartialEq for ToolRequest
impl PartialEq for ToolRequest
Source§impl Serialize for ToolRequest
impl Serialize for ToolRequest
impl StructuralPartialEq for ToolRequest
Auto Trait Implementations§
impl Freeze for ToolRequest
impl RefUnwindSafe for ToolRequest
impl Send for ToolRequest
impl Sync for ToolRequest
impl Unpin for ToolRequest
impl UnsafeUnpin for ToolRequest
impl UnwindSafe for ToolRequest
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