Skip to content

Commit 1f08bda

Browse files
docs(closes OPEN-9953): expose endpoints to get and delete a row
1 parent ea39015 commit 1f08bda

File tree

6 files changed

+421
-6
lines changed

6 files changed

+421
-6
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
configured_endpoints: 29
2-
openapi_spec_hash: 20caa671b1b1a87c0a5cb6ebd7e4b064
3-
config_hash: aaf12ae1da71c62ca5195fc2b66f657c
1+
configured_endpoints: 31
2+
openapi_spec_hash: a574ef9082e992c25120554886a9ab7a
3+
config_hash: f8fb410519268f9f228074c9344acc1f

api.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,19 @@ Methods:
152152
Types:
153153

154154
```python
155-
from openlayer.types.inference_pipelines import RowUpdateResponse, RowListResponse
155+
from openlayer.types.inference_pipelines import (
156+
RowRetrieveResponse,
157+
RowUpdateResponse,
158+
RowListResponse,
159+
)
156160
```
157161

158162
Methods:
159163

164+
- <code title="get /inference-pipelines/{inferencePipelineId}/rows/{inferenceId}">client.inference_pipelines.rows.<a href="./src/openlayer/resources/inference_pipelines/rows.py">retrieve</a>(inference_id, \*, inference_pipeline_id) -> <a href="./src/openlayer/types/inference_pipelines/row_retrieve_response.py">RowRetrieveResponse</a></code>
160165
- <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>
161166
- <code title="post /inference-pipelines/{inferencePipelineId}/rows">client.inference_pipelines.rows.<a href="./src/openlayer/resources/inference_pipelines/rows.py">list</a>(inference_pipeline_id, \*\*<a href="src/openlayer/types/inference_pipelines/row_list_params.py">params</a>) -> <a href="./src/openlayer/types/inference_pipelines/row_list_response.py">RowListResponse</a></code>
167+
- <code title="delete /inference-pipelines/{inferencePipelineId}/rows/{inferenceId}">client.inference_pipelines.rows.<a href="./src/openlayer/resources/inference_pipelines/rows.py">delete</a>(inference_id, \*, inference_pipeline_id) -> None</code>
162168

163169
## TestResults
164170

src/openlayer/resources/inference_pipelines/rows.py

Lines changed: 200 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import httpx
88

9-
from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
9+
from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, SequenceNotStr, omit, not_given
1010
from ..._utils import path_template, maybe_transform, async_maybe_transform
1111
from ..._compat import cached_property
1212
from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -20,6 +20,7 @@
2020
from ...types.inference_pipelines import row_list_params, row_update_params
2121
from ...types.inference_pipelines.row_list_response import RowListResponse
2222
from ...types.inference_pipelines.row_update_response import RowUpdateResponse
23+
from ...types.inference_pipelines.row_retrieve_response import RowRetrieveResponse
2324

2425
__all__ = ["RowsResource", "AsyncRowsResource"]
2526

