casedev 0.1.0__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 (185) hide show
  1. casedev/__init__.py +104 -0
  2. casedev/_base_client.py +1995 -0
  3. casedev/_client.py +560 -0
  4. casedev/_compat.py +219 -0
  5. casedev/_constants.py +14 -0
  6. casedev/_exceptions.py +108 -0
  7. casedev/_files.py +123 -0
  8. casedev/_models.py +857 -0
  9. casedev/_qs.py +150 -0
  10. casedev/_resource.py +43 -0
  11. casedev/_response.py +830 -0
  12. casedev/_streaming.py +333 -0
  13. casedev/_types.py +260 -0
  14. casedev/_utils/__init__.py +64 -0
  15. casedev/_utils/_compat.py +45 -0
  16. casedev/_utils/_datetime_parse.py +136 -0
  17. casedev/_utils/_logs.py +25 -0
  18. casedev/_utils/_proxy.py +65 -0
  19. casedev/_utils/_reflection.py +42 -0
  20. casedev/_utils/_resources_proxy.py +24 -0
  21. casedev/_utils/_streams.py +12 -0
  22. casedev/_utils/_sync.py +58 -0
  23. casedev/_utils/_transform.py +457 -0
  24. casedev/_utils/_typing.py +156 -0
  25. casedev/_utils/_utils.py +421 -0
  26. casedev/_version.py +4 -0
  27. casedev/lib/.keep +4 -0
  28. casedev/py.typed +0 -0
  29. casedev/resources/__init__.py +173 -0
  30. casedev/resources/actions/__init__.py +33 -0
  31. casedev/resources/actions/actions.py +102 -0
  32. casedev/resources/actions/v1.py +640 -0
  33. casedev/resources/compute/__init__.py +33 -0
  34. casedev/resources/compute/compute.py +102 -0
  35. casedev/resources/compute/v1/__init__.py +89 -0
  36. casedev/resources/compute/v1/environments.py +492 -0
  37. casedev/resources/compute/v1/functions.py +278 -0
  38. casedev/resources/compute/v1/invoke.py +216 -0
  39. casedev/resources/compute/v1/runs.py +290 -0
  40. casedev/resources/compute/v1/secrets.py +655 -0
  41. casedev/resources/compute/v1/v1.py +583 -0
  42. casedev/resources/convert/__init__.py +33 -0
  43. casedev/resources/convert/convert.py +102 -0
  44. casedev/resources/convert/v1/__init__.py +33 -0
  45. casedev/resources/convert/v1/jobs.py +254 -0
  46. casedev/resources/convert/v1/v1.py +450 -0
  47. casedev/resources/format/__init__.py +33 -0
  48. casedev/resources/format/format.py +102 -0
  49. casedev/resources/format/v1/__init__.py +33 -0
  50. casedev/resources/format/v1/templates.py +419 -0
  51. casedev/resources/format/v1/v1.py +244 -0
  52. casedev/resources/llm/__init__.py +33 -0
  53. casedev/resources/llm/llm.py +192 -0
  54. casedev/resources/llm/v1/__init__.py +33 -0
  55. casedev/resources/llm/v1/chat.py +243 -0
  56. casedev/resources/llm/v1/v1.py +317 -0
  57. casedev/resources/ocr/__init__.py +33 -0
  58. casedev/resources/ocr/ocr.py +102 -0
  59. casedev/resources/ocr/v1.py +407 -0
  60. casedev/resources/search/__init__.py +33 -0
  61. casedev/resources/search/search.py +102 -0
  62. casedev/resources/search/v1.py +1052 -0
  63. casedev/resources/templates/__init__.py +33 -0
  64. casedev/resources/templates/templates.py +102 -0
  65. casedev/resources/templates/v1.py +633 -0
  66. casedev/resources/vault/__init__.py +47 -0
  67. casedev/resources/vault/graphrag.py +256 -0
  68. casedev/resources/vault/objects.py +571 -0
  69. casedev/resources/vault/vault.py +764 -0
  70. casedev/resources/voice/__init__.py +61 -0
  71. casedev/resources/voice/streaming.py +160 -0
  72. casedev/resources/voice/transcription.py +327 -0
  73. casedev/resources/voice/v1/__init__.py +33 -0
  74. casedev/resources/voice/v1/speak.py +478 -0
  75. casedev/resources/voice/v1/v1.py +290 -0
  76. casedev/resources/voice/voice.py +166 -0
  77. casedev/resources/webhooks/__init__.py +33 -0
  78. casedev/resources/webhooks/v1.py +447 -0
  79. casedev/resources/webhooks/webhooks.py +102 -0
  80. casedev/resources/workflows/__init__.py +33 -0
  81. casedev/resources/workflows/v1.py +1053 -0
  82. casedev/resources/workflows/workflows.py +102 -0
  83. casedev/types/__init__.py +12 -0
  84. casedev/types/actions/__init__.py +8 -0
  85. casedev/types/actions/v1_create_params.py +22 -0
  86. casedev/types/actions/v1_create_response.py +33 -0
  87. casedev/types/actions/v1_execute_params.py +16 -0
  88. casedev/types/actions/v1_execute_response.py +31 -0
  89. casedev/types/compute/__init__.py +7 -0
  90. casedev/types/compute/v1/__init__.py +18 -0
  91. casedev/types/compute/v1/environment_create_params.py +12 -0
  92. casedev/types/compute/v1/environment_create_response.py +34 -0
  93. casedev/types/compute/v1/environment_delete_response.py +11 -0
  94. casedev/types/compute/v1/function_get_logs_params.py +12 -0
  95. casedev/types/compute/v1/function_list_params.py +12 -0
  96. casedev/types/compute/v1/invoke_run_params.py +21 -0
  97. casedev/types/compute/v1/invoke_run_response.py +39 -0
  98. casedev/types/compute/v1/run_list_params.py +18 -0
  99. casedev/types/compute/v1/secret_create_params.py +24 -0
  100. casedev/types/compute/v1/secret_create_response.py +24 -0
  101. casedev/types/compute/v1/secret_delete_group_params.py +18 -0
  102. casedev/types/compute/v1/secret_list_params.py +15 -0
  103. casedev/types/compute/v1/secret_retrieve_group_params.py +12 -0
  104. casedev/types/compute/v1/secret_update_group_params.py +16 -0
  105. casedev/types/compute/v1_deploy_params.py +114 -0
  106. casedev/types/compute/v1_deploy_response.py +30 -0
  107. casedev/types/compute/v1_get_usage_params.py +15 -0
  108. casedev/types/convert/__init__.py +8 -0
  109. casedev/types/convert/v1/__init__.py +3 -0
  110. casedev/types/convert/v1_process_params.py +15 -0
  111. casedev/types/convert/v1_process_response.py +19 -0
  112. casedev/types/convert/v1_webhook_params.py +32 -0
  113. casedev/types/convert/v1_webhook_response.py +13 -0
  114. casedev/types/format/__init__.py +5 -0
  115. casedev/types/format/v1/__init__.py +7 -0
  116. casedev/types/format/v1/template_create_params.py +32 -0
  117. casedev/types/format/v1/template_create_response.py +27 -0
  118. casedev/types/format/v1/template_list_params.py +12 -0
  119. casedev/types/format/v1_create_document_params.py +42 -0
  120. casedev/types/llm/__init__.py +5 -0
  121. casedev/types/llm/v1/__init__.py +6 -0
  122. casedev/types/llm/v1/chat_create_completion_params.py +42 -0
  123. casedev/types/llm/v1/chat_create_completion_response.py +49 -0
  124. casedev/types/llm/v1_create_embedding_params.py +27 -0
  125. casedev/types/ocr/__init__.py +6 -0
  126. casedev/types/ocr/v1_process_params.py +44 -0
  127. casedev/types/ocr/v1_process_response.py +32 -0
  128. casedev/types/search/__init__.py +15 -0
  129. casedev/types/search/v1_answer_params.py +45 -0
  130. casedev/types/search/v1_answer_response.py +35 -0
  131. casedev/types/search/v1_contents_params.py +42 -0
  132. casedev/types/search/v1_contents_response.py +31 -0
  133. casedev/types/search/v1_research_params.py +23 -0
  134. casedev/types/search/v1_research_response.py +20 -0
  135. casedev/types/search/v1_retrieve_research_params.py +15 -0
  136. casedev/types/search/v1_search_params.py +56 -0
  137. casedev/types/search/v1_search_response.py +38 -0
  138. casedev/types/search/v1_similar_params.py +44 -0
  139. casedev/types/search/v1_similar_response.py +33 -0
  140. casedev/types/templates/__init__.py +8 -0
  141. casedev/types/templates/v1_execute_params.py +22 -0
  142. casedev/types/templates/v1_execute_response.py +31 -0
  143. casedev/types/templates/v1_list_params.py +32 -0
  144. casedev/types/templates/v1_search_params.py +18 -0
  145. casedev/types/vault/__init__.py +6 -0
  146. casedev/types/vault/object_create_presigned_url_params.py +22 -0
  147. casedev/types/vault/object_create_presigned_url_response.py +51 -0
  148. casedev/types/vault_create_params.py +20 -0
  149. casedev/types/vault_create_response.py +36 -0
  150. casedev/types/vault_ingest_response.py +26 -0
  151. casedev/types/vault_list_response.py +40 -0
  152. casedev/types/vault_search_params.py +27 -0
  153. casedev/types/vault_search_response.py +53 -0
  154. casedev/types/vault_upload_params.py +26 -0
  155. casedev/types/vault_upload_response.py +39 -0
  156. casedev/types/voice/__init__.py +7 -0
  157. casedev/types/voice/transcription_create_params.py +36 -0
  158. casedev/types/voice/transcription_retrieve_response.py +41 -0
  159. casedev/types/voice/v1/__init__.py +6 -0
  160. casedev/types/voice/v1/speak_create_params.py +59 -0
  161. casedev/types/voice/v1/speak_stream_params.py +58 -0
  162. casedev/types/voice/v1_list_voices_params.py +36 -0
  163. casedev/types/webhooks/__init__.py +6 -0
  164. casedev/types/webhooks/v1_create_params.py +20 -0
  165. casedev/types/webhooks/v1_create_response.py +33 -0
  166. casedev/types/workflows/__init__.py +19 -0
  167. casedev/types/workflows/v1_create_params.py +32 -0
  168. casedev/types/workflows/v1_create_response.py +29 -0
  169. casedev/types/workflows/v1_delete_response.py +13 -0
  170. casedev/types/workflows/v1_deploy_response.py +20 -0
  171. casedev/types/workflows/v1_execute_params.py +12 -0
  172. casedev/types/workflows/v1_execute_response.py +22 -0
  173. casedev/types/workflows/v1_list_executions_params.py +13 -0
  174. casedev/types/workflows/v1_list_executions_response.py +27 -0
  175. casedev/types/workflows/v1_list_params.py +18 -0
  176. casedev/types/workflows/v1_list_response.py +37 -0
  177. casedev/types/workflows/v1_retrieve_execution_response.py +31 -0
  178. casedev/types/workflows/v1_retrieve_response.py +35 -0
  179. casedev/types/workflows/v1_undeploy_response.py +13 -0
  180. casedev/types/workflows/v1_update_params.py +26 -0
  181. casedev/types/workflows/v1_update_response.py +17 -0
  182. casedev-0.1.0.dist-info/METADATA +454 -0
  183. casedev-0.1.0.dist-info/RECORD +185 -0
  184. casedev-0.1.0.dist-info/WHEEL +4 -0
  185. casedev-0.1.0.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,583 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing_extensions import Literal
