Class TestCase

java.lang.Object
com.tnsai.prompt.optimizer.TestCase

public class TestCase extends Object
Test case for prompt optimization.

A test case consists of an input and expected output pair used to evaluate prompt performance.

  • Constructor Details

    • TestCase

      public TestCase(String input, String expectedOutput)
      Creates a test case with default weight.
    • TestCase

      public TestCase(String input, String expectedOutput, String category)
      Creates a test case with category.
    • TestCase

      public TestCase(String input, String expectedOutput, String category, float weight)
      Creates a test case with all fields.
  • Method Details

    • getInput

      public String getInput()
    • getExpectedOutput

      public String getExpectedOutput()
    • getCategory

      public String getCategory()
    • getWeight

      public float getWeight()
    • hasCategory

      public boolean hasCategory()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • builder

      public static TestCase.Builder builder()
      Builder for test cases.