Skip to content

Commit 0d9551c

Browse files
committed
init commit
1 parent 80e662a commit 0d9551c

File tree

7 files changed

+1485
-0
lines changed

7 files changed

+1485
-0
lines changed

src/runloop_api_client/sdk/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@
3333
from .async_blueprint import AsyncBlueprint
3434
from .async_execution import AsyncExecution
3535
from .execution_result import ExecutionResult
36+
from .scenario_builder import ScenarioBuilder
3637
from .async_scenario_run import AsyncScenarioRun
3738
from .async_storage_object import AsyncStorageObject
3839
from .async_execution_result import AsyncExecutionResult
40+
from .async_scenario_builder import AsyncScenarioBuilder
3941

4042
__all__ = [
4143
# Main SDK entry points
@@ -71,6 +73,8 @@
7173
"AsyncScenario",
7274
"ScenarioRun",
7375
"AsyncScenarioRun",
76+
"ScenarioBuilder",
77+
"AsyncScenarioBuilder",
7478
"Scorer",
7579
"AsyncScorer",
7680
"Snapshot",

src/runloop_api_client/sdk/async_.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
from .async_blueprint import AsyncBlueprint
3838
from ..lib.context_loader import TarFilter, build_directory_tar
3939
from .async_storage_object import AsyncStorageObject
40+
from .async_scenario_builder import AsyncScenarioBuilder
4041
from ..types.object_create_params import ContentType
4142
from ..types.shared_params.agent_source import Git, Npm, Pip, Object
4243

@@ -773,6 +774,13 @@ class AsyncScenarioOps:
773774
>>> scenario = runloop.scenario.from_id("scn-xxx")
774775
>>> run = await scenario.run()
775776
>>> scenarios = await runloop.scenario.list()
777+
778+
Example using builder:
779+
>>> builder = runloop.scenario.builder("my-scenario")
780+
>>> builder.from_blueprint_id("bp-xxx")
781+
>>> builder.with_problem_statement("Fix the bug")
782+
>>> builder.add_test_scorer("tests", test_command="pytest")
783+
>>> scenario = await builder.push()
776784
"""
777785

778786
def __init__(self, client: AsyncRunloop) -> None:
@@ -783,6 +791,16 @@ def __init__(self, client: AsyncRunloop) -> None:
783791
"""
784792
self._client = client
785793

794+
def builder(self, name: str) -> AsyncScenarioBuilder:
795+
"""Create a new scenario builder.
796+
797+
:param name: Name for the scenario
798+
:type name: str
799+
:return: A new AsyncScenarioBuilder instance
800+
:rtype: AsyncScenarioBuilder
801+
"""
802+
return AsyncScenarioBuilder(self._client, name)
803+
786804
def from_id(self, scenario_id: str) -> AsyncScenario:
787805
"""Get an AsyncScenario instance for an existing scenario ID.
788806

0 commit comments

Comments
 (0)