Skip to content

Commit 6852bd4

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): update via SDK Studio (#263)
1 parent b8718de commit 6852bd4

File tree

6 files changed

+59
-59
lines changed

6 files changed

+59
-59
lines changed

api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@ Methods:
6969
Types:
7070

7171
```python
72-
from openlayer.types.inference_pipelines import RowStreamResponse
72+
from openlayer.types.inference_pipelines import RowUpdateResponse
7373
```
7474

7575
Methods:
7676

77-
- <code title="put /inference-pipelines/{inferencePipelineId}/rows">client.inference_pipelines.rows.<a href="./src/openlayer/resources/inference_pipelines/rows.py">stream</a>(inference_pipeline_id, \*\*<a href="src/openlayer/types/inference_pipelines/row_stream_params.py">params</a>) -> <a href="./src/openlayer/types/inference_pipelines/row_stream_response.py">RowStreamResponse</a></code>
77+
- <code title="put /inference-pipelines/{inferencePipelineId}/rows">client.inference_pipelines.rows.<a href="./src/openlayer/resources/inference_pipelines/rows.py">update</a>(inference_pipeline_id, \*\*<a href="src/openlayer/types/inference_pipelines/row_update_params.py">params</a>) -> <a href="./src/openlayer/types/inference_pipelines/row_update_response.py">RowUpdateResponse</a></code>
7878

7979
## TestResults
8080

src/openlayer/resources/inference_pipelines/rows.py

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
async_to_streamed_response_wrapper,
2121
)
2222
from ..._base_client import make_request_options
23-
from ...types.inference_pipelines import row_stream_params
24-
from ...types.inference_pipelines.row_stream_response import RowStreamResponse
23+
from ...types.inference_pipelines import row_update_params
24+
from ...types.inference_pipelines.row_update_response import RowUpdateResponse
2525

2626
__all__ = ["RowsResource", "AsyncRowsResource"]
2727

@@ -35,20 +35,20 @@ def with_raw_response(self) -> RowsResourceWithRawResponse:
3535
def with_streaming_response(self) -> RowsResourceWithStreamingResponse:
3636
return RowsResourceWithStreamingResponse(self)
3737

38-
def stream(
38+
def update(
3939
self,
4040
inference_pipeline_id: str,
4141
*,
4242
inference_id: str,
4343
row: object,
44-
config: Optional[row_stream_params.Config] | NotGiven = NOT_GIVEN,
44+
config: Optional[row_update_params.Config] | NotGiven = NOT_GIVEN,
4545
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
4646
# The extra values given here take precedence over values defined on the client or passed to this method.
4747
extra_headers: Headers | None = None,
4848
extra_query: Query | None = None,
4949
extra_body: Body | None = None,
5050
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
51-
) -> RowStreamResponse:
51+
) -> RowUpdateResponse:
5252
"""
5353
Update an inference data point in an inference pipeline.
5454
@@ -74,16 +74,16 @@ def stream(
7474
"row": row,
7575
"config": config,
7676
},
77-
row_stream_params.RowStreamParams,
77+
row_update_params.RowUpdateParams,
7878
),
7979
options=make_request_options(
8080
extra_headers=extra_headers,
8181
extra_query=extra_query,
8282
extra_body=extra_body,
8383
timeout=timeout,
84-
query=maybe_transform({"inference_id": inference_id}, row_stream_params.RowStreamParams),
84+
query=maybe_transform({"inference_id": inference_id}, row_update_params.RowUpdateParams),
8585
),
86-
cast_to=RowStreamResponse,
86+
cast_to=RowUpdateResponse,
8787
)
8888

8989

@@ -96,20 +96,20 @@ def with_raw_response(self) -> AsyncRowsResourceWithRawResponse:
9696
def with_streaming_response(self) -> AsyncRowsResourceWithStreamingResponse:
9797
return AsyncRowsResourceWithStreamingResponse(self)
9898

99-
async def stream(
99+
async def update(
100100
self,
101101
inference_pipeline_id: str,
102102
*,
103103
inference_id: str,
104104
row: object,
105-
config: Optional[row_stream_params.Config] | NotGiven = NOT_GIVEN,
105+
config: Optional[row_update_params.Config] | NotGiven = NOT_GIVEN,
106106
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
107107
# The extra values given here take precedence over values defined on the client or passed to this method.
108108
extra_headers: Headers | None = None,
109109
extra_query: Query | None = None,
110110
extra_body: Body | None = None,
111111
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
112-
) -> RowStreamResponse:
112+
) -> RowUpdateResponse:
113113
"""
114114
Update an inference data point in an inference pipeline.
115115
@@ -135,50 +135,50 @@ async def stream(
135135
"row": row,
136136
"config": config,
137137
},
138-
row_stream_params.RowStreamParams,
138+
row_update_params.RowUpdateParams,
139139
),
140140
options=make_request_options(
141141
extra_headers=extra_headers,
142142
extra_query=extra_query,
143143
extra_body=extra_body,
144144
timeout=timeout,
145-
query=await async_maybe_transform({"inference_id": inference_id}, row_stream_params.RowStreamParams),
145+
query=await async_maybe_transform({"inference_id": inference_id}, row_update_params.RowUpdateParams),
146146
),
147-
cast_to=RowStreamResponse,
147+
cast_to=RowUpdateResponse,
148148
)
149149

