Skip to content

Commit 8ebd055

Browse files
feat(api): api update
1 parent 038fe71 commit 8ebd055

File tree

4 files changed

+66
-184
lines changed

4 files changed

+66
-184
lines changed

.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
@@ -185,12 +185,12 @@ def update(
185185
self,
186186
id: str,
187187
*,
188-
input_context: InputContextParam,
189-
name: str,
190-
scoring_contract: ScoringContractParam,
191188
environment_parameters: Optional[ScenarioEnvironmentParam] | NotGiven = NOT_GIVEN,
189+
input_context: Optional[InputContextParam] | NotGiven = NOT_GIVEN,
192190
metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
191+
name: Optional[str] | NotGiven = NOT_GIVEN,
193192
reference_output: Optional[str] | NotGiven = NOT_GIVEN,
193+
scoring_contract: Optional[ScoringContractParam] | NotGiven = NOT_GIVEN,
194194
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
195195
# The extra values given here take precedence over values defined on the client or passed to this method.
196196
extra_headers: Headers | None = None,
@@ -201,23 +201,24 @@ def update(
201201
) -> ScenarioView:
202202
"""
203203
Update a Scenario, a repeatable AI coding evaluation test that defines the
204-
starting environment as well as evaluation success criteria.
204+
starting environment as well as evaluation success criteria. Only provided
205+
fields will be updated.
205206
206207
Args:
207-
input_context: The input context for the Scenario.
208-
209-
name: Name of the scenario.
210-
211-
scoring_contract: The scoring contract for the Scenario.
212-
213208
environment_parameters: The Environment in which the Scenario will run.
214209
210+
input_context: The input context for the Scenario.
211+
215212
metadata: User defined metadata to attach to the scenario for organization.
216213
214+
name: Name of the scenario.
215+
217216
reference_output: A string representation of the reference output to solve the scenario. Commonly
218217
can be the result of a git diff or a sequence of command actions to apply to the
219218
environment.
220219
220+
scoring_contract: The scoring contract for the Scenario.
221+
221222
extra_headers: Send extra headers
222223
223224
extra_query: Add additional query parameters to the request
@@ -234,12 +235,12 @@ def update(
234235
f"/v1/scenarios/{id}",
235236
body=maybe_transform(
236237
{
237-
"input_context": input_context,
238-
"name": name,
239-
"scoring_contract": scoring_contract,
240238
"environment_parameters": environment_parameters,
239+
"input_context": input_context,
241240
"metadata": metadata,
241+
"name": name,
242242
"reference_output": reference_output,
243+
"scoring_contract": scoring_contract,
243244
},
244245
scenario_update_params.ScenarioUpdateParams,
245246
),
@@ -611,12 +612,12 @@ async def update(
611612
self,
612613
id: str,
613614
*,
614-
input_context: InputContextParam,
615-
name: str,
616-
scoring_contract: ScoringContractParam,
617615
environment_parameters: Optional[ScenarioEnvironmentParam] | NotGiven = NOT_GIVEN,
616+
input_context: Optional[InputContextParam] | NotGiven = NOT_GIVEN,
618617
metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
618+
name: Optional[str] | NotGiven = NOT_GIVEN,
619619
reference_output: Optional[str] | NotGiven = NOT_GIVEN,
620+
scoring_contract: Optional[ScoringContractParam] | NotGiven = NOT_GIVEN,
620621
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
621622
# The extra values given here take precedence over values defined on the client or passed to this method.
622623
extra_headers: Headers | None = None,
@@ -627,23 +628,24 @@ async def update(
627628
) -> ScenarioView:
628629
"""
629630
Update a Scenario, a repeatable AI coding evaluation test that defines the
630-
starting environment as well as evaluation success criteria.
631+
starting environment as well as evaluation success criteria. Only provided
632+
fields will be updated.
631633
632634
Args:
633-
input_context: The input context for the Scenario.
634-
635-
name: Name of the scenario.
636-
637-
scoring_contract: The scoring contract for the Scenario.
638-
639635
environment_parameters: The Environment in which the Scenario will run.
640636
637+
input_context: The input context for the Scenario.
638+
641639
metadata: User defined metadata to attach to the scenario for organization.
642640
641+
name: Name of the scenario.
642+
643643
reference_output: A string representation of the reference output to solve the scenario. Commonly
644644
can be the result of a git diff or a sequence of command actions to apply to the
645645
environment.
646646
647+
scoring_contract: The scoring contract for the Scenario.
648+
647649
extra_headers: Send extra headers
648650
649651
extra_query: Add additional query parameters to the request
@@ -660,12 +662,12 @@ async def update(
660662
f"/v1/scenarios/{id}",
661663
body=await async_maybe_transform(
662664
{
663-
"input_context": input_context,
664-
"name": name,
665-
"scoring_contract": scoring_contract,
666665
"environment_parameters": environment_parameters,
666+
"input_context": input_context,
667667
"metadata": metadata,
668+
"name": name,
668669
"reference_output": reference_output,
670+
"scoring_contract": scoring_contract,
669671
},
670672
scenario_update_params.ScenarioUpdateParams,
671673
),

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)