Package dev.dokimos.core.conversation
Class LLMSimulatedUser.Builder
java.lang.Object
dev.dokimos.core.conversation.LLMSimulatedUser.Builder
- Enclosing class:
LLMSimulatedUser
Builder for constructing LLM simulated users.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbehaviorGuidelines(String guidelines) Sets additional behavior guidelines for the simulated user.build()Builds the LLM simulated user.fixedResponse(String response) Adds a fixed response to use before generating dynamic responses.fixedResponses(List<String> responses) Sets all fixed responses at once.Sets the JudgeLM to use for generating responses.Sets a short persona description.systemPrompt(String systemPrompt) Sets the complete system prompt directly.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
judge
Sets the JudgeLM to use for generating responses.- Parameters:
judge- the JudgeLM instance- Returns:
- this builder
-
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
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
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
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
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
Builds the LLM simulated user.- Returns:
- a new LLM simulated user
- Throws:
IllegalStateException- if judge is not set
-