Skip to content

Commit 0cbecb8

Browse files
feat(api): manual updates
1 parent de9aa8e commit 0cbecb8

File tree

6 files changed

+474
-2
lines changed

6 files changed

+474
-2
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 65
1+
configured_endpoints: 66
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/julep-ai-inc-dash%2Fjulep-e66d0877850bb5d2cf4c57163dc5ea0450141dcef34823472e80cb08371fa737.yml
33
openapi_spec_hash: cf36192f4e7ecb828467c03855a6508d
4-
config_hash: f7773022cf6c63ceefb06a65bbdbd360
4+
config_hash: cbbcfe531bf3096e61f5c3e4e398440e

api.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,13 @@ Methods:
201201
- <code title="get /executions/{execution_id}/transitions">client.executions.transitions.<a href="./src/julep/resources/executions/transitions.py">list</a>(execution_id, \*\*<a href="src/julep/types/executions/transition_list_params.py">params</a>) -> <a href="./src/julep/types/transition.py">SyncOffsetPagination[Transition]</a></code>
202202
- <code title="get /executions/{execution_id}/transitions.stream">client.executions.transitions.<a href="./src/julep/resources/executions/transitions.py">stream</a>(execution_id, \*\*<a href="src/julep/types/executions/transition_stream_params.py">params</a>) -> object</code>
203203

204+
## Status
205+
206+
Methods:
207+
208+
- <code title="get /executions/{execution_id}">client.executions.status.<a href="./src/julep/resources/executions/status.py">get</a>(execution_id) -> <a href="./src/julep/types/execution.py">Execution</a></code>
209+
- <code title="get /executions/{execution_id}/status.stream">client.executions.status.<a href="./src/julep/resources/executions/status.py">stream</a>(execution_id) -> None</code>
210+
204211
# Secrets
205212

206213
Types:

