GET
/
v1
/
scenarios
/
{id}
import Runloop from '@runloop/api-client';

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

async function main() {
  const scenario = await client.scenarios.retrieve('id');

  console.log(scenario.id);
}

main();
{
  "id": "<string>",
  "name": "<string>",
  "environment": {
    "blueprint_id": "<string>",
    "snapshot_id": "<string>",
    "prebuilt_id": "<string>",
    "launch_parameters": {
      "launch_commands": [
        "<string>"
      ],
      "resource_size_request": "X_SMALL",
      "keep_alive_time_seconds": 123,
      "available_ports": [
        123
      ],
      "after_idle": {
        "idle_time_seconds": 123,
        "on_idle": "shutdown"
      },
      "custom_cpu_cores": 123,
      "custom_gb_memory": 123
    },
    "working_directory": "<string>"
  },
  "input_context": {
    "problem_statement": "<string>",
    "additional_context": {}
  },
  "scoring_contract": {
    "scoring_function_parameters": [
      {
        "name": "<string>",
        "scorer": {
          "lang": "<string>",
          "search_directory": "<string>",
          "pattern": "<string>",
          "type": "ast_grep_scorer"
        },
        "weight": 123
      }
    ]
  },
  "metadata": {},
  "reference_output": "<string>",
  "is_public": true
}

Authorizations

Authorization
string
header
required

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

Path Parameters

id
string
required

The Scenario ID.

Response

200 - application/json
OK

A ScenarioView represents a repeatable AI coding evaluation test, complete with initial environment and scoring contract.

id
string
required

The ID of the Scenario.

name
string
required

The name of the Scenario.

input_context
object
required

The input context for the Scenario.

scoring_contract
object
required

The scoring contract for the Scenario.

metadata
object
required

User defined metadata to attach to the scenario for organization.

environment
object

The Environment in which the Scenario is run.

reference_output
string | null

A string representation of the reference output to solve the scenario. Commonly can be the result of a git diff or a sequence of command actions to apply to the environment.

is_public
boolean

Whether this scenario is public.

Was this page helpful?