pub struct ConversationStore { /* private fields */ }Expand description
Conversation storage backend
Implementations§
Source§impl ConversationStore
impl ConversationStore
Sourcepub fn new() -> ConversationStore
pub fn new() -> ConversationStore
Create a new in-memory conversation store
Sourcepub fn with_persistence<P>(storage_path: P) -> ConversationStore
pub fn with_persistence<P>(storage_path: P) -> ConversationStore
Create a new conversation store with file-based persistence
Sourcepub async fn initialize(&self) -> Result<(), Error>
pub async fn initialize(&self) -> Result<(), Error>
Initialize the store (load from disk if using persistence)
Sourcepub async fn create_conversation(
&self,
workspace_id: Option<String>,
) -> Result<String, Error>
pub async fn create_conversation( &self, workspace_id: Option<String>, ) -> Result<String, Error>
Create a new conversation
Sourcepub async fn get_conversation(
&self,
id: &str,
) -> Result<Option<Conversation>, Error>
pub async fn get_conversation( &self, id: &str, ) -> Result<Option<Conversation>, Error>
Get a conversation by ID
Sourcepub async fn add_message(
&self,
conversation_id: &str,
message: ChatMessage,
) -> Result<(), Error>
pub async fn add_message( &self, conversation_id: &str, message: ChatMessage, ) -> Result<(), Error>
Add a message to a conversation
Sourcepub async fn get_context(
&self,
conversation_id: &str,
) -> Result<Option<ChatContext>, Error>
pub async fn get_context( &self, conversation_id: &str, ) -> Result<Option<ChatContext>, Error>
Get conversation context for chat
Sourcepub async fn list_conversations(
&self,
workspace_id: Option<&str>,
) -> Result<Vec<Conversation>, Error>
pub async fn list_conversations( &self, workspace_id: Option<&str>, ) -> Result<Vec<Conversation>, Error>
List conversations for a workspace
Trait Implementations§
Source§impl Default for ConversationStore
impl Default for ConversationStore
Source§fn default() -> ConversationStore
fn default() -> ConversationStore
Returns the “default value” for a type. Read more
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
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