Class LLMSimulatedUser.Builder

java.lang.Object
dev.dokimos.core.conversation.LLMSimulatedUser.Builder
Enclosing class:
LLMSimulatedUser

public static class LLMSimulatedUser.Builder extends Object
Builder for constructing LLM simulated users.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • judge

      public LLMSimulatedUser.Builder judge(JudgeLM judge)
      Sets the JudgeLM to use for generating responses.
      Parameters:
      judge - the JudgeLM instance
      Returns:
      this builder
    • systemPrompt

      public LLMSimulatedUser.Builder systemPrompt(String systemPrompt)
      Sets the complete system prompt directly.

      This overrides any persona or behavior guidelines. Use this for full control over the user's behavior.

      Parameters:
      systemPrompt - the system prompt
      Returns:
      this builder
    • persona

      public LLMSimulatedUser.Builder persona(String persona)
      Sets a short persona description.

      This will be combined with behavior guidelines to create the system prompt. Example: "frustrated customer who received a defective product"

      Parameters:
      persona - the persona description
      Returns:
      this builder
    • behaviorGuidelines

      public LLMSimulatedUser.Builder behaviorGuidelines(String guidelines)
      Sets additional behavior guidelines for the simulated user.

      Example: "Be assertive but not abusive. Express dissatisfaction clearly."

      Parameters:
      guidelines - the behavior guidelines
      Returns:
      this builder
    • fixedResponse

      public LLMSimulatedUser.Builder fixedResponse(String response)
      Adds a fixed response to use before generating dynamic responses.

      Fixed responses are used in order for the first N turns, after which the LLM generates responses dynamically. This is useful for testing specific conversation flows.

      Parameters:
      response - the fixed response
      Returns:
      this builder
    • fixedResponses

      public LLMSimulatedUser.Builder fixedResponses(List<String> responses)
      Sets all fixed responses at once.

      Fixed responses are used in order for the first N turns.

      Parameters:
      responses - the list of fixed responses
      Returns:
      this builder
    • build

      public LLMSimulatedUser build()
      Builds the LLM simulated user.
      Returns:
      a new LLM simulated user
      Throws:
      IllegalStateException - if judge is not set