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§
Sourcefn render(&self, context: &PromptContext) -> LangExtractResult<String>
fn render(&self, context: &PromptContext) -> LangExtractResult<String>
Render the template with the given context
Sourcefn validate(&self) -> LangExtractResult<()>
fn validate(&self) -> LangExtractResult<()>
Validate the template structure
Sourcefn required_variables(&self) -> Vec<String>
fn required_variables(&self) -> Vec<String>
Get required variables for this template