pub struct ContinuationManager { /* private fields */ }Expand description
Manages conversation continuation across providers
Implementations§
Source§impl ContinuationManager
impl ContinuationManager
Sourcepub fn register_adapter(&mut self, adapter: Box<dyn ProviderAdapter>)
pub fn register_adapter(&mut self, adapter: Box<dyn ProviderAdapter>)
Register a provider adapter
Sourcepub fn create_context(
&mut self,
title: &str,
system_prompt: Option<&str>,
) -> Uuid
pub fn create_context( &mut self, title: &str, system_prompt: Option<&str>, ) -> Uuid
Create a new conversation context
Sourcepub fn add_message(
&mut self,
context_id: Uuid,
message: NormalizedMessage,
) -> bool
pub fn add_message( &mut self, context_id: Uuid, message: NormalizedMessage, ) -> bool
Add a message to the context
Sourcepub fn switch_provider(
&mut self,
context_id: Uuid,
to_provider: &str,
to_model: Option<&str>,
reason: Option<&str>,
) -> Option<ProviderMessages>
pub fn switch_provider( &mut self, context_id: Uuid, to_provider: &str, to_model: Option<&str>, reason: Option<&str>, ) -> Option<ProviderMessages>
Switch provider for a conversation
Sourcepub fn get_provider_messages(
&self,
context_id: Uuid,
provider: &str,
) -> Option<ProviderMessages>
pub fn get_provider_messages( &self, context_id: Uuid, provider: &str, ) -> Option<ProviderMessages>
Get context for a provider
Sourcepub fn process_response(
&mut self,
context_id: Uuid,
response: &ProviderResponse,
) -> Option<NormalizedMessage>
pub fn process_response( &mut self, context_id: Uuid, response: &ProviderResponse, ) -> Option<NormalizedMessage>
Process a response from a provider
Sourcepub fn get_context(&self, context_id: Uuid) -> Option<&ConversationContext>
pub fn get_context(&self, context_id: Uuid) -> Option<&ConversationContext>
Get a context
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ContinuationManager
impl !RefUnwindSafe for ContinuationManager
impl Send for ContinuationManager
impl Sync for ContinuationManager
impl Unpin for ContinuationManager
impl UnsafeUnpin for ContinuationManager
impl !UnwindSafe for ContinuationManager
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