@@ -44,6 +45,48 @@ def with_streaming_response(self) -> RowsResourceWithStreamingResponse:
4445
"""
4546
return RowsResourceWithStreamingResponse(self)
4647

48+
def retrieve(
49+
self,
50+
inference_id: str,
51+
*,
52+
inference_pipeline_id: str,
53+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
54+
# The extra values given here take precedence over values defined on the client or passed to this method.
55+
extra_headers: Headers | None = None,
56+
extra_query: Query | None = None,
57+
extra_body: Body | None = None,
58+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
59+
) -> RowRetrieveResponse:
60+
"""
61+
Fetch a single inference pipeline row by inference ID, including OTel steps.
62+
63+
Args:
64+
extra_headers: Send extra headers
65+
66+
extra_query: Add additional query parameters to the request
67+
68+
extra_body: Add additional JSON properties to the request
69+
70+
timeout: Override the client-level default timeout for this request, in seconds
71+
"""
72+
if not inference_pipeline_id:
73+
raise ValueError(
74+
f"Expected a non-empty value for `inference_pipeline_id` but received {inference_pipeline_id!r}"
75+
)
76+
if not inference_id:
77+
raise ValueError(f"Expected a non-empty value for `inference_id` but received {inference_id!r}")
78+
return self._get(
79+
path_template(
80+
"/inference-pipelines/{inference_pipeline_id}/rows/{inference_id}",
81+
inference_pipeline_id=inference_pipeline_id,
82+
inference_id=inference_id,
83+
),
84+
options=make_request_options(
85+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
86+
),
87+
cast_to=RowRetrieveResponse,
88+
)
89+
4790
def update(
4891
self,
4992
inference_pipeline_id: str,
@@ -177,6 +220,51 @@ def list(
177220
cast_to=RowListResponse,
178221
)
179222

223+
def delete(
224+
self,
225+
inference_id: str,
226+
*,
227+
inference_pipeline_id: str,
228+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
229+
# The extra values given here take precedence over values defined on the client or passed to this method.
230+
extra_headers: Headers | None = None,
231+
extra_query: Query | None = None,
232+
extra_body: Body | None = None,
233+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
234+
) -> None:
235+
"""Delete a single inference pipeline row by inference ID.
236+
237+
Only project admins can
238+
perform this action.
239+
240+
Args:
241+
extra_headers: Send extra headers
242+
243+
extra_query: Add additional query parameters to the request
244+
245+
extra_body: Add additional JSON properties to the request
246+
247+
timeout: Override the client-level default timeout for this request, in seconds
248+
"""
249+
if not inference_pipeline_id:
250+
raise ValueError(
251+
f"Expected a non-empty value for `inference_pipeline_id` but received {inference_pipeline_id!r}"
252+
)
253+
if not inference_id:
254+
raise ValueError(f"Expected a non-empty value for `inference_id` but received {inference_id!r}")
255+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
256+
return self._delete(
257+
path_template(
258+
"/inference-pipelines/{inference_pipeline_id}/rows/{inference_id}",
259+
inference_pipeline_id=inference_pipeline_id,
260+
inference_id=inference_id,
261+
),
262+
options=make_request_options(
263+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
264+
),
265+
cast_to=NoneType,
266+
)
267+
180268

181269
class AsyncRowsResource(AsyncAPIResource):
182270
@cached_property
@@ -198,6 +286,48 @@ def with_streaming_response(self) -> AsyncRowsResourceWithStreamingResponse:
198286
"""
199287
return AsyncRowsResourceWithStreamingResponse(self)
200288

