pub struct PersonaGenerator { /* private fields */ }Expand description
Persona generator for creating personas from descriptions
Implementations§
Source§impl PersonaGenerator
impl PersonaGenerator
Sourcepub fn with_config(config: IntelligentBehaviorConfig) -> Self
pub fn with_config(config: IntelligentBehaviorConfig) -> Self
Create a new persona generator with custom configuration
Sourcepub async fn generate(
&self,
request: &PersonaGenerationRequest,
ai_mode: Option<AiMode>,
deterministic_config: Option<&DeterministicModeConfig>,
) -> Result<PersonaGenerationResponse>
pub async fn generate( &self, request: &PersonaGenerationRequest, ai_mode: Option<AiMode>, deterministic_config: Option<&DeterministicModeConfig>, ) -> Result<PersonaGenerationResponse>
Generate a persona from natural language description
This method uses AI to generate a complete persona profile including:
- Realistic traits based on the description
- A narrative backstory
- Appropriate lifecycle configuration
- Domain-specific characteristics
In deterministic mode (ai_mode = generate_once_freeze), this method will first check for frozen artifacts before generating new ones.
Sourcepub async fn tweak(
&self,
base_persona: &Value,
description: &str,
) -> Result<PersonaGenerationResponse>
pub async fn tweak( &self, base_persona: &Value, description: &str, ) -> Result<PersonaGenerationResponse>
Tweak an existing persona based on a description
This method modifies an existing persona by adjusting traits, adding new ones, or updating the backstory based on the provided description.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PersonaGenerator
impl !RefUnwindSafe for PersonaGenerator
impl Send for PersonaGenerator
impl Sync for PersonaGenerator
impl Unpin for PersonaGenerator
impl UnsafeUnpin for PersonaGenerator
impl !UnwindSafe for PersonaGenerator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more