Class LLMSimulatedUser

java.lang.Object
dev.dokimos.core.conversation.LLMSimulatedUser
All Implemented Interfaces:
SimulatedUser

public class LLMSimulatedUser extends Object implements SimulatedUser
An LLM-based simulated user for multi-turn conversation testing.

This implementation uses a JudgeLM to generate contextually appropriate user messages based on a configured persona and behavior guidelines. It supports both fully dynamic responses and fixed initial responses.

Example usage:


 SimulatedUser user = LLMSimulatedUser.builder()
         .judge(judgeLM)
         .persona("frustrated customer who received a defective product")
         .behaviorGuidelines("Be assertive but not abusive. Express dissatisfaction clearly.")
         .build();
 
See Also:
  • Method Details

    • builder

      public static LLMSimulatedUser.Builder builder()
      Creates a new builder for constructing an LLM simulated user.
      Returns:
      a new builder
    • generateMessage

      public Message generateMessage(ConversationTrajectory trajectory)
      Description copied from interface: SimulatedUser
      Generates the next user message based on the current conversation state.

      The implementation should analyze the trajectory to understand context and generate an appropriate response that advances the conversation in a realistic manner.

      Specified by:
      generateMessage in interface SimulatedUser
      Parameters:
      trajectory - the current conversation trajectory
      Returns:
      the next user message