Skip to main content

ExampleSelector

Trait ExampleSelector 

Source
pub trait ExampleSelector: Send + Sync {
    // Required methods
    fn select_examples<'life0, 'life1, 'async_trait>(
        &'life0 self,
        input: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<FewShotExample>, SynapticError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn add_example<'life0, 'async_trait>(
        &'life0 self,
        example: FewShotExample,
    ) -> Pin<Box<dyn Future<Output = Result<(), SynapticError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait for selecting examples for few-shot prompting.

Required Methods§

Source

fn select_examples<'life0, 'life1, 'async_trait>( &'life0 self, input: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<FewShotExample>, SynapticError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Select examples most relevant to the input.

Source

fn add_example<'life0, 'async_trait>( &'life0 self, example: FewShotExample, ) -> Pin<Box<dyn Future<Output = Result<(), SynapticError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Add a new example to the selector’s pool.

Implementors§