POST
/
runs
/
{runId}
/
records
import Scorecard from 'scorecard-ai';

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

async function main() {
  const record = await client.records.create('135', {
    inputs: { question: 'What is the capital of France?' },
    labels: { idealAnswer: 'Paris is the capital of France' },
    outputs: { response: 'The capital of France is Paris.' },
    testcaseId: '248',
  });

  console.log(record.id);
}

main();
{
  "id": "135",
  "testcaseId": "248",
  "inputs": {
    "question": "What is the capital of France?"
  },
  "labels": {
    "idealAnswer": "Paris is the capital of France"
  },
  "outputs": {
    "response": "The capital of France is Paris."
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

runId
string
required

The ID of the Run.

Example:

"135"

Body

application/json
inputs
object
required

The actual inputs sent to the system, which should match the system's input schema.

labels
object
required

The expected outputs for the Testcase.

outputs
object
required

The actual outputs from the system.

testcaseId
string

The ID of the Testcase.

Response

201
application/json
Record created successfully

A record of a system execution in the Scorecard system.

id
string
required

The ID of the Record.

runId
string
required

The ID of the Run containing this Record.

inputs
object
required

The actual inputs sent to the system, which should match the system's input schema.

labels
object
required

The expected outputs for the Testcase.

outputs
object
required

The actual outputs from the system.

testcaseId
string

The ID of the Testcase.