src/julep/resources/executions/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3+
from .status import (
4+
StatusResource,
5+
AsyncStatusResource,
6+
StatusResourceWithRawResponse,
7+
AsyncStatusResourceWithRawResponse,
8+
StatusResourceWithStreamingResponse,
9+
AsyncStatusResourceWithStreamingResponse,
10+
)
311
from .executions import (
412
ExecutionsResource,
513
AsyncExecutionsResource,
@@ -24,6 +32,12 @@
2432
"AsyncTransitionsResourceWithRawResponse",
2533
"TransitionsResourceWithStreamingResponse",
2634
"AsyncTransitionsResourceWithStreamingResponse",
35+
"StatusResource",
36+
"AsyncStatusResource",
37+
"StatusResourceWithRawResponse",
38+
"AsyncStatusResourceWithRawResponse",
39+
"StatusResourceWithStreamingResponse",
40+
"AsyncStatusResourceWithStreamingResponse",
2741
"ExecutionsResource",
2842
"AsyncExecutionsResource",
2943
"ExecutionsResourceWithRawResponse",

src/julep/resources/executions/executions.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@
77

88
import httpx
99

10+
from .status import (
11+
StatusResource,
12+
AsyncStatusResource,
13+
StatusResourceWithRawResponse,
14+
AsyncStatusResourceWithRawResponse,
15+
StatusResourceWithStreamingResponse,
16+
AsyncStatusResourceWithStreamingResponse,
17+
)
1018
from ...types import execution_list_params, execution_create_params, execution_change_status_params
1119
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
1220
from ..._utils import maybe_transform, async_maybe_transform
@@ -38,6 +46,10 @@ class ExecutionsResource(SyncAPIResource):
3846
def transitions(self) -> TransitionsResource:
3947
return TransitionsResource(self._client)
4048

49+
@cached_property
50+
def status(self) -> StatusResource:
51+
return StatusResource(self._client)
52+
4153
@cached_property
4254
def with_raw_response(self) -> ExecutionsResourceWithRawResponse:
4355
"""
@@ -282,6 +294,10 @@ class AsyncExecutionsResource(AsyncAPIResource):
282294
def transitions(self) -> AsyncTransitionsResource:
283295
return AsyncTransitionsResource(self._client)
284296

297+
@cached_property
298+
def status(self) -> AsyncStatusResource:
299+
return AsyncStatusResource(self._client)
300+
285301
@cached_property
286302
def with_raw_response(self) -> AsyncExecutionsResourceWithRawResponse:
287303
"""
@@ -542,6 +558,10 @@ def __init__(self, executions: ExecutionsResource) -> None:
542558
def transitions(self) -> TransitionsResourceWithRawResponse:
543559
return TransitionsResourceWithRawResponse(self._executions.transitions)
544560

561+
@cached_property
562+
def status(self) -> StatusResourceWithRawResponse:
563+
return StatusResourceWithRawResponse(self._executions.status)
564+
545565

546566
class AsyncExecutionsResourceWithRawResponse:
547567
def __init__(self, executions: AsyncExecutionsResource) -> None:
@@ -564,6 +584,10 @@ def __init__(self, executions: AsyncExecutionsResource) -> None:
564584
def transitions(self) -> AsyncTransitionsResourceWithRawResponse:
565585
return AsyncTransitionsResourceWithRawResponse(self._executions.transitions)
566586

587+
@cached_property
588+
def status(self) -> AsyncStatusResourceWithRawResponse:
589+
return AsyncStatusResourceWithRawResponse(self._executions.status)
590+
567591

568592
class ExecutionsResourceWithStreamingResponse:
569593
def __init__(self, executions: ExecutionsResource) -> None:
@@ -586,6 +610,10 @@ def __init__(self, executions: ExecutionsResource) -> None:
586610
def transitions(self) -> TransitionsResourceWithStreamingResponse:
587611
return TransitionsResourceWithStreamingResponse(self._executions.transitions)
588612

613+
@cached_property
614+
def status(self) -> StatusResourceWithStreamingResponse:
615+
return StatusResourceWithStreamingResponse(self._executions.status)
616+
589617

590618
class AsyncExecutionsResourceWithStreamingResponse:
591619
def __init__(self, executions: AsyncExecutionsResource) -> None:
@@ -607,3 +635,7 @@ def __init__(self, executions: AsyncExecutionsResource) -> None:
607635
@cached_property
608636
def transitions(self) -> AsyncTransitionsResourceWithStreamingResponse:
609637
return AsyncTransitionsResourceWithStreamingResponse(self._executions.transitions)
638+
639+
@cached_property
640+
def status(self) -> AsyncStatusResourceWithStreamingResponse:
641+
return AsyncStatusResourceWithStreamingResponse(self._executions.status)
Lines changed: 245 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,245 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
import httpx
6+
7+
from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven
8+
from ..._compat import cached_property
9+
from ..._resource import SyncAPIResource, AsyncAPIResource
10+
from ..._response import (
11+
to_raw_response_wrapper,
12+
to_streamed_response_wrapper,
13+
async_to_raw_response_wrapper,
14+
async_to_streamed_response_wrapper,
15+
)
16+
from ..._base_client import make_request_options
17+
from ...types.execution import Execution
18+
19+
__all__ = ["StatusResource", "AsyncStatusResource"]
20+
21+
22+
class StatusResource(SyncAPIResource):
23+
@cached_property
24+
def with_raw_response(self) -> StatusResourceWithRawResponse:
25+
"""
26+
This property can be used as a prefix for any HTTP method call to return
27+
the raw response object instead of the parsed content.
28+
29+
For more information, see https://www.github.com/julep-ai/python-sdk#accessing-raw-response-data-eg-headers
30+
"""
31+
return StatusResourceWithRawResponse(self)
32+
33+
@cached_property
34+
def with_streaming_response(self) -> StatusResourceWithStreamingResponse:
35+
"""
36+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
37+
38+
For more information, see https://www.github.com/julep-ai/python-sdk#with_streaming_response
39+
"""
40+
return StatusResourceWithStreamingResponse(self)
41+
42+
def get(
43+
self,
44+
execution_id: str,
45+
*,
46+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
47+
# The extra values given here take precedence over values defined on the client or passed to this method.
48+
extra_headers: Headers | None = None,
49+
extra_query: Query | None = None,
50+
extra_body: Body | None = None,
51+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
52+
) -> Execution:
53+
"""
54+
Get Execution Details
55+
56+
Args:
57+
extra_headers: Send extra headers
58+
59+
extra_query: Add additional query parameters to the request
60+
61+
extra_body: Add additional JSON properties to the request
62+
63+
timeout: Override the client-level default timeout for this request, in seconds
64+
"""
65+
if not execution_id:
66+
raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}")
67+
return self._get(
68+
f"/executions/{execution_id}",
69+
options=make_request_options(
70+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
71+
),
72+
cast_to=Execution,
73+
)
74+
75+
def stream(
76+
self,
77+
execution_id: str,
78+
*,
79+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
80+
# The extra values given here take precedence over values defined on the client or passed to this method.
81+
extra_headers: Headers | None = None,
82+
extra_query: Query | None = None,
83+
extra_body: Body | None = None,
84+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
85+
) -> None:
86+
"""
87+
SSE endpoint that streams the status of a given execution_id by polling the
88+
latest_executions view.
89+
90+
Args:
91+
extra_headers: Send extra headers
92+
93+
extra_query: Add additional query parameters to the request
94+
95+
extra_body: Add additional JSON properties to the request
96+
97+
timeout: Override the client-level default timeout for this request, in seconds
98+
"""
99+
if not execution_id:
100+
raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}")
101+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
102+
return self._get(
103+
f"/executions/{execution_id}/status.stream",
104+
options=make_request_options(
105+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
106+
),
107+
cast_to=NoneType,
108+
)
109+
110+
111+
class AsyncStatusResource(AsyncAPIResource):
112+
@cached_property
113+
def with_raw_response(self) -> AsyncStatusResourceWithRawResponse:
114+
"""
115+
This property can be used as a prefix for any HTTP method call to return
116+
the raw response object instead of the parsed content.
117+
118+
For more information, see https://www.github.com/julep-ai/python-sdk#accessing-raw-response-data-eg-headers
119+
"""
120+
return AsyncStatusResourceWithRawResponse(self)
121+
122+
@cached_property
123+
def with_streaming_response(self) -> AsyncStatusResourceWithStreamingResponse:
124+
"""
125+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
126+
127+
For more information, see https://www.github.com/julep-ai/python-sdk#with_streaming_response
128+
"""
129+
return AsyncStatusResourceWithStreamingResponse(self)
130+
131+
async def get(
132+
self,
133+
execution_id: str,
134+
*,
135+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
136+
# The extra values given here take precedence over values defined on the client or passed to this method.
137+
extra_headers: Headers | None = None,
138+
extra_query: Query | None = None,
139+
extra_body: Body | None = None,
140+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
141+
) -> Execution:
142+
"""
143+
Get Execution Details
144+
145+
Args:
146+
extra_headers: Send extra headers
147+
148+
extra_query: Add additional query parameters to the request
149+
150+
extra_body: Add additional JSON properties to the request
151+
152+
timeout: Override the client-level default timeout for this request, in seconds
153+
"""
154+
if not execution_id:
155+
raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}")
156+
return await self._get(
157+
f"/executions/{execution_id}",
158+
options=make_request_options(
159+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
160+
),
161+
cast_to=Execution,
162+
)
163+
164+
async def stream(
165+
self,
166+
execution_id: str,
167+
*,
168+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
169+
# The extra values given here take precedence over values defined on the client or passed to this method.
170+
extra_headers: Headers | None = None,
171+
extra_query: Query | None = None,
172+
extra_body: Body | None = None,
173+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
174+
) -> None:
175+
"""
176+
SSE endpoint that streams the status of a given execution_id by polling the
177+
latest_executions view.
178+
179+
Args:
180+
extra_headers: Send extra headers
181+
182+
extra_query: Add additional query parameters to the request
183+
184+
extra_body: Add additional JSON properties to the request
185+
186+
timeout: Override the client-level default timeout for this request, in seconds
187+
"""
188+
if not execution_id:
189+
raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}")
190+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
191+
return await self._get(
192+
f"/executions/{execution_id}/status.stream",
193+
options=make_request_options(
194+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
195+
),
196+
cast_to=NoneType,
197+
)
198+
199+
200+
class StatusResourceWithRawResponse:
201+
def __init__(self, status: StatusResource) -> None:
202+
self._status = status
203+
204+
self.get = to_raw_response_wrapper(
205+
status.get,
206+
)
207+
self.stream = to_raw_response_wrapper(
208+
status.stream,
209+
)
210+
211+
212+
class AsyncStatusResourceWithRawResponse:
213+
def __init__(self, status: AsyncStatusResource) -> None:
214+
self._status = status
215+
216+
self.get = async_to_raw_response_wrapper(
217+
status.get,
218+
)
219+
self.stream = async_to_raw_response_wrapper(
220+
status.stream,
221+
)
222+
223+
224+
class StatusResourceWithStreamingResponse:
225+
def __init__(self, status: StatusResource) -> None:
226+
self._status = status
227+
228+
self.get = to_streamed_response_wrapper(
229+
status.get,
230+
)
231+
self.stream = to_streamed_response_wrapper(
232+
status.stream,
233+
)
234+
235+
236+
class AsyncStatusResourceWithStreamingResponse:
237+
def __init__(self, status: AsyncStatusResource) -> None:
238+
self._status = status
239+
240+
self.get = async_to_streamed_response_wrapper(
241+
status.get,
242+
)
243+
self.stream = async_to_streamed_response_wrapper(
244+
status.stream,
245+
)

0 commit comments

Comments
 (0)