API Reference
Devbox
- The Devbox Object
- Devbox Lifecycle
- Devbox File Tools
- Devbox Shell Tools
- Devbox Network Tools
- Devbox Persistence Tools
- Devbox Observability Tools
- Devbox Add-ons
Blueprint
- The Blueprint Object
- Blueprint Lifecycle
- Blueprint Observability
Repository
- The Repository Object
- Repository Lifecycle
Code Scenario
- Code Scenario Lifecycle
- Scenarios Runs
- Custom Scenario Scorer
- Public Scenarios
Benchmark
- Benchmark Lifecycle
- Benchmark Runs
- Public Benchmarks
Code Scenario Lifecycle
Update a Scenario.
Code Scenario Lifecycle
Update a Scenario.
Update a Scenario, a repeatable AI coding evaluation test that defines the starting environment as well as evaluation success criteria.
POST
/
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 scenarioView = await client.scenarios.update('id', {
input_context: { problem_statement: 'problem_statement' },
is_public: true,
name: 'name',
scoring_contract: {
scoring_function_parameters: [
{
name: 'name',
scorer: { pattern: 'pattern', search_directory: 'search_directory', type: 'ast_grep_scorer' },
weight: 0,
},
],
},
});
console.log(scenarioView.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,
"architecture": "x86_64",
"user_parameters": {
"username": "<string>",
"uid": 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
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Path Parameters
The Scenario ID.
Body
application/json
Response
200 - application/json
OK
A ScenarioDefinitionView represents a repeatable AI coding evaluation test, complete with initial environment and scoring contract.
Was this page helpful?
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 scenarioView = await client.scenarios.update('id', {
input_context: { problem_statement: 'problem_statement' },
is_public: true,
name: 'name',
scoring_contract: {
scoring_function_parameters: [
{
name: 'name',
scorer: { pattern: 'pattern', search_directory: 'search_directory', type: 'ast_grep_scorer' },
weight: 0,
},
],
},
});
console.log(scenarioView.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,
"architecture": "x86_64",
"user_parameters": {
"username": "<string>",
"uid": 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
}