pub struct ConversationStore { /* private fields */ }Expand description
Conversation storage operations.
Implementations§
Source§impl ConversationStore
impl ConversationStore
Sourcepub async fn create(&self) -> StoreResult<ConversationData>
pub async fn create(&self) -> StoreResult<ConversationData>
Sourcepub async fn get_or_create(
&self,
conversation_id: &str,
) -> StoreResult<ConversationData>
pub async fn get_or_create( &self, conversation_id: &str, ) -> StoreResult<ConversationData>
Gets a conversation or creates it if it doesn’t exist.
§Errors
Returns error if database query fails.
Sourcepub async fn get(&self, conversation_id: &str) -> StoreResult<ConversationData>
pub async fn get(&self, conversation_id: &str) -> StoreResult<ConversationData>
Sourcepub async fn rehydrate(
&self,
conversation_id: &str,
) -> StoreResult<Vec<InOutItem>>
pub async fn rehydrate( &self, conversation_id: &str, ) -> StoreResult<Vec<InOutItem>>
Rehydrates a conversation with all its items.
§Errors
Returns error if conversation not found or database query fails.
Sourcepub async fn persist(
&self,
conversation_id: &str,
response_id: &str,
previous_response_id: Option<&str>,
new_items: Vec<InOutItem>,
metadata: &ResponseMetadata,
) -> StoreResult<()>
pub async fn persist( &self, conversation_id: &str, response_id: &str, previous_response_id: Option<&str>, new_items: Vec<InOutItem>, metadata: &ResponseMetadata, ) -> StoreResult<()>
Persists conversation turn with new items and response metadata.
Creates items in the conversation and stores the associated response record.
§Errors
Returns StorageError if conversation not found or database operation fails.
Trait Implementations§
Source§impl Clone for ConversationStore
impl Clone for ConversationStore
Source§fn clone(&self) -> ConversationStore
fn clone(&self) -> ConversationStore
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ConversationStore
impl !UnwindSafe for ConversationStore
impl Freeze for ConversationStore
impl Send for ConversationStore
impl Sync for ConversationStore
impl Unpin for ConversationStore
impl UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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