Personas
A Persona defines who the simulated user is, how they behave, and how they sound.
from deepeval.dataset import Persona
persona = Persona(
name="Andy Byron",
characteristics="You are the CEO of Astronomer. You are curt and used to being deferred to. You speak in short sentences and interrupt long explanations.",
voice="onyx",
)A persona pairs with a ConversationalGolden: the persona is who is calling, while the golden's scenario and expected_outcome are what they are trying to do.
from deepeval.dataset import ConversationalGolden
golden = ConversationalGolden(
scenario="Andy Byron wants to purchase a VIP ticket to a Coldplay concert.",
expected_outcome="Successful purchase of a ticket.",
persona=persona,
)Create A Persona
There is ONE mandatory and EIGHT optional parameters when creating a Persona:
characteristics: a string prompt describing the user's demographics, personality, emotional arc, and speaking style.- [Optional]
name: a string name for the caller. Defaulted toNone. - [Optional]
voice: a string voice ID passed to yourtts_model. Defaulted toNone(the TTS model's own default voice). - [Optional]
interruption_behavior: anInterruptionBehaviorthat enables duplex barge-in, orNonefor half-duplex. Defaulted toNone. - [Optional]
speaks_first: a boolean for whether the caller opens the conversation instead of waiting for the agent's greeting. Defaulted toTrue. - [Optional]
muted: a boolean which when set toTruemakes the caller stay completely silent for the whole call. Defaulted toFalse. - [Optional]
background_noise: aBackgroundNoiseSettingsthat loops ambient audio underneath the caller's speech. Defaulted toNone. - [Optional]
multilingual_stt: a boolean which when set toTrueasks yourstt_modelto detect the agent's language per utterance instead of locking to one. Defaulted toFalse. - [Optional]
hold_timeout: a float number of seconds of agent silence or hold music before the caller hangs up. Defaulted toNone.
Only name and characteristics apply to text simulations. Everything else is voice-only and is ignored when you simulate with a model_callback.
Configuring Characteristics
characteristics is a prompt, not a label. The simulator model writes the caller's dialogue from it and the TTS model speaks that text verbatim β so emotion, hesitation, and pacing come from the words you tell the persona to use, not from vocal knobs.
Describe behavior in terms of word choice and conversational patterns:
# Less effective β a label the model has to interpret
Persona(characteristics="You are an angry customer.")
# More effective β observable behavior the model can act out
Persona(
characteristics="""You are extremely frustrated and losing patience. You use short, clipped sentences.
When you have to repeat information you have already given, you say things like "I already told you this."
Your language gets sharper the longer the agent takes to resolve your issue.""",
)A few things that matter more in voice than in text:
- Give the caller an emotional arc. Real callers escalate and de-escalate: "You start calm but grow frustrated if the agent puts you on hold. If your issue is resolved, your tone softens."
- Punctuation is a speech cue.
!reads as emphasis,,as a natural pause,-as a brief break, and short sentences as stress. Avoid..., which some TTS engines read aloud as "dot dot dot". - Spell filler words plainly.
um,uh,hmm,oh,wellβ notummmoruhhhh, which TTS engines often spell out letter by letter. - Tag blocks work well.
characteristicsis free-form multi-line text, so<speaking_style>β¦</speaking_style>or<end_call>β¦</end_call>sections are a good way to separate delivery from call-control instructions.
Configuring Audio
Voice
voice is passed straight through to your tts_model, so valid values depend on the model you configured on VoiceConfig β "alloy", "onyx", "shimmer", etc. for the default OpenAITTSModel.
persona = Persona(
characteristics="You are an older adult who is uncomfortable with technology.",
voice="onyx",
)Rate, pitch, and delivery style are not persona fields, because no two TTS providers spell them the same way. Set those on the TTS model itself (OpenAITTSModel(generation_kwargs={...})) and keep the persona portable.
Background Noise
Real calls are not made from a recording booth. background_noise loops an ambient audio file underneath the caller's speech, so your agent's speech recognition has to work through it:
from deepeval.dataset import Persona, BackgroundNoiseSettings
persona = Persona(
characteristics="You are calling from a busy cafe and keep losing your train of thought.",
background_noise=BackgroundNoiseSettings(audio="cafe.wav", volume=0.3),
)There is ONE mandatory and ONE optional parameter when creating a BackgroundNoiseSettings:
audio: a path to a.wavor.mp3file, which is looped for the length of the call.- [Optional]
volume: a float between0.0and1.0for how loudly the noise is mixed in. Defaulted to0.3.
Configuring Behavior
Who Speaks First
Most voice agents open with a greeting. Set speaks_first=False and the simulated caller stays quiet until the agent has spoken, so the greeting becomes the first Turn of the conversation:
persona = Persona(
characteristics="You are a patient caller who waits to be greeted.",
speaks_first=False,
)Silent Callers
muted=True makes the caller never speak at all β every user turn is empty and only silence goes up the wire. Use it to test how your agent handles dead air: does it re-prompt, escalate, or hang up?
persona = Persona(characteristics="You are unable to speak.", muted=True)Hanging Up On Hold Music
hold_timeout is the number of seconds of agent silence (or hold music) the caller tolerates before ending the call. Without it, the simulation runs until max_user_simulations is exhausted:
persona = Persona(
characteristics="You are in a hurry and will not sit through hold music.",
hold_timeout=15,
)This is most useful for transfer flows β set it to 10β15 seconds to confirm a hand-off actually happened without waiting out the agent's own timeout.
Multilingual Recognition
By default the caller "hears" your agent in whatever language your stt_model is configured for. Set multilingual_stt=True and the STT model detects the language per utterance instead, which is what you want for agents that switch mid-call ("For English press one, para espaΓ±ol presione dos").
Interruptions
interruption_behavior turns the call duplex: instead of politely waiting for each reply, the caller can cut in mid-sentence while the agent is still speaking.
from deepeval.dataset import Persona, InterruptionBehavior
persona = Persona(
characteristics="You are impatient and finish other people's sentences.",
interruption_behavior=InterruptionBehavior(frequency="frequent", overlap="insist"),
)frequency controls how readily the caller barges in, and overlap controls what they do when both sides end up talking at once. Leaving interruption_behavior as None keeps the conversation half-duplex.
FAQs
Do personas work in text simulations too?
name and characteristics mean anything there β those are what the simulator model role-plays from. Voice, background noise, interruptions, and the behavioral flags require a VoiceConfig and are ignored otherwise.Can one persona be reused across many goldens?
ConversationalGolden, so build one Persona and pass the same object to every golden you want that caller to run β a matrix of personas against scenarios is how you find the cases where your agent only works for the easy caller.Why isn't there a speaking rate or accent field?
voice is the only synthesis knob every DeepEvalBaseTTS implementation shares. Rate, pitch, and style are spelled differently by every provider, so they belong on your TTS model rather than on the persona. Accent, in practice, is a property of the voice you pick.Does the persona reach Confident AI?
characteristics are sent as the test case's user description today. The structured voice settings stay local until the platform has a field for them.