Skip to content

Commit 9bb3abf

Browse files
feat(api): api update
1 parent 90da631 commit 9bb3abf

File tree

8 files changed

+147
-13
lines changed

8 files changed

+147
-13
lines changed

.stats.yml

Lines changed: 3 additions & 3 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-ecb3d41adaf06e76fd95f11d6da77c7aa0119387a3f372e736edd1579ec2aa03.yml
3-
openapi_spec_hash: 2671664b7d6b0107a6402746033a65ac
4-
config_hash: c4d0f5cf7262a18f9254da07d289f3ec
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-04db114d63ee85c22cfe1523fc2422a2e19b7cb7b93cbee97936a1e1a8997a89.yml
3+
openapi_spec_hash: c3d50a0138a3a9c35f0a02292f3788a3
4+
config_hash: 55cf3b0829d3d91846df7c4cfab7db0d

api.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ Types:
264264
```python
265265
from runloop_api_client.types import (
266266
InputContext,
267+
InputContextUpdate,
267268
ScenarioCreateParameters,
268269
ScenarioEnvironment,
269270
ScenarioRunListView,
@@ -272,6 +273,7 @@ from runloop_api_client.types import (
272273
ScenarioView,
273274
ScoringContract,
274275
ScoringContractResultView,
276+
ScoringContractUpdate,
275277
ScoringFunction,
276278
ScoringFunctionResultView,
277279
StartScenarioRunParameters,

src/runloop_api_client/resources/scenarios/scenarios.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@
4646
from ...types.scenario_run_view import ScenarioRunView
4747
from ...types.input_context_param import InputContextParam
4848
from ...types.scoring_contract_param import ScoringContractParam
49+
from ...types.input_context_update_param import InputContextUpdateParam
4950
from ...types.scenario_environment_param import ScenarioEnvironmentParam
51+
from ...types.scoring_contract_update_param import ScoringContractUpdateParam
5052

5153
__all__ = ["ScenariosResource", "AsyncScenariosResource"]
5254

@@ -186,11 +188,11 @@ def update(
186188
id: str,
187189
*,
188190
environment_parameters: Optional[ScenarioEnvironmentParam] | NotGiven = NOT_GIVEN,
189-
input_context: Optional[InputContextParam] | NotGiven = NOT_GIVEN,
191+
input_context: Optional[InputContextUpdateParam] | NotGiven = NOT_GIVEN,
190192
metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
191193
name: Optional[str] | NotGiven = NOT_GIVEN,
192194
reference_output: Optional[str] | NotGiven = NOT_GIVEN,
193-
scoring_contract: Optional[ScoringContractParam] | NotGiven = NOT_GIVEN,
195+
scoring_contract: Optional[ScoringContractUpdateParam] | NotGiven = NOT_GIVEN,
194196
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
195197
# The extra values given here take precedence over values defined on the client or passed to this method.
196198
extra_headers: Headers | None = None,
@@ -613,11 +615,11 @@ async def update(
613615
id: str,
614616
*,
615617
environment_parameters: Optional[ScenarioEnvironmentParam] | NotGiven = NOT_GIVEN,
616-
input_context: Optional[InputContextParam] | NotGiven = NOT_GIVEN,
618+
input_context: Optional[InputContextUpdateParam] | NotGiven = NOT_GIVEN,
617619
metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN,
618620
name: Optional[str] | NotGiven = NOT_GIVEN,
619621
reference_output: Optional[str] | NotGiven = NOT_GIVEN,
620-
scoring_contract: Optional[ScoringContractParam] | NotGiven = NOT_GIVEN,
622+
scoring_contract: Optional[ScoringContractUpdateParam] | NotGiven = NOT_GIVEN,
621623
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
622624
# The extra values given here take precedence over values defined on the client or passed to this method.
623625
extra_headers: Headers | None = None,

src/runloop_api_client/types/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
from .benchmark_start_run_params import BenchmarkStartRunParams as BenchmarkStartRunParams
5555
from .blueprint_build_parameters import BlueprintBuildParameters as BlueprintBuildParameters
5656
from .devbox_execute_sync_params import DevboxExecuteSyncParams as DevboxExecuteSyncParams
57+
from .input_context_update_param import InputContextUpdateParam as InputContextUpdateParam
5758
from .repository_connection_view import RepositoryConnectionView as RepositoryConnectionView
5859
from .scenario_environment_param import ScenarioEnvironmentParam as ScenarioEnvironmentParam
5960
from .devbox_create_tunnel_params import DevboxCreateTunnelParams as DevboxCreateTunnelParams
@@ -69,6 +70,7 @@
6970
from .scoring_function_result_view import ScoringFunctionResultView as ScoringFunctionResultView
7071
from .repository_inspection_details import RepositoryInspectionDetails as RepositoryInspectionDetails
7172
from .scenario_definition_list_view import ScenarioDefinitionListView as ScenarioDefinitionListView
73+
from .scoring_contract_update_param import ScoringContractUpdateParam as ScoringContractUpdateParam
7274
from .blueprint_build_logs_list_view import BlueprintBuildLogsListView as BlueprintBuildLogsListView
7375
from .devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse as DevboxCreateSSHKeyResponse
7476
from .repository_connection_list_view import RepositoryConnectionListView as RepositoryConnectionListView
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing import Optional
6+
from typing_extensions import Literal, Required, Annotated, TypedDict
7+
8+
from .._utils import PropertyInfo
9+
10+
__all__ = ["InputContextUpdateParam", "AdditionalContext"]
11+
12+
13+
class AdditionalContext(TypedDict, total=False):
14+
array: Required[bool]
15+
16+
big_decimal: Required[Annotated[bool, PropertyInfo(alias="bigDecimal")]]
17+
18+
big_integer: Required[Annotated[bool, PropertyInfo(alias="bigInteger")]]
19+
20+
binary: Required[bool]
21+
22+
boolean: Required[bool]
23+
24+
container_node: Required[Annotated[bool, PropertyInfo(alias="containerNode")]]
25+
26+
double: Required[bool]
27+
28+
empty: Required[bool]
29+
30+
float: Required[bool]
31+
32+
floating_point_number: Required[Annotated[bool, PropertyInfo(alias="floatingPointNumber")]]
33+
34+
int: Required[bool]
35+
36+
integral_number: Required[Annotated[bool, PropertyInfo(alias="integralNumber")]]
37+
38+
long: Required[bool]
39+
40+
missing_node: Required[Annotated[bool, PropertyInfo(alias="missingNode")]]
41+
42+
null: Required[bool]
43+
44+
number: Required[bool]
45+
46+
object: Required[bool]
47+
48+
pojo: Required[bool]
49+
50+
short: Required[bool]
51+
52+
textual: Required[bool]
53+
54+
value_node: Required[Annotated[bool, PropertyInfo(alias="valueNode")]]
55+
56+
node_type: Annotated[
57+
Literal["ARRAY", "BINARY", "BOOLEAN", "MISSING", "NULL", "NUMBER", "OBJECT", "POJO", "STRING"],
58+
PropertyInfo(alias="nodeType"),
59+
]
60+
61+
62+
class InputContextUpdateParam(TypedDict, total=False):
63+
additional_context: Optional[AdditionalContext]
64+
"""Additional JSON structured input context."""
65+
66+
problem_statement: Optional[str]
67+
"""The problem statement for the Scenario."""

src/runloop_api_client/types/scenario_update_params.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
from typing import Dict, Optional
66
from typing_extensions import TypedDict
77

8-
from .input_context_param import InputContextParam
9-
from .scoring_contract_param import ScoringContractParam
8+
from .input_context_update_param import InputContextUpdateParam
109
from .scenario_environment_param import ScenarioEnvironmentParam
10+
from .scoring_contract_update_param import ScoringContractUpdateParam
1111

1212
__all__ = ["ScenarioUpdateParams"]
1313

@@ -16,7 +16,7 @@ class ScenarioUpdateParams(TypedDict, total=False):
1616
environment_parameters: Optional[ScenarioEnvironmentParam]
1717
"""The Environment in which the Scenario will run."""
1818

19-
input_context: Optional[InputContextParam]
19+
input_context: Optional[InputContextUpdateParam]
2020
"""The input context for the Scenario."""
2121

2222
metadata: Optional[Dict[str, str]]
@@ -32,5 +32,5 @@ class ScenarioUpdateParams(TypedDict, total=False):
3232
apply to the environment.
3333
"""
3434

35-
scoring_contract: Optional[ScoringContractParam]
35+
scoring_contract: Optional[ScoringContractUpdateParam]
3636
"""The scoring contract for the Scenario."""
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing import Iterable, Optional
6+
from typing_extensions import TypedDict
7+
8+
from .scoring_function_param import ScoringFunctionParam
9+
10+
__all__ = ["ScoringContractUpdateParam"]
11+
12+
13+
class ScoringContractUpdateParam(TypedDict, total=False):
14+
scoring_function_parameters: Optional[Iterable[ScoringFunctionParam]]
15+
"""A list of scoring functions used to evaluate the Scenario."""

tests/api_resources/test_scenarios.py

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,31 @@ def test_method_update_with_all_params(self, client: Runloop) -> None:
217217
"working_directory": "working_directory",
218218
},
219219
input_context={
220+
"additional_context": {
221+
"array": True,
222+
"big_decimal": True,
223+
"big_integer": True,
224+
"binary": True,
225+
"boolean": True,
226+
"container_node": True,
227+
"double": True,
228+
"empty": True,
229+
"float": True,
230+
"floating_point_number": True,
231+
"int": True,
232+
"integral_number": True,
233+
"long": True,
234+
"missing_node": True,
235+
"null": True,
236+
"number": True,
237+
"object": True,
238+
"pojo": True,
239+
"short": True,
240+
"textual": True,
241+
"value_node": True,
242+
"node_type": "ARRAY",
243+
},
220244
"problem_statement": "problem_statement",
221-
"additional_context": {},
222245
},
223246
metadata={"foo": "string"},
224247
name="name",
@@ -583,8 +606,31 @@ async def test_method_update_with_all_params(self, async_client: AsyncRunloop) -
583606
"working_directory": "working_directory",
584607
},
585608
input_context={
609+
"additional_context": {
610+
"array": True,
611+
"big_decimal": True,
612+
"big_integer": True,
613+
"binary": True,
614+
"boolean": True,
615+
"container_node": True,
616+
"double": True,
617+
"empty": True,
618+
"float": True,
619+
"floating_point_number": True,
620+
"int": True,
621+
"integral_number": True,
622+
"long": True,
623+
"missing_node": True,
624+
"null": True,
625+
"number": True,
626+
"object": True,
627+
"pojo": True,
628+
"short": True,
629+
"textual": True,
630+
"value_node": True,
631+
"node_type": "ARRAY",
632+
},
586633
"problem_statement": "problem_statement",
587-
"additional_context": {},
588634
},
589635
metadata={"foo": "string"},
590636
name="name",

0 commit comments

Comments
 (0)