pub struct SessionRecorder { /* private fields */ }Expand description
Writes one JSONL file per run. Call start() then zero or more step() then finish().
Implementations§
Source§impl SessionRecorder
impl SessionRecorder
Sourcepub fn new(
agent_sessions_dir: PathBuf,
project_sessions_dir: Option<PathBuf>,
agent: String,
project: Option<String>,
session_id: String,
) -> Self
pub fn new( agent_sessions_dir: PathBuf, project_sessions_dir: Option<PathBuf>, agent: String, project: Option<String>, session_id: String, ) -> Self
Create a new recorder. Paths should be ENACT_HOME/agents/
Sourcepub fn start(&mut self, input: &str) -> Result<()>
pub fn start(&mut self, input: &str) -> Result<()>
Record session start. Call once at the beginning of a run.
Sourcepub fn turn(&self, turn: u32, input: &str, output: &str) -> Result<()>
pub fn turn(&self, turn: u32, input: &str, output: &str) -> Result<()>
Record one conversation turn (user input + assistant output).
Sourcepub fn step(
&self,
step: u32,
tool: &str,
args: &Value,
duration_ms: u64,
) -> Result<()>
pub fn step( &self, step: u32, tool: &str, args: &Value, duration_ms: u64, ) -> Result<()>
Record one tool step (legacy, for backwards compatibility).
Sourcepub fn tool_call(
&self,
tool_call_id: &str,
tool: &str,
input: &Value,
) -> Result<()>
pub fn tool_call( &self, tool_call_id: &str, tool: &str, input: &Value, ) -> Result<()>
Record a tool call (input/arguments before execution).
Auto Trait Implementations§
impl Freeze for SessionRecorder
impl RefUnwindSafe for SessionRecorder
impl Send for SessionRecorder
impl Sync for SessionRecorder
impl Unpin for SessionRecorder
impl UnsafeUnpin for SessionRecorder
impl UnwindSafe for SessionRecorder
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