150150

151151
class RowsResourceWithRawResponse:
152152
def __init__(self, rows: RowsResource) -> None:
153153
self._rows = rows
154154

155-
self.stream = to_raw_response_wrapper(
156-
rows.stream,
155+
self.update = to_raw_response_wrapper(
156+
rows.update,
157157
)
158158

159159

160160
class AsyncRowsResourceWithRawResponse:
161161
def __init__(self, rows: AsyncRowsResource) -> None:
162162
self._rows = rows
163163

164-
self.stream = async_to_raw_response_wrapper(
165-
rows.stream,
164+
self.update = async_to_raw_response_wrapper(
165+
rows.update,
166166
)
167167

168168

169169
class RowsResourceWithStreamingResponse:
170170
def __init__(self, rows: RowsResource) -> None:
171171
self._rows = rows
172172

173-
self.stream = to_streamed_response_wrapper(
174-
rows.stream,
173+
self.update = to_streamed_response_wrapper(
174+
rows.update,
175175
)
176176

177177

178178
class AsyncRowsResourceWithStreamingResponse:
179179
def __init__(self, rows: AsyncRowsResource) -> None:
180180
self._rows = rows
181181

182-
self.stream = async_to_streamed_response_wrapper(
183-
rows.stream,
182+
self.update = async_to_streamed_response_wrapper(
183+
rows.update,
184184
)

src/openlayer/types/inference_pipelines/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
from __future__ import annotations
44

5-
from .row_stream_params import RowStreamParams as RowStreamParams
5+
from .row_update_params import RowUpdateParams as RowUpdateParams
66
from .data_stream_params import DataStreamParams as DataStreamParams
7-
from .row_stream_response import RowStreamResponse as RowStreamResponse
7+
from .row_update_response import RowUpdateResponse as RowUpdateResponse
88
from .data_stream_response import DataStreamResponse as DataStreamResponse
99
from .test_result_list_params import TestResultListParams as TestResultListParams
1010
from .test_result_list_response import TestResultListResponse as TestResultListResponse

src/openlayer/types/inference_pipelines/row_stream_params.py renamed to src/openlayer/types/inference_pipelines/row_update_params.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77

88
from ..._utils import PropertyInfo
99

10-
__all__ = ["RowStreamParams", "Config"]
10+
__all__ = ["RowUpdateParams", "Config"]
1111

1212

13-
class RowStreamParams(TypedDict, total=False):
13+
class RowUpdateParams(TypedDict, total=False):
1414
inference_id: Required[Annotated[str, PropertyInfo(alias="inferenceId")]]
1515
"""Specify the inference id as a query param."""
1616

src/openlayer/types/inference_pipelines/row_stream_response.py renamed to src/openlayer/types/inference_pipelines/row_update_response.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
from ..._models import BaseModel
66

7-
__all__ = ["RowStreamResponse"]
7+
__all__ = ["RowUpdateResponse"]
88

99

10-
class RowStreamResponse(BaseModel):
10+
class RowUpdateResponse(BaseModel):
1111
success: Literal[True]

tests/api_resources/inference_pipelines/test_rows.py

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from openlayer import Openlayer, AsyncOpenlayer
1111
from tests.utils import assert_matches_type
12-
from openlayer.types.inference_pipelines import RowStreamResponse
12+
from openlayer.types.inference_pipelines import RowUpdateResponse
1313

1414
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
1515

@@ -18,17 +18,17 @@ class TestRows:
1818
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
1919

2020
@parametrize
21-
def test_method_stream(self, client: Openlayer) -> None:
22-
row = client.inference_pipelines.rows.stream(
21+
def test_method_update(self, client: Openlayer) -> None:
22+
row = client.inference_pipelines.rows.update(
2323
inference_pipeline_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
2424
inference_id="inferenceId",
2525
row={},
2626
)
27-
assert_matches_type(RowStreamResponse, row, path=["response"])
27+
assert_matches_type(RowUpdateResponse, row, path=["response"])
2828

2929
@parametrize
30-
def test_method_stream_with_all_params(self, client: Openlayer) -> None:
31-
row = client.inference_pipelines.rows.stream(
30+
def test_method_update_with_all_params(self, client: Openlayer) -> None:
31+
row = client.inference_pipelines.rows.update(
3232
inference_pipeline_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
3333
inference_id="inferenceId",
3434
row={},
@@ -40,11 +40,11 @@ def test_method_stream_with_all_params(self, client: Openlayer) -> None:
4040
"human_feedback_column_name": "human_feedback",
4141
},
4242
)
43-
assert_matches_type(RowStreamResponse, row, path=["response"])
43+
assert_matches_type(RowUpdateResponse, row, path=["response"])
4444

4545
@parametrize
46-
def test_raw_response_stream(self, client: Openlayer) -> None:
47-
response = client.inference_pipelines.rows.with_raw_response.stream(
46+
def test_raw_response_update(self, client: Openlayer) -> None:
47+
response = client.inference_pipelines.rows.with_raw_response.update(
4848
inference_pipeline_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
4949
inference_id="inferenceId",
5050
row={},
@@ -53,11 +53,11 @@ def test_raw_response_stream(self, client: Openlayer) -> None:
5353
assert response.is_closed is True
5454
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
5555
row = response.parse()
56-
assert_matches_type(RowStreamResponse, row, path=["response"])
56+
assert_matches_type(RowUpdateResponse, row, path=["response"])
5757

5858
@parametrize
59-
def test_streaming_response_stream(self, client: Openlayer) -> None:
60-
with client.inference_pipelines.rows.with_streaming_response.stream(
59+
def test_streaming_response_update(self, client: Openlayer) -> None:
60+
with client.inference_pipelines.rows.with_streaming_response.update(
6161
inference_pipeline_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
6262
inference_id="inferenceId",
6363
row={},
@@ -66,14 +66,14 @@ def test_streaming_response_stream(self, client: Openlayer) -> None:
6666
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
6767

6868
row = response.parse()
69-
assert_matches_type(RowStreamResponse, row, path=["response"])
69+
assert_matches_type(RowUpdateResponse, row, path=["response"])
7070

7171
assert cast(Any, response.is_closed) is True
7272

7373
@parametrize
74-
def test_path_params_stream(self, client: Openlayer) -> None:
74+
def test_path_params_update(self, client: Openlayer) -> None:
7575
with pytest.raises(ValueError, match=r"Expected a non-empty value for `inference_pipeline_id` but received ''"):
76-
client.inference_pipelines.rows.with_raw_response.stream(
76+
client.inference_pipelines.rows.with_raw_response.update(
7777
inference_pipeline_id="",
7878
inference_id="inferenceId",
7979
row={},
@@ -84,17 +84,17 @@ class TestAsyncRows:
8484
parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
8585

8686
@parametrize
87-
async def test_method_stream(self, async_client: AsyncOpenlayer) -> None:
88-
row = await async_client.inference_pipelines.rows.stream(
87+
async def test_method_update(self, async_client: AsyncOpenlayer) -> None:
88+
row = await async_client.inference_pipelines.rows.update(
8989
inference_pipeline_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
9090
inference_id="inferenceId",
9191
row={},
9292
)
93-
assert_matches_type(RowStreamResponse, row, path=["response"])
93+
assert_matches_type(RowUpdateResponse, row, path=["response"])
9494

9595
@parametrize
96-
async def test_method_stream_with_all_params(self, async_client: AsyncOpenlayer) -> None:
97-
row = await async_client.inference_pipelines.rows.stream(
96+
async def test_method_update_with_all_params(self, async_client: AsyncOpenlayer) -> None:
97+
row = await async_client.inference_pipelines.rows.update(
9898
inference_pipeline_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
9999
inference_id="inferenceId",
100100
row={},
@@ -106,11 +106,11 @@ async def test_method_stream_with_all_params(self, async_client: AsyncOpenlayer)
106106
"human_feedback_column_name": "human_feedback",
107107
},
108108
)
109-
assert_matches_type(RowStreamResponse, row, path=["response"])
109+
assert_matches_type(RowUpdateResponse, row, path=["response"])
110110

111111
@parametrize
112-
async def test_raw_response_stream(self, async_client: AsyncOpenlayer) -> None:
113-
response = await async_client.inference_pipelines.rows.with_raw_response.stream(
112+
async def test_raw_response_update(self, async_client: AsyncOpenlayer) -> None:
113+
response = await async_client.inference_pipelines.rows.with_raw_response.update(
114114
inference_pipeline_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
115115
inference_id="inferenceId",
116116
row={},
@@ -119,11 +119,11 @@ async def test_raw_response_stream(self, async_client: AsyncOpenlayer) -> None:
119119
assert response.is_closed is True
120120
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
121121
row = await response.parse()
122-
assert_matches_type(RowStreamResponse, row, path=["response"])
122+
assert_matches_type(RowUpdateResponse, row, path=["response"])
123123

124124
@parametrize
125-
async def test_streaming_response_stream(self, async_client: AsyncOpenlayer) -> None:
126-
async with async_client.inference_pipelines.rows.with_streaming_response.stream(
125+
async def test_streaming_response_update(self, async_client: AsyncOpenlayer) -> None:
126+
async with async_client.inference_pipelines.rows.with_streaming_response.update(
127127
inference_pipeline_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
128128
inference_id="inferenceId",
129129
row={},
@@ -132,14 +132,14 @@ async def test_streaming_response_stream(self, async_client: AsyncOpenlayer) ->
132132
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
133133

134134
row = await response.parse()
135-
assert_matches_type(RowStreamResponse, row, path=["response"])
135+
assert_matches_type(RowUpdateResponse, row, path=["response"])
136136

137137
assert cast(Any, response.is_closed) is True
138138

139139
@parametrize
140-
async def test_path_params_stream(self, async_client: AsyncOpenlayer) -> None:
140+
async def test_path_params_update(self, async_client: AsyncOpenlayer) -> None:
141141
with pytest.raises(ValueError, match=r"Expected a non-empty value for `inference_pipeline_id` but received ''"):
142-
await async_client.inference_pipelines.rows.with_raw_response.stream(
142+
await async_client.inference_pipelines.rows.with_raw_response.update(
143143
inference_pipeline_id="",
144144
inference_id="inferenceId",
145145
row={},

0 commit comments

Comments
 (0)