Cache

Trait Cache 

Source
pub trait Cache: Send + Sync {
    // Required methods
    fn get(&self, prompt: &str) -> Option<String>;
    fn set(&self, prompt: &str, response: String);
}
Expand description

Trait for prompt caching strategies.

Required Methods§

Source

fn get(&self, prompt: &str) -> Option<String>

Try to retrieve a cached response for a prompt.

Source

fn set(&self, prompt: &str, response: String)

Store a response in the cache.

Implementors§