Skip to main content

AsyncExampleSelector

Trait AsyncExampleSelector 

Source
pub trait AsyncExampleSelector<E>: Send + Sync
where E: Send + Sync + 'static,
{ // Required method fn select_async<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, input: &'life1 str, examples: &'life2 [E], ) -> Pin<Box<dyn Future<Output = Result<Vec<E>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; }
Expand description

Async-first variant of cognis_core::prompts::ExampleSelector. Use when you want to call selection from within an async context without going through block_in_place.

Required Methods§

Source

fn select_async<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, input: &'life1 str, examples: &'life2 [E], ) -> Pin<Box<dyn Future<Output = Result<Vec<E>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Select examples to include for input.

Implementors§

Source§

impl<E> AsyncExampleSelector<E> for MmrExampleSelector<E>
where E: Clone + Send + Sync + 'static,

Source§

impl<E> AsyncExampleSelector<E> for SemanticSimilarityExampleSelector<E>
where E: Clone + Send + Sync + 'static,