Struct llm_chain::summarization::TextSummarizer
source · pub struct TextSummarizer<E: Executor> { /* private fields */ }
Expand description
A TextSummarizer
takes a given text and summarizes it using an Executor
.
The summarizer is built on top of a map_reduce::Chain
, which takes care of the summarization process.
Implementations§
source§impl<E: Executor> TextSummarizer<E>
impl<E: Executor> TextSummarizer<E>
sourcepub async fn summarize_text(
&self,
exec: &E,
text: &str
) -> Result<String, TextSummarizerError<E::Error>>
pub async fn summarize_text( &self, exec: &E, text: &str ) -> Result<String, TextSummarizerError<E::Error>>
Summarizes the given text using the provided Executor
.
Returns the summarized text, or an error if the summarization process fails.
Trait Implementations§
Auto Trait Implementations§
impl<E> RefUnwindSafe for TextSummarizer<E>where <E as Executor>::PerInvocationOptions: RefUnwindSafe,
impl<E> Send for TextSummarizer<E>
impl<E> Sync for TextSummarizer<E>
impl<E> Unpin for TextSummarizer<E>where <E as Executor>::PerInvocationOptions: Unpin,
impl<E> UnwindSafe for TextSummarizer<E>where <E as Executor>::PerInvocationOptions: UnwindSafe,
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request