runloop-api-client 0.1.0a3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. runloop_api_client-0.1.0a3.dist-info/METADATA +334 -0
  2. runloop_api_client-0.1.0a3.dist-info/RECORD +61 -0
  3. runloop_api_client-0.1.0a3.dist-info/WHEEL +4 -0
  4. runloop_api_client-0.1.0a3.dist-info/licenses/LICENSE +7 -0
  5. runloop_minus_api_minus_client/__init__.py +83 -0
  6. runloop_minus_api_minus_client/_base_client.py +2006 -0
  7. runloop_minus_api_minus_client/_client.py +422 -0
  8. runloop_minus_api_minus_client/_compat.py +222 -0
  9. runloop_minus_api_minus_client/_constants.py +14 -0
  10. runloop_minus_api_minus_client/_exceptions.py +108 -0
  11. runloop_minus_api_minus_client/_files.py +127 -0
  12. runloop_minus_api_minus_client/_models.py +739 -0
  13. runloop_minus_api_minus_client/_qs.py +150 -0
  14. runloop_minus_api_minus_client/_resource.py +43 -0
  15. runloop_minus_api_minus_client/_response.py +822 -0
  16. runloop_minus_api_minus_client/_streaming.py +333 -0
  17. runloop_minus_api_minus_client/_types.py +220 -0
  18. runloop_minus_api_minus_client/_utils/__init__.py +52 -0
  19. runloop_minus_api_minus_client/_utils/_logs.py +25 -0
  20. runloop_minus_api_minus_client/_utils/_proxy.py +63 -0
  21. runloop_minus_api_minus_client/_utils/_reflection.py +8 -0
  22. runloop_minus_api_minus_client/_utils/_streams.py +12 -0
  23. runloop_minus_api_minus_client/_utils/_sync.py +81 -0
  24. runloop_minus_api_minus_client/_utils/_transform.py +382 -0
  25. runloop_minus_api_minus_client/_utils/_typing.py +120 -0
  26. runloop_minus_api_minus_client/_utils/_utils.py +402 -0
  27. runloop_minus_api_minus_client/_version.py +4 -0
  28. runloop_minus_api_minus_client/lib/.keep +4 -0
  29. runloop_minus_api_minus_client/py.typed +0 -0
  30. runloop_minus_api_minus_client/resources/__init__.py +47 -0
  31. runloop_minus_api_minus_client/resources/devboxes/__init__.py +33 -0
  32. runloop_minus_api_minus_client/resources/devboxes/devboxes.py +560 -0
  33. runloop_minus_api_minus_client/resources/devboxes/logs.py +143 -0
  34. runloop_minus_api_minus_client/resources/functions/__init__.py +33 -0
  35. runloop_minus_api_minus_client/resources/functions/functions.py +376 -0
  36. runloop_minus_api_minus_client/resources/functions/invocations/__init__.py +33 -0
  37. runloop_minus_api_minus_client/resources/functions/invocations/invocations.py +310 -0
  38. runloop_minus_api_minus_client/resources/functions/invocations/spans.py +147 -0
  39. runloop_minus_api_minus_client/resources/projects/__init__.py +33 -0
  40. runloop_minus_api_minus_client/resources/projects/logs.py +143 -0
  41. runloop_minus_api_minus_client/resources/projects/projects.py +155 -0
  42. runloop_minus_api_minus_client/types/__init__.py +14 -0
  43. runloop_minus_api_minus_client/types/devbox_create_params.py +30 -0
  44. runloop_minus_api_minus_client/types/devbox_execution_detail_view.py +21 -0
  45. runloop_minus_api_minus_client/types/devbox_list_params.py +12 -0
  46. runloop_minus_api_minus_client/types/devbox_list_view.py +13 -0
  47. runloop_minus_api_minus_client/types/devbox_view.py +21 -0
  48. runloop_minus_api_minus_client/types/devboxes/__init__.py +5 -0
  49. runloop_minus_api_minus_client/types/devboxes/devbox_logs_list_view.py +23 -0
  50. runloop_minus_api_minus_client/types/function_invoke_async_params.py +23 -0
  51. runloop_minus_api_minus_client/types/function_invoke_sync_params.py +23 -0
  52. runloop_minus_api_minus_client/types/function_list_view.py +20 -0
  53. runloop_minus_api_minus_client/types/functions/__init__.py +5 -0
  54. runloop_minus_api_minus_client/types/functions/function_invocation_list_view.py +26 -0
  55. runloop_minus_api_minus_client/types/functions/invocations/__init__.py +5 -0
  56. runloop_minus_api_minus_client/types/functions/invocations/invocation_span_list_view.py +16 -0
  57. runloop_minus_api_minus_client/types/project_list_view.py +149 -0
  58. runloop_minus_api_minus_client/types/projects/__init__.py +3 -0
  59. runloop_minus_api_minus_client/types/shared/__init__.py +4 -0
  60. runloop_minus_api_minus_client/types/shared/function_invocation_detail_view.py +25 -0
  61. runloop_minus_api_minus_client/types/shared/project_logs_view.py +22 -0
