pub struct Summarizer { /* private fields */ }Expand description
Summarizer for large content.
Implementations§
Source§impl Summarizer
impl Summarizer
Sourcepub fn new(fast_model: Box<dyn Provider>) -> Self
pub fn new(fast_model: Box<dyn Provider>) -> Self
Create a new summarizer with fast model only.
Sourcepub fn new_with_main(
fast_model: Box<dyn Provider>,
main_model: Box<dyn Provider>,
) -> Self
pub fn new_with_main( fast_model: Box<dyn Provider>, main_model: Box<dyn Provider>, ) -> Self
Create a new summarizer with both models.
Sourcepub async fn summarize_light(&self, content: &str) -> Result<String>
pub async fn summarize_light(&self, content: &str) -> Result<String>
Generate a light summary (quick, key points only).
Sourcepub async fn summarize_deep(&self, content: &str) -> Result<String>
pub async fn summarize_deep(&self, content: &str) -> Result<String>
Generate a deep summary (more detailed).
Sourcepub fn smart_truncate(content: &str, target_tokens: u32) -> String
pub fn smart_truncate(content: &str, target_tokens: u32) -> String
Smart truncation preserving structure.
Sourcepub fn truncate_preserve_ends(content: &str, target_tokens: u32) -> String
pub fn truncate_preserve_ends(content: &str, target_tokens: u32) -> String
Truncate preserving beginning and end.
Sourcepub fn needs_summary(content: &str, threshold_tokens: u32) -> bool
pub fn needs_summary(content: &str, threshold_tokens: u32) -> bool
Check if content needs summarization.
Auto Trait Implementations§
impl Freeze for Summarizer
impl !RefUnwindSafe for Summarizer
impl Send for Summarizer
impl Sync for Summarizer
impl Unpin for Summarizer
impl UnsafeUnpin for Summarizer
impl !UnwindSafe for Summarizer
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