import SGPClient from 'sgp';
const client = new SGPClient({
apiKey: 'My API Key',
});
// Automatically fetches more pages as needed.
for await (const evaluationListResponse of client.evaluations.list()) {
console.log(evaluationListResponse.id);
}{
"items": [
{
"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"
}
],
"total_item_count": 123,
"current_page": 123,
"items_per_page": 123
}Lists all evaluations accessible to the user.
This API can be used to list evaluations. If a user has access to multiple accounts, all evaluations from all accounts the user is associated with will be returned.
import SGPClient from 'sgp';
const client = new SGPClient({
apiKey: 'My API Key',
});
// Automatically fetches more pages as needed.
for await (const evaluationListResponse of client.evaluations.list()) {
console.log(evaluationListResponse.id);
}{
"items": [
{
"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"
}
],
"total_item_count": 123,
"current_page": 123,
"items_per_page": 123
}ApplicationSpec, AsyncJobs, EvaluationConfig, EvaluationDatasets status:asc, status:desc, application_spec_id:asc, application_spec_id:desc, application_spec:asc, application_spec:desc, application_variant_id:asc, application_variant_id:desc, application_variant:asc, application_variant:desc, evaluation_config_id:asc, evaluation_config_id:desc, completed_at:asc, completed_at:desc, total_test_case_result_count:asc, total_test_case_result_count:desc, completed_test_case_result_count:asc, completed_test_case_result_count:desc, annotation_config:asc, annotation_config:desc, question_id_to_annotation_config:asc, question_id_to_annotation_config:desc, metric_config:asc, metric_config:desc, evaluation_config_expanded:asc, evaluation_config_expanded:desc, test_case_results:asc, test_case_results:desc, async_jobs:asc, async_jobs:desc, evaluation_datasets:asc, evaluation_datasets:desc, id:asc, id:desc, created_at:asc, created_at:desc, account_id:asc, account_id:desc, created_by_user_id:asc, created_by_user_id:desc, created_by_identity_type:asc, created_by_identity_type:desc, archived_at:asc, archived_at:desc, name:asc, name:desc, description:asc, description:desc, tags:asc, tags:desc, evaluation_config:asc, evaluation_config:desc Page number for pagination to be returned by the given endpoint. Starts at page 1
x >= 1Maximum number of artifacts to be returned by the given endpoint. Defaults to 100 and cannot be greater than 10k.
1 <= x <= 10000Successful Response