pub struct LLMSummarizer { /* private fields */ }Implementations§
Source§impl LLMSummarizer
impl LLMSummarizer
pub fn new(llm: Arc<dyn LLMProvider>) -> Self
pub fn with_prompt(self, prompt: impl Into<String>) -> Self
pub fn with_merge_prompt(self, prompt: impl Into<String>) -> Self
pub fn with_batch_size(self, size: usize) -> Self
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>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn summarize<'life0, 'life1, 'async_trait>(
&'life0 self,
messages: &'life1 [ChatMessage],
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: '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>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn merge_summaries<'life0, 'life1, 'async_trait>(
&'life0 self,
summaries: &'life1 [String],
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: '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