import SGPClient from 'sgp';
const client = new SGPClient({
apiKey: 'My API Key',
});
const testCase = await client.evaluationDatasets.testCases.retrieve('evaluation_dataset_id', 'test_case_id');
console.log(testCase);
{
"evaluation_dataset_id": "<string>",
"schema_type": "GENERATION",
"test_case_data": {
"input": "<string>",
"expected_output": "<string>",
"expected_extra_info": {
"schema_type": "CHUNKS",
"chunks": [
{
"text": "<string>",
"metadata": {}
}
]
},
"artifact_ids_filter": [
"<string>"
]
},
"chat_history": {},
"autogenerated": true,
"test_case_metadata": {},
"invalidated_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"account_id": "<string>",
"created_by_user_id": "<string>",
"created_by_identity_type": "user",
"archived_at": "2023-11-07T05:31:56Z"
}
Get the test case by its id.
import SGPClient from 'sgp';
const client = new SGPClient({
apiKey: 'My API Key',
});
const testCase = await client.evaluationDatasets.testCases.retrieve('evaluation_dataset_id', 'test_case_id');
console.log(testCase);
{
"evaluation_dataset_id": "<string>",
"schema_type": "GENERATION",
"test_case_data": {
"input": "<string>",
"expected_output": "<string>",
"expected_extra_info": {
"schema_type": "CHUNKS",
"chunks": [
{
"text": "<string>",
"metadata": {}
}
]
},
"artifact_ids_filter": [
"<string>"
]
},
"chat_history": {},
"autogenerated": true,
"test_case_metadata": {},
"invalidated_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"account_id": "<string>",
"created_by_user_id": "<string>",
"created_by_identity_type": "user",
"archived_at": "2023-11-07T05:31:56Z"
}
Successful Response
The response is of type object
.