TemplateRenderer

Trait TemplateRenderer 

Source
pub trait TemplateRenderer {
    // Required methods
    fn render(&self, context: &PromptContext) -> LangExtractResult<String>;
    fn validate(&self) -> LangExtractResult<()>;
    fn required_variables(&self) -> Vec<String>;
}
Expand description

Trait for rendering prompt templates

Required Methods§

Source

fn render(&self, context: &PromptContext) -> LangExtractResult<String>

Render the template with the given context

Source

fn validate(&self) -> LangExtractResult<()>

Validate the template structure

Source

fn required_variables(&self) -> Vec<String>

Get required variables for this template

Implementors§