Skip to content

Commit 134f28f

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): OpenAPI spec update via Stainless API (#4)
1 parent ef88178 commit 134f28f

19 files changed

Lines changed: 26 additions & 950 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 21
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-778b6e08d43e3ffe57654335fe785cace2a54b805a2c2b31421d40beabc44386.yml
1+
configured_endpoints: 18
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4ab9f1a3f003af273e162d93a86042a8c482a935bc904259aac18bd459ab687e.yml

api.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ from runloop.types import FunctionList
5555
Methods:
5656

5757
- <code title="get /v1/functions">client.functions.<a href="./src/runloop/resources/functions/functions.py">list</a>() -> <a href="./src/runloop/types/function_list.py">FunctionList</a></code>
58-
- <code title="post /v1/functions/{projectName}/{functionName}/invoke_async">client.functions.<a href="./src/runloop/resources/functions/functions.py">invoke_async</a>(function_name, \*, project_name, \*\*<a href="src/runloop/types/function_invoke_async_params.py">params</a>) -> <a href="./src/runloop/types/shared/function_invocation_detail.py">FunctionInvocationDetail</a></code>
59-
- <code title="post /v1/functions/{projectName}/{functionName}/invoke_sync">client.functions.<a href="./src/runloop/resources/functions/functions.py">invoke_sync</a>(function_name, \*, project_name, \*\*<a href="src/runloop/types/function_invoke_sync_params.py">params</a>) -> <a href="./src/runloop/types/shared/function_invocation_detail.py">FunctionInvocationDetail</a></code>
6058

6159
## Invocations
6260

@@ -154,7 +152,3 @@ Types:
154152
```python
155153
from runloop.types.sessions.sessions import SessionKv
156154
```
157-
158-
Methods:
159-
160-
- <code title="get /v1/sessions/sessions/{sessionId}/kv">client.sessions.sessions.kv.<a href="./src/runloop/resources/sessions/sessions/kv.py">list</a>(session_id, \*\*<a href="src/runloop/types/sessions/sessions/kv_list_params.py">params</a>) -> <a href="./src/runloop/types/sessions/sessions/session_kv.py">SessionKv</a></code>

src/runloop/resources/functions/functions.py

Lines changed: 0 additions & 228 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import httpx
66

7-
from ...types import function_invoke_sync_params, function_invoke_async_params
87
from .openapi import (
98
OpenAPIResource,
109
AsyncOpenAPIResource,
@@ -14,10 +13,6 @@
1413
AsyncOpenAPIResourceWithStreamingResponse,
1514
)
1615
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
17-
from ..._utils import (
18-
maybe_transform,
19-
async_maybe_transform,
20-
)
2116
from ..._compat import cached_property
2217
from ..._resource import SyncAPIResource, AsyncAPIResource
2318
from ..._response import (
@@ -39,7 +34,6 @@
3934
)
4035
from ...types.function_list import FunctionList
4136
from .invocations.invocations import InvocationsResource, AsyncInvocationsResource
42-
from ...types.shared.function_invocation_detail import FunctionInvocationDetail
4337

4438
__all__ = ["FunctionsResource", "AsyncFunctionsResource"]
4539

@@ -80,105 +74,6 @@ def list(
8074
cast_to=FunctionList,
8175
)
8276

83-
def invoke_async(
84-
self,
85-
function_name: str,
86-
*,
87-
project_name: str,
88-
request: object,
89-
runloop_meta: function_invoke_async_params.RunloopMeta | NotGiven = NOT_GIVEN,
90-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
91-
# The extra values given here take precedence over values defined on the client or passed to this method.
92-
extra_headers: Headers | None = None,
93-
extra_query: Query | None = None,
94-
extra_body: Body | None = None,
95-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
96-
) -> FunctionInvocationDetail:
97-
"""Invoke the remote function asynchronously.
98-
99-
This will return a job id that can be
100-
used to query the status of the function invocation.
101-
102-
Args:
103-
request: Json of the request
104-
105-
extra_headers: Send extra headers
106-
107-
extra_query: Add additional query parameters to the request
108-
109-
extra_body: Add additional JSON properties to the request
110-
111-
timeout: Override the client-level default timeout for this request, in seconds
112-
"""
113-
if not project_name:
114-
raise ValueError(f"Expected a non-empty value for `project_name` but received {project_name!r}")
115-
if not function_name:
116-
raise ValueError(f"Expected a non-empty value for `function_name` but received {function_name!r}")
117-
return self._post(
118-
f"/v1/functions/{project_name}/{function_name}/invoke_async",
119-
body=maybe_transform(
120-
{
121-
"request": request,
122-
"runloop_meta": runloop_meta,
123-
},
124-
function_invoke_async_params.FunctionInvokeAsyncParams,
125-
),
126-
options=make_request_options(
127-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
128-
),
129-
cast_to=FunctionInvocationDetail,
130-
)
131-
132-
def invoke_sync(
133-
self,
134-
function_name: str,
135-
*,
136-
project_name: str,
137-
request: object,
138-
runloop_meta: function_invoke_sync_params.RunloopMeta | NotGiven = NOT_GIVEN,
139-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
140-
# The extra values given here take precedence over values defined on the client or passed to this method.
141-
extra_headers: Headers | None = None,
142-
extra_query: Query | None = None,
143-
extra_body: Body | None = None,
144-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
145-
) -> FunctionInvocationDetail:
146-
"""Invoke the remote function synchronously.
147-
148-
This will block until the function
149-
completes and return the result. If the function call takes too long, the
150-
request will timeout.
151-
152-
Args:
153-
request: Json of the request
154-
155-
extra_headers: Send extra headers
156-
157-
extra_query: Add additional query parameters to the request
158-
159-
extra_body: Add additional JSON properties to the request
160-
161-
timeout: Override the client-level default timeout for this request, in seconds
162-
"""
163-
if not project_name:
164-
raise ValueError(f"Expected a non-empty value for `project_name` but received {project_name!r}")
165-
if not function_name:
166-
raise ValueError(f"Expected a non-empty value for `function_name` but received {function_name!r}")
167-
return self._post(
168-
f"/v1/functions/{project_name}/{function_name}/invoke_sync",
169-
body=maybe_transform(
170-
{
171-
"request": request,
172-
"runloop_meta": runloop_meta,
173-
},
174-
function_invoke_sync_params.FunctionInvokeSyncParams,
175-
),
176-
options=make_request_options(
177-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
178-
),
179-
cast_to=FunctionInvocationDetail,
180-
)
181-
18277

18378
class AsyncFunctionsResource(AsyncAPIResource):
18479
@cached_property
@@ -216,105 +111,6 @@ async def list(
216111
cast_to=FunctionList,
217112
)
218113

219-
async def invoke_async(
220-
self,
221-
function_name: str,
222-
*,
223-
project_name: str,
224-
request: object,
225-
runloop_meta: function_invoke_async_params.RunloopMeta | NotGiven = NOT_GIVEN,
226-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
227-
# The extra values given here take precedence over values defined on the client or passed to this method.
228-
extra_headers: Headers | None = None,
229-
extra_query: Query | None = None,
230-
extra_body: Body | None = None,
231-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
232-
) -> FunctionInvocationDetail:
233-
"""Invoke the remote function asynchronously.
234-
235-
This will return a job id that can be
236-
used to query the status of the function invocation.
237-
238-
Args:
239-
request: Json of the request
240-
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 project_name:
250-
raise ValueError(f"Expected a non-empty value for `project_name` but received {project_name!r}")
251-
if not function_name:
252-
raise ValueError(f"Expected a non-empty value for `function_name` but received {function_name!r}")
253-
return await self._post(
254-
f"/v1/functions/{project_name}/{function_name}/invoke_async",
255-
body=await async_maybe_transform(
256-
{
257-
"request": request,
258-
"runloop_meta": runloop_meta,
259-
},
260-
function_invoke_async_params.FunctionInvokeAsyncParams,
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=FunctionInvocationDetail,
266-
)
267-
268-
async def invoke_sync(
269-
self,
270-
function_name: str,
271-
*,
272-
project_name: str,
273-
request: object,
274-
runloop_meta: function_invoke_sync_params.RunloopMeta | NotGiven = NOT_GIVEN,
275-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
276-
# The extra values given here take precedence over values defined on the client or passed to this method.
277-
extra_headers: Headers | None = None,
278-
extra_query: Query | None = None,
279-
extra_body: Body | None = None,
280-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
281-
) -> FunctionInvocationDetail:
282-
"""Invoke the remote function synchronously.
283-
284-
This will block until the function
285-
completes and return the result. If the function call takes too long, the
286-
request will timeout.
287-
288-
Args:
289-
request: Json of the request
290-
291-
extra_headers: Send extra headers
292-
293-
extra_query: Add additional query parameters to the request
294-
295-
extra_body: Add additional JSON properties to the request
296-
297-
timeout: Override the client-level default timeout for this request, in seconds
298-
"""
299-
if not project_name:
300-
raise ValueError(f"Expected a non-empty value for `project_name` but received {project_name!r}")
301-
if not function_name:
302-
raise ValueError(f"Expected a non-empty value for `function_name` but received {function_name!r}")
303-
return await self._post(
304-
f"/v1/functions/{project_name}/{function_name}/invoke_sync",
305-
body=await async_maybe_transform(
306-
{
307-
"request": request,
308-
"runloop_meta": runloop_meta,
309-
},
310-
function_invoke_sync_params.FunctionInvokeSyncParams,
311-
),
312-
options=make_request_options(
313-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
314-
),
315-
cast_to=FunctionInvocationDetail,
316-
)
317-
318114

319115
class FunctionsResourceWithRawResponse:
320116
def __init__(self, functions: FunctionsResource) -> None:
@@ -323,12 +119,6 @@ def __init__(self, functions: FunctionsResource) -> None:
323119
self.list = to_raw_response_wrapper(
324120
functions.list,
325121
)
326-
self.invoke_async = to_raw_response_wrapper(
327-
functions.invoke_async,
328-
)
329-
self.invoke_sync = to_raw_response_wrapper(
330-
functions.invoke_sync,
331-
)
332122

333123
@cached_property
334124
def invocations(self) -> InvocationsResourceWithRawResponse:
@@ -346,12 +136,6 @@ def __init__(self, functions: AsyncFunctionsResource) -> None:
346136
self.list = async_to_raw_response_wrapper(
347137
functions.list,
348138
)
349-
self.invoke_async = async_to_raw_response_wrapper(
350-
functions.invoke_async,
351-
)
352-
self.invoke_sync = async_to_raw_response_wrapper(
353-
functions.invoke_sync,
354-
)
355139

356140
@cached_property
357141
def invocations(self) -> AsyncInvocationsResourceWithRawResponse:
@@ -369,12 +153,6 @@ def __init__(self, functions: FunctionsResource) -> None:
369153
self.list = to_streamed_response_wrapper(
370154
functions.list,
371155
)
372-
self.invoke_async = to_streamed_response_wrapper(
373-
functions.invoke_async,
374-
)
375-
self.invoke_sync = to_streamed_response_wrapper(
376-
functions.invoke_sync,
377-
)
378156

379157
@cached_property
380158
def invocations(self) -> InvocationsResourceWithStreamingResponse:
@@ -392,12 +170,6 @@ def __init__(self, functions: AsyncFunctionsResource) -> None:
392170
self.list = async_to_streamed_response_wrapper(
393171
functions.list,
394172
)
395-
self.invoke_async = async_to_streamed_response_wrapper(
396-
functions.invoke_async,
397-
)
398-
self.invoke_sync = async_to_streamed_response_wrapper(
399-
functions.invoke_sync,
400-
)
401173

402174
@cached_property
403175
def invocations(self) -> AsyncInvocationsResourceWithStreamingResponse:

src/runloop/resources/sessions/sessions/__init__.py

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

3-
from .kv import (
4-
KvResource,
5-
AsyncKvResource,
6-
KvResourceWithRawResponse,
7-
AsyncKvResourceWithRawResponse,
8-
KvResourceWithStreamingResponse,
9-
AsyncKvResourceWithStreamingResponse,
10-
)
113
from .sessions import (
124
SessionsResource,
135
AsyncSessionsResource,
@@ -18,12 +10,6 @@
1810
)
1911

2012
__all__ = [
21-
"KvResource",
22-
"AsyncKvResource",
23-
"KvResourceWithRawResponse",
24-
"AsyncKvResourceWithRawResponse",
25-
"KvResourceWithStreamingResponse",
26-
"AsyncKvResourceWithStreamingResponse",
2713
"SessionsResource",
2814
"AsyncSessionsResource",
2915
"SessionsResourceWithRawResponse",

0 commit comments

Comments
 (0)