Create a new ScenarioBuilder.
Name for the scenario
The Runloop client instance
Set a blueprint to define the baseline environment for the scenario.
Blueprint to use
Builder for chaining
Set a snapshot to define the baseline environment for the scenario.
Snapshot to use
Builder for chaining
Set the working directory for the scenario.
Working directory path
Builder for chaining
Set the problem statement for the scenario. This will be provided as input context to the agent.
Problem statement text
Builder for chaining
Set additional structured context for the scenario.
Additional context (JSON-serializable)
Builder for chaining
Add a test-based scorer that runs a test command.
Builder for chaining
Add a command scorer that runs a shell command. Scoring passes if the command returns exit code 0.
Name of the scoring function
Scorer options
Shell command to execute
Optionalweight?: numberWeight for this scorer (default: 1.0)
Builder for chaining
Add a standalone bash script scorer. The script should output "score=X.X" where X.X is a float between 0.0 and 1.0.
Name of the scoring function
Scorer options
Bash script content
Optionalweight?: numberWeight for this scorer (default: 1.0)
Builder for chaining
Add a standalone Python script scorer. The script should print the score in the range [0.0, 1.0] to stdout.
Name of the scoring function
Scorer options
Python script content
Optionalweight?: numberWeight for this scorer (default: 1.0)
Optionalpython_version_constraint?: stringPython version (default "==3.12.10")
Optionalrequirements_contents?: stringpip requirements.txt content
Builder for chaining
Add an AST grep scorer that matches code patterns.
Name of the scoring function
Scorer options
AST pattern to match
Optionalweight?: numberWeight for this scorer (default: 1.0)
Optionalsearch_directory?: stringDirectory to search (default: ".")
Optionallang?: stringLanguage of the pattern
Builder for chaining
Add a custom scorer registered with Runloop.
Name of the scoring function
Scorer options
Type identifier registered with Runloop
Optionalweight?: numberWeight for this scorer (default: 1.0)
Optionalscorer_params?: unknownAdditional JSON parameters for the scorer
Builder for chaining
Set metadata for the scenario.
Key-value metadata
Builder for chaining
Set the reference solution or gold patch for validation.
Reference solution (e.g., git diff)
Builder for chaining
Set required environment variables.
List of required environment variable names
Builder for chaining
Set required secrets.
List of required secret names
Builder for chaining
Set the validation strategy.
Validation type
Builder for chaining
Build the scenario creation parameters.
Validates that required fields are set and normalizes scorer weights to sum to 1.0.
Parameters for scenario creation
Create the scenario on the platform.
Calls build to validate and assemble parameters, then creates the scenario via the API.
Optionaloptions: RequestOptions<unknown>Request options
Created Scenario instance
Fluent builder for constructing ScenarioCreateParams.
Remarks
Overview
The
ScenarioBuilderprovides a step-by-step, chainable interface for configuring all aspects of a scenario before pushing it to the platform.Quickstart