PersonaTemplate

Trait PersonaTemplate 

Source
pub trait PersonaTemplate: Send + Sync {
    // Required methods
    fn generate_traits(&self, seed: u64) -> HashMap<String, String>;
    fn domain(&self) -> Domain;

    // Provided method
    fn generate_backstory(
        &self,
        persona: &PersonaProfile,
    ) -> Result<Option<String>> { ... }
}
Expand description

Trait for persona templates that generate traits based on a seed

Required Methods§

Source

fn generate_traits(&self, seed: u64) -> HashMap<String, String>

Generate traits for a persona based on its seed

Source

fn domain(&self) -> Domain

Get the domain this template applies to

Provided Methods§

Source

fn generate_backstory(&self, persona: &PersonaProfile) -> Result<Option<String>>

Generate a backstory for a persona based on its traits

This is an optional method that can be overridden by implementations to provide domain-specific backstory generation. The default implementation uses the BackstoryGenerator.

Implementors§