pub struct TrajectoryCollector {
pub trajectory: Trajectory,
/* private fields */
}Expand description
TrajectoryCollector — collects trajectory data during an agent run.
Attach to AgentRunner to capture all steps incrementally.
Fields§
§trajectory: TrajectoryImplementations§
Source§impl TrajectoryCollector
impl TrajectoryCollector
pub fn new(session_id: impl Into<String>, model: impl Into<String>) -> Self
Sourcepub fn start_step(&mut self, action: &str, action_args: &str)
pub fn start_step(&mut self, action: &str, action_args: &str)
Start tracking a new tool call step.
Sourcepub fn complete_step(&mut self, observation: &str, success: bool)
pub fn complete_step(&mut self, observation: &str, success: bool)
Complete the current step with an observation.
Sourcepub fn set_thought(&mut self, thought: &str)
pub fn set_thought(&mut self, thought: &str)
Attach a thought to the current step.
Sourcepub fn set_response(&mut self, response: &str)
pub fn set_response(&mut self, response: &str)
Attach a final response to the current step.
Sourcepub fn record_message(
&mut self,
role: &str,
content: &str,
tool_call_id: Option<&str>,
tool_name: Option<&str>,
)
pub fn record_message( &mut self, role: &str, content: &str, tool_call_id: Option<&str>, tool_name: Option<&str>, )
Record a message to the trajectory.
Auto Trait Implementations§
impl Freeze for TrajectoryCollector
impl RefUnwindSafe for TrajectoryCollector
impl Send for TrajectoryCollector
impl Sync for TrajectoryCollector
impl Unpin for TrajectoryCollector
impl UnsafeUnpin for TrajectoryCollector
impl UnwindSafe for TrajectoryCollector
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more