pub trait Estimatable: Send + Sync {
// Required method
fn for_estimate<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Cow<'_, str>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn additional_tokens(&self) -> usize { ... }
}
Expand description
A value that can be estimated for the number of tokens it contains.
Required Methods§
fn for_estimate<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Cow<'_, str>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Provided Methods§
Sourcefn additional_tokens(&self) -> usize
fn additional_tokens(&self) -> usize
Optionally return extra tokens that should be added to the estimate.