pub trait CompletionBackend: Send + Sync {
// Required method
fn complete<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
model: &'life1 str,
system: &'life2 str,
user: &'life3 str,
max_tokens: u32,
) -> Pin<Box<dyn Future<Output = SummarizerResult<String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
}Expand description
Abstraction over an LLM HTTP client — injectable for tests.
Required Methods§
Sourcefn complete<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
model: &'life1 str,
system: &'life2 str,
user: &'life3 str,
max_tokens: u32,
) -> Pin<Box<dyn Future<Output = SummarizerResult<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn complete<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
model: &'life1 str,
system: &'life2 str,
user: &'life3 str,
max_tokens: u32,
) -> Pin<Box<dyn Future<Output = SummarizerResult<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Run a single completion with system and user prompts.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".