Class GoldenGenerator.Builder

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

public static class GoldenGenerator.Builder extends Object
Builder for constructing golden generators.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • application

      public GoldenGenerator.Builder application(ConversationalApplication application)
      Sets the application under test, which answers every seed.
      Parameters:
      application - the application to drive
      Returns:
      this builder
    • judge

      public GoldenGenerator.Builder judge(JudgeLM judge)
      Sets the judge used to build persona-driven users.

      Scripted seeds need no judge: their user turns are replayed verbatim. The judge is only requested when a persona-driven seed is generated, and its absence then fails with a message naming the seed.

      Parameters:
      judge - the judge
      Returns:
      this builder
    • maxTurns

      public GoldenGenerator.Builder maxTurns(int maxTurns)
      Sets the default turn limit for seeds that do not set their own. Default is 10.

      A scripted seed stops at its last user turn even when the limit is higher.

      Parameters:
      maxTurns - the maximum number of turns
      Returns:
      this builder
    • name

      public GoldenGenerator.Builder name(String name)
      Sets the name of the generated dataset. Defaults to "goldens".
      Parameters:
      name - the dataset name
      Returns:
      this builder
    • description

      public GoldenGenerator.Builder description(String description)
      Sets the description of the generated dataset.
      Parameters:
      description - the dataset description
      Returns:
      this builder
    • seed

      Adds one seed to generate.
      Parameters:
      seed - the seed to add
      Returns:
      this builder
    • seeds

      public GoldenGenerator.Builder seeds(List<ScenarioSeed> seeds)
      Replaces the seeds to generate.
      Parameters:
      seeds - the seeds, in generation order
      Returns:
      this builder
    • build

      public GoldenGenerator build()
      Builds the golden generator.
      Returns:
      a new golden generator
      Throws:
      IllegalStateException - if the application or the seeds are missing