Skip to content

Commit c0e987d

Browse files
feat(api): update via SDK Studio (#274)
1 parent 6d2708a commit c0e987d

File tree

7 files changed

+317
-3
lines changed

7 files changed

+317
-3
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
configured_endpoints: 12
1+
configured_endpoints: 13

api.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,13 @@ Methods:
5555
Types:
5656

5757
```python
58-
from openlayer.types import InferencePipelineRetrieveResponse
58+
from openlayer.types import InferencePipelineRetrieveResponse, InferencePipelineUpdateResponse
5959
```
6060

6161
Methods:
6262

6363
- <code title="get /inference-pipelines/{inferencePipelineId}">client.inference_pipelines.<a href="./src/openlayer/resources/inference_pipelines/inference_pipelines.py">retrieve</a>(inference_pipeline_id) -> <a href="./src/openlayer/types/inference_pipeline_retrieve_response.py">InferencePipelineRetrieveResponse</a></code>
64+
- <code title="put /inference-pipelines/{inferencePipelineId}">client.inference_pipelines.<a href="./src/openlayer/resources/inference_pipelines/inference_pipelines.py">update</a>(inference_pipeline_id, \*\*<a href="src/openlayer/types/inference_pipeline_update_params.py">params</a>) -> <a href="./src/openlayer/types/inference_pipeline_update_response.py">InferencePipelineUpdateResponse</a></code>
6465
- <code title="delete /inference-pipelines/{inferencePipelineId}">client.inference_pipelines.<a href="./src/openlayer/resources/inference_pipelines/inference_pipelines.py">delete</a>(inference_pipeline_id) -> None</code>
6566

6667
## Data

src/openlayer/resources/inference_pipelines/inference_pipelines.py

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
from __future__ import annotations
44

5+
from typing import Optional
6+
57
import httpx
68

79
from .data import (
@@ -20,7 +22,12 @@
2022
RowsResourceWithStreamingResponse,
2123
AsyncRowsResourceWithStreamingResponse,
2224
)
25+
from ...types import inference_pipeline_update_params
2326
from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven
27+
from ..._utils import (
28+
maybe_transform,
29+
async_maybe_transform,
30+
)
2431
from ..._compat import cached_property
2532
from ..._resource import SyncAPIResource, AsyncAPIResource
2633
from ..._response import (
@@ -38,6 +45,7 @@
3845
AsyncTestResultsResourceWithStreamingResponse,
3946
)
4047
from ..._base_client import make_request_options
48+
from ...types.inference_pipeline_update_response import InferencePipelineUpdateResponse
4149
from ...types.inference_pipeline_retrieve_response import InferencePipelineRetrieveResponse
4250

4351
__all__ = ["InferencePipelinesResource", "AsyncInferencePipelinesResource"]
@@ -99,6 +107,59 @@ def retrieve(
99107
cast_to=InferencePipelineRetrieveResponse,
100108
)
101109

110+
def update(
111+
self,
112+
inference_pipeline_id: str,
113+
*,
114+
description: Optional[str] | NotGiven = NOT_GIVEN,
115+
name: str | NotGiven = NOT_GIVEN,
116+
reference_dataset_uri: Optional[str] | NotGiven = NOT_GIVEN,
117+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
118+
# The extra values given here take precedence over values defined on the client or passed to this method.
119+
extra_headers: Headers | None = None,
120+
extra_query: Query | None = None,
121+
extra_body: Body | None = None,
122+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
123+
) -> InferencePipelineUpdateResponse:
124+
"""
125+
Update inference pipeline.
126+
127+
Args:
128+
description: The inference pipeline description.
129+
130+
name: The inference pipeline name.
131+
132+
reference_dataset_uri: The storage uri of your reference dataset. We recommend using the Python SDK or
133+
the UI to handle your reference dataset updates.
134+
135+
extra_headers: Send extra headers
136+
137+
extra_query: Add additional query parameters to the request
138+
139+
extra_body: Add additional JSON properties to the request
140+
141+
timeout: Override the client-level default timeout for this request, in seconds
142+
"""
143+
if not inference_pipeline_id:
144+
raise ValueError(
145+
f"Expected a non-empty value for `inference_pipeline_id` but received {inference_pipeline_id!r}"
146+
)
147+
return self._put(
148+
f"/inference-pipelines/{inference_pipeline_id}",
149+
body=maybe_transform(
150+
{
151+
"description": description,
152+
"name": name,
153+
"reference_dataset_uri": reference_dataset_uri,
154+
},
155+
inference_pipeline_update_params.InferencePipelineUpdateParams,
156+
),
157+
options=make_request_options(
158+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
159+
),
160+
cast_to=InferencePipelineUpdateResponse,
161+
)
162+
102163
def delete(
103164
self,
104165
inference_pipeline_id: str,
@@ -192,6 +253,59 @@ async def retrieve(
192253
cast_to=InferencePipelineRetrieveResponse,
193254
)
194255

256+
async def update(
257+
self,
258+
inference_pipeline_id: str,
259+
*,
260+
description: Optional[str] | NotGiven = NOT_GIVEN,
261+
name: str | NotGiven = NOT_GIVEN,
262+
reference_dataset_uri: Optional[str] | NotGiven = NOT_GIVEN,
263+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
264+
# The extra values given here take precedence over values defined on the client or passed to this method.
265+
extra_headers: Headers | None = None,
266+
extra_query: Query | None = None,
267+
extra_body: Body | None = None,
268+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
269+
) -> InferencePipelineUpdateResponse:
270+
"""
271+
Update inference pipeline.
272+
273+
Args:
274+
description: The inference pipeline description.
275+
276+
name: The inference pipeline name.
277+
278+
reference_dataset_uri: The storage uri of your reference dataset. We recommend using the Python SDK or
279+
the UI to handle your reference dataset updates.
280+
281+
extra_headers: Send extra headers
282+
283+
extra_query: Add additional query parameters to the request
284+
285+
extra_body: Add additional JSON properties to the request
286+
287+
timeout: Override the client-level default timeout for this request, in seconds
288+
"""
289+
if not inference_pipeline_id:
290+
raise ValueError(
291+
f"Expected a non-empty value for `inference_pipeline_id` but received {inference_pipeline_id!r}"
292+
)
293+
return await self._put(
294+
f"/inference-pipelines/{inference_pipeline_id}",
295+
body=await async_maybe_transform(
296+
{
297+
"description": description,
298+
"name": name,
299+
"reference_dataset_uri": reference_dataset_uri,
300+
},
301+
inference_pipeline_update_params.InferencePipelineUpdateParams,
302+
),
303+
options=make_request_options(
304+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
305+
),
306+
cast_to=InferencePipelineUpdateResponse,
307+
)
308+
195309
async def delete(
196310
self,
197311
inference_pipeline_id: str,
@@ -236,6 +350,9 @@ def __init__(self, inference_pipelines: InferencePipelinesResource) -> None:
236350
self.retrieve = to_raw_response_wrapper(
237351
inference_pipelines.retrieve,
238352
)
353+
self.update = to_raw_response_wrapper(
354+
inference_pipelines.update,
355+
)
239356
self.delete = to_raw_response_wrapper(
240357
inference_pipelines.delete,
241358
)
@@ -260,6 +377,9 @@ def __init__(self, inference_pipelines: AsyncInferencePipelinesResource) -> None
260377
self.retrieve = async_to_raw_response_wrapper(
261378
inference_pipelines.retrieve,
262379
)
380+
self.update = async_to_raw_response_wrapper(
381+
inference_pipelines.update,
382+
)
263383
self.delete = async_to_raw_response_wrapper(
264384
inference_pipelines.delete,
265385
)
@@ -284,6 +404,9 @@ def __init__(self, inference_pipelines: InferencePipelinesResource) -> None:
284404
self.retrieve = to_streamed_response_wrapper(
285405
inference_pipelines.retrieve,
286406
)
407+
self.update = to_streamed_response_wrapper(
408+
inference_pipelines.update,
409+
)
287410
self.delete = to_streamed_response_wrapper(
288411
inference_pipelines.delete,
289412
)
@@ -308,6 +431,9 @@ def __init__(self, inference_pipelines: AsyncInferencePipelinesResource) -> None
308431
self.retrieve = async_to_streamed_response_wrapper(
309432
inference_pipelines.retrieve,
310433
)
434+
self.update = async_to_streamed_response_wrapper(
435+
inference_pipelines.update,
436+
)
311437
self.delete = async_to_streamed_response_wrapper(
312438
inference_pipelines.delete,
313439
)

src/openlayer/types/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@
66
from .project_create_params import ProjectCreateParams as ProjectCreateParams
77
from .project_list_response import ProjectListResponse as ProjectListResponse
88
from .project_create_response import ProjectCreateResponse as ProjectCreateResponse
9+
from .inference_pipeline_update_params import InferencePipelineUpdateParams as InferencePipelineUpdateParams
10+
from .inference_pipeline_update_response import InferencePipelineUpdateResponse as InferencePipelineUpdateResponse
911
from .inference_pipeline_retrieve_response import InferencePipelineRetrieveResponse as InferencePipelineRetrieveResponse
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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 Annotated, TypedDict
7+
8+
from .._utils import PropertyInfo
9+
10+
__all__ = ["InferencePipelineUpdateParams"]
11+
12+
13+
class InferencePipelineUpdateParams(TypedDict, total=False):
14+
description: Optional[str]
15+
"""The inference pipeline description."""
16+
17+
name: str
18+
"""The inference pipeline name."""
19+
20+
reference_dataset_uri: Annotated[Optional[str], PropertyInfo(alias="referenceDatasetUri")]
21+
"""The storage uri of your reference dataset.
22+
23+
We recommend using the Python SDK or the UI to handle your reference dataset
24+
updates.
25+
"""
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import Optional
4+
from datetime import datetime
5+
from typing_extensions import Literal
6+
7+
from pydantic import Field as FieldInfo
8+
9+
from .._models import BaseModel
10+
11+
__all__ = ["InferencePipelineUpdateResponse", "Links"]
12+
13+
14+
class Links(BaseModel):
15+
app: str
16+
17+
18+
class InferencePipelineUpdateResponse(BaseModel):
19+
id: str
20+
"""The inference pipeline id."""
21+
22+
date_created: datetime = FieldInfo(alias="dateCreated")
23+
"""The creation date."""
24+
25+
date_last_evaluated: Optional[datetime] = FieldInfo(alias="dateLastEvaluated", default=None)
26+
"""The last test evaluation date."""
27+
28+
date_last_sample_received: Optional[datetime] = FieldInfo(alias="dateLastSampleReceived", default=None)
29+
"""The last data sample received date."""
30+
31+
date_of_next_evaluation: Optional[datetime] = FieldInfo(alias="dateOfNextEvaluation", default=None)
32+
"""The next test evaluation date."""
33+
34+
date_updated: datetime = FieldInfo(alias="dateUpdated")
35+
"""The last updated date."""
36+
37+
description: Optional[str] = None
38+
"""The inference pipeline description."""
39+
40+
failing_goal_count: int = FieldInfo(alias="failingGoalCount")
41+
"""The number of tests failing."""
42+
43+
links: Links
44+
45+
name: str
46+
"""The inference pipeline name."""
47+
48+
passing_goal_count: int = FieldInfo(alias="passingGoalCount")
49+
"""The number of tests passing."""
50+
51+
project_id: str = FieldInfo(alias="projectId")
52+
"""The project id."""
53+
54+
status: Literal["queued", "running", "paused", "failed", "completed", "unknown"]
55+
"""The status of test evaluation for the inference pipeline."""
56+
57+
status_message: Optional[str] = FieldInfo(alias="statusMessage", default=None)
58+
"""The status message of test evaluation for the inference pipeline."""
59+
60+
total_goal_count: int = FieldInfo(alias="totalGoalCount")
61+
"""The total number of tests."""

0 commit comments

Comments
 (0)