Skip to content

Commit 2c30a5b

Browse files
feat(api): api update
1 parent e689cc4 commit 2c30a5b

4 files changed

Lines changed: 66 additions & 184 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 91
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-32aaecf1da425c37d534ed04df36003ab9d766a7755cd18f96541929a2a3ea59.yml
3-
openapi_spec_hash: e326c47b99943cbbab473fde3b257221
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ecb3d41adaf06e76fd95f11d6da77c7aa0119387a3f372e736edd1579ec2aa03.yml
3+
openapi_spec_hash: 2671664b7d6b0107a6402746033a65ac
44
config_hash: 421e8d0e71c7ef71fdfebede08ea7271

src/runloop_api_client/resources/scenarios/scenarios.py

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,12 @@ def update(
184184
self,
185185
id: str,
186186
*,
187-
input_context: InputContextParam,
188-
name: str,
189-
scoring_contract: ScoringContractParam,
190187
environment_parameters: Optional[ScenarioEnvironmentParam] | NotGiven = NOT_GIVEN,
188+
input_context: Optional[InputContextParam] | NotGiven = NOT_GIVEN,
191189
metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
190+
name: Optional[str] | NotGiven = NOT_GIVEN,
192191
reference_output: Optional[str] | NotGiven = NOT_GIVEN,
192+
scoring_contract: Optional[ScoringContractParam] | NotGiven = NOT_GIVEN,
193193
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
194194
# The extra values given here take precedence over values defined on the client or passed to this method.
195195
extra_headers: Headers | None = None,
@@ -200,23 +200,24 @@ def update(
200200
) -> ScenarioView:
201201
"""
202202
Update a Scenario, a repeatable AI coding evaluation test that defines the
203-
starting environment as well as evaluation success criteria.
203+
starting environment as well as evaluation success criteria. Only provided
204+
fields will be updated.
204205
205206
Args:
206-
input_context: The input context for the Scenario.
207-
208-
name: Name of the scenario.
209-
210-
scoring_contract: The scoring contract for the Scenario.
211-
212207
environment_parameters: The Environment in which the Scenario will run.
213208
209+
input_context: The input context for the Scenario.
210+
214211
metadata: User defined metadata to attach to the scenario for organization.
215212
213+
name: Name of the scenario.
214+
216215
reference_output: A string representation of the reference output to solve the scenario. Commonly
217216
can be the result of a git diff or a sequence of command actions to apply to the
218217
environment.
219218
219+
scoring_contract: The scoring contract for the Scenario.
220+
220221
extra_headers: Send extra headers
221222
222223
extra_query: Add additional query parameters to the request
@@ -233,12 +234,12 @@ def update(
233234
f"/v1/scenarios/{id}",
234235
body=maybe_transform(
235236
{
236-
"input_context": input_context,
237-
"name": name,
238-
"scoring_contract": scoring_contract,
239237
"environment_parameters": environment_parameters,
238+
"input_context": input_context,
240239
"metadata": metadata,
240+
"name": name,
241241
"reference_output": reference_output,
242+
"scoring_contract": scoring_contract,
242243
},
243244
scenario_update_params.ScenarioUpdateParams,
244245
),
@@ -551,12 +552,12 @@ async def update(
551552
self,
552553
id: str,
553554
*,
554-
input_context: InputContextParam,
555-
name: str,
556-
scoring_contract: ScoringContractParam,
557555
environment_parameters: Optional[ScenarioEnvironmentParam] | NotGiven = NOT_GIVEN,
556+
input_context: Optional[InputContextParam] | NotGiven = NOT_GIVEN,
558557
metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
558+
name: Optional[str] | NotGiven = NOT_GIVEN,
559559
reference_output: Optional[str] | NotGiven = NOT_GIVEN,
560+
scoring_contract: Optional[ScoringContractParam] | NotGiven = NOT_GIVEN,
560561
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
561562
# The extra values given here take precedence over values defined on the client or passed to this method.
562563
extra_headers: Headers | None = None,
@@ -567,23 +568,24 @@ async def update(
567568
) -> ScenarioView:
568569
"""
569570
Update a Scenario, a repeatable AI coding evaluation test that defines the
570-
starting environment as well as evaluation success criteria.
571+
starting environment as well as evaluation success criteria. Only provided
572+
fields will be updated.
571573
572574
Args:
573-
input_context: The input context for the Scenario.
574-
575-
name: Name of the scenario.
576-
577-
scoring_contract: The scoring contract for the Scenario.
578-
579575
environment_parameters: The Environment in which the Scenario will run.
580576
577+
input_context: The input context for the Scenario.
578+
581579
metadata: User defined metadata to attach to the scenario for organization.
582580
581+
name: Name of the scenario.
582+
583583
reference_output: A string representation of the reference output to solve the scenario. Commonly
584584
can be the result of a git diff or a sequence of command actions to apply to the
585585
environment.
586586
587+
scoring_contract: The scoring contract for the Scenario.
588+
587589
extra_headers: Send extra headers
588590
589591
extra_query: Add additional query parameters to the request
@@ -600,12 +602,12 @@ async def update(
600602
f"/v1/scenarios/{id}",
601603
body=await async_maybe_transform(
602604
{
603-
"input_context": input_context,
604-
"name": name,
605-
"scoring_contract": scoring_contract,
606605
"environment_parameters": environment_parameters,
606+
"input_context": input_context,
607607
"metadata": metadata,
608+
"name": name,
608609
"reference_output": reference_output,
610+
"scoring_contract": scoring_contract,
609611
},
610612
scenario_update_params.ScenarioUpdateParams,
611613
),

src/runloop_api_client/types/scenario_update_params.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from __future__ import annotations
44

55
from typing import Dict, Optional
6-
from typing_extensions import Required, TypedDict
6+
from typing_extensions import TypedDict
77

88
from .input_context_param import InputContextParam
99
from .scoring_contract_param import ScoringContractParam
@@ -13,24 +13,24 @@
1313

1414

1515
class ScenarioUpdateParams(TypedDict, total=False):
16-
input_context: Required[InputContextParam]
17-
"""The input context for the Scenario."""
18-
19-
name: Required[str]
20-
"""Name of the scenario."""
21-
22-
scoring_contract: Required[ScoringContractParam]
23-
"""The scoring contract for the Scenario."""
24-
2516
environment_parameters: Optional[ScenarioEnvironmentParam]
2617
"""The Environment in which the Scenario will run."""
2718

19+
input_context: Optional[InputContextParam]
20+
"""The input context for the Scenario."""
21+
2822
metadata: Optional[Dict[str, str]]
2923
"""User defined metadata to attach to the scenario for organization."""
3024

25+
name: Optional[str]
26+
"""Name of the scenario."""
27+
3128
reference_output: Optional[str]
3229
"""A string representation of the reference output to solve the scenario.
3330
3431
Commonly can be the result of a git diff or a sequence of command actions to
3532
apply to the environment.
3633
"""
34+
35+
scoring_contract: Optional[ScoringContractParam]
36+
"""The scoring contract for the Scenario."""

0 commit comments

Comments
 (0)