POST
/
v1
/
scenarios
/
scorers
JavaScript
import Runloop from '@runloop/api-client';

const client = new Runloop({
  bearerToken: 'My Bearer Token',
});

const scorer = await client.scenarios.scorers.create({ bash_script: 'bash_script', type: 'type' });

console.log(scorer.id);
{
  "id": "<string>",
  "type": "<string>",
  "bash_script": "<string>"
}

Authorizations

Authorization
string
header
required

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

Body

application/json
type
string
required

Name of the type of custom scorer.

bash_script
string
required

Bash script for the custom scorer taking context as a json object $RL_SCORER_CONTEXT.

Response

OK

A ScenarioScorerView represents a custom scoring function for a Scenario.

id
string
required

ID for the scenario scorer.

type
string
required

Name of the type of scenario scorer.

bash_script
string
required

Bash script that takes in $RL_TEST_CONTEXT as env variable and runs scoring.