Class SyntheticDataGenerator

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

public class SyntheticDataGenerator extends Object
Generates synthetic test data for prompt optimization.

Creates test cases based on task descriptions, including edge cases and variations.

Usage


 SyntheticDataGenerator generator = new SyntheticDataGenerator(llmClient);

 List<TestCase> testCases = generator.generate(
     "Summarize news articles",
     10,
     GenerationSpec.balanced()
 );
 
  • Constructor Details

    • SyntheticDataGenerator

      public SyntheticDataGenerator(com.tnsai.llm.LLMClient llmClient)
  • Method Details

    • generate

      public List<TestCase> generate(String taskDescription, int count)
      Generates test cases for a task.
      Parameters:
      taskDescription - description of the task
      count - number of test cases to generate
      Returns:
      list of generated test cases
    • generate

      public List<TestCase> generate(String taskDescription, int count, SyntheticDataGenerator.GenerationSpec config)
      Generates test cases with custom configuration.
      Parameters:
      taskDescription - description of the task
      count - number of test cases
      config - generation configuration
      Returns:
      list of generated test cases
    • generateEdgeCases

      public List<TestCase> generateEdgeCases(String taskDescription, int count)
      Generates edge cases specifically.
    • generateGoldenDataset

      public List<TestCase> generateGoldenDataset(String taskDescription, int count)
      Generates a golden dataset (high-quality reference examples).