Skip to main content

PromptRunner

Trait PromptRunner 

Source
pub trait PromptRunner: Send + 'static {
    // Required method
    fn run(
        &mut self,
        prompt: &str,
        model: &str,
        emit: &(dyn Fn(EntryBody) + Sync),
    ) -> Result<(), String>;

    // Provided methods
    fn run_with_first_output(
        &mut self,
        prompt: &str,
        model: &str,
        emit: &(dyn Fn(EntryBody) + Sync),
        _on_first_output: &(dyn Fn(Instant) + Sync),
    ) -> Result<(), String> { ... }
    fn set_pending_user_parts(&mut self, _parts: Vec<UserPart>) { ... }
}

Required Methods§

Source

fn run( &mut self, prompt: &str, model: &str, emit: &(dyn Fn(EntryBody) + Sync), ) -> Result<(), String>

Provided Methods§

Source

fn run_with_first_output( &mut self, prompt: &str, model: &str, emit: &(dyn Fn(EntryBody) + Sync), _on_first_output: &(dyn Fn(Instant) + Sync), ) -> Result<(), String>

Source

fn set_pending_user_parts(&mut self, _parts: Vec<UserPart>)

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§