testset = client.testsets.create( project_id="1234", name="Testset name", description="Required Testset description", field_mapping={# Inputs represent the input to the AI system."inputs":["userQuery"],# Labels represent the expected output of the AI system."labels":["ideal"],# Metadata fields are used for grouping Testcases, but not seen by the AI system."metadata":[],}, json_schema={"type":"object","properties":{# The original message."userQuery":{"type":"string"},# The ideal model response"ideal":{"type":"string"},},"required":["userQuery","ideal"],},)
In SDK v1, Testcases were created with a user_query and ideal.
In SDK v2, Testcases are now created with a jsonData field that matches the schema of the Testset.
client.testcase.create( testset_id=testset.id, user_query="What's 2+2 in English?", ideal="Four",)
client.testcases.create( testset_id=testset.id, items=[{"json_data":{"userQuery":"What's 2+2 in English?","ideal":"Four",},},])
For any operations not listed here, refer to the SDK v2 docs.