pub struct JsonlAgentStorage {
pub jsonl_path: PathBuf,
}Expand description
JSON Lines file-based implementation of AgentStorage.
Each session is stored as a separate .jsonl file under jsonl_path.
Fields§
§jsonl_path: PathBufDirectory where session .jsonl files are written.
Implementations§
Source§impl JsonlAgentStorage
impl JsonlAgentStorage
Sourcepub fn new(jsonl_path: Option<PathBuf>) -> Self
pub fn new(jsonl_path: Option<PathBuf>) -> Self
Create a new JsonlAgentStorage.
If jsonl_path is None, the default directory from jsonl_session_storage is used.
Trait Implementations§
Source§impl AgentStorage for JsonlAgentStorage
impl AgentStorage for JsonlAgentStorage
Source§fn create_session<'life0, 'async_trait>(
&'life0 self,
event: SessionInitEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_session<'life0, 'async_trait>(
&'life0 self,
event: SessionInitEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Persist the initial event that starts a new session.
Source§fn update_session<'life0, 'async_trait>(
&'life0 self,
event: AgentEventAny,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_session<'life0, 'async_trait>(
&'life0 self,
event: AgentEventAny,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Append an event to an existing session.
Source§fn get_session<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<AgentEventAny>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_session<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<AgentEventAny>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieve all events for a given session, ordered by time.
Source§impl Debug for JsonlAgentStorage
impl Debug for JsonlAgentStorage
Auto Trait Implementations§
impl Freeze for JsonlAgentStorage
impl RefUnwindSafe for JsonlAgentStorage
impl Send for JsonlAgentStorage
impl Sync for JsonlAgentStorage
impl Unpin for JsonlAgentStorage
impl UnsafeUnpin for JsonlAgentStorage
impl UnwindSafe for JsonlAgentStorage
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