pub struct ToolExecutionContext<'a> {
pub session_id: Option<&'a str>,
pub tool_call_id: &'a str,
pub event_tx: Option<&'a Sender<AgentEvent>>,
}Expand description
Context passed to tools during execution.
All fields are optional and should be treated as best-effort hints.
Fields§
§session_id: Option<&'a str>Bamboo session id that is executing the tool.
tool_call_id: &'a strTool call id from the model (ToolCall.id).
event_tx: Option<&'a Sender<AgentEvent>>Event sender for streaming progress to clients (agent SSE stream).
Implementations§
Source§impl<'a> ToolExecutionContext<'a>
impl<'a> ToolExecutionContext<'a>
pub fn none(tool_call_id: &'a str) -> Self
Sourcepub fn cloned_sender(&self) -> Option<Sender<AgentEvent>>
pub fn cloned_sender(&self) -> Option<Sender<AgentEvent>>
Clone the sender (when present) for use in spawned tasks.
Sourcepub async fn emit(&self, event: AgentEvent)
pub async fn emit(&self, event: AgentEvent)
Best-effort emit of an event (ignored if no sender).
Sourcepub async fn emit_tool_token(&self, content: impl Into<String>)
pub async fn emit_tool_token(&self, content: impl Into<String>)
Convenience helper for streaming tool-scoped output.
Trait Implementations§
Source§impl<'a> Clone for ToolExecutionContext<'a>
impl<'a> Clone for ToolExecutionContext<'a>
Source§fn clone(&self) -> ToolExecutionContext<'a>
fn clone(&self) -> ToolExecutionContext<'a>
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<'a> Debug for ToolExecutionContext<'a>
impl<'a> Debug for ToolExecutionContext<'a>
impl<'a> Copy for ToolExecutionContext<'a>
Auto Trait Implementations§
impl<'a> Freeze for ToolExecutionContext<'a>
impl<'a> RefUnwindSafe for ToolExecutionContext<'a>
impl<'a> Send for ToolExecutionContext<'a>
impl<'a> Sync for ToolExecutionContext<'a>
impl<'a> Unpin for ToolExecutionContext<'a>
impl<'a> UnsafeUnpin for ToolExecutionContext<'a>
impl<'a> UnwindSafe for ToolExecutionContext<'a>
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