import SGPClient from 'sgp';
const client = new SGPClient({
apiKey: 'My API Key',
});
const applicationTestCaseOutput = await client.applicationTestCaseOutputs.retrieve(
'application_test_case_output_id',
);
console.log(applicationTestCaseOutput);
{
"interaction": {
"id": "<string>",
"input": {},
"output": {},
"aggregated": true,
"application_spec_id": "<string>",
"application_variant_id": "<string>",
"start_timestamp": "2023-11-07T05:31:56Z",
"duration_ms": 123,
"operation_status": "SUCCESS",
"operation_metadata": {},
"chat_thread_id": "<string>",
"interaction_source": "EXTERNAL_AI",
"created_at": "2023-11-07T05:31:56Z",
"trace_spans": [
{
"id": "<string>",
"application_interaction_id": "<string>",
"application_variant_id": "<string>",
"node_id": "<string>",
"operation_type": "TEXT_INPUT",
"operation_status": "SUCCESS",
"operation_input": {},
"operation_output": {},
"operation_expected": {},
"operation_metadata": {},
"start_timestamp": "2023-11-07T05:31:56Z",
"end_timestamp": "2023-11-07T05:31:56Z",
"duration_ms": 123,
"trace_id": "<string>",
"parent_id": "<string>",
"group_id": "<string>",
"account_id": "<string>",
"created_by_user_id": "<string>"
}
]
},
"test_case_version": {
"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"
},
"metric_scores": [
{
"score": 123,
"metric_type": "answer-correctness",
"category": "accuracy",
"llm_metadata": {
"reasoning": "<string>",
"logging": {},
"time_elapsed_s": 123,
"usage": [
{
"prompt_tokens": 123,
"completion_tokens": 123,
"cost": 123,
"model": "gpt-4-turbo-2024-04-09"
}
]
}
}
],
"application_variant_id": "<string>",
"evaluation_dataset_id": "<string>",
"test_case_id": "<string>",
"output": {
"generation_output": "<string>",
"generation_extra_info": {
"schema_type": "CHUNKS",
"chunks": [
{
"text": "<string>",
"metadata": {}
}
]
}
},
"schema_type": "GENERATION",
"application_interaction_id": "<string>",
"application_test_case_output_group_id": "<string>",
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"account_id": "<string>",
"metrics": {}
}
Gets the details of a application test case output
This API can be used to get information about a single application test case output by ID. To use this API, pass in the id
that was returned from your Create Application Test Case Output API call as a path parameter.
Review the response schema to see the fields that will be returned.
import SGPClient from 'sgp';
const client = new SGPClient({
apiKey: 'My API Key',
});
const applicationTestCaseOutput = await client.applicationTestCaseOutputs.retrieve(
'application_test_case_output_id',
);
console.log(applicationTestCaseOutput);
{
"interaction": {
"id": "<string>",
"input": {},
"output": {},
"aggregated": true,
"application_spec_id": "<string>",
"application_variant_id": "<string>",
"start_timestamp": "2023-11-07T05:31:56Z",
"duration_ms": 123,
"operation_status": "SUCCESS",
"operation_metadata": {},
"chat_thread_id": "<string>",
"interaction_source": "EXTERNAL_AI",
"created_at": "2023-11-07T05:31:56Z",
"trace_spans": [
{
"id": "<string>",
"application_interaction_id": "<string>",
"application_variant_id": "<string>",
"node_id": "<string>",
"operation_type": "TEXT_INPUT",
"operation_status": "SUCCESS",
"operation_input": {},
"operation_output": {},
"operation_expected": {},
"operation_metadata": {},
"start_timestamp": "2023-11-07T05:31:56Z",
"end_timestamp": "2023-11-07T05:31:56Z",
"duration_ms": 123,
"trace_id": "<string>",
"parent_id": "<string>",
"group_id": "<string>",
"account_id": "<string>",
"created_by_user_id": "<string>"
}
]
},
"test_case_version": {
"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"
},
"metric_scores": [
{
"score": 123,
"metric_type": "answer-correctness",
"category": "accuracy",
"llm_metadata": {
"reasoning": "<string>",
"logging": {},
"time_elapsed_s": 123,
"usage": [
{
"prompt_tokens": 123,
"completion_tokens": 123,
"cost": 123,
"model": "gpt-4-turbo-2024-04-09"
}
]
}
}
],
"application_variant_id": "<string>",
"evaluation_dataset_id": "<string>",
"test_case_id": "<string>",
"output": {
"generation_output": "<string>",
"generation_extra_info": {
"schema_type": "CHUNKS",
"chunks": [
{
"text": "<string>",
"metadata": {}
}
]
}
},
"schema_type": "GENERATION",
"application_interaction_id": "<string>",
"application_test_case_output_group_id": "<string>",
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"account_id": "<string>",
"metrics": {}
}
Show child attributes
Successful Response
The response is of type object
.