Skip to content

Commit 3e19f41

Browse files
feat(api): api update (#549)
1 parent 4e782f1 commit 3e19f41

19 files changed

+193
-22
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 77
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a3d91c690527ff6a9040ade46943ba56916987f1f7d1fb45a9974546770ffe97.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-cb8add05a7b418d6f8a5624be8477564853da49e8bf9671ae89b8ce49a04b6cd.yml

src/runloop_api_client/resources/benchmarks/benchmarks.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import List, Optional
5+
from typing import Dict, List, Optional
66

77
import httpx
88

@@ -69,6 +69,7 @@ def create(
6969
self,
7070
*,
7171
name: str,
72+
metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
7273
scenario_ids: Optional[List[str]] | NotGiven = NOT_GIVEN,
7374
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
7475
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -84,6 +85,8 @@ def create(
8485
Args:
8586
name: The name of the Benchmark.
8687
88+
metadata: User defined metadata to attach to the benchmark for organization.
89+
8790
scenario_ids: The Scenario IDs that make up the Benchmark.
8891
8992
extra_headers: Send extra headers
@@ -101,6 +104,7 @@ def create(
101104
body=maybe_transform(
102105
{
103106
"name": name,
107+
"metadata": metadata,
104108
"scenario_ids": scenario_ids,
105109
},
106110
benchmark_create_params.BenchmarkCreateParams,
@@ -246,6 +250,7 @@ def start_run(
246250
self,
247251
*,
248252
benchmark_id: str,
253+
metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
249254
run_name: Optional[str] | NotGiven = NOT_GIVEN,
250255
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
251256
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -261,6 +266,8 @@ def start_run(
261266
Args:
262267
benchmark_id: ID of the Benchmark to run.
263268
269+
metadata: User defined metadata to attach to the benchmark run for organization.
270+
264271
run_name: Display name of the run.
265272
266273
extra_headers: Send extra headers
@@ -278,6 +285,7 @@ def start_run(
278285
body=maybe_transform(
279286
{
280287
"benchmark_id": benchmark_id,
288+
"metadata": metadata,
281289
"run_name": run_name,
282290
},
283291
benchmark_start_run_params.BenchmarkStartRunParams,
@@ -321,6 +329,7 @@ async def create(
321329
self,
322330
*,
323331
name: str,
332+
metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
324333
scenario_ids: Optional[List[str]] | NotGiven = NOT_GIVEN,
325334
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
326335
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -336,6 +345,8 @@ async def create(
336345
Args:
337346
name: The name of the Benchmark.
338347
348+
metadata: User defined metadata to attach to the benchmark for organization.
349+
339350
scenario_ids: The Scenario IDs that make up the Benchmark.
340351
341352
extra_headers: Send extra headers
@@ -353,6 +364,7 @@ async def create(
353364
body=await async_maybe_transform(
354365
{
355366
"name": name,
367+
"metadata": metadata,
356368
"scenario_ids": scenario_ids,
357369
},
358370
benchmark_create_params.BenchmarkCreateParams,
@@ -498,6 +510,7 @@ async def start_run(
498510
self,
499511
*,
500512
benchmark_id: str,
513+
metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
501514
run_name: Optional[str] | NotGiven = NOT_GIVEN,
502515
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
503516
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -513,6 +526,8 @@ async def start_run(
513526
Args:
514527
benchmark_id: ID of the Benchmark to run.
515528
529+
metadata: User defined metadata to attach to the benchmark run for organization.
530+
516531
run_name: Display name of the run.
517532
518533
extra_headers: Send extra headers
@@ -530,6 +545,7 @@ async def start_run(
530545
body=await async_maybe_transform(
531546
{
532547
"benchmark_id": benchmark_id,
548+
"metadata": metadata,
533549
"run_name": run_name,
534550
},
535551
benchmark_start_run_params.BenchmarkStartRunParams,

src/runloop_api_client/resources/scenarios/scenarios.py

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Optional
5+
from typing import Dict, Optional
66

77
import httpx
88

@@ -88,6 +88,8 @@ def create(
8888
name: str,
8989
scoring_contract: ScoringContractParam,
9090
environment_parameters: Optional[ScenarioEnvironmentParam] | NotGiven = NOT_GIVEN,
91+
metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
92+
reference_output: Optional[str] | NotGiven = NOT_GIVEN,
9193
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
9294
# The extra values given here take precedence over values defined on the client or passed to this method.
9395
extra_headers: Headers | None = None,
@@ -109,6 +111,12 @@ def create(
109111
110112
environment_parameters: The Environment in which the Scenario will run.
111113
114+
metadata: User defined metadata to attach to the scenario for organization.
115+
116+
reference_output: A string representation of the reference output to solve the scenario. Commonly
117+
can be the result of a git diff or a sequence of command actions to apply to the
118+
environment.
119+
112120
extra_headers: Send extra headers
113121
114122
extra_query: Add additional query parameters to the request
@@ -127,6 +135,8 @@ def create(
127135
"name": name,
128136
"scoring_contract": scoring_contract,
129137
"environment_parameters": environment_parameters,
138+
"metadata": metadata,
139+
"reference_output": reference_output,
130140
},
131141
scenario_create_params.ScenarioCreateParams,
132142
),
@@ -281,6 +291,7 @@ def start_run(
281291
*,
282292
scenario_id: str,
283293
benchmark_run_id: Optional[str] | NotGiven = NOT_GIVEN,
294+
metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
284295
run_name: Optional[str] | NotGiven = NOT_GIVEN,
285296
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
286297
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -298,6 +309,8 @@ def start_run(
298309
299310
benchmark_run_id: Benchmark to associate the run.
300311
312+
metadata: User defined metadata to attach to the run for organization.
313+
301314
run_name: Display name of the run.
302315
303316
extra_headers: Send extra headers
@@ -316,6 +329,7 @@ def start_run(
316329
{
317330
"scenario_id": scenario_id,
318331
"benchmark_run_id": benchmark_run_id,
332+
"metadata": metadata,
319333
"run_name": run_name,
320334
},
321335
scenario_start_run_params.ScenarioStartRunParams,
@@ -423,6 +437,8 @@ async def create(
423437
name: str,
424438
scoring_contract: ScoringContractParam,
425439
environment_parameters: Optional[ScenarioEnvironmentParam] | NotGiven = NOT_GIVEN,
440+
metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
441+
reference_output: Optional[str] | NotGiven = NOT_GIVEN,
426442
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
427443
# The extra values given here take precedence over values defined on the client or passed to this method.
428444
extra_headers: Headers | None = None,
@@ -444,6 +460,12 @@ async def create(
444460
445461
environment_parameters: The Environment in which the Scenario will run.
446462
463+
metadata: User defined metadata to attach to the scenario for organization.
464+
465+
reference_output: A string representation of the reference output to solve the scenario. Commonly
466+
can be the result of a git diff or a sequence of command actions to apply to the
467+
environment.
468+
447469
extra_headers: Send extra headers
448470
449471
extra_query: Add additional query parameters to the request
@@ -462,6 +484,8 @@ async def create(
462484
"name": name,
463485
"scoring_contract": scoring_contract,
464486
"environment_parameters": environment_parameters,
487+
"metadata": metadata,
488+
"reference_output": reference_output,
465489
},
466490
scenario_create_params.ScenarioCreateParams,
467491
),
@@ -616,6 +640,7 @@ async def start_run(
616640
*,
617641
scenario_id: str,
618642
benchmark_run_id: Optional[str] | NotGiven = NOT_GIVEN,
643+
metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
619644
run_name: Optional[str] | NotGiven = NOT_GIVEN,
620645
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
621646
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -633,6 +658,8 @@ async def start_run(
633658
634659
benchmark_run_id: Benchmark to associate the run.
635660
661+
metadata: User defined metadata to attach to the run for organization.
662+
636663
run_name: Display name of the run.
637664
638665
extra_headers: Send extra headers
@@ -651,6 +678,7 @@ async def start_run(
651678
{
652679
"scenario_id": scenario_id,
653680
"benchmark_run_id": benchmark_run_id,
681+
"metadata": metadata,
654682
"run_name": run_name,
655683
},
656684
scenario_start_run_params.ScenarioStartRunParams,

src/runloop_api_client/types/benchmark_create_params.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import List, Optional
5+
from typing import Dict, List, Optional
66
from typing_extensions import Required, TypedDict
77

88
__all__ = ["BenchmarkCreateParams"]
@@ -12,5 +12,8 @@ class BenchmarkCreateParams(TypedDict, total=False):
1212
name: Required[str]
1313
"""The name of the Benchmark."""
1414

15+
metadata: Optional[Dict[str, str]]
16+
"""User defined metadata to attach to the benchmark for organization."""
17+
1518
scenario_ids: Optional[List[str]]
1619
"""The Scenario IDs that make up the Benchmark."""

src/runloop_api_client/types/benchmark_run_view.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import List, Optional
3+
from typing import Dict, List, Optional
44
from typing_extensions import Literal
55

66
from .._models import BaseModel
@@ -15,6 +15,12 @@ class BenchmarkRunView(BaseModel):
1515
benchmark_id: str
1616
"""The ID of the Benchmark."""
1717

18+
metadata: Dict[str, str]
19+
"""User defined metadata to attach to the benchmark run for organization."""
20+
21+
pending_scenarios: List[str]
22+
"""List of Scenarios that need to be completed before benchmark can be completed."""
23+
1824
start_time_ms: int
1925
"""The time the benchmark run execution started (Unix timestamp milliseconds)."""
2026

@@ -27,9 +33,6 @@ class BenchmarkRunView(BaseModel):
2733
name: Optional[str] = None
2834
"""The name of the BenchmarkRun."""
2935

30-
pending_scenarios: Optional[List[str]] = None
31-
"""List of Scenarios that need to be completed before benchmark can be completed."""
32-
3336
score: Optional[float] = None
3437
"""The final score across the BenchmarkRun, present once completed.
3538

src/runloop_api_client/types/benchmark_start_run_params.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Optional
5+
from typing import Dict, Optional
66
from typing_extensions import Required, TypedDict
77

88
__all__ = ["BenchmarkStartRunParams"]
@@ -12,5 +12,8 @@ class BenchmarkStartRunParams(TypedDict, total=False):
1212
benchmark_id: Required[str]
1313
"""ID of the Benchmark to run."""
1414

15+
metadata: Optional[Dict[str, str]]
16+
"""User defined metadata to attach to the benchmark run for organization."""
17+
1518
run_name: Optional[str]
1619
"""Display name of the run."""

src/runloop_api_client/types/benchmark_view.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import List
3+
from typing import Dict, List
44

55
from pydantic import Field as FieldInfo
66

@@ -13,6 +13,9 @@ class BenchmarkView(BaseModel):
1313
id: str
1414
"""The ID of the Benchmark."""
1515

16+
metadata: Dict[str, str]
17+
"""User defined metadata to attach to the benchmark for organization."""
18+
1619
name: str
1720
"""The name of the Benchmark."""
1821

src/runloop_api_client/types/scenario_create_params.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Optional
5+
from typing import Dict, Optional
66
from typing_extensions import Required, TypedDict
77

88
from .input_context_param import InputContextParam
@@ -24,3 +24,13 @@ class ScenarioCreateParams(TypedDict, total=False):
2424

2525
environment_parameters: Optional[ScenarioEnvironmentParam]
2626
"""The Environment in which the Scenario will run."""
27+
28+
metadata: Optional[Dict[str, str]]
29+
"""User defined metadata to attach to the scenario for organization."""
30+
31+
reference_output: Optional[str]
32+
"""A string representation of the reference output to solve the scenario.
33+
34+
Commonly can be the result of a git diff or a sequence of command actions to
35+
apply to the environment.
36+
"""

src/runloop_api_client/types/scenario_environment.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from typing import Optional
44

55
from .._models import BaseModel
6+
from .shared.launch_parameters import LaunchParameters
67

78
__all__ = ["ScenarioEnvironment"]
89

@@ -11,8 +12,17 @@ class ScenarioEnvironment(BaseModel):
1112
blueprint_id: Optional[str] = None
1213
"""Use the blueprint with matching ID."""
1314

15+
launch_parameters: Optional[LaunchParameters] = None
16+
"""Optional launch parameters to apply to the devbox environment at launch."""
17+
1418
prebuilt_id: Optional[str] = None
1519
"""Use the prebuilt with matching ID."""
1620

1721
snapshot_id: Optional[str] = None
1822
"""Use the snapshot with matching ID."""
23+
24+
working_directory: Optional[str] = None
25+
"""The working directory where the agent is expected to fulfill the scenario.
26+
27+
Scoring functions also run from the working directory.
28+
"""

src/runloop_api_client/types/scenario_environment_param.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,26 @@
55
from typing import Optional
66
from typing_extensions import TypedDict
77

8+
from .shared_params.launch_parameters import LaunchParameters
9+
810
__all__ = ["ScenarioEnvironmentParam"]
911

1012

1113
class ScenarioEnvironmentParam(TypedDict, total=False):
1214
blueprint_id: Optional[str]
1315
"""Use the blueprint with matching ID."""
1416

17+
launch_parameters: Optional[LaunchParameters]
18+
"""Optional launch parameters to apply to the devbox environment at launch."""
19+
1520
prebuilt_id: Optional[str]
1621
"""Use the prebuilt with matching ID."""
1722

1823
snapshot_id: Optional[str]
1924
"""Use the snapshot with matching ID."""
25+
26+
working_directory: Optional[str]
27+
"""The working directory where the agent is expected to fulfill the scenario.
28+
29+
Scoring functions also run from the working directory.
30+
"""

0 commit comments

Comments
 (0)