pub struct FakeAgentObserver { /* private fields */ }Expand description
In-memory AgentObserver that records every event it receives, for
asserting on the stream an agent emits.
Implementations§
Source§impl FakeAgentObserver
impl FakeAgentObserver
pub fn new() -> Self
pub fn with_event_panic(self, predicate: fn(&AgentEvent) -> bool) -> Self
pub fn with_system_prompt_panic(self) -> Self
pub fn with_tool_trace_context_panic(self) -> Self
Trait Implementations§
Source§impl AgentObserver for FakeAgentObserver
impl AgentObserver for FakeAgentObserver
fn on_event(&mut self, message: &AgentEvent)
Source§fn on_system_prompt(&mut self, prompt: &str)
fn on_system_prompt(&mut self, prompt: &str)
Called with the rendered system prompt for the next chat request
Source§fn tool_trace_context(&self, _tool_id: &str) -> Option<TraceContext>
fn tool_trace_context(&self, _tool_id: &str) -> Option<TraceContext>
Trace context to propagate to whatever executes
tool_id, available onceAuto Trait Implementations§
impl Freeze for FakeAgentObserver
impl RefUnwindSafe for FakeAgentObserver
impl Send for FakeAgentObserver
impl Sync for FakeAgentObserver
impl Unpin for FakeAgentObserver
impl UnsafeUnpin for FakeAgentObserver
impl UnwindSafe for FakeAgentObserver
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