Skip to main content

PromptHandler

Trait PromptHandler 

Source
pub trait PromptHandler:
    Send
    + Sync
    + 'static {
    // Required methods
    fn list(&self) -> Pin<Box<dyn Future<Output = Vec<PromptDef>> + Send + '_>>;
    fn get(
        &self,
        name: &str,
        args: HashMap<String, String>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<PromptMessage>, String>> + Send + '_>>;
}
Expand description

Prompt handler trait

Implement this trait to handle prompt operations.

Required Methods§

Source

fn list(&self) -> Pin<Box<dyn Future<Output = Vec<PromptDef>> + Send + '_>>

List available prompts

Source

fn get( &self, name: &str, args: HashMap<String, String>, ) -> Pin<Box<dyn Future<Output = Result<Vec<PromptMessage>, String>> + Send + '_>>

Get a prompt with arguments

Implementors§