pub struct AgentTrace { /* private fields */ }Expand description
A recorded agent event stream (as seen by an
AgentObserver), with assertion helpers
for trace-shaped tests. Build one with
TestAgentBuilder::run_trace.
Implementations§
Source§impl AgentTrace
impl AgentTrace
pub fn from_events(events: Vec<AgentEvent>) -> Self
pub fn from_observer_events(events: &Arc<Mutex<Vec<AgentEvent>>>) -> Self
pub fn events(&self) -> &[AgentEvent]
pub fn assert_names(&self, expected: &[&str])
Sourcepub fn position(&self, predicate: impl Fn(&AgentEvent) -> bool) -> usize
pub fn position(&self, predicate: impl Fn(&AgentEvent) -> bool) -> usize
Index into Self::events of the first event matching predicate.
Sourcepub fn positions(&self, predicate: impl Fn(&AgentEvent) -> bool) -> Vec<usize>
pub fn positions(&self, predicate: impl Fn(&AgentEvent) -> bool) -> Vec<usize>
Indexes into Self::events of every event matching predicate.
pub fn call_usage(&self, for_purpose: LlmCallPurpose) -> Option<TokenUsage>
Auto Trait Implementations§
impl Freeze for AgentTrace
impl RefUnwindSafe for AgentTrace
impl Send for AgentTrace
impl Sync for AgentTrace
impl Unpin for AgentTrace
impl UnsafeUnpin for AgentTrace
impl UnwindSafe for AgentTrace
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