pub trait MessageFormatter: Send + Sync {
// Required methods
fn format_messages(
&self,
input_variables: PromptArgs,
) -> Result<Vec<Message>, PromptError>;
fn input_variables(&self) -> Vec<String>;
}Expand description
Represents a generic template for formatting messages.
Required Methods§
fn format_messages( &self, input_variables: PromptArgs, ) -> Result<Vec<Message>, PromptError>
Sourcefn input_variables(&self) -> Vec<String>
fn input_variables(&self) -> Vec<String>
Returns a list of required input variable names for the template.
Trait Implementations§
Source§impl<MF> From<MF> for Box<dyn MessageFormatter>where
MF: MessageFormatter + 'static,
impl<MF> From<MF> for Box<dyn MessageFormatter>where
MF: MessageFormatter + 'static,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".