Create Test Cases
Create one or more test cases
Create one or more test cases for a prompt. Test cases can be used to validate prompt performance and ensure consistent output across different scenarios.
Create a Test Case
Create Multiple Test Cases
Request Body
The request body can be either a single test case object or an array of test case objects.
Test Case Object
Field | Type | Required | Description |
---|---|---|---|
promptId | string | Yes | UUID of the prompt to create test cases for |
title | string | No | Title of the test case |
messages | array | Yes | Array of message objects with role and content |
variables | object | No | Key-value pairs of variables used in the test case |
variablesRichContent | object | Yes | Key-value pairs of rich content variables |
files | array | No | Array of file objects to attach to the test case |
expectedOutput | string | No | Expected output for evaluation purposes |
promptApplicationId | string | No | UUID of the prompt application if applicable |
metadata | object | No | Metadata about the test case including source |
Message Object
Field | Type | Required | Description |
---|---|---|---|
role | string | Yes | Role of the message sender (user, system, assistant, function, developer) |
content | string | Yes | Content of the message |
File Object
Field | Type | Required | Description |
---|---|---|---|
index | number | Yes | Index of the file in the array |
name | string | Yes | Name of the file |
mimeType | string | Yes | MIME type of the file |
vaultUrl | string | Yes | URL to the file in the vault |
variableName | string | Yes | Variable name associated with the file |
url | string | Yes | Public URL to the file |
Response
The response will contain the created test case(s) with all fields including the generated IDs and timestamps.
Body
Key-value pairs of rich content variables
UUID of the prompt to create test cases for
Array of message objects with role and content
Title of the test case
Expected output for evaluation purposes
UUID of the prompt application if applicable
Key-value pairs of variables used in the test case
Array of file objects to attach to the test case
Metadata about the test case
Key-value pairs of rich content variables
UUID of the prompt to create test cases for
Array of message objects with role and content
Title of the test case
Expected output for evaluation purposes
UUID of the prompt application if applicable
Key-value pairs of variables used in the test case
Array of file objects to attach to the test case
Metadata about the test case
Key-value pairs of rich content variables
UUID of the prompt to create test cases for
Array of message objects with role and content
Title of the test case
Expected output for evaluation purposes
UUID of the prompt application if applicable
Key-value pairs of variables used in the test case
Array of file objects to attach to the test case
Metadata about the test case
Response
Test case(s) created successfully