import SGPClient from 'sgp';
const client = new SGPClient({
apiKey: 'My API Key',
});
const applicationTestCaseOutputs = await client.applicationTestCaseOutputs.batch([
{
account_id: 'account_id',
application_variant_id: 'application_variant_id',
evaluation_dataset_version_num: 0,
output: { generation_output: 'generation_output' },
test_case_id: 'test_case_id',
},
]);
console.log(applicationTestCaseOutputs);[
{
"application_variant_id": "<string>",
"evaluation_dataset_id": "<string>",
"test_case_id": "<string>",
"output": {
"generation_output": "<string>",
"generation_extra_info": {
"chunks": [
{
"text": "<string>",
"metadata": {}
}
],
"schema_type": "CHUNKS"
}
},
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"account_id": "<string>",
"schema_type": "GENERATION",
"application_interaction_id": "<string>",
"application_test_case_output_group_id": "<string>",
"metrics": {}
}
]Creates a batch of application test case outputs
This API can be used to create multiple application test case outputs so users do not have to the incur the cost of repeated network calls. To use this API, pass in a list of application test case outputs in the request body.
import SGPClient from 'sgp';
const client = new SGPClient({
apiKey: 'My API Key',
});
const applicationTestCaseOutputs = await client.applicationTestCaseOutputs.batch([
{
account_id: 'account_id',
application_variant_id: 'application_variant_id',
evaluation_dataset_version_num: 0,
output: { generation_output: 'generation_output' },
test_case_id: 'test_case_id',
},
]);
console.log(applicationTestCaseOutputs);[
{
"application_variant_id": "<string>",
"evaluation_dataset_id": "<string>",
"test_case_id": "<string>",
"output": {
"generation_output": "<string>",
"generation_extra_info": {
"chunks": [
{
"text": "<string>",
"metadata": {}
}
],
"schema_type": "CHUNKS"
}
},
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"account_id": "<string>",
"schema_type": "GENERATION",
"application_interaction_id": "<string>",
"application_test_case_output_group_id": "<string>",
"metrics": {}
}
]Show child attributes
Show child attributes
List of trace spans associated with the application's execution. These spans provide insight into the individual steps taken by nodes involved in generating the output.
Show child attributes
Identifier for the node that emitted this trace span.
The start time of the step.
Type of the operation, e.g., RERANKING.
COMPLETION, RERANKING, RETRIEVAL, CUSTOM The outcome of the operation performed by this node.
SUCCESS, ERROR The end time of the step.
The JSON representation of the metadata insights emitted during execution. This can differ based on different types of operations.
The duration of the operation step in milliseconds.
The ID of the account that owns this trace span.
If set to true, the output batch will be saved even if there are missing outputs for some test cases.
Successful Response
Show child attributes
Show child attributes
The unique identifier of the entity.
The date and time when the entity was created in ISO format.
The ID of the account that owns the given entity.
"GENERATION"