import SGPClient from 'sgp';
const client = new SGPClient({
apiKey: 'My API Key',
});
const evaluation = await client.evaluations.retrieve('evaluation_id');
console.log(evaluation.id);{
"name": "<string>",
"description": "<string>",
"status": "PENDING",
"application_spec_id": "<string>",
"total_test_case_result_count": 123,
"completed_test_case_result_count": 123,
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"account_id": "<string>",
"created_by_user_id": "<string>",
"created_by_identity_type": "user",
"evaluation_datasets": [
{
"name": "<string>",
"schema_type": "GENERATION",
"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",
"knowledge_base_id": "<string>",
"evaluation_dataset_metadata": {},
"out_of_date": true,
"vendor": "scale",
"archived_at": "2023-11-07T05:31:56Z",
"schema_sub_type": "summarization"
}
],
"evaluation_config_expanded": {
"evaluation_type": "studio",
"question_set_id": "<string>",
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"account_id": "<string>",
"created_by_user_id": "<string>",
"created_by_identity_type": "user",
"question_set": {
"name": "<string>",
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"account_id": "<string>",
"created_by_user_id": "<string>",
"created_by_identity_type": "user",
"questions": [
{
"type": "categorical",
"title": "<string>",
"prompt": "<string>",
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"account_id": "<string>",
"created_by_user_id": "<string>",
"created_by_identity_type": "user",
"choices": [
{
"label": "<string>",
"value": "<string>",
"audit_required": false
}
],
"ratingOptions": {
"minLabel": "<string>",
"maxLabel": "<string>",
"scaleSteps": 123
},
"numberOptions": {
"min": 123,
"max": 123
},
"freeTextOptions": {
"characterLimit": {
"min": 50,
"max": 1000
}
},
"multi": true,
"dropdown": true,
"required": true,
"conditions": [
{}
],
"default": "<unknown>",
"form_schema": {}
}
],
"question_id_to_config": {},
"instructions": "<string>",
"archived_at": "2023-11-07T05:31:56Z"
},
"studio_project_id": "<string>",
"auto_evaluation_model": "gpt-4-32k-0613",
"auto_evaluation_parameters": {
"temperature": 1,
"batch_size": 13
}
},
"async_jobs": [
{
"status": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"job_type": "<string>",
"parent_job_id": "<string>",
"status_reason": "<string>",
"progress": {},
"job_metadata": {}
}
],
"application_spec": {
"name": "<string>",
"description": "<string>",
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"account_id": "<string>",
"theme_id": "<string>",
"run_online_evaluation": false,
"parent_application_spec_id": "<string>",
"created_by_user_id": "<string>",
"created_by_identity_type": "user",
"archived_at": "2023-11-07T05:31:56Z"
},
"application_variant_id": "<string>",
"tags": {},
"evaluation_config": {},
"evaluation_config_id": "<string>",
"completed_at": "2023-11-07T05:31:56Z",
"annotation_config": {
"annotation_config_type": "flexible",
"components": [
[
{
"data_loc": [
"<string>"
],
"optional": false,
"label": "<string>"
}
]
],
"direction": "row",
"llm_prompt": {
"variables": [
{
"name": "<string>",
"data_loc": [
"<string>"
],
"optional": false
}
],
"template": "<string>"
}
},
"question_id_to_annotation_config": {},
"metric_config": {
"components": [
{
"type": "rouge",
"name": "<string>",
"mappings": {},
"params": {}
}
]
},
"archived_at": "2023-11-07T05:31:56Z"
}Gets the details of a evaluation
This API can be used to get information about a single evaluation by ID. To use this API, pass in the id that was returned from your Create Evaluation 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 evaluation = await client.evaluations.retrieve('evaluation_id');
console.log(evaluation.id);{
"name": "<string>",
"description": "<string>",
"status": "PENDING",
"application_spec_id": "<string>",
"total_test_case_result_count": 123,
"completed_test_case_result_count": 123,
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"account_id": "<string>",
"created_by_user_id": "<string>",
"created_by_identity_type": "user",
"evaluation_datasets": [
{
"name": "<string>",
"schema_type": "GENERATION",
"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",
"knowledge_base_id": "<string>",
"evaluation_dataset_metadata": {},
"out_of_date": true,
"vendor": "scale",
"archived_at": "2023-11-07T05:31:56Z",
"schema_sub_type": "summarization"
}
],
"evaluation_config_expanded": {
"evaluation_type": "studio",
"question_set_id": "<string>",
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"account_id": "<string>",
"created_by_user_id": "<string>",
"created_by_identity_type": "user",
"question_set": {
"name": "<string>",
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"account_id": "<string>",
"created_by_user_id": "<string>",
"created_by_identity_type": "user",
"questions": [
{
"type": "categorical",
"title": "<string>",
"prompt": "<string>",
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"account_id": "<string>",
"created_by_user_id": "<string>",
"created_by_identity_type": "user",
"choices": [
{
"label": "<string>",
"value": "<string>",
"audit_required": false
}
],
"ratingOptions": {
"minLabel": "<string>",
"maxLabel": "<string>",
"scaleSteps": 123
},
"numberOptions": {
"min": 123,
"max": 123
},
"freeTextOptions": {
"characterLimit": {
"min": 50,
"max": 1000
}
},
"multi": true,
"dropdown": true,
"required": true,
"conditions": [
{}
],
"default": "<unknown>",
"form_schema": {}
}
],
"question_id_to_config": {},
"instructions": "<string>",
"archived_at": "2023-11-07T05:31:56Z"
},
"studio_project_id": "<string>",
"auto_evaluation_model": "gpt-4-32k-0613",
"auto_evaluation_parameters": {
"temperature": 1,
"batch_size": 13
}
},
"async_jobs": [
{
"status": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"job_type": "<string>",
"parent_job_id": "<string>",
"status_reason": "<string>",
"progress": {},
"job_metadata": {}
}
],
"application_spec": {
"name": "<string>",
"description": "<string>",
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"account_id": "<string>",
"theme_id": "<string>",
"run_online_evaluation": false,
"parent_application_spec_id": "<string>",
"created_by_user_id": "<string>",
"created_by_identity_type": "user",
"archived_at": "2023-11-07T05:31:56Z"
},
"application_variant_id": "<string>",
"tags": {},
"evaluation_config": {},
"evaluation_config_id": "<string>",
"completed_at": "2023-11-07T05:31:56Z",
"annotation_config": {
"annotation_config_type": "flexible",
"components": [
[
{
"data_loc": [
"<string>"
],
"optional": false,
"label": "<string>"
}
]
],
"direction": "row",
"llm_prompt": {
"variables": [
{
"name": "<string>",
"data_loc": [
"<string>"
],
"optional": false
}
],
"template": "<string>"
}
},
"question_id_to_annotation_config": {},
"metric_config": {
"components": [
{
"type": "rouge",
"name": "<string>",
"mappings": {},
"params": {}
}
]
},
"archived_at": "2023-11-07T05:31:56Z"
}ApplicationSpec, AsyncJobs, EvaluationConfig, EvaluationDatasets Successful Response
PENDING, COMPLETED, FAILED The total number of test case results for the evaluation
The number of test case results that have been completed for the evaluation
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.
The user who originally created the entity.
The type of identity that created the entity.
user, service_account Show child attributes
Show child attributes
Show child attributes
Show child attributes
The ID of the associated evaluation config.
The date and time that all test case results for the evaluation were completed for the evaluation in ISO format.
Annotation configuration for tasking
Show child attributes
Specifies the annotation configuration to use for specific questions.
Show child attributes
Specifies the config for the metrics to be computed.
Show child attributes
The date and time when the entity was archived in ISO format.