pub struct Session {
pub meta: SessionMeta,
pub messages: Vec<Message>,
pub session_dir: PathBuf,
pub modified_files: Vec<PathBuf>,
}Fields§
§meta: SessionMeta§messages: Vec<Message>§session_dir: PathBuf§modified_files: Vec<PathBuf>Files Ralph has modified in this session (for checkpoint snapshotting).
Implementations§
Source§impl Session
impl Session
Sourcepub fn create(
workspace: &Path,
provider: &str,
model: &str,
config: &Config,
) -> Result<Self>
pub fn create( workspace: &Path, provider: &str, model: &str, config: &Config, ) -> Result<Self>
Create a fresh session.
Sourcepub fn find_for_workspace(workspace: &Path, config: &Config) -> Option<Self>
pub fn find_for_workspace(workspace: &Path, config: &Config) -> Option<Self>
Find the most recent session for the given workspace.
Sourcepub fn list_all(config: &Config) -> Vec<SessionMeta>
pub fn list_all(config: &Config) -> Vec<SessionMeta>
List all sessions, sorted by last_active descending.
Sourcepub fn save_turn(
&mut self,
new_messages: &[Message],
turn_count: u32,
) -> Result<()>
pub fn save_turn( &mut self, new_messages: &[Message], turn_count: u32, ) -> Result<()>
Append messages and persist.
pub fn set_status(&mut self, status: SessionStatus) -> Result<()>
pub fn flush(&self) -> Result<()>
pub fn checkpoints_dir(&self) -> PathBuf
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Session
impl RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnsafeUnpin for Session
impl UnwindSafe for Session
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