pub struct ToolContext {
pub run_id: RunId,
pub call_id: String,
pub session_id: Option<SessionId>,
pub step: u32,
}Expand description
Per-call context the agent loop hands to Tool::execute.
Use run_id + call_id as an idempotency key for tools with side
effects: a retried job re-runs the loop, and the key lets the tool detect
a duplicate.
Fields§
§run_id: RunIdThe run that issued the call.
call_id: StringThe provider-assigned id of this tool call.
session_id: Option<SessionId>The session the run belongs to, if any.
step: u32The loop step (0-based) that issued the call.
Implementations§
Trait Implementations§
Source§impl Clone for ToolContext
impl Clone for ToolContext
Source§impl Debug for ToolContext
impl Debug for ToolContext
impl Eq for ToolContext
Source§impl PartialEq for ToolContext
impl PartialEq for ToolContext
impl StructuralPartialEq for ToolContext
Auto Trait Implementations§
impl Forget for ToolContext
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Scoped for T
impl<T> Scoped for T
Source§fn scope(ctx: &PolicyContext) -> ScopeQuery<'_, Self>
fn scope(ctx: &PolicyContext) -> ScopeQuery<'_, Self>
Open a deferred
ScopeQuery for this type. Resolves the
registered scope at .load() time, not here.