POST
/
scoring_system
/
generate
import PiClient from 'withpi';

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

async function main() {
  const scoringSpec = await client.scoringSystem.generate({
    application_description: "Write a children's story communicating a simple life lesson.",
  });

  console.log(scoringSpec.description);
}

main();
{
  "description": "Write a children's story communicating a simple life lesson.",
  "dimensions": [
    {
      "description": "dimension1 description",
      "label": "dimension1",
      "sub_dimensions": [
        {
          "description": "subdimension1 description",
          "label": "subdimension1",
          "scoring_type": "PI_SCORER"
        }
      ]
    }
  ],
  "name": "Sample Scoring Spec"
}

Authorizations

x-api-key
string
header
required

Body

application/json
application_description
string
required

The application description to generate a scoring spec for.

Example:

"Write a children's story communicating a simple life lesson."

try_auto_generating_python_code
boolean
default:false

If true, try to generate python code for sub-dimensions in the scoring spec.

Example:

false

Response

200
application/json
Successful Response
description
string
required

The application description

Example:

"Write a children's story communicating a simple life lesson."

dimensions
object[]
required

The dimensions of the scoring spec

Example:
[
  {
    "description": "dimension1 description",
    "label": "dimension1",
    "sub_dimensions": [
      {
        "description": "subdimension1 description",
        "label": "subdimension1",
        "scoring_type": "PI_SCORER"
      }
    ]
  }
]
name
string
required

The name of the scoring spec

Example:

"Sample Scoring Spec"