pub struct LLMSummarizer { /* private fields */ }Implementations§
Source§impl LLMSummarizer
impl LLMSummarizer
pub fn new(llm: Arc<dyn LLMProvider>) -> LLMSummarizer
pub fn with_prompt(self, prompt: impl Into<String>) -> LLMSummarizer
pub fn with_merge_prompt(self, prompt: impl Into<String>) -> LLMSummarizer
pub fn with_batch_size(self, size: usize) -> LLMSummarizer
Trait Implementations§
Source§impl Summarizer for LLMSummarizer
impl Summarizer for LLMSummarizer
Source§fn summarize<'life0, 'life1, 'async_trait>(
&'life0 self,
messages: &'life1 [ChatMessage],
) -> Pin<Box<dyn Future<Output = Result<String, AgentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
LLMSummarizer: 'async_trait,
fn summarize<'life0, 'life1, 'async_trait>(
&'life0 self,
messages: &'life1 [ChatMessage],
) -> Pin<Box<dyn Future<Output = Result<String, AgentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
LLMSummarizer: 'async_trait,
Produce a summary from a batch of messages.
Source§fn max_batch_size(&self) -> usize
fn max_batch_size(&self) -> usize
Maximum messages per summarization call. Returns 20 by default.
Source§fn merge_summaries<'life0, 'life1, 'async_trait>(
&'life0 self,
summaries: &'life1 [String],
) -> Pin<Box<dyn Future<Output = Result<String, AgentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
LLMSummarizer: 'async_trait,
fn merge_summaries<'life0, 'life1, 'async_trait>(
&'life0 self,
summaries: &'life1 [String],
) -> Pin<Box<dyn Future<Output = Result<String, AgentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
LLMSummarizer: 'async_trait,
Combine multiple summaries into one. Joins with
\n\n by default.Auto Trait Implementations§
impl Freeze for LLMSummarizer
impl !RefUnwindSafe for LLMSummarizer
impl Send for LLMSummarizer
impl Sync for LLMSummarizer
impl Unpin for LLMSummarizer
impl UnsafeUnpin for LLMSummarizer
impl !UnwindSafe for LLMSummarizer
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 moreCreates a shared type from an unshared type.