Trait SimplePrompt

Source
pub trait SimplePrompt:
    Debug
    + Send
    + Sync
    + DynClone {
    // Required method
    fn prompt<'life0, 'async_trait>(
        &'life0 self,
        prompt: Prompt,
    ) -> Pin<Box<dyn Future<Output = Result<String, LanguageModelError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn name(&self) -> &'static str { ... }
}
Expand description

Given a string prompt, queries an LLM

Required Methods§

Source

fn prompt<'life0, 'async_trait>( &'life0 self, prompt: Prompt, ) -> Pin<Box<dyn Future<Output = Result<String, LanguageModelError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Provided Methods§

Source

fn name(&self) -> &'static str

Trait Implementations§

Source§

impl SimplePrompt for &dyn SimplePrompt

Source§

fn prompt<'life0, 'async_trait>( &'life0 self, prompt: Prompt, ) -> Pin<Box<dyn Future<Output = Result<String, LanguageModelError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn name(&self) -> &'static str

Source§

impl SimplePrompt for Box<dyn SimplePrompt>

Source§

fn prompt<'life0, 'async_trait>( &'life0 self, prompt: Prompt, ) -> Pin<Box<dyn Future<Output = Result<String, LanguageModelError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn name(&self) -> &'static str

Implementations on Foreign Types§

Source§

impl SimplePrompt for Box<dyn SimplePrompt>

Source§

fn prompt<'life0, 'async_trait>( &'life0 self, prompt: Prompt, ) -> Pin<Box<dyn Future<Output = Result<String, LanguageModelError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn name(&self) -> &'static str

Implementors§