casedev 0.1.0__py3-none-any.whl → 0.2.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.
- casedev/_base_client.py +140 -11
- casedev/_client.py +290 -119
- casedev/_models.py +16 -1
- casedev/_types.py +12 -2
- casedev/_version.py +1 -1
- casedev/resources/__init__.py +0 -70
- casedev/resources/compute/v1/__init__.py +0 -42
- casedev/resources/compute/v1/environments.py +16 -19
- casedev/resources/compute/v1/secrets.py +35 -41
- casedev/resources/compute/v1/v1.py +14 -276
- casedev/resources/format/v1/templates.py +11 -13
- casedev/resources/llm/llm.py +6 -7
- casedev/resources/llm/v1/v1.py +11 -13
- casedev/resources/ocr/v1.py +10 -13
- casedev/resources/search/v1.py +6 -7
- casedev/resources/vault/graphrag.py +11 -13
- casedev/resources/vault/objects.py +20 -25
- casedev/resources/vault/vault.py +64 -28
- casedev/resources/voice/streaming.py +6 -7
- casedev/resources/voice/transcription.py +82 -23
- casedev/resources/voice/v1/speak.py +1 -195
- casedev/resources/voice/v1/v1.py +6 -7
- casedev/types/__init__.py +2 -0
- casedev/types/compute/__init__.py +1 -2
- casedev/types/compute/v1/__init__.py +7 -5
- casedev/types/compute/v1/environment_list_response.py +40 -0
- casedev/types/compute/v1/environment_retrieve_response.py +36 -0
- casedev/types/compute/v1/environment_set_default_response.py +36 -0
- casedev/types/{convert/v1_webhook_response.py → compute/v1/secret_delete_group_response.py} +3 -3
- casedev/types/compute/v1/secret_list_response.py +31 -0
- casedev/types/compute/v1/secret_retrieve_group_response.py +38 -0
- casedev/types/compute/v1/secret_update_group_response.py +22 -0
- casedev/types/compute/v1_get_usage_response.py +51 -0
- casedev/types/format/v1/__init__.py +2 -0
- casedev/types/format/v1/template_list_response.py +40 -0
- casedev/types/format/v1/template_retrieve_response.py +33 -0
- casedev/types/llm/__init__.py +2 -0
- casedev/types/llm/v1_create_embedding_response.py +31 -0
- casedev/types/llm/v1_list_models_response.py +41 -0
- casedev/types/llm_get_config_response.py +33 -0
- casedev/types/ocr/__init__.py +2 -0
- casedev/types/ocr/v1_download_response.py +7 -0
- casedev/types/ocr/v1_process_params.py +2 -0
- casedev/types/ocr/v1_retrieve_response.py +32 -0
- casedev/types/search/__init__.py +1 -0
- casedev/types/search/v1_retrieve_research_response.py +74 -0
- casedev/types/vault/__init__.py +6 -0
- casedev/types/vault/graphrag_get_stats_response.py +31 -0
- casedev/types/{workflows/v1_delete_response.py → vault/graphrag_init_response.py} +6 -2
- casedev/types/vault/object_download_response.py +7 -0
- casedev/types/vault/object_get_text_response.py +35 -0
- casedev/types/vault/object_list_response.py +64 -0
- casedev/types/vault/object_retrieve_response.py +57 -0
- casedev/types/vault_create_params.py +16 -1
- casedev/types/vault_create_response.py +5 -2
- casedev/types/vault_ingest_response.py +15 -5
- casedev/types/vault_retrieve_response.py +76 -0
- casedev/types/vault_search_params.py +19 -5
- casedev/types/vault_search_response.py +25 -1
- casedev/types/vault_upload_params.py +7 -0
- casedev/types/vault_upload_response.py +6 -0
- casedev/types/voice/__init__.py +3 -0
- casedev/types/voice/streaming_get_url_response.py +44 -0
- casedev/types/voice/transcription_create_params.py +23 -3
- casedev/types/voice/transcription_create_response.py +22 -0
- casedev/types/voice/transcription_retrieve_response.py +19 -17
- casedev/types/voice/v1/__init__.py +0 -1
- casedev/types/voice/v1/speak_create_params.py +2 -0
- casedev/types/voice/v1_list_voices_response.py +40 -0
- casedev/types/webhooks/__init__.py +0 -3
- {casedev-0.1.0.dist-info → casedev-0.2.0.dist-info}/METADATA +10 -13
- casedev-0.2.0.dist-info/RECORD +149 -0
- {casedev-0.1.0.dist-info → casedev-0.2.0.dist-info}/licenses/LICENSE +1 -1
- casedev/resources/actions/__init__.py +0 -33
- casedev/resources/actions/actions.py +0 -102
- casedev/resources/actions/v1.py +0 -640
- casedev/resources/compute/v1/functions.py +0 -278
- casedev/resources/compute/v1/invoke.py +0 -216
- casedev/resources/compute/v1/runs.py +0 -290
- casedev/resources/convert/__init__.py +0 -33
- casedev/resources/convert/convert.py +0 -102
- casedev/resources/convert/v1/__init__.py +0 -33
- casedev/resources/convert/v1/jobs.py +0 -254
- casedev/resources/convert/v1/v1.py +0 -450
- casedev/resources/templates/__init__.py +0 -33
- casedev/resources/templates/templates.py +0 -102
- casedev/resources/templates/v1.py +0 -633
- casedev/resources/webhooks/__init__.py +0 -33
- casedev/resources/webhooks/v1.py +0 -447
- casedev/resources/webhooks/webhooks.py +0 -102
- casedev/resources/workflows/__init__.py +0 -33
- casedev/resources/workflows/v1.py +0 -1053
- casedev/resources/workflows/workflows.py +0 -102
- casedev/types/actions/__init__.py +0 -8
- casedev/types/actions/v1_create_params.py +0 -22
- casedev/types/actions/v1_create_response.py +0 -33
- casedev/types/actions/v1_execute_params.py +0 -16
- casedev/types/actions/v1_execute_response.py +0 -31
- casedev/types/compute/v1/function_get_logs_params.py +0 -12
- casedev/types/compute/v1/function_list_params.py +0 -12
- casedev/types/compute/v1/invoke_run_params.py +0 -21
- casedev/types/compute/v1/invoke_run_response.py +0 -39
- casedev/types/compute/v1/run_list_params.py +0 -18
- casedev/types/compute/v1_deploy_params.py +0 -114
- casedev/types/compute/v1_deploy_response.py +0 -30
- casedev/types/convert/__init__.py +0 -8
- casedev/types/convert/v1/__init__.py +0 -3
- casedev/types/convert/v1_process_params.py +0 -15
- casedev/types/convert/v1_process_response.py +0 -19
- casedev/types/convert/v1_webhook_params.py +0 -32
- casedev/types/templates/__init__.py +0 -8
- casedev/types/templates/v1_execute_params.py +0 -22
- casedev/types/templates/v1_execute_response.py +0 -31
- casedev/types/templates/v1_list_params.py +0 -32
- casedev/types/templates/v1_search_params.py +0 -18
- casedev/types/voice/v1/speak_stream_params.py +0 -58
- casedev/types/webhooks/v1_create_params.py +0 -20
- casedev/types/webhooks/v1_create_response.py +0 -33
- casedev/types/workflows/__init__.py +0 -19
- casedev/types/workflows/v1_create_params.py +0 -32
- casedev/types/workflows/v1_create_response.py +0 -29
- casedev/types/workflows/v1_deploy_response.py +0 -20
- casedev/types/workflows/v1_execute_params.py +0 -12
- casedev/types/workflows/v1_execute_response.py +0 -22
- casedev/types/workflows/v1_list_executions_params.py +0 -13
- casedev/types/workflows/v1_list_executions_response.py +0 -27
- casedev/types/workflows/v1_list_params.py +0 -18
- casedev/types/workflows/v1_list_response.py +0 -37
- casedev/types/workflows/v1_retrieve_execution_response.py +0 -31
- casedev/types/workflows/v1_retrieve_response.py +0 -35
- casedev/types/workflows/v1_undeploy_response.py +0 -13
- casedev/types/workflows/v1_update_params.py +0 -26
- casedev/types/workflows/v1_update_response.py +0 -17
- casedev-0.1.0.dist-info/RECORD +0 -185
- {casedev-0.1.0.dist-info → casedev-0.2.0.dist-info}/WHEEL +0 -0
|
@@ -2,26 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing_extensions import Literal
|
|
6
|
-
|
|
7
5
|
import httpx
|
|
8
6
|
|
|
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
7
|
from .secrets import (
|
|
26
8
|
SecretsResource,
|
|
27
9
|
AsyncSecretsResource,
|
|
@@ -32,14 +14,6 @@ from .secrets import (
|
|
|
32
14
|
)
|
|
33
15
|
from ...._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given
|
|
34
16
|
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
17
|
from ...._compat import cached_property
|
|
44
18
|
from ...._resource import SyncAPIResource, AsyncAPIResource
|
|
45
19
|
from ...._response import (
|
|
@@ -57,8 +31,8 @@ from .environments import (
|
|
|
57
31
|
AsyncEnvironmentsResourceWithStreamingResponse,
|
|
58
32
|
)
|
|
59
33
|
from ...._base_client import make_request_options
|
|
60
|
-
from ....types.compute import
|
|
61
|
-
from ....types.compute.
|
|
34
|
+
from ....types.compute import v1_get_usage_params
|
|
35
|
+
from ....types.compute.v1_get_usage_response import V1GetUsageResponse
|
|
62
36
|
|
|
63
37
|
__all__ = ["V1Resource", "AsyncV1Resource"]
|
|
64
38
|
|
|
@@ -68,18 +42,6 @@ class V1Resource(SyncAPIResource):
|
|
|
68
42
|
def environments(self) -> EnvironmentsResource:
|
|
69
43
|
return EnvironmentsResource(self._client)
|
|
70
44
|
|
|
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
45
|
@cached_property
|
|
84
46
|
def secrets(self) -> SecretsResource:
|
|
85
47
|
return SecretsResource(self._client)
|
|
@@ -103,81 +65,6 @@ class V1Resource(SyncAPIResource):
|
|
|
103
65
|
"""
|
|
104
66
|
return V1ResourceWithStreamingResponse(self)
|
|
105
67
|
|
|
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
68
|
def get_pricing(
|
|
182
69
|
self,
|
|
183
70
|
*,
|
|
@@ -188,11 +75,11 @@ class V1Resource(SyncAPIResource):
|
|
|
188
75
|
extra_body: Body | None = None,
|
|
189
76
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
190
77
|
) -> None:
|
|
191
|
-
"""Returns current pricing for GPU
|
|
78
|
+
"""Returns current pricing for GPU instances.
|
|
192
79
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
80
|
+
Prices are fetched in real-time and
|
|
81
|
+
include a 20% platform fee. For detailed instance types and availability, use
|
|
82
|
+
GET /compute/v1/instance-types.
|
|
196
83
|
"""
|
|
197
84
|
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
198
85
|
return self._get(
|
|
@@ -214,7 +101,7 @@ class V1Resource(SyncAPIResource):
|
|
|
214
101
|
extra_query: Query | None = None,
|
|
215
102
|
extra_body: Body | None = None,
|
|
216
103
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
217
|
-
) ->
|
|
104
|
+
) -> V1GetUsageResponse:
|
|
218
105
|
"""
|
|
219
106
|
Returns detailed compute usage statistics and billing information for your
|
|
220
107
|
organization. Includes GPU and CPU hours, total runs, costs, and breakdowns by
|
|
@@ -233,7 +120,6 @@ class V1Resource(SyncAPIResource):
|
|
|
233
120
|
|
|
234
121
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
235
122
|
"""
|
|
236
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
237
123
|
return self._get(
|
|
238
124
|
"/compute/v1/usage",
|
|
239
125
|
options=make_request_options(
|
|
@@ -249,7 +135,7 @@ class V1Resource(SyncAPIResource):
|
|
|
249
135
|
v1_get_usage_params.V1GetUsageParams,
|
|
250
136
|
),
|
|
251
137
|
),
|
|
252
|
-
cast_to=
|
|
138
|
+
cast_to=V1GetUsageResponse,
|
|
253
139
|
)
|
|
254
140
|
|
|
255
141
|
|
|
@@ -258,18 +144,6 @@ class AsyncV1Resource(AsyncAPIResource):
|
|
|
258
144
|
def environments(self) -> AsyncEnvironmentsResource:
|
|
259
145
|
return AsyncEnvironmentsResource(self._client)
|
|
260
146
|
|
|
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
147
|
@cached_property
|
|
274
148
|
def secrets(self) -> AsyncSecretsResource:
|
|
275
149
|
return AsyncSecretsResource(self._client)
|
|
@@ -293,81 +167,6 @@ class AsyncV1Resource(AsyncAPIResource):
|
|
|
293
167
|
"""
|
|
294
168
|
return AsyncV1ResourceWithStreamingResponse(self)
|
|
295
169
|
|
|
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
170
|
async def get_pricing(
|
|
372
171
|
self,
|
|
373
172
|
*,
|
|
@@ -378,11 +177,11 @@ class AsyncV1Resource(AsyncAPIResource):
|
|
|
378
177
|
extra_body: Body | None = None,
|
|
379
178
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
380
179
|
) -> None:
|
|
381
|
-
"""Returns current pricing for GPU
|
|
180
|
+
"""Returns current pricing for GPU instances.
|
|
382
181
|
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
182
|
+
Prices are fetched in real-time and
|
|
183
|
+
include a 20% platform fee. For detailed instance types and availability, use
|
|
184
|
+
GET /compute/v1/instance-types.
|
|
386
185
|
"""
|
|
387
186
|
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
388
187
|
return await self._get(
|
|
@@ -404,7 +203,7 @@ class AsyncV1Resource(AsyncAPIResource):
|
|
|
404
203
|
extra_query: Query | None = None,
|
|
405
204
|
extra_body: Body | None = None,
|
|
406
205
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
407
|
-
) ->
|
|
206
|
+
) -> V1GetUsageResponse:
|
|
408
207
|
"""
|
|
409
208
|
Returns detailed compute usage statistics and billing information for your
|
|
410
209
|
organization. Includes GPU and CPU hours, total runs, costs, and breakdowns by
|
|
@@ -423,7 +222,6 @@ class AsyncV1Resource(AsyncAPIResource):
|
|
|
423
222
|
|
|
424
223
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
425
224
|
"""
|
|
426
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
427
225
|
return await self._get(
|
|
428
226
|
"/compute/v1/usage",
|
|
429
227
|
options=make_request_options(
|
|
@@ -439,7 +237,7 @@ class AsyncV1Resource(AsyncAPIResource):
|
|
|
439
237
|
v1_get_usage_params.V1GetUsageParams,
|
|
440
238
|
),
|
|
441
239
|
),
|
|
442
|
-
cast_to=
|
|
240
|
+
cast_to=V1GetUsageResponse,
|
|
443
241
|
)
|
|
444
242
|
|
|
445
243
|
|
|
@@ -447,9 +245,6 @@ class V1ResourceWithRawResponse:
|
|
|
447
245
|
def __init__(self, v1: V1Resource) -> None:
|
|
448
246
|
self._v1 = v1
|
|
449
247
|
|
|
450
|
-
self.deploy = to_raw_response_wrapper(
|
|
451
|
-
v1.deploy,
|
|
452
|
-
)
|
|
453
248
|
self.get_pricing = to_raw_response_wrapper(
|
|
454
249
|
v1.get_pricing,
|
|
455
250
|
)
|
|
@@ -461,18 +256,6 @@ class V1ResourceWithRawResponse:
|
|
|
461
256
|
def environments(self) -> EnvironmentsResourceWithRawResponse:
|
|
462
257
|
return EnvironmentsResourceWithRawResponse(self._v1.environments)
|
|
463
258
|
|
|
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
259
|
@cached_property
|
|
477
260
|
def secrets(self) -> SecretsResourceWithRawResponse:
|
|
478
261
|
return SecretsResourceWithRawResponse(self._v1.secrets)
|
|
@@ -482,9 +265,6 @@ class AsyncV1ResourceWithRawResponse:
|
|
|
482
265
|
def __init__(self, v1: AsyncV1Resource) -> None:
|
|
483
266
|
self._v1 = v1
|
|
484
267
|
|
|
485
|
-
self.deploy = async_to_raw_response_wrapper(
|
|
486
|
-
v1.deploy,
|
|
487
|
-
)
|
|
488
268
|
self.get_pricing = async_to_raw_response_wrapper(
|
|
489
269
|
v1.get_pricing,
|
|
490
270
|
)
|
|
@@ -496,18 +276,6 @@ class AsyncV1ResourceWithRawResponse:
|
|
|
496
276
|
def environments(self) -> AsyncEnvironmentsResourceWithRawResponse:
|
|
497
277
|
return AsyncEnvironmentsResourceWithRawResponse(self._v1.environments)
|
|
498
278
|
|
|
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
279
|
@cached_property
|
|
512
280
|
def secrets(self) -> AsyncSecretsResourceWithRawResponse:
|
|
513
281
|
return AsyncSecretsResourceWithRawResponse(self._v1.secrets)
|
|
@@ -517,9 +285,6 @@ class V1ResourceWithStreamingResponse:
|
|
|
517
285
|
def __init__(self, v1: V1Resource) -> None:
|
|
518
286
|
self._v1 = v1
|
|
519
287
|
|
|
520
|
-
self.deploy = to_streamed_response_wrapper(
|
|
521
|
-
v1.deploy,
|
|
522
|
-
)
|
|
523
288
|
self.get_pricing = to_streamed_response_wrapper(
|
|
524
289
|
v1.get_pricing,
|
|
525
290
|
)
|
|
@@ -531,18 +296,6 @@ class V1ResourceWithStreamingResponse:
|
|
|
531
296
|
def environments(self) -> EnvironmentsResourceWithStreamingResponse:
|
|
532
297
|
return EnvironmentsResourceWithStreamingResponse(self._v1.environments)
|
|
533
298
|
|
|
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
299
|
@cached_property
|
|
547
300
|
def secrets(self) -> SecretsResourceWithStreamingResponse:
|
|
548
301
|
return SecretsResourceWithStreamingResponse(self._v1.secrets)
|
|
@@ -552,9 +305,6 @@ class AsyncV1ResourceWithStreamingResponse:
|
|
|
552
305
|
def __init__(self, v1: AsyncV1Resource) -> None:
|
|
553
306
|
self._v1 = v1
|
|
554
307
|
|
|
555
|
-
self.deploy = async_to_streamed_response_wrapper(
|
|
556
|
-
v1.deploy,
|
|
557
|
-
)
|
|
558
308
|
self.get_pricing = async_to_streamed_response_wrapper(
|
|
559
309
|
v1.get_pricing,
|
|
560
310
|
)
|
|
@@ -566,18 +316,6 @@ class AsyncV1ResourceWithStreamingResponse:
|
|
|
566
316
|
def environments(self) -> AsyncEnvironmentsResourceWithStreamingResponse:
|
|
567
317
|
return AsyncEnvironmentsResourceWithStreamingResponse(self._v1.environments)
|
|
568
318
|
|
|
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
319
|
@cached_property
|
|
582
320
|
def secrets(self) -> AsyncSecretsResourceWithStreamingResponse:
|
|
583
321
|
return AsyncSecretsResourceWithStreamingResponse(self._v1.secrets)
|
|
@@ -6,7 +6,7 @@ from typing_extensions import Literal
|
|
|
6
6
|
|
|
7
7
|
import httpx
|
|
8
8
|
|
|
9
|
-
from ...._types import Body, Omit, Query, Headers,
|
|
9
|
+
from ...._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
|
|
10
10
|
from ...._utils import maybe_transform, async_maybe_transform
|
|
11
11
|
from ...._compat import cached_property
|
|
12
12
|
from ...._resource import SyncAPIResource, AsyncAPIResource
|
|
@@ -18,7 +18,9 @@ from ...._response import (
|
|
|
18
18
|
)
|
|
19
19
|
from ...._base_client import make_request_options
|
|
20
20
|
from ....types.format.v1 import template_list_params, template_create_params
|
|
21
|
+
from ....types.format.v1.template_list_response import TemplateListResponse
|
|
21
22
|
from ....types.format.v1.template_create_response import TemplateCreateResponse
|
|
23
|
+
from ....types.format.v1.template_retrieve_response import TemplateRetrieveResponse
|
|
22
24
|
|
|
23
25
|
__all__ = ["TemplatesResource", "AsyncTemplatesResource"]
|
|
24
26
|
|
|
@@ -119,7 +121,7 @@ class TemplatesResource(SyncAPIResource):
|
|
|
119
121
|
extra_query: Query | None = None,
|
|
120
122
|
extra_body: Body | None = None,
|
|
121
123
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
122
|
-
) ->
|
|
124
|
+
) -> TemplateRetrieveResponse:
|
|
123
125
|
"""Retrieve a specific document format template by ID.
|
|
124
126
|
|
|
125
127
|
Format templates define how
|
|
@@ -137,13 +139,12 @@ class TemplatesResource(SyncAPIResource):
|
|
|
137
139
|
"""
|
|
138
140
|
if not id:
|
|
139
141
|
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
140
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
141
142
|
return self._get(
|
|
142
143
|
f"/format/v1/templates/{id}",
|
|
143
144
|
options=make_request_options(
|
|
144
145
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
145
146
|
),
|
|
146
|
-
cast_to=
|
|
147
|
+
cast_to=TemplateRetrieveResponse,
|
|
147
148
|
)
|
|
148
149
|
|
|
149
150
|
def list(
|
|
@@ -156,7 +157,7 @@ class TemplatesResource(SyncAPIResource):
|
|
|
156
157
|
extra_query: Query | None = None,
|
|
157
158
|
extra_body: Body | None = None,
|
|
158
159
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
159
|
-
) ->
|
|
160
|
+
) -> TemplateListResponse:
|
|
160
161
|
"""Retrieve all format templates for the organization.
|
|
161
162
|
|
|
162
163
|
Templates define reusable
|
|
@@ -177,7 +178,6 @@ class TemplatesResource(SyncAPIResource):
|
|
|
177
178
|
|
|
178
179
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
179
180
|
"""
|
|
180
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
181
181
|
return self._get(
|
|
182
182
|
"/format/v1/templates",
|
|
183
183
|
options=make_request_options(
|
|
@@ -187,7 +187,7 @@ class TemplatesResource(SyncAPIResource):
|
|
|
187
187
|
timeout=timeout,
|
|
188
188
|
query=maybe_transform({"type": type}, template_list_params.TemplateListParams),
|
|
189
189
|
),
|
|
190
|
-
cast_to=
|
|
190
|
+
cast_to=TemplateListResponse,
|
|
191
191
|
)
|
|
192
192
|
|
|
193
193
|
|
|
@@ -287,7 +287,7 @@ class AsyncTemplatesResource(AsyncAPIResource):
|
|
|
287
287
|
extra_query: Query | None = None,
|
|
288
288
|
extra_body: Body | None = None,
|
|
289
289
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
290
|
-
) ->
|
|
290
|
+
) -> TemplateRetrieveResponse:
|
|
291
291
|
"""Retrieve a specific document format template by ID.
|
|
292
292
|
|
|
293
293
|
Format templates define how
|
|
@@ -305,13 +305,12 @@ class AsyncTemplatesResource(AsyncAPIResource):
|
|
|
305
305
|
"""
|
|
306
306
|
if not id:
|
|
307
307
|
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
308
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
309
308
|
return await self._get(
|
|
310
309
|
f"/format/v1/templates/{id}",
|
|
311
310
|
options=make_request_options(
|
|
312
311
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
313
312
|
),
|
|
314
|
-
cast_to=
|
|
313
|
+
cast_to=TemplateRetrieveResponse,
|
|
315
314
|
)
|
|
316
315
|
|
|
317
316
|
async def list(
|
|
@@ -324,7 +323,7 @@ class AsyncTemplatesResource(AsyncAPIResource):
|
|
|
324
323
|
extra_query: Query | None = None,
|
|
325
324
|
extra_body: Body | None = None,
|
|
326
325
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
327
|
-
) ->
|
|
326
|
+
) -> TemplateListResponse:
|
|
328
327
|
"""Retrieve all format templates for the organization.
|
|
329
328
|
|
|
330
329
|
Templates define reusable
|
|
@@ -345,7 +344,6 @@ class AsyncTemplatesResource(AsyncAPIResource):
|
|
|
345
344
|
|
|
346
345
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
347
346
|
"""
|
|
348
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
349
347
|
return await self._get(
|
|
350
348
|
"/format/v1/templates",
|
|
351
349
|
options=make_request_options(
|
|
@@ -355,7 +353,7 @@ class AsyncTemplatesResource(AsyncAPIResource):
|
|
|
355
353
|
timeout=timeout,
|
|
356
354
|
query=await async_maybe_transform({"type": type}, template_list_params.TemplateListParams),
|
|
357
355
|
),
|
|
358
|
-
cast_to=
|
|
356
|
+
cast_to=TemplateListResponse,
|
|
359
357
|
)
|
|
360
358
|
|
|
361
359
|
|
casedev/resources/llm/llm.py
CHANGED
|
@@ -12,7 +12,7 @@ from .v1.v1 import (
|
|
|
12
12
|
V1ResourceWithStreamingResponse,
|
|
13
13
|
AsyncV1ResourceWithStreamingResponse,
|
|
14
14
|
)
|
|
15
|
-
from ..._types import Body, Query, Headers,
|
|
15
|
+
from ..._types import Body, Query, Headers, NotGiven, not_given
|
|
16
16
|
from ..._compat import cached_property
|
|
17
17
|
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
18
18
|
from ..._response import (
|
|
@@ -22,6 +22,7 @@ from ..._response import (
|
|
|
22
22
|
async_to_streamed_response_wrapper,
|
|
23
23
|
)
|
|
24
24
|
from ..._base_client import make_request_options
|
|
25
|
+
from ...types.llm_get_config_response import LlmGetConfigResponse
|
|
25
26
|
|
|
26
27
|
__all__ = ["LlmResource", "AsyncLlmResource"]
|
|
27
28
|
|
|
@@ -59,7 +60,7 @@ class LlmResource(SyncAPIResource):
|
|
|
59
60
|
extra_query: Query | None = None,
|
|
60
61
|
extra_body: Body | None = None,
|
|
61
62
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
62
|
-
) ->
|
|
63
|
+
) -> LlmGetConfigResponse:
|
|
63
64
|
"""
|
|
64
65
|
Retrieves the AI Gateway configuration including all available language models
|
|
65
66
|
and their specifications. This endpoint returns model information compatible
|
|
@@ -73,13 +74,12 @@ class LlmResource(SyncAPIResource):
|
|
|
73
74
|
- Configure AI SDK clients
|
|
74
75
|
- Build model selection interfaces
|
|
75
76
|
"""
|
|
76
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
77
77
|
return self._get(
|
|
78
78
|
"/llm/config",
|
|
79
79
|
options=make_request_options(
|
|
80
80
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
81
81
|
),
|
|
82
|
-
cast_to=
|
|
82
|
+
cast_to=LlmGetConfigResponse,
|
|
83
83
|
)
|
|
84
84
|
|
|
85
85
|
|
|
@@ -116,7 +116,7 @@ class AsyncLlmResource(AsyncAPIResource):
|
|
|
116
116
|
extra_query: Query | None = None,
|
|
117
117
|
extra_body: Body | None = None,
|
|
118
118
|
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
119
|
-
) ->
|
|
119
|
+
) -> LlmGetConfigResponse:
|
|
120
120
|
"""
|
|
121
121
|
Retrieves the AI Gateway configuration including all available language models
|
|
122
122
|
and their specifications. This endpoint returns model information compatible
|
|
@@ -130,13 +130,12 @@ class AsyncLlmResource(AsyncAPIResource):
|
|
|
130
130
|
- Configure AI SDK clients
|
|
131
131
|
- Build model selection interfaces
|
|
132
132
|
"""
|
|
133
|
-
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
134
133
|
return await self._get(
|
|
135
134
|
"/llm/config",
|
|
136
135
|
options=make_request_options(
|
|
137
136
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
138
137
|
),
|
|
139
|
-
cast_to=
|
|
138
|
+
cast_to=LlmGetConfigResponse,
|
|
140
139
|
)
|
|
141
140
|
|
|
142
141
|
|