Class UserPersonas
This class provides ready-to-use personas for common testing scenarios, eliminating the need to write custom system prompts for typical use cases.
Note: Unlike OpenEvals and DeepEval (which don't provide pre-built personas), Dokimos includes these templates as a convenience for common testing needs.
Example usage:
SimulatedUser user = UserPersonas.aggressiveCustomer(judgeLM);
ConversationSimulator simulator = ConversationSimulator.builder()
.simulatedUser(user)
.application(myApp)
.build();
-
Method Summary
Modifier and TypeMethodDescriptionstatic SimulatedUseradversarialUser(JudgeLM judge) Creates a simulated adversarial user who tries to manipulate the system.static SimulatedUseraggressiveCustomer(JudgeLM judge) Creates a simulated aggressive customer who is frustrated and demanding.static SimulatedUserconfusedUser(JudgeLM judge) Creates a simulated confused user who struggles to understand.static SimulatedUserCreates a custom simulated user with the specified persona and guidelines.static SimulatedUserimpatientUser(JudgeLM judge) Creates a simulated impatient user who wants quick answers.static SimulatedUsernoviceUser(JudgeLM judge) Creates a simulated novice user who is new to the domain.static SimulatedUseroffTopicUser(JudgeLM judge) Creates a simulated off-topic user who frequently goes on tangents.static SimulatedUsersatisfiedCustomer(JudgeLM judge) Creates a simulated satisfied customer who is cooperative and positive.static SimulatedUsertechnicalExpert(JudgeLM judge) Creates a simulated technical expert who understands complex concepts.
-
Method Details
-
aggressiveCustomer
Creates a simulated aggressive customer who is frustrated and demanding.This persona expresses strong dissatisfaction, uses assertive language, and expects immediate resolution. Useful for testing customer service applications under pressure.
- Parameters:
judge- the JudgeLM to use for response generation- Returns:
- a simulated aggressive customer
-
confusedUser
Creates a simulated confused user who struggles to understand.This persona asks clarifying questions, misunderstands instructions, and needs things explained multiple ways. Useful for testing how well applications handle users with varying technical literacy.
- Parameters:
judge- the JudgeLM to use for response generation- Returns:
- a simulated confused user
-
impatientUser
Creates a simulated impatient user who wants quick answers.This persona has little tolerance for long explanations, wants immediate solutions, and may interrupt or express frustration with slow responses.
- Parameters:
judge- the JudgeLM to use for response generation- Returns:
- a simulated impatient user
-
satisfiedCustomer
Creates a simulated satisfied customer who is cooperative and positive.This persona is easy to work with, provides positive feedback, and engages constructively. Useful for testing happy-path scenarios.
- Parameters:
judge- the JudgeLM to use for response generation- Returns:
- a simulated satisfied customer
-
technicalExpert
Creates a simulated technical expert who understands complex concepts.This persona uses technical terminology, asks detailed questions, and may challenge or probe for deeper information. Useful for testing how well applications handle knowledgeable users.
- Parameters:
judge- the JudgeLM to use for response generation- Returns:
- a simulated technical expert
-
noviceUser
Creates a simulated novice user who is new to the domain.This persona needs basic explanations, asks fundamental questions, and benefits from patient, educational responses.
- Parameters:
judge- the JudgeLM to use for response generation- Returns:
- a simulated novice user
-
adversarialUser
Creates a simulated adversarial user who tries to manipulate the system.This persona attempts to get the assistant to behave inappropriately, bypass guidelines, or reveal information it shouldn't. Useful for red-teaming and security testing.
- Parameters:
judge- the JudgeLM to use for response generation- Returns:
- a simulated adversarial user
-
offTopicUser
Creates a simulated off-topic user who frequently goes on tangents.This persona changes subjects unexpectedly, brings up unrelated topics, and tests how well the application maintains focus and redirects conversations.
- Parameters:
judge- the JudgeLM to use for response generation- Returns:
- a simulated off-topic user
-
custom
Creates a custom simulated user with the specified persona and guidelines.Use this method when the pre-built personas don't fit your testing needs.
- Parameters:
judge- the JudgeLM to use for response generationpersona- a short description of the user's characterbehaviorGuidelines- specific behavior rules for the simulated user- Returns:
- a custom simulated user
-