Skip to main content

BaseGenerator

The BaseGenerator class is the core component for generating synthetic test datasets from your documentation.

Overview

Constructor Parameters

generate_dataset Method

Parameters

Return Value

Basic Example

With Seed Examples

Guide the style of generated questions:

Conversation Mode

Generate coherent multi-turn conversations:

With Selection Strategy

Random Sampling

Generate multiple diverse datasets:

Generated Query Metadata

Each generated batch includes metadata in the agentic field:

Complete Example

Error Handling

Best Practices

Match chunk size to your content:
  • 500-1000: Short, focused sections
  • 1000-2000: Standard documentation
  • 2000-4000: Long-form content
Provide seed examples to guide question style:
  • Low (0.0-0.3): More deterministic, focused questions
  • Medium (0.4-0.7): Balanced creativity
  • High (0.8-1.0): More varied, creative questions
Enable conversation mode when testing context retention:

Next Steps

Context Loaders

Learn about loading documentation

Strategies

Learn about chunk selection