pub struct ModelSummarizer { /* private fields */ }Expand description
The model fill over any ModelProvider: the range goes to the
worker as one rendered transcript, the answer comes back capped at
SUMMARY_MAX_BYTES. Retryable provider errors are retried
ModelSummarizer::attempts times; anything else fails straight
to the extractive stand-in.
Implementations§
Source§impl ModelSummarizer
impl ModelSummarizer
Sourcepub fn new(provider: Arc<dyn ModelProvider>, model: impl Into<String>) -> Self
pub fn new(provider: Arc<dyn ModelProvider>, model: impl Into<String>) -> Self
A worker on provider running model. Three attempts on
retryable errors.
Sourcepub fn with_attempts(
provider: Arc<dyn ModelProvider>,
model: impl Into<String>,
attempts: u32,
) -> Self
pub fn with_attempts( provider: Arc<dyn ModelProvider>, model: impl Into<String>, attempts: u32, ) -> Self
A worker with an explicit retry budget for retryable errors.
Trait Implementations§
Source§impl Debug for ModelSummarizer
impl Debug for ModelSummarizer
Source§impl Summarizer for ModelSummarizer
impl Summarizer for ModelSummarizer
Source§fn summarize<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
messages: &'life1 [Message],
context: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<String, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn summarize<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
messages: &'life1 [Message],
context: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<String, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
A dense markdown digest of
messages — one range of the log,
in order. context is the digest of the immediately preceding
range, when there is one: it exists to resolve references
(“that file”, “run it again”) and is never part of the summary.
Err leaves the extractive stand-in in place.Auto Trait Implementations§
impl !RefUnwindSafe for ModelSummarizer
impl !UnwindSafe for ModelSummarizer
impl Forget for ModelSummarizer
impl Freeze for ModelSummarizer
impl Send for ModelSummarizer
impl Sync for ModelSummarizer
impl Unpin for ModelSummarizer
impl UnsafeUnpin for ModelSummarizer
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