The Test Service in the Galtea SDK allows you to manage test-cases for evaluating your products. This Service is exposed by the galtea.tests object and we will further explore its API down below.

Remember that we will be using the galtea object. More information here.

Create Test Case

This method allows you to create a test case for your test.

test_case = galtea.test_cases.create(
    test_id="YOUR_TEST_ID",
    input="What is the capital of France?",
    expected_output="Paris",
    context="France is a country in Europe\nIt is known for its art, fashion, and culture\nThe capital of France is Paris\nParis is known for its cafe culture and landmarks like the Eiffel Tower",
    tag="capital city",
)
test_id
string
required

The ID of the test you want to create the test case for.

input
string
required

The input for the test case. This is the question or prompt you want to send to your model for a later evaluation.

expected_output
string

The expected output for the input given. This is the correct answer or response you want to evaluate against.

context
string

The context for the test case. This is the additional information that can help the model generate the expected output.

tag
string

The tag for the test case. This is a label that can help you categorize or identify the test case.

Listing Tests

This method allows you to list all tests associated with a specific product.

tests = galtea.test_cases.list(test_id="YOUR_TEST_ID")
test_id
string
required

The ID of the test you want to get the test cases from.

Retrieving Test

This method allows you to retrieve a specific test case by its ID.

test_case = galtea.test_cases.get(test_case_id="YOUR_TEST_ID")
test_case_id
string
required

The ID of the test case you want to retrieve.

Deleting Test

This method allows you to delete a specific test by its ID.

galtea.test_cases.delete(test_case_id="YOUR_TEST_ID")
test_case_id
string
required

The ID of the test case you want to delete.