pub trait BaseExampleSelector: Send + Sync {
// Required methods
fn add_example(&mut self, example: Example) -> Result<()>;
fn select_examples(&self, input_variables: &Example) -> Result<Vec<Example>>;
// Provided methods
fn aadd_example<'life0, 'async_trait>(
&'life0 mut self,
example: Example,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn aselect_examples<'life0, 'life1, 'async_trait>(
&'life0 self,
input_variables: &'life1 Example,
) -> Pin<Box<dyn Future<Output = Result<Vec<Example>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
}
Expand description
Interface for selecting examples to include in prompts.
Example selectors are used to dynamically choose which examples to include in prompts based on the input variables. This is essential for few-shot learning and context-aware prompt construction.