6
+
7
+ import httpx
8
+
9
+ from .runs import (
10
+ RunsResource,
11
+ AsyncRunsResource,
12
+ RunsResourceWithRawResponse,
13
+ AsyncRunsResourceWithRawResponse,
14
+ RunsResourceWithStreamingResponse,
15
+ AsyncRunsResourceWithStreamingResponse,
16
+ )
17
+ from .invoke import (
18
+ InvokeResource,
19
+ AsyncInvokeResource,
20
+ InvokeResourceWithRawResponse,
21
+ AsyncInvokeResourceWithRawResponse,
22
+ InvokeResourceWithStreamingResponse,
23
+ AsyncInvokeResourceWithStreamingResponse,
24
+ )
25
+ from .secrets import (
26
+ SecretsResource,
27
+ AsyncSecretsResource,
28
+ SecretsResourceWithRawResponse,
29
+ AsyncSecretsResourceWithRawResponse,
30
+ SecretsResourceWithStreamingResponse,
31
+ AsyncSecretsResourceWithStreamingResponse,
32
+ )
33
+ from ...._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given
34
+ from ...._utils import maybe_transform, async_maybe_transform
35
+ from .functions import (
36
+ FunctionsResource,
37
+ AsyncFunctionsResource,
38
+ FunctionsResourceWithRawResponse,
39
+ AsyncFunctionsResourceWithRawResponse,
40
+ FunctionsResourceWithStreamingResponse,
41
+ AsyncFunctionsResourceWithStreamingResponse,
42
+ )
43
+ from ...._compat import cached_property
44
+ from ...._resource import SyncAPIResource, AsyncAPIResource
45
+ from ...._response import (
46
+ to_raw_response_wrapper,
47
+ to_streamed_response_wrapper,
48
+ async_to_raw_response_wrapper,
49
+ async_to_streamed_response_wrapper,
50
+ )
51
+ from .environments import (
52
+ EnvironmentsResource,
53
+ AsyncEnvironmentsResource,
54
+ EnvironmentsResourceWithRawResponse,
55
+ AsyncEnvironmentsResourceWithRawResponse,
56
+ EnvironmentsResourceWithStreamingResponse,
57
+ AsyncEnvironmentsResourceWithStreamingResponse,
58
+ )
59
+ from ...._base_client import make_request_options
60
+ from ....types.compute import v1_deploy_params, v1_get_usage_params
61
+ from ....types.compute.v1_deploy_response import V1DeployResponse
62
+
63
+ __all__ = ["V1Resource", "AsyncV1Resource"]
64
+
65
+
66
+ class V1Resource(SyncAPIResource):
67
+ @cached_property
68
+ def environments(self) -> EnvironmentsResource:
69
+ return EnvironmentsResource(self._client)
70
+
71
+ @cached_property
72
+ def functions(self) -> FunctionsResource:
73
+ return FunctionsResource(self._client)
74
+
75
+ @cached_property
76
+ def invoke(self) -> InvokeResource:
77
+ return InvokeResource(self._client)
78
+
79
+ @cached_property
80
+ def runs(self) -> RunsResource:
81
+ return RunsResource(self._client)
82
+
83
+ @cached_property
84
+ def secrets(self) -> SecretsResource:
85
+ return SecretsResource(self._client)
86
+
87
+ @cached_property
88
+ def with_raw_response(self) -> V1ResourceWithRawResponse:
89
+ """
90
+ This property can be used as a prefix for any HTTP method call to return
91
+ the raw response object instead of the parsed content.
92
+
93
+ For more information, see https://www.github.com/CaseMark/casedev-python#accessing-raw-response-data-eg-headers
94
+ """
95
+ return V1ResourceWithRawResponse(self)
96
+
97
+ @cached_property
98
+ def with_streaming_response(self) -> V1ResourceWithStreamingResponse:
99
+ """
100
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
101
+
102
+ For more information, see https://www.github.com/CaseMark/casedev-python#with_streaming_response
103
+ """
104
+ return V1ResourceWithStreamingResponse(self)
105
+
106
+ def deploy(
107
+ self,
108
+ *,
109
+ entrypoint_name: str,
110
+ type: Literal["task", "service"],
111
+ code: str | Omit = omit,
112
+ config: v1_deploy_params.Config | Omit = omit,
113
+ dockerfile: str | Omit = omit,
114
+ entrypoint_file: str | Omit = omit,
115
+ environment: str | Omit = omit,
116
+ image: str | Omit = omit,
117
+ runtime: Literal["python", "dockerfile", "image"] | Omit = omit,
118
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
119
+ # The extra values given here take precedence over values defined on the client or passed to this method.
120
+ extra_headers: Headers | None = None,
121
+ extra_query: Query | None = None,
122
+ extra_body: Body | None = None,
123
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
124
+ ) -> V1DeployResponse:
125
+ """
126
+ Deploy code to Case.dev's serverless compute infrastructure powered by Modal.
127
+ Supports Python, Dockerfile, and container image runtimes with GPU acceleration
128
+ for AI/ML workloads. Code is deployed as tasks (batch jobs) or services (web
129
+ endpoints) with automatic scaling.
130
+
131
+ Args:
132
+ entrypoint_name: Function/app name (used for domain: hello → hello.org.case.systems)
133
+
134
+ type: Deployment type: task for batch jobs, service for web endpoints
135
+
136
+ code: Python code (required for python runtime)
137
+
138
+ config: Runtime and resource configuration
139
+
140
+ dockerfile: Dockerfile content (required for dockerfile runtime)
141
+
142
+ entrypoint_file: Python entrypoint file name
143
+
144
+ environment: Environment name (uses default if not specified)
145
+
146
+ image: Container image name (required for image runtime, e.g.,
147
+ 'nvidia/cuda:12.8.1-devel-ubuntu22.04')
148
+
149
+ runtime: Runtime environment
150
+
151
+ extra_headers: Send extra headers
152
+
153
+ extra_query: Add additional query parameters to the request
154
+
155
+ extra_body: Add additional JSON properties to the request
156
+
157
+ timeout: Override the client-level default timeout for this request, in seconds
158
+ """
159
+ return self._post(
160
+ "/compute/v1/deploy",
161
+ body=maybe_transform(
162
+ {
163
+ "entrypoint_name": entrypoint_name,
164
+ "type": type,
165
+ "code": code,
166
+ "config": config,
167
+ "dockerfile": dockerfile,
168
+ "entrypoint_file": entrypoint_file,
169
+ "environment": environment,
170
+ "image": image,
171
+ "runtime": runtime,
172
+ },
173
+ v1_deploy_params.V1DeployParams,
174
+ ),
175
+ options=make_request_options(
176
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
177
+ ),
178
+ cast_to=V1DeployResponse,
179
+ )
180
+
181
+ def get_pricing(
182
+ self,
183
+ *,
184
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
185
+ # The extra values given here take precedence over values defined on the client or passed to this method.
186
+ extra_headers: Headers | None = None,
187
+ extra_query: Query | None = None,
188
+ extra_body: Body | None = None,
189
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
190
+ ) -> None:
191
+ """Returns current pricing for GPU and CPU compute resources.
192
+
193
+ This public endpoint
194
+ provides detailed pricing information for all available compute types, including
195
+ GPU instances and CPU cores, with billing model details.
196
+ """
197
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
198
+ return self._get(
199
+ "/compute/v1/pricing",
200
+ options=make_request_options(
201
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
202
+ ),
203
+ cast_to=NoneType,
204
+ )
205
+
206
+ def get_usage(
207
+ self,
208
+ *,
209
+ month: int | Omit = omit,
210
+ year: int | Omit = omit,
211
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
212
+ # The extra values given here take precedence over values defined on the client or passed to this method.
213
+ extra_headers: Headers | None = None,
214
+ extra_query: Query | None = None,
215
+ extra_body: Body | None = None,
216
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
217
+ ) -> None:
218
+ """
219
+ Returns detailed compute usage statistics and billing information for your
220
+ organization. Includes GPU and CPU hours, total runs, costs, and breakdowns by
221
+ environment. Use optional query parameters to filter by specific year and month.
222
+
223
+ Args:
224
+ month: Month to filter usage data (1-12, defaults to current month)
225
+
226
+ year: Year to filter usage data (defaults to current year)
227
+
228
+ extra_headers: Send extra headers
229
+
230
+ extra_query: Add additional query parameters to the request
231
+
232
+ extra_body: Add additional JSON properties to the request
233
+
234
+ timeout: Override the client-level default timeout for this request, in seconds
235
+ """
236
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
237
+ return self._get(
238
+ "/compute/v1/usage",
239
+ options=make_request_options(
240
+ extra_headers=extra_headers,
241
+ extra_query=extra_query,
242
+ extra_body=extra_body,
243
+ timeout=timeout,
244
+ query=maybe_transform(
245
+ {
246
+ "month": month,
247
+ "year": year,
248
+ },
249
+ v1_get_usage_params.V1GetUsageParams,
250
+ ),
251
+ ),
252
+ cast_to=NoneType,
253
+ )
254
+
255
+
256
+ class AsyncV1Resource(AsyncAPIResource):
257
+ @cached_property
258
+ def environments(self) -> AsyncEnvironmentsResource:
259
+ return AsyncEnvironmentsResource(self._client)
260
+
261
+ @cached_property
262
+ def functions(self) -> AsyncFunctionsResource:
263
+ return AsyncFunctionsResource(self._client)
264
+
265
+ @cached_property
266
+ def invoke(self) -> AsyncInvokeResource:
267
+ return AsyncInvokeResource(self._client)
268
+
269
+ @cached_property
270
+ def runs(self) -> AsyncRunsResource:
271
+ return AsyncRunsResource(self._client)
272
+
273
+ @cached_property
274
+ def secrets(self) -> AsyncSecretsResource:
275
+ return AsyncSecretsResource(self._client)
276
+
277
+ @cached_property
278
+ def with_raw_response(self) -> AsyncV1ResourceWithRawResponse:
279
+ """
280
+ This property can be used as a prefix for any HTTP method call to return
281
+ the raw response object instead of the parsed content.
282
+
283
+ For more information, see https://www.github.com/CaseMark/casedev-python#accessing-raw-response-data-eg-headers
284
+ """
285
+ return AsyncV1ResourceWithRawResponse(self)
286
+
287
+ @cached_property
288
+ def with_streaming_response(self) -> AsyncV1ResourceWithStreamingResponse:
289
+ """
290
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
291
+
292
+ For more information, see https://www.github.com/CaseMark/casedev-python#with_streaming_response
293
+ """
294
+ return AsyncV1ResourceWithStreamingResponse(self)
295
+
296
+ async def deploy(
297
+ self,
298
+ *,
299
+ entrypoint_name: str,
300
+ type: Literal["task", "service"],
301
+ code: str | Omit = omit,
302
+ config: v1_deploy_params.Config | Omit = omit,
303
+ dockerfile: str | Omit = omit,
304
+ entrypoint_file: str | Omit = omit,
305
+ environment: str | Omit = omit,
306
+ image: str | Omit = omit,
307
+ runtime: Literal["python", "dockerfile", "image"] | Omit = omit,
308
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
309
+ # The extra values given here take precedence over values defined on the client or passed to this method.
310
+ extra_headers: Headers | None = None,
311
+ extra_query: Query | None = None,
312
+ extra_body: Body | None = None,
313
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
314
+ ) -> V1DeployResponse:
315
+ """
316
+ Deploy code to Case.dev's serverless compute infrastructure powered by Modal.
317
+ Supports Python, Dockerfile, and container image runtimes with GPU acceleration
318
+ for AI/ML workloads. Code is deployed as tasks (batch jobs) or services (web
319
+ endpoints) with automatic scaling.
320
+
321
+ Args:
322
+ entrypoint_name: Function/app name (used for domain: hello → hello.org.case.systems)
323
+
324
+ type: Deployment type: task for batch jobs, service for web endpoints
325
+
326
+ code: Python code (required for python runtime)
327
+
328
+ config: Runtime and resource configuration
329
+
330
+ dockerfile: Dockerfile content (required for dockerfile runtime)
331
+
332
+ entrypoint_file: Python entrypoint file name
333
+
334
+ environment: Environment name (uses default if not specified)
335
+
336
+ image: Container image name (required for image runtime, e.g.,
337
+ 'nvidia/cuda:12.8.1-devel-ubuntu22.04')
338
+
339
+ runtime: Runtime environment
340
+
341
+ extra_headers: Send extra headers
342
+
343
+ extra_query: Add additional query parameters to the request
344
+
345
+ extra_body: Add additional JSON properties to the request
346
+
347
+ timeout: Override the client-level default timeout for this request, in seconds
348
+ """
349
+ return await self._post(
350
+ "/compute/v1/deploy",
351
+ body=await async_maybe_transform(
352
+ {
353
+ "entrypoint_name": entrypoint_name,
354
+ "type": type,
355
+ "code": code,
356
+ "config": config,
357
+ "dockerfile": dockerfile,
358
+ "entrypoint_file": entrypoint_file,
359
+ "environment": environment,
360
+ "image": image,
361
+ "runtime": runtime,
362
+ },
363
+ v1_deploy_params.V1DeployParams,
364
+ ),
365
+ options=make_request_options(
366
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
367
+ ),
368
+ cast_to=V1DeployResponse,
369
+ )
370
+
371
+ async def get_pricing(
372
+ self,
373
+ *,
374
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
375
+ # The extra values given here take precedence over values defined on the client or passed to this method.
376
+ extra_headers: Headers | None = None,
377
+ extra_query: Query | None = None,
378
+ extra_body: Body | None = None,
379
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
380
+ ) -> None:
381
+ """Returns current pricing for GPU and CPU compute resources.
382
+
383
+ This public endpoint
384
+ provides detailed pricing information for all available compute types, including
385
+ GPU instances and CPU cores, with billing model details.
386
+ """
387
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
388
+ return await self._get(
389
+ "/compute/v1/pricing",
390
+ options=make_request_options(
391
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
392
+ ),
393
+ cast_to=NoneType,
394
+ )
395
+
396
+ async def get_usage(
397
+ self,
398
+ *,
399
+ month: int | Omit = omit,
400
+ year: int | Omit = omit,
401
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
402
+ # The extra values given here take precedence over values defined on the client or passed to this method.
403
+ extra_headers: Headers | None = None,
404
+ extra_query: Query | None = None,
405
+ extra_body: Body | None = None,
406
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
407
+ ) -> None:
408
+ """
409
+ Returns detailed compute usage statistics and billing information for your
410
+ organization. Includes GPU and CPU hours, total runs, costs, and breakdowns by
411
+ environment. Use optional query parameters to filter by specific year and month.
412
+
413
+ Args:
414
+ month: Month to filter usage data (1-12, defaults to current month)
415
+
416
+ year: Year to filter usage data (defaults to current year)
417
+
418
+ extra_headers: Send extra headers
419
+
420
+ extra_query: Add additional query parameters to the request
421
+
422
+ extra_body: Add additional JSON properties to the request
423
+
424
+ timeout: Override the client-level default timeout for this request, in seconds
425
+ """
426
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
427
+ return await self._get(
428
+ "/compute/v1/usage",
429
+ options=make_request_options(
430
+ extra_headers=extra_headers,
431
+ extra_query=extra_query,
432
+ extra_body=extra_body,
433
+ timeout=timeout,
434
+ query=await async_maybe_transform(
435
+ {
436
+ "month": month,
437
+ "year": year,
438
+ },
439
+ v1_get_usage_params.V1GetUsageParams,
440
+ ),
441
+ ),
442
+ cast_to=NoneType,
443
+ )
444
+
445
+
446
+ class V1ResourceWithRawResponse:
447
+ def __init__(self, v1: V1Resource) -> None:
448
+ self._v1 = v1
449
+
450
+ self.deploy = to_raw_response_wrapper(
451
+ v1.deploy,
452
+ )
453
+ self.get_pricing = to_raw_response_wrapper(
454
+ v1.get_pricing,
455
+ )
456
+ self.get_usage = to_raw_response_wrapper(
457
+ v1.get_usage,
458
+ )
459
+
460
+ @cached_property
461
+ def environments(self) -> EnvironmentsResourceWithRawResponse:
462
+ return EnvironmentsResourceWithRawResponse(self._v1.environments)
463
+
464
+ @cached_property
465
+ def functions(self) -> FunctionsResourceWithRawResponse:
466
+ return FunctionsResourceWithRawResponse(self._v1.functions)
467
+
468
+ @cached_property
469
+ def invoke(self) -> InvokeResourceWithRawResponse:
470
+ return InvokeResourceWithRawResponse(self._v1.invoke)
471
+
472
+ @cached_property
473
+ def runs(self) -> RunsResourceWithRawResponse:
474
+ return RunsResourceWithRawResponse(self._v1.runs)
475
+
476
+ @cached_property
477
+ def secrets(self) -> SecretsResourceWithRawResponse:
478
+ return SecretsResourceWithRawResponse(self._v1.secrets)
479
+
480
+
481
+ class AsyncV1ResourceWithRawResponse:
482
+ def __init__(self, v1: AsyncV1Resource) -> None:
483
+ self._v1 = v1
484
+
485
+ self.deploy = async_to_raw_response_wrapper(
486
+ v1.deploy,
487
+ )
488
+ self.get_pricing = async_to_raw_response_wrapper(
489
+ v1.get_pricing,
490
+ )
491
+ self.get_usage = async_to_raw_response_wrapper(
492
+ v1.get_usage,
493
+ )
494
+
495
+ @cached_property
496
+ def environments(self) -> AsyncEnvironmentsResourceWithRawResponse:
497
+ return AsyncEnvironmentsResourceWithRawResponse(self._v1.environments)
498
+
499
+ @cached_property
500
+ def functions(self) -> AsyncFunctionsResourceWithRawResponse:
501
+ return AsyncFunctionsResourceWithRawResponse(self._v1.functions)
502
+
503
+ @cached_property
504
+ def invoke(self) -> AsyncInvokeResourceWithRawResponse:
505
+ return AsyncInvokeResourceWithRawResponse(self._v1.invoke)
506
+
507
+ @cached_property
508
+ def runs(self) -> AsyncRunsResourceWithRawResponse:
509
+ return AsyncRunsResourceWithRawResponse(self._v1.runs)
510
+
511
+ @cached_property
512
+ def secrets(self) -> AsyncSecretsResourceWithRawResponse:
513
+ return AsyncSecretsResourceWithRawResponse(self._v1.secrets)
514
+
515
+
516
+ class V1ResourceWithStreamingResponse:
517
+ def __init__(self, v1: V1Resource) -> None:
518
+ self._v1 = v1
519
+
520
+ self.deploy = to_streamed_response_wrapper(
521
+ v1.deploy,
522
+ )
523
+ self.get_pricing = to_streamed_response_wrapper(
524
+ v1.get_pricing,
525
+ )
526
+ self.get_usage = to_streamed_response_wrapper(
527
+ v1.get_usage,
528
+ )
529
+
530
+ @cached_property
531
+ def environments(self) -> EnvironmentsResourceWithStreamingResponse:
532
+ return EnvironmentsResourceWithStreamingResponse(self._v1.environments)
533
+
534
+ @cached_property
535
+ def functions(self) -> FunctionsResourceWithStreamingResponse:
536
+ return FunctionsResourceWithStreamingResponse(self._v1.functions)
537
+
538
+ @cached_property
539
+ def invoke(self) -> InvokeResourceWithStreamingResponse:
540
+ return InvokeResourceWithStreamingResponse(self._v1.invoke)
541
+
542
+ @cached_property
543
+ def runs(self) -> RunsResourceWithStreamingResponse:
544
+ return RunsResourceWithStreamingResponse(self._v1.runs)
545
+
546
+ @cached_property
547
+ def secrets(self) -> SecretsResourceWithStreamingResponse:
548
+ return SecretsResourceWithStreamingResponse(self._v1.secrets)
549
+
550
+
551
+ class AsyncV1ResourceWithStreamingResponse:
552
+ def __init__(self, v1: AsyncV1Resource) -> None:
553
+ self._v1 = v1
554
+
555
+ self.deploy = async_to_streamed_response_wrapper(
556
+ v1.deploy,
557
+ )
558
+ self.get_pricing = async_to_streamed_response_wrapper(
559
+ v1.get_pricing,
560
+ )
561
+ self.get_usage = async_to_streamed_response_wrapper(
562
+ v1.get_usage,
563
+ )
564
+
565
+ @cached_property
566
+ def environments(self) -> AsyncEnvironmentsResourceWithStreamingResponse:
567
+ return AsyncEnvironmentsResourceWithStreamingResponse(self._v1.environments)
568
+
569
+ @cached_property
570
+ def functions(self) -> AsyncFunctionsResourceWithStreamingResponse:
571
+ return AsyncFunctionsResourceWithStreamingResponse(self._v1.functions)
572
+
573
+ @cached_property
574
+ def invoke(self) -> AsyncInvokeResourceWithStreamingResponse:
575
+ return AsyncInvokeResourceWithStreamingResponse(self._v1.invoke)
576
+
577
+ @cached_property
578
+ def runs(self) -> AsyncRunsResourceWithStreamingResponse:
579
+ return AsyncRunsResourceWithStreamingResponse(self._v1.runs)
580
+
581
+ @cached_property
582
+ def secrets(self) -> AsyncSecretsResourceWithStreamingResponse:
583
+ return AsyncSecretsResourceWithStreamingResponse(self._v1.secrets)
@@ -0,0 +1,33 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from .v1 import (
4
+ V1Resource,
5
+ AsyncV1Resource,
6
+ V1ResourceWithRawResponse,
7
+ AsyncV1ResourceWithRawResponse,
8
+ V1ResourceWithStreamingResponse,
9
+ AsyncV1ResourceWithStreamingResponse,
10
+ )
11
+ from .convert import (
12
+ ConvertResource,
13
+ AsyncConvertResource,
14
+ ConvertResourceWithRawResponse,
15
+ AsyncConvertResourceWithRawResponse,
16
+ ConvertResourceWithStreamingResponse,
17
+ AsyncConvertResourceWithStreamingResponse,
18
+ )
19
+
20
+ __all__ = [
21
+ "V1Resource",
22
+ "AsyncV1Resource",
23
+ "V1ResourceWithRawResponse",
24
+ "AsyncV1ResourceWithRawResponse",
25
+ "V1ResourceWithStreamingResponse",
26
+ "AsyncV1ResourceWithStreamingResponse",
27
+ "ConvertResource",
28
+ "AsyncConvertResource",
29
+ "ConvertResourceWithRawResponse",
30
+ "AsyncConvertResourceWithRawResponse",
31
+ "ConvertResourceWithStreamingResponse",
32
+ "AsyncConvertResourceWithStreamingResponse",
33
+ ]