import SGPClient from 'sgp';
const client = new SGPClient({
apiKey: 'My API Key',
});
const autoGeneratedDraftTestCase = await client.evaluationDatasets.autogeneratedDraftTestCases.create(
'evaluation_dataset_id',
{
account_id: 'account_id',
approved: true,
test_case_data: { artifact_ids_filter: ['string'], input: 'input' },
},
);
console.log(autoGeneratedDraftTestCase.id);
{
"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>"
]
},
"approved": true,
"topic_str": "<string>",
"content_metadata": {},
"id": "<string>",
"account_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_by_user_id": "<string>",
"created_by_identity_type": "user"
}
Creates a autogenerated draft test case
This API can be used to create a autogenerated draft test case. To use this API, review the request schema and pass in all fields that are required to create a autogenerated draft test case.
import SGPClient from 'sgp';
const client = new SGPClient({
apiKey: 'My API Key',
});
const autoGeneratedDraftTestCase = await client.evaluationDatasets.autogeneratedDraftTestCases.create(
'evaluation_dataset_id',
{
account_id: 'account_id',
approved: true,
test_case_data: { artifact_ids_filter: ['string'], input: 'input' },
},
);
console.log(autoGeneratedDraftTestCase.id);
{
"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>"
]
},
"approved": true,
"topic_str": "<string>",
"content_metadata": {},
"id": "<string>",
"account_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_by_user_id": "<string>",
"created_by_identity_type": "user"
}
Successful Response
The response is of type object
.