pub trait ContextStrategy: Send + Sync {
// Required method
fn build(&self, state: &State, history: &[Message]) -> Vec<Message>;
// Provided methods
fn folds(&self, _history: &[Message]) -> Vec<(usize, usize)> { ... }
fn fold_budget(&self, _history: &[Message]) -> Option<usize> { ... }
}Required Methods§
Provided Methods§
Sourcefn folds(&self, _history: &[Message]) -> Vec<(usize, usize)>
fn folds(&self, _history: &[Message]) -> Vec<(usize, usize)>
The folds this strategy makes over history, as (a, b) ranges of history[1..].
Strategies that never fold return none.
Sourcefn fold_budget(&self, _history: &[Message]) -> Option<usize>
fn fold_budget(&self, _history: &[Message]) -> Option<usize>
The fold budget in force after history, in approximate tokens, for strategies that fold.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".