289+
async def retrieve(
290+
self,
291+
inference_id: str,
292+
*,
293+
inference_pipeline_id: str,
294+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
295+
# The extra values given here take precedence over values defined on the client or passed to this method.
296+
extra_headers: Headers | None = None,
297+
extra_query: Query | None = None,
298+
extra_body: Body | None = None,
299+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
300+
) -> RowRetrieveResponse:
301+
"""
302+
Fetch a single inference pipeline row by inference ID, including OTel steps.
303+
304+
Args:
305+
extra_headers: Send extra headers
306+
307+
extra_query: Add additional query parameters to the request
308+
309+
extra_body: Add additional JSON properties to the request
310+
311+
timeout: Override the client-level default timeout for this request, in seconds
312+
"""
313+
if not inference_pipeline_id:
314+
raise ValueError(
315+
f"Expected a non-empty value for `inference_pipeline_id` but received {inference_pipeline_id!r}"
316+
)
317+
if not inference_id:
318+
raise ValueError(f"Expected a non-empty value for `inference_id` but received {inference_id!r}")
319+
return await self._get(
320+
path_template(
321+
"/inference-pipelines/{inference_pipeline_id}/rows/{inference_id}",
322+
inference_pipeline_id=inference_pipeline_id,
323+
inference_id=inference_id,
324+
),
325+
options=make_request_options(
326+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
327+
),
328+
cast_to=RowRetrieveResponse,
329+
)
330+
201331
async def update(
202332
self,
203333
inference_pipeline_id: str,
@@ -331,50 +461,119 @@ async def list(
331461
cast_to=RowListResponse,
332462
)
333463

464+
async def delete(
465+
self,
466+
inference_id: str,
467+
*,
468+
inference_pipeline_id: str,
469+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
470+
# The extra values given here take precedence over values defined on the client or passed to this method.
471+
extra_headers: Headers | None = None,
472+
extra_query: Query | None = None,
473+
extra_body: Body | None = None,
474+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
475+
) -> None:
476+
"""Delete a single inference pipeline row by inference ID.
477+
478+
Only project admins can
479+
perform this action.
480+
481+
Args:
482+
extra_headers: Send extra headers
483+
484+
extra_query: Add additional query parameters to the request
485+
486+
extra_body: Add additional JSON properties to the request
487+
488+
timeout: Override the client-level default timeout for this request, in seconds
489+
"""
490+
if not inference_pipeline_id:
491+
raise ValueError(
492+
f"Expected a non-empty value for `inference_pipeline_id` but received {inference_pipeline_id!r}"
493+
)
494+
if not inference_id:
495+
raise ValueError(f"Expected a non-empty value for `inference_id` but received {inference_id!r}")
496+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
497+
return await self._delete(
498+
path_template(
499+
"/inference-pipelines/{inference_pipeline_id}/rows/{inference_id}",
500+
inference_pipeline_id=inference_pipeline_id,
501+
inference_id=inference_id,
502+
),
503+
options=make_request_options(
504+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
505+
),
506+
cast_to=NoneType,
507+
)
508+
334509

335510
class RowsResourceWithRawResponse:
336511
def __init__(self, rows: RowsResource) -> None:
337512
self._rows = rows
338513

514+
self.retrieve = to_raw_response_wrapper(
515+
rows.retrieve,
516+
)
339517
self.update = to_raw_response_wrapper(
340518
rows.update,
341519
)
342520
self.list = to_raw_response_wrapper(
343521
rows.list,
344522
)
523+
self.delete = to_raw_response_wrapper(
524+
rows.delete,
525+
)
345526

346527

347528
class AsyncRowsResourceWithRawResponse:
348529
def __init__(self, rows: AsyncRowsResource) -> None:
349530
self._rows = rows
350531

532+
self.retrieve = async_to_raw_response_wrapper(
533+
rows.retrieve,
534+
)
351535
self.update = async_to_raw_response_wrapper(
352536
rows.update,
353537
)
354538
self.list = async_to_raw_response_wrapper(
355539
rows.list,
356540
)
541+
self.delete = async_to_raw_response_wrapper(
542+
rows.delete,
543+
)
357544

358545

359546
class RowsResourceWithStreamingResponse:
360547
def __init__(self, rows: RowsResource) -> None:
361548
self._rows = rows
362549

550+
self.retrieve = to_streamed_response_wrapper(
551+
rows.retrieve,
552+
)
363553
self.update = to_streamed_response_wrapper(
364554
rows.update,
365555
)
366556
self.list = to_streamed_response_wrapper(
367557
rows.list,
368558
)
559+
self.delete = to_streamed_response_wrapper(
560+
rows.delete,
561+
)
369562

370563

371564
class AsyncRowsResourceWithStreamingResponse:
372565
def __init__(self, rows: AsyncRowsResource) -> None:
373566
self._rows = rows
374567

568+
self.retrieve = async_to_streamed_response_wrapper(
569+
rows.retrieve,
570+
)
375571
self.update = async_to_streamed_response_wrapper(
376572
rows.update,
377573
)
378574
self.list = async_to_streamed_response_wrapper(
379575
rows.list,
380576
)
577+
self.delete = async_to_streamed_response_wrapper(
578+
rows.delete,
579+
)

src/openlayer/types/inference_pipelines/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
from .data_stream_params import DataStreamParams as DataStreamParams
99
from .row_update_response import RowUpdateResponse as RowUpdateResponse
1010
from .data_stream_response import DataStreamResponse as DataStreamResponse
11+
from .row_retrieve_response import RowRetrieveResponse as RowRetrieveResponse
1112
from .test_result_list_params import TestResultListParams as TestResultListParams
1213
from .test_result_list_response import TestResultListResponse as TestResultListResponse
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import Optional
4+
5+
from ..._models import BaseModel
6+
7+
__all__ = ["RowRetrieveResponse"]
8+
9+
10+
class RowRetrieveResponse(BaseModel):
11+
row: Optional[object] = None
12+
13+
success: Optional[bool] = None

0 commit comments

Comments
 (0)