While Galtea can automatically generate tests from a knowledge file, you can also create custom Tests by providing your own set of Test Cases.

Creating Tests with the SDK

Tests can be generated automatically by Galtea providing a knowledge file via the sdk or the dashboard.

The Galtea SDK provides methods to create both Quality Tests and Red Teaming Tests.

If you have a prepared test file in CSV format, you can upload it directly.

from galtea import Galtea
import os

galtea = Galtea(api_key=os.getenv("GALTEA_API_KEY"))

# Upload a pre-existing test file to the Galtea Platform
test = galtea.tests.create(
    name="financial-qa-test",
    type="QUALITY",
    product_id="YOUR_PRODUCT_ID",
    test_file_path="path/to/your/finance_db_sample.csv"
)

print(f"Test created with ID: {test.id}")

The test file must follow the structure specified for Quality Tests or Red Teaming Tests. If the file is not correctly formatted, test cases will not be created automatically, but you can still add them manually.

Next Steps