@@ -0,0 +1,33 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from .functions import (
4
+ FunctionsResource,
5
+ AsyncFunctionsResource,
6
+ FunctionsResourceWithRawResponse,
7
+ AsyncFunctionsResourceWithRawResponse,
8
+ FunctionsResourceWithStreamingResponse,
9
+ AsyncFunctionsResourceWithStreamingResponse,
10
+ )
11
+ from .invocations import (
12
+ InvocationsResource,
13
+ AsyncInvocationsResource,
14
+ InvocationsResourceWithRawResponse,
15
+ AsyncInvocationsResourceWithRawResponse,
16
+ InvocationsResourceWithStreamingResponse,
17
+ AsyncInvocationsResourceWithStreamingResponse,
18
+ )
19
+
20
+ __all__ = [
21
+ "InvocationsResource",
22
+ "AsyncInvocationsResource",
23
+ "InvocationsResourceWithRawResponse",
24
+ "AsyncInvocationsResourceWithRawResponse",
25
+ "InvocationsResourceWithStreamingResponse",
26
+ "AsyncInvocationsResourceWithStreamingResponse",
27
+ "FunctionsResource",
28
+ "AsyncFunctionsResource",
29
+ "FunctionsResourceWithRawResponse",
30
+ "AsyncFunctionsResourceWithRawResponse",
31
+ "FunctionsResourceWithStreamingResponse",
32
+ "AsyncFunctionsResourceWithStreamingResponse",
33
+ ]
@@ -0,0 +1,376 @@
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 function_invoke_sync_params, function_invoke_async_params
8
+ from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
9
+ from ..._utils import (
10
+ maybe_transform,
11
+ async_maybe_transform,
12
+ )
13
+ from ..._compat import cached_property
14
+ from ..._resource import SyncAPIResource, AsyncAPIResource
15
+ from ..._response import (
16
+ to_raw_response_wrapper,
17
+ to_streamed_response_wrapper,
18
+ async_to_raw_response_wrapper,
19
+ async_to_streamed_response_wrapper,
20
+ )
21
+ from .invocations import (
22
+ InvocationsResource,
23
+ AsyncInvocationsResource,
24
+ InvocationsResourceWithRawResponse,
25
+ AsyncInvocationsResourceWithRawResponse,
26
+ InvocationsResourceWithStreamingResponse,
27
+ AsyncInvocationsResourceWithStreamingResponse,
28
+ )
29
+ from ..._base_client import (
30
+ make_request_options,
31
+ )
32
+ from .invocations.invocations import InvocationsResource, AsyncInvocationsResource
33
+ from ...types.function_list_view import FunctionListView
34
+ from ...types.shared.function_invocation_detail_view import FunctionInvocationDetailView
35
+
36
+ __all__ = ["FunctionsResource", "AsyncFunctionsResource"]
37
+
38
+
39
+ class FunctionsResource(SyncAPIResource):
40
+ @cached_property
41
+ def invocations(self) -> InvocationsResource:
42
+ return InvocationsResource(self._client)
43
+
44
+ @cached_property
45
+ def with_raw_response(self) -> FunctionsResourceWithRawResponse:
46
+ return FunctionsResourceWithRawResponse(self)
47
+
48
+ @cached_property
49
+ def with_streaming_response(self) -> FunctionsResourceWithStreamingResponse:
50
+ return FunctionsResourceWithStreamingResponse(self)
51
+
52
+ def list(
53
+ self,
54
+ *,
55
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
56
+ # The extra values given here take precedence over values defined on the client or passed to this method.
57
+ extra_headers: Headers | None = None,
58
+ extra_query: Query | None = None,
59
+ extra_body: Body | None = None,
60
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
61
+ ) -> FunctionListView:
62
+ """List the functions that are available for invocation."""
63
+ return self._get(
64
+ "/v1/functions",
65
+ options=make_request_options(
66
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
67
+ ),
68
+ cast_to=FunctionListView,
69
+ )
70
+
71
+ def invoke_async(
72
+ self,
73
+ function_name: str,
74
+ *,
75
+ project_name: str,
76
+ request: object,
77
+ runloop_meta: function_invoke_async_params.RunloopMeta | NotGiven = NOT_GIVEN,
78
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
79
+ # The extra values given here take precedence over values defined on the client or passed to this method.
80
+ extra_headers: Headers | None = None,
81
+ extra_query: Query | None = None,
82
+ extra_body: Body | None = None,
83
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
84
+ ) -> FunctionInvocationDetailView:
85
+ """Invoke the remote function asynchronously.
86
+
87
+ This will return a job id that can be
88
+ used to query the status of the function invocation.
89
+
90
+ Args:
91
+ request: Json of the request
92
+
93
+ extra_headers: Send extra headers
94
+
95
+ extra_query: Add additional query parameters to the request
96
+
97
+ extra_body: Add additional JSON properties to the request
98
+
99
+ timeout: Override the client-level default timeout for this request, in seconds
100
+ """
101
+ if not project_name:
102
+ raise ValueError(f"Expected a non-empty value for `project_name` but received {project_name!r}")
103
+ if not function_name:
104
+ raise ValueError(f"Expected a non-empty value for `function_name` but received {function_name!r}")
105
+ return self._post(
106
+ f"/v1/functions/{project_name}/{function_name}/invoke_async",
107
+ body=maybe_transform(
108
+ {
109
+ "request": request,
110
+ "runloop_meta": runloop_meta,
111
+ },
112
+ function_invoke_async_params.FunctionInvokeAsyncParams,
113
+ ),
114
+ options=make_request_options(
115
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
116
+ ),
117
+ cast_to=FunctionInvocationDetailView,
118
+ )
119
+
120
+ def invoke_sync(
121
+ self,
122
+ function_name: str,
123
+ *,
124
+ project_name: str,
125
+ request: object,
126
+ runloop_meta: function_invoke_sync_params.RunloopMeta | NotGiven = NOT_GIVEN,
127
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
128
+ # The extra values given here take precedence over values defined on the client or passed to this method.
129
+ extra_headers: Headers | None = None,
130
+ extra_query: Query | None = None,
131
+ extra_body: Body | None = None,
132
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
133
+ ) -> FunctionInvocationDetailView:
134
+ """Invoke the remote function synchronously.
135
+
136
+ This will block until the function
137
+ completes and return the result. If the function call takes too long, the
138
+ request will timeout.
139
+
140
+ Args:
141
+ request: Json of the request
142
+
143
+ extra_headers: Send extra headers
144
+
145
+ extra_query: Add additional query parameters to the request
146
+
147
+ extra_body: Add additional JSON properties to the request
148
+
149
+ timeout: Override the client-level default timeout for this request, in seconds
150
+ """
151
+ if not project_name:
152
+ raise ValueError(f"Expected a non-empty value for `project_name` but received {project_name!r}")
153
+ if not function_name:
154
+ raise ValueError(f"Expected a non-empty value for `function_name` but received {function_name!r}")
155
+ return self._post(
156
+ f"/v1/functions/{project_name}/{function_name}/invoke_sync",
157
+ body=maybe_transform(
158
+ {
159
+ "request": request,
160
+ "runloop_meta": runloop_meta,
161
+ },
162
+ function_invoke_sync_params.FunctionInvokeSyncParams,
163
+ ),
164
+ options=make_request_options(
165
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
166
+ ),
167
+ cast_to=FunctionInvocationDetailView,
168
+ )
169
+
170
+
171
+ class AsyncFunctionsResource(AsyncAPIResource):
172
+ @cached_property
173
+ def invocations(self) -> AsyncInvocationsResource:
174
+ return AsyncInvocationsResource(self._client)
175
+
176
+ @cached_property
177
+ def with_raw_response(self) -> AsyncFunctionsResourceWithRawResponse:
178
+ return AsyncFunctionsResourceWithRawResponse(self)
179
+
180
+ @cached_property
181
+ def with_streaming_response(self) -> AsyncFunctionsResourceWithStreamingResponse:
182
+ return AsyncFunctionsResourceWithStreamingResponse(self)
183
+
184
+ async def list(
185
+ self,
186
+ *,
187
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
188
+ # The extra values given here take precedence over values defined on the client or passed to this method.
189
+ extra_headers: Headers | None = None,
190
+ extra_query: Query | None = None,
191
+ extra_body: Body | None = None,
192
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
193
+ ) -> FunctionListView:
194
+ """List the functions that are available for invocation."""
195
+ return await self._get(
196
+ "/v1/functions",
197
+ options=make_request_options(
198
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
199
+ ),
200
+ cast_to=FunctionListView,
201
+ )
202
+
203
+ async def invoke_async(
204
+ self,
205
+ function_name: str,
206
+ *,
207
+ project_name: str,
208
+ request: object,
209
+ runloop_meta: function_invoke_async_params.RunloopMeta | NotGiven = NOT_GIVEN,
210
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
211
+ # The extra values given here take precedence over values defined on the client or passed to this method.
212
+ extra_headers: Headers | None = None,
213
+ extra_query: Query | None = None,
214
+ extra_body: Body | None = None,
215
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
216
+ ) -> FunctionInvocationDetailView:
217
+ """Invoke the remote function asynchronously.
218
+
219
+ This will return a job id that can be
220
+ used to query the status of the function invocation.
221
+
222
+ Args:
223
+ request: Json of the request
224
+
225
+ extra_headers: Send extra headers
226
+
227
+ extra_query: Add additional query parameters to the request
228
+
229
+ extra_body: Add additional JSON properties to the request
230
+
231
+ timeout: Override the client-level default timeout for this request, in seconds
232
+ """
233
+ if not project_name:
234
+ raise ValueError(f"Expected a non-empty value for `project_name` but received {project_name!r}")
235
+ if not function_name:
236
+ raise ValueError(f"Expected a non-empty value for `function_name` but received {function_name!r}")
237
+ return await self._post(
238
+ f"/v1/functions/{project_name}/{function_name}/invoke_async",
239
+ body=await async_maybe_transform(
240
+ {
241
+ "request": request,
242
+ "runloop_meta": runloop_meta,
243
+ },
244
+ function_invoke_async_params.FunctionInvokeAsyncParams,
245
+ ),
246
+ options=make_request_options(
247
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
248
+ ),
249
+ cast_to=FunctionInvocationDetailView,
250
+ )
251
+
252
+ async def invoke_sync(
253
+ self,
254
+ function_name: str,
255
+ *,
256
+ project_name: str,
257
+ request: object,
258
+ runloop_meta: function_invoke_sync_params.RunloopMeta | NotGiven = NOT_GIVEN,
259
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
260
+ # The extra values given here take precedence over values defined on the client or passed to this method.
261
+ extra_headers: Headers | None = None,
262
+ extra_query: Query | None = None,
263
+ extra_body: Body | None = None,
264
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
265
+ ) -> FunctionInvocationDetailView:
266
+ """Invoke the remote function synchronously.
267
+
268
+ This will block until the function
269
+ completes and return the result. If the function call takes too long, the
270
+ request will timeout.
271
+
272
+ Args:
273
+ request: Json of the request
274
+
275
+ extra_headers: Send extra headers
276
+
277
+ extra_query: Add additional query parameters to the request
278
+
279
+ extra_body: Add additional JSON properties to the request
280
+
281
+ timeout: Override the client-level default timeout for this request, in seconds
282
+ """
283
+ if not project_name:
284
+ raise ValueError(f"Expected a non-empty value for `project_name` but received {project_name!r}")
285
+ if not function_name:
286
+ raise ValueError(f"Expected a non-empty value for `function_name` but received {function_name!r}")
287
+ return await self._post(
288
+ f"/v1/functions/{project_name}/{function_name}/invoke_sync",
289
+ body=await async_maybe_transform(
290
+ {
291
+ "request": request,
292
+ "runloop_meta": runloop_meta,
293
+ },
294
+ function_invoke_sync_params.FunctionInvokeSyncParams,
295
+ ),
296
+ options=make_request_options(
297
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
298
+ ),
299
+ cast_to=FunctionInvocationDetailView,
300
+ )
301
+
302
+
303
+ class FunctionsResourceWithRawResponse:
304
+ def __init__(self, functions: FunctionsResource) -> None:
305
+ self._functions = functions
306
+
307
+ self.list = to_raw_response_wrapper(
308
+ functions.list,
309
+ )
310
+ self.invoke_async = to_raw_response_wrapper(
311
+ functions.invoke_async,
312
+ )
313
+ self.invoke_sync = to_raw_response_wrapper(
314
+ functions.invoke_sync,
315
+ )
316
+
317
+ @cached_property
318
+ def invocations(self) -> InvocationsResourceWithRawResponse:
319
+ return InvocationsResourceWithRawResponse(self._functions.invocations)
320
+
321
+
322
+ class AsyncFunctionsResourceWithRawResponse:
323
+ def __init__(self, functions: AsyncFunctionsResource) -> None:
324
+ self._functions = functions
325
+
326
+ self.list = async_to_raw_response_wrapper(
327
+ functions.list,
328
+ )
329
+ self.invoke_async = async_to_raw_response_wrapper(
330
+ functions.invoke_async,
331
+ )
332
+ self.invoke_sync = async_to_raw_response_wrapper(
333
+ functions.invoke_sync,
334
+ )
335
+
336
+ @cached_property
337
+ def invocations(self) -> AsyncInvocationsResourceWithRawResponse:
338
+ return AsyncInvocationsResourceWithRawResponse(self._functions.invocations)
339
+
340
+
341
+ class FunctionsResourceWithStreamingResponse:
342
+ def __init__(self, functions: FunctionsResource) -> None:
343
+ self._functions = functions
344
+
345
+ self.list = to_streamed_response_wrapper(
346
+ functions.list,
347
+ )
348
+ self.invoke_async = to_streamed_response_wrapper(
349
+ functions.invoke_async,
350
+ )
351
+ self.invoke_sync = to_streamed_response_wrapper(
352
+ functions.invoke_sync,
353
+ )
354
+
355
+ @cached_property
356
+ def invocations(self) -> InvocationsResourceWithStreamingResponse:
357
+ return InvocationsResourceWithStreamingResponse(self._functions.invocations)
358
+
359
+
360
+ class AsyncFunctionsResourceWithStreamingResponse:
361
+ def __init__(self, functions: AsyncFunctionsResource) -> None:
362
+ self._functions = functions
363
+
364
+ self.list = async_to_streamed_response_wrapper(
365
+ functions.list,
366
+ )
367
+ self.invoke_async = async_to_streamed_response_wrapper(
368
+ functions.invoke_async,
369
+ )
370
+ self.invoke_sync = async_to_streamed_response_wrapper(
371
+ functions.invoke_sync,
372
+ )
373
+
374
+ @cached_property
375
+ def invocations(self) -> AsyncInvocationsResourceWithStreamingResponse:
376
+ return AsyncInvocationsResourceWithStreamingResponse(self._functions.invocations)
@@ -0,0 +1,33 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from .spans import (
4
+ SpansResource,
5
+ AsyncSpansResource,
6
+ SpansResourceWithRawResponse,
7
+ AsyncSpansResourceWithRawResponse,
8
+ SpansResourceWithStreamingResponse,
9
+ AsyncSpansResourceWithStreamingResponse,
10
+ )
11
+ from .invocations import (
12
+ InvocationsResource,
13
+ AsyncInvocationsResource,
14
+ InvocationsResourceWithRawResponse,
15
+ AsyncInvocationsResourceWithRawResponse,
16
+ InvocationsResourceWithStreamingResponse,
17
+ AsyncInvocationsResourceWithStreamingResponse,
18
+ )
19
+
20
+ __all__ = [
21
+ "SpansResource",
22
+ "AsyncSpansResource",
23
+ "SpansResourceWithRawResponse",
24
+ "AsyncSpansResourceWithRawResponse",
25
+ "SpansResourceWithStreamingResponse",
26
+ "AsyncSpansResourceWithStreamingResponse",
27
+ "InvocationsResource",
28
+ "AsyncInvocationsResource",
29
+ "InvocationsResourceWithRawResponse",
30
+ "AsyncInvocationsResourceWithRawResponse",
31
+ "InvocationsResourceWithStreamingResponse",
32
+ "AsyncInvocationsResourceWithStreamingResponse",
33
+ ]