GET
/
v4
/
application-test-case-outputs
import SGPClient from 'sgp';

const client = new SGPClient({
  apiKey: process.env['SGP_API_KEY'], // This is the default and can be omitted
});

async function main() {
  // Automatically fetches more pages as needed.
  for await (const applicationTestCaseOutput of client.applicationTestCaseOutputs.list()) {
    console.log(applicationTestCaseOutput);
  }
}

main();
{
  "items": [
    {
      "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>",
            "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",
            "duration_ms": 123
          }
        ]
      },
      "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": {},
        "id": "<string>",
        "created_at": "2023-11-07T05:31:56Z",
        "account_id": "<string>",
        "created_by_user_id": "<string>",
        "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": {}
    }
  ],
  "total_item_count": 123,
  "current_page": 123,
  "items_per_page": 123
}

Authorizations

x-api-key
string
header
required

Headers

x-selected-account-id
string | null

Query Parameters

view
enum<string>[] | null
Available options:
MetricScores,
TestCaseVersion,
Trace
page
integer
default:
1

Page number for pagination to be returned by the given endpoint. Starts at page 1

Required range: x > 1
limit
integer
default:
100

Maximum number of artifacts to be returned by the given endpoint. Defaults to 100 and cannot be greater than 10k.

Required range: 1 < x < 10000
account_id
string | null
application_variant_id
application_variant_report_id
evaluation_dataset_id
evaluation_dataset_version_num
application_test_case_output_group_id

Response

200
application/json
Successful Response
items
object[]
required

The data returned for the current page.

total_item_count
integer
required

The total number of items of the query

current_page
integer
required

The current page number.

items_per_page
integer
required

The number of items per page.