pub trait TurnGenerator: Send + Sync {
// Required method
fn generate<'life0, 'async_trait>(
&'life0 self,
req: GenerateRequest,
) -> Pin<Box<dyn Future<Output = Result<InferenceResult, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn generate_coder<'life0, 'async_trait>(
&'life0 self,
req: GenerateRequest,
) -> Pin<Box<dyn Future<Output = Result<InferenceResult, TurnGenerationError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn context_window(&self, _model: &str) -> usize { ... }
}Required Methods§
fn generate<'life0, 'async_trait>(
&'life0 self,
req: GenerateRequest,
) -> Pin<Box<dyn Future<Output = Result<InferenceResult, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Provided Methods§
Sourcefn generate_coder<'life0, 'async_trait>(
&'life0 self,
req: GenerateRequest,
) -> Pin<Box<dyn Future<Output = Result<InferenceResult, TurnGenerationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn generate_coder<'life0, 'async_trait>(
&'life0 self,
req: GenerateRequest,
) -> Pin<Box<dyn Future<Output = Result<InferenceResult, TurnGenerationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Coder-specific generation keeps routing exhaustion typed so an unattended caller can classify configuration failures without parsing error prose. Other consumers retain the original string seam.
Sourcefn context_window(&self, _model: &str) -> usize
fn context_window(&self, _model: &str) -> usize
The context window (in tokens) of the model this generator drives, or
0 when unknown. Multi-turn drivers use it to bound their running
message history before it overflows the window. Defaults to 0 so
test doubles need not implement it (the loop then skips compaction).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".