pub struct ConversationStore { /* private fields */ }Expand description
Conversation storage backend
Implementations§
Source§impl ConversationStore
impl ConversationStore
Sourcepub fn with_persistence<P: AsRef<Path>>(storage_path: P) -> Self
pub fn with_persistence<P: AsRef<Path>>(storage_path: P) -> Self
Create a new conversation store with file-based persistence
Sourcepub async fn initialize(&self) -> Result<()>
pub async fn initialize(&self) -> Result<()>
Initialize the store (load from disk if using persistence)
Sourcepub async fn create_conversation(
&self,
workspace_id: Option<String>,
) -> Result<String>
pub async fn create_conversation( &self, workspace_id: Option<String>, ) -> Result<String>
Create a new conversation
Sourcepub async fn get_conversation(&self, id: &str) -> Result<Option<Conversation>>
pub async fn get_conversation(&self, id: &str) -> Result<Option<Conversation>>
Get a conversation by ID
Sourcepub async fn add_message(
&self,
conversation_id: &str,
message: ChatMessage,
) -> Result<()>
pub async fn add_message( &self, conversation_id: &str, message: ChatMessage, ) -> Result<()>
Add a message to a conversation
Sourcepub async fn get_context(
&self,
conversation_id: &str,
) -> Result<Option<ChatContext>>
pub async fn get_context( &self, conversation_id: &str, ) -> Result<Option<ChatContext>>
Get conversation context for chat
Sourcepub async fn list_conversations(
&self,
workspace_id: Option<&str>,
) -> Result<Vec<Conversation>>
pub async fn list_conversations( &self, workspace_id: Option<&str>, ) -> Result<Vec<Conversation>>
List conversations for a workspace
Sourcepub async fn delete_conversation(&self, conversation_id: &str) -> Result<()>
pub async fn delete_conversation(&self, conversation_id: &str) -> Result<()>
Delete a conversation
Sourcepub async fn clear_old_conversations(&self, days: u64) -> Result<usize>
pub async fn clear_old_conversations(&self, days: u64) -> Result<usize>
Clear old conversations (older than specified days)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConversationStore
impl !RefUnwindSafe for ConversationStore
impl Send for ConversationStore
impl Sync for ConversationStore
impl Unpin for ConversationStore
impl UnsafeUnpin for ConversationStore
impl !UnwindSafe for ConversationStore
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