Attributes
- Companion
- class
- Graph
-
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
TestDataset.type
Members list
Type members
Inherited and Abstract types
The names of the product elements
The names of the product elements
Attributes
- Inherited from:
- Mirror
The name of the type
The name of the type
Attributes
- Inherited from:
- Mirror
Value members
Concrete methods
Create a dataset from a sequence of samples.
Create a dataset from a sequence of samples.
Attributes
Create an empty dataset.
Create an empty dataset.
Attributes
Parse dataset from JSON string.
Parse dataset from JSON string.
Value parameters
- json
-
The JSON string
Attributes
- Returns
-
The parsed dataset or an error
Load dataset from a JSON file.
Load dataset from a JSON file.
Expected JSON format:
{
{
"name": "my_dataset",
"metadata": {"source": "manual"},
"samples": [
{
"question": "What is the capital of France?",
"answer": "Paris is the capital of France.",
"contexts": ["Paris is the capital and largest city of France."],
"ground_truth": "The capital of France is Paris.",
"metadata": {"category": "geography"}
}
]
}
}
Value parameters
- path
-
Path to the JSON file
Attributes
- Returns
-
The loaded dataset or an error
Generate synthetic test cases from documents using LLM.
Generate synthetic test cases from documents using LLM.
For each document, generates question-answer pairs with the document serving as both context and source of ground truth.
Value parameters
- datasetName
-
Name for the generated dataset
- documents
-
The source documents
- llmClient
-
LLM client for generation
- samplesPerDoc
-
Number of QA pairs to generate per document
Attributes
- Returns
-
Generated dataset or an error
Save dataset to a JSON file.
Save dataset to a JSON file.
Value parameters
- dataset
-
The dataset to save
- path
-
Path for the output file
Attributes
- Returns
-
Success or an error
Create a simple dataset with a single sample (useful for quick testing).
Create a simple dataset with a single sample (useful for quick testing).
Attributes
Convert dataset to JSON string.
Convert dataset to JSON string.
Value parameters
- dataset
-
The dataset to convert
- pretty
-
Whether to format with indentation
Attributes
- Returns
-
JSON string representation