pub struct ToolContext {
pub agent_id: String,
pub session_id: String,
pub task_id: String,
pub run_id: String,
pub thread_id: String,
pub user_id: String,
pub session_store: Arc<dyn SessionStore>,
pub event_tx: Option<Arc<Sender<AgentEvent>>>,
pub metadata: Option<HashMap<String, Value>>,
}Expand description
Tool execution context - lighter weight than ExecutorContext
Fields§
§agent_id: StringAgent ID executing the tool
session_id: StringSession ID for the current conversation
task_id: StringTask ID for the current task
run_id: StringRun ID for the current execution
thread_id: StringThread ID for conversation grouping
user_id: StringUser ID if available
session_store: Arc<dyn SessionStore>Session store for persistent state across tool calls
event_tx: Option<Arc<Sender<AgentEvent>>>Event sender for emitting events during tool execution
metadata: Option<HashMap<String, Value>>Additional metadata for the tool. Useful in direct inline agent invocation.
Trait Implementations§
Source§impl Clone for ToolContext
impl Clone for ToolContext
Source§fn clone(&self) -> ToolContext
fn clone(&self) -> ToolContext
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 moreAuto Trait Implementations§
impl Freeze for ToolContext
impl !RefUnwindSafe for ToolContext
impl Send for ToolContext
impl Sync for ToolContext
impl Unpin for ToolContext
impl UnsafeUnpin for ToolContext
impl !UnwindSafe for ToolContext
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