Class UserPersonas

java.lang.Object
dev.dokimos.core.conversation.UserPersonas

public final class UserPersonas extends Object
Factory for creating pre-built simulated user personas.

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 Details

    • aggressiveCustomer

      public static SimulatedUser aggressiveCustomer(JudgeLM judge)
      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

      public static SimulatedUser confusedUser(JudgeLM judge)
      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

      public static SimulatedUser impatientUser(JudgeLM judge)
      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

      public static SimulatedUser satisfiedCustomer(JudgeLM judge)
      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

      public static SimulatedUser technicalExpert(JudgeLM judge)
      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

      public static SimulatedUser noviceUser(JudgeLM judge)
      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

      public static SimulatedUser adversarialUser(JudgeLM judge)
      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

      public static SimulatedUser offTopicUser(JudgeLM judge)
      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

      public static SimulatedUser custom(JudgeLM judge, String persona, String behaviorGuidelines)
      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 generation
      persona - a short description of the user's character
      behaviorGuidelines - specific behavior rules for the simulated user
      Returns:
      a custom simulated user