pub struct PersonaGenerator { /* private fields */ }Expand description
Persona generator for creating personas from descriptions
Implementations§
Source§impl PersonaGenerator
impl PersonaGenerator
Sourcepub fn new() -> PersonaGenerator
pub fn new() -> PersonaGenerator
Create a new persona generator with default configuration
Sourcepub fn with_config(config: IntelligentBehaviorConfig) -> PersonaGenerator
pub fn with_config(config: IntelligentBehaviorConfig) -> PersonaGenerator
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, Error>
pub async fn generate( &self, request: &PersonaGenerationRequest, ai_mode: Option<AiMode>, deterministic_config: Option<&DeterministicModeConfig>, ) -> Result<PersonaGenerationResponse, Error>
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, Error>
pub async fn tweak( &self, base_persona: &Value, description: &str, ) -> Result<PersonaGenerationResponse, Error>
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§
Source§impl Default for PersonaGenerator
impl Default for PersonaGenerator
Source§fn default() -> PersonaGenerator
fn default() -> PersonaGenerator
Returns the “default value” for a type. Read more
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more