Package dev.dokimos.core.conversation
Class ScenarioSeed.Builder
java.lang.Object
dev.dokimos.core.conversation.ScenarioSeed.Builder
- Enclosing class:
ScenarioSeed
Builder for constructing scenario seeds.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the scenario seed.expectedOutcome(String expectedOutcome) Sets the natural-language completion criterion stored under"expectedOutcome"in the generated example's metadata, for a judge to grade the conversation against.expectedOutput(String key, Object value) Adds an expected output with the given key and value.expectedOutputs(Map<String, Object> expectedOutputs) Adds all entries from the given expected outputs map.initialMessage(String initialMessage) Sets the first user message.maxTurns(int maxTurns) Sets the turn limit for this seed, overriding the generator's default.Adds metadata with the given key and value.Adds all entries from the given metadata map.personaFactory(Function<JudgeLM, SimulatedUser> personaFactory) Sets the factory that builds the simulated user from the generator's judge.Sets the scenario description.Adds one scripted user turn.Replaces the scripted user turns.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
scenario
Sets the scenario description.- Parameters:
scenario- the scenario description- Returns:
- this builder
-
initialMessage
Sets the first user message.On a scripted seed this message replaces the first entry of
userTurns, which is then never sent.- Parameters:
initialMessage- the first user message- Returns:
- this builder
-
expectedOutcome
Sets the natural-language completion criterion stored under"expectedOutcome"in the generated example's metadata, for a judge to grade the conversation against. It is never used as a stopping condition.- Parameters:
expectedOutcome- the expected outcome- Returns:
- this builder
-
userTurn
Adds one scripted user turn.- Parameters:
turn- the user turn content- Returns:
- this builder
-
userTurns
Replaces the scripted user turns.- Parameters:
turns- the user turns, in order- Returns:
- this builder
-
personaFactory
Sets the factory that builds the simulated user from the generator's judge.- Parameters:
personaFactory- the persona factory- Returns:
- this builder
-
maxTurns
Sets the turn limit for this seed, overriding the generator's default. A scripted seed stops at its last user turn regardless of the limit.- Parameters:
maxTurns- the maximum number of turns- Returns:
- this builder
-
expectedOutput
Adds an expected output with the given key and value.- Parameters:
key- the output keyvalue- the output value- Returns:
- this builder
-
expectedOutputs
Adds all entries from the given expected outputs map.- Parameters:
expectedOutputs- the expected outputs to add- Returns:
- this builder
-
metadata
Adds metadata with the given key and value.- Parameters:
key- the metadata keyvalue- the metadata value- Returns:
- this builder
-
metadata
Adds all entries from the given metadata map.- Parameters:
metadata- the metadata to add- Returns:
- this builder
-
build
Builds the scenario seed.- Returns:
- a new scenario seed
- Throws:
IllegalArgumentException- if neither or both of userTurns and personaFactory are set
-