pub struct LlmHandler { /* private fields */ }Implementations§
Source§impl LlmHandler
impl LlmHandler
pub fn new( config: LlmConfig, interruption: InterruptionConfig, global_follow_up_config: Option<FollowUpConfig>, scenes: HashMap<String, Scene>, dtmf: Option<HashMap<String, DtmfAction>>, initial_scene_id: Option<String>, sip_config: Option<SipOption>, ) -> Self
pub fn with_provider( config: LlmConfig, provider: Arc<dyn LlmProvider>, rag_retriever: Arc<dyn RagRetriever>, interruption: InterruptionConfig, global_follow_up_config: Option<FollowUpConfig>, scenes: HashMap<String, Scene>, dtmf: Option<HashMap<String, DtmfAction>>, initial_scene_id: Option<String>, sip_config: Option<SipOption>, ) -> Self
pub fn get_history_ref(&self) -> &[ChatMessage]
pub fn get_current_scene_id(&self) -> Option<String>
pub fn set_call(&mut self, call: ActiveCallRef)
pub fn set_event_sender(&mut self, sender: EventSender)
Trait Implementations§
Source§impl DialogueHandler for LlmHandler
impl DialogueHandler for LlmHandler
fn on_start<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Command>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_event<'life0, 'life1, 'async_trait>(
&'life0 mut self,
event: &'life1 SessionEvent,
) -> Pin<Box<dyn Future<Output = Result<Vec<Command>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_history<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<ChatMessage>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn summarize<'life0, 'life1, 'async_trait>(
&'life0 mut self,
prompt: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Auto Trait Implementations§
impl Freeze for LlmHandler
impl !RefUnwindSafe for LlmHandler
impl Send for LlmHandler
impl Sync for LlmHandler
impl Unpin for LlmHandler
impl !UnwindSafe for LlmHandler
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<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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