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.
- casedev/__init__.py +104 -0
- casedev/_base_client.py +1995 -0
- casedev/_client.py +560 -0
- casedev/_compat.py +219 -0
- casedev/_constants.py +14 -0
- casedev/_exceptions.py +108 -0
- casedev/_files.py +123 -0
- casedev/_models.py +857 -0
- casedev/_qs.py +150 -0
- casedev/_resource.py +43 -0
- casedev/_response.py +830 -0
- casedev/_streaming.py +333 -0
- casedev/_types.py +260 -0
- casedev/_utils/__init__.py +64 -0
- casedev/_utils/_compat.py +45 -0
- casedev/_utils/_datetime_parse.py +136 -0
- casedev/_utils/_logs.py +25 -0
- casedev/_utils/_proxy.py +65 -0
- casedev/_utils/_reflection.py +42 -0
- casedev/_utils/_resources_proxy.py +24 -0
- casedev/_utils/_streams.py +12 -0
- casedev/_utils/_sync.py +58 -0
- casedev/_utils/_transform.py +457 -0
- casedev/_utils/_typing.py +156 -0
- casedev/_utils/_utils.py +421 -0
- casedev/_version.py +4 -0
- casedev/lib/.keep +4 -0
- casedev/py.typed +0 -0
- casedev/resources/__init__.py +173 -0
- casedev/resources/actions/__init__.py +33 -0
- casedev/resources/actions/actions.py +102 -0
- casedev/resources/actions/v1.py +640 -0
- casedev/resources/compute/__init__.py +33 -0
- casedev/resources/compute/compute.py +102 -0
- casedev/resources/compute/v1/__init__.py +89 -0
- casedev/resources/compute/v1/environments.py +492 -0
- casedev/resources/compute/v1/functions.py +278 -0
- casedev/resources/compute/v1/invoke.py +216 -0
- casedev/resources/compute/v1/runs.py +290 -0
- casedev/resources/compute/v1/secrets.py +655 -0
- casedev/resources/compute/v1/v1.py +583 -0
- casedev/resources/convert/__init__.py +33 -0
- casedev/resources/convert/convert.py +102 -0
- casedev/resources/convert/v1/__init__.py +33 -0
- casedev/resources/convert/v1/jobs.py +254 -0
- casedev/resources/convert/v1/v1.py +450 -0
- casedev/resources/format/__init__.py +33 -0
- casedev/resources/format/format.py +102 -0
- casedev/resources/format/v1/__init__.py +33 -0
- casedev/resources/format/v1/templates.py +419 -0
- casedev/resources/format/v1/v1.py +244 -0
- casedev/resources/llm/__init__.py +33 -0
- casedev/resources/llm/llm.py +192 -0
- casedev/resources/llm/v1/__init__.py +33 -0
- casedev/resources/llm/v1/chat.py +243 -0
- casedev/resources/llm/v1/v1.py +317 -0
- casedev/resources/ocr/__init__.py +33 -0
- casedev/resources/ocr/ocr.py +102 -0
- casedev/resources/ocr/v1.py +407 -0
- casedev/resources/search/__init__.py +33 -0
- casedev/resources/search/search.py +102 -0
- casedev/resources/search/v1.py +1052 -0
- casedev/resources/templates/__init__.py +33 -0
- casedev/resources/templates/templates.py +102 -0
- casedev/resources/templates/v1.py +633 -0
- casedev/resources/vault/__init__.py +47 -0
- casedev/resources/vault/graphrag.py +256 -0
- casedev/resources/vault/objects.py +571 -0
- casedev/resources/vault/vault.py +764 -0
- casedev/resources/voice/__init__.py +61 -0
- casedev/resources/voice/streaming.py +160 -0
- casedev/resources/voice/transcription.py +327 -0
- casedev/resources/voice/v1/__init__.py +33 -0
- casedev/resources/voice/v1/speak.py +478 -0
- casedev/resources/voice/v1/v1.py +290 -0
- casedev/resources/voice/voice.py +166 -0
- casedev/resources/webhooks/__init__.py +33 -0
- casedev/resources/webhooks/v1.py +447 -0
- casedev/resources/webhooks/webhooks.py +102 -0
- casedev/resources/workflows/__init__.py +33 -0
- casedev/resources/workflows/v1.py +1053 -0
- casedev/resources/workflows/workflows.py +102 -0
- casedev/types/__init__.py +12 -0
- casedev/types/actions/__init__.py +8 -0
- casedev/types/actions/v1_create_params.py +22 -0
- casedev/types/actions/v1_create_response.py +33 -0
- casedev/types/actions/v1_execute_params.py +16 -0
- casedev/types/actions/v1_execute_response.py +31 -0
- casedev/types/compute/__init__.py +7 -0
- casedev/types/compute/v1/__init__.py +18 -0
- casedev/types/compute/v1/environment_create_params.py +12 -0
- casedev/types/compute/v1/environment_create_response.py +34 -0
- casedev/types/compute/v1/environment_delete_response.py +11 -0
- casedev/types/compute/v1/function_get_logs_params.py +12 -0
- casedev/types/compute/v1/function_list_params.py +12 -0
- casedev/types/compute/v1/invoke_run_params.py +21 -0
- casedev/types/compute/v1/invoke_run_response.py +39 -0
- casedev/types/compute/v1/run_list_params.py +18 -0
- casedev/types/compute/v1/secret_create_params.py +24 -0
- casedev/types/compute/v1/secret_create_response.py +24 -0
- casedev/types/compute/v1/secret_delete_group_params.py +18 -0
- casedev/types/compute/v1/secret_list_params.py +15 -0
- casedev/types/compute/v1/secret_retrieve_group_params.py +12 -0
- casedev/types/compute/v1/secret_update_group_params.py +16 -0
- casedev/types/compute/v1_deploy_params.py +114 -0
- casedev/types/compute/v1_deploy_response.py +30 -0
- casedev/types/compute/v1_get_usage_params.py +15 -0
- casedev/types/convert/__init__.py +8 -0
- casedev/types/convert/v1/__init__.py +3 -0
- casedev/types/convert/v1_process_params.py +15 -0
- casedev/types/convert/v1_process_response.py +19 -0
- casedev/types/convert/v1_webhook_params.py +32 -0
- casedev/types/convert/v1_webhook_response.py +13 -0
- casedev/types/format/__init__.py +5 -0
- casedev/types/format/v1/__init__.py +7 -0
- casedev/types/format/v1/template_create_params.py +32 -0
- casedev/types/format/v1/template_create_response.py +27 -0
- casedev/types/format/v1/template_list_params.py +12 -0
- casedev/types/format/v1_create_document_params.py +42 -0
- casedev/types/llm/__init__.py +5 -0
- casedev/types/llm/v1/__init__.py +6 -0
- casedev/types/llm/v1/chat_create_completion_params.py +42 -0
- casedev/types/llm/v1/chat_create_completion_response.py +49 -0
- casedev/types/llm/v1_create_embedding_params.py +27 -0
- casedev/types/ocr/__init__.py +6 -0
- casedev/types/ocr/v1_process_params.py +44 -0
- casedev/types/ocr/v1_process_response.py +32 -0
- casedev/types/search/__init__.py +15 -0
- casedev/types/search/v1_answer_params.py +45 -0
- casedev/types/search/v1_answer_response.py +35 -0
- casedev/types/search/v1_contents_params.py +42 -0
- casedev/types/search/v1_contents_response.py +31 -0
- casedev/types/search/v1_research_params.py +23 -0
- casedev/types/search/v1_research_response.py +20 -0
- casedev/types/search/v1_retrieve_research_params.py +15 -0
- casedev/types/search/v1_search_params.py +56 -0
- casedev/types/search/v1_search_response.py +38 -0
- casedev/types/search/v1_similar_params.py +44 -0
- casedev/types/search/v1_similar_response.py +33 -0
- casedev/types/templates/__init__.py +8 -0
- casedev/types/templates/v1_execute_params.py +22 -0
- casedev/types/templates/v1_execute_response.py +31 -0
- casedev/types/templates/v1_list_params.py +32 -0
- casedev/types/templates/v1_search_params.py +18 -0
- casedev/types/vault/__init__.py +6 -0
- casedev/types/vault/object_create_presigned_url_params.py +22 -0
- casedev/types/vault/object_create_presigned_url_response.py +51 -0
- casedev/types/vault_create_params.py +20 -0
- casedev/types/vault_create_response.py +36 -0
- casedev/types/vault_ingest_response.py +26 -0
- casedev/types/vault_list_response.py +40 -0
- casedev/types/vault_search_params.py +27 -0
- casedev/types/vault_search_response.py +53 -0
- casedev/types/vault_upload_params.py +26 -0
- casedev/types/vault_upload_response.py +39 -0
- casedev/types/voice/__init__.py +7 -0
- casedev/types/voice/transcription_create_params.py +36 -0
- casedev/types/voice/transcription_retrieve_response.py +41 -0
- casedev/types/voice/v1/__init__.py +6 -0
- casedev/types/voice/v1/speak_create_params.py +59 -0
- casedev/types/voice/v1/speak_stream_params.py +58 -0
- casedev/types/voice/v1_list_voices_params.py +36 -0
- casedev/types/webhooks/__init__.py +6 -0
- casedev/types/webhooks/v1_create_params.py +20 -0
- casedev/types/webhooks/v1_create_response.py +33 -0
- casedev/types/workflows/__init__.py +19 -0
- casedev/types/workflows/v1_create_params.py +32 -0
- casedev/types/workflows/v1_create_response.py +29 -0
- casedev/types/workflows/v1_delete_response.py +13 -0
- casedev/types/workflows/v1_deploy_response.py +20 -0
- casedev/types/workflows/v1_execute_params.py +12 -0
- casedev/types/workflows/v1_execute_response.py +22 -0
- casedev/types/workflows/v1_list_executions_params.py +13 -0
- casedev/types/workflows/v1_list_executions_response.py +27 -0
- casedev/types/workflows/v1_list_params.py +18 -0
- casedev/types/workflows/v1_list_response.py +37 -0
- casedev/types/workflows/v1_retrieve_execution_response.py +31 -0
- casedev/types/workflows/v1_retrieve_response.py +35 -0
- casedev/types/workflows/v1_undeploy_response.py +13 -0
- casedev/types/workflows/v1_update_params.py +26 -0
- casedev/types/workflows/v1_update_response.py +17 -0
- casedev-0.1.0.dist-info/METADATA +454 -0
- casedev-0.1.0.dist-info/RECORD +185 -0
- casedev-0.1.0.dist-info/WHEEL +4 -0
- casedev-0.1.0.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,450 @@
|
|
|
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 .jobs import (
|
|
10
|
+
JobsResource,
|
|
11
|
+
AsyncJobsResource,
|
|
12
|
+
JobsResourceWithRawResponse,
|
|
13
|
+
AsyncJobsResourceWithRawResponse,
|
|
14
|
+
JobsResourceWithStreamingResponse,
|
|
15
|
+
AsyncJobsResourceWithStreamingResponse,
|
|
16
|
+
)
|
|
17
|
+
from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
|
18
|
+
from ...._utils import maybe_transform, async_maybe_transform
|
|
19
|
+
from ...._compat import cached_property
|
|
20
|
+
from ...._resource import SyncAPIResource, AsyncAPIResource
|
|
21
|
+
from ...._response import (
|
|
22
|
+
BinaryAPIResponse,
|
|
23
|
+
AsyncBinaryAPIResponse,
|
|
24
|
+
StreamedBinaryAPIResponse,
|
|
25
|
+
AsyncStreamedBinaryAPIResponse,
|
|
26
|
+
to_raw_response_wrapper,
|
|
27
|
+
to_streamed_response_wrapper,
|
|
28
|
+
async_to_raw_response_wrapper,
|
|
29
|
+
to_custom_raw_response_wrapper,
|
|
30
|
+
async_to_streamed_response_wrapper,
|
|
31
|
+
to_custom_streamed_response_wrapper,
|
|
32
|
+
async_to_custom_raw_response_wrapper,
|
|
33
|
+
async_to_custom_streamed_response_wrapper,
|
|
34
|
+
)
|
|
35
|
+
from ...._base_client import make_request_options
|
|
36
|
+
from ....types.convert import v1_process_params, v1_webhook_params
|
|
37
|
+
from ....types.convert.v1_process_response import V1ProcessResponse
|
|
38
|
+
from ....types.convert.v1_webhook_response import V1WebhookResponse
|
|
39
|
+
|
|
40
|
+
__all__ = ["V1Resource", "AsyncV1Resource"]
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class V1Resource(SyncAPIResource):
|
|
44
|
+
@cached_property
|
|
45
|
+
def jobs(self) -> JobsResource:
|
|
46
|
+
return JobsResource(self._client)
|
|
47
|
+
|
|
48
|
+
@cached_property
|
|
49
|
+
def with_raw_response(self) -> V1ResourceWithRawResponse:
|
|
50
|
+
"""
|
|
51
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
52
|
+
the raw response object instead of the parsed content.
|
|
53
|
+
|
|
54
|
+
For more information, see https://www.github.com/CaseMark/casedev-python#accessing-raw-response-data-eg-headers
|
|
55
|
+
"""
|
|
56
|
+
return V1ResourceWithRawResponse(self)
|
|
57
|
+
|
|
58
|
+
@cached_property
|
|
59
|
+
def with_streaming_response(self) -> V1ResourceWithStreamingResponse:
|
|
60
|
+
"""
|
|
61
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
62
|
+
|
|
63
|
+
For more information, see https://www.github.com/CaseMark/casedev-python#with_streaming_response
|
|
64
|
+
"""
|
|
65
|
+
return V1ResourceWithStreamingResponse(self)
|
|
66
|
+
|
|
67
|
+
def download(
|
|
68
|
+
self,
|
|
69
|
+
id: str,
|
|
70
|
+
*,
|
|
71
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
72
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
73
|
+
extra_headers: Headers | None = None,
|
|
74
|
+
extra_query: Query | None = None,
|
|
75
|
+
extra_body: Body | None = None,
|
|
76
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
77
|
+
) -> BinaryAPIResponse:
|
|
78
|
+
"""Download the converted M4A audio file from a completed FTR conversion job.
|
|
79
|
+
|
|
80
|
+
The
|
|
81
|
+
file is streamed directly to the client with appropriate headers for audio
|
|
82
|
+
playback or download.
|
|
83
|
+
|
|
84
|
+
Args:
|
|
85
|
+
extra_headers: Send extra headers
|
|
86
|
+
|
|
87
|
+
extra_query: Add additional query parameters to the request
|
|
88
|
+
|
|
89
|
+
extra_body: Add additional JSON properties to the request
|
|
90
|
+
|
|
91
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
92
|
+
"""
|
|
93
|
+
if not id:
|
|
94
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
95
|
+
extra_headers = {"Accept": "audio/mp4", **(extra_headers or {})}
|
|
96
|
+
return self._get(
|
|
97
|
+
f"/convert/v1/download/{id}",
|
|
98
|
+
options=make_request_options(
|
|
99
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
100
|
+
),
|
|
101
|
+
cast_to=BinaryAPIResponse,
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
def process(
|
|
105
|
+
self,
|
|
106
|
+
*,
|
|
107
|
+
input_url: str,
|
|
108
|
+
callback_url: str | Omit = omit,
|
|
109
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
110
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
111
|
+
extra_headers: Headers | None = None,
|
|
112
|
+
extra_query: Query | None = None,
|
|
113
|
+
extra_body: Body | None = None,
|
|
114
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
115
|
+
) -> V1ProcessResponse:
|
|
116
|
+
"""
|
|
117
|
+
Submit an FTR (ForensicTech Recording) file for conversion to M4A audio format.
|
|
118
|
+
This endpoint is commonly used to convert court recording files into standard
|
|
119
|
+
audio formats for transcription or playback. The conversion is processed
|
|
120
|
+
asynchronously - you'll receive a job ID to track the conversion status.
|
|
121
|
+
|
|
122
|
+
**Supported Input**: FTR files via S3 presigned URLs **Output Format**: M4A
|
|
123
|
+
audio **Processing**: Asynchronous with webhook callbacks
|
|
124
|
+
|
|
125
|
+
Args:
|
|
126
|
+
input_url: HTTPS URL to the FTR file (must be a valid S3 presigned URL)
|
|
127
|
+
|
|
128
|
+
callback_url: Optional webhook URL to receive conversion completion notification
|
|
129
|
+
|
|
130
|
+
extra_headers: Send extra headers
|
|
131
|
+
|
|
132
|
+
extra_query: Add additional query parameters to the request
|
|
133
|
+
|
|
134
|
+
extra_body: Add additional JSON properties to the request
|
|
135
|
+
|
|
136
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
137
|
+
"""
|
|
138
|
+
return self._post(
|
|
139
|
+
"/convert/v1/process",
|
|
140
|
+
body=maybe_transform(
|
|
141
|
+
{
|
|
142
|
+
"input_url": input_url,
|
|
143
|
+
"callback_url": callback_url,
|
|
144
|
+
},
|
|
145
|
+
v1_process_params.V1ProcessParams,
|
|
146
|
+
),
|
|
147
|
+
options=make_request_options(
|
|
148
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
149
|
+
),
|
|
150
|
+
cast_to=V1ProcessResponse,
|
|
151
|
+
)
|
|
152
|
+
|
|
153
|
+
def webhook(
|
|
154
|
+
self,
|
|
155
|
+
*,
|
|
156
|
+
job_id: str,
|
|
157
|
+
status: Literal["completed", "failed"],
|
|
158
|
+
error: str | Omit = omit,
|
|
159
|
+
result: v1_webhook_params.Result | Omit = omit,
|
|
160
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
161
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
162
|
+
extra_headers: Headers | None = None,
|
|
163
|
+
extra_query: Query | None = None,
|
|
164
|
+
extra_body: Body | None = None,
|
|
165
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
166
|
+
) -> V1WebhookResponse:
|
|
167
|
+
"""
|
|
168
|
+
Internal webhook endpoint that receives completion notifications from the Modal
|
|
169
|
+
FTR converter service. This endpoint handles status updates for file conversion
|
|
170
|
+
jobs, including success and failure notifications. Requires valid Bearer token
|
|
171
|
+
authentication.
|
|
172
|
+
|
|
173
|
+
Args:
|
|
174
|
+
job_id: Unique identifier for the conversion job
|
|
175
|
+
|
|
176
|
+
status: Status of the conversion job
|
|
177
|
+
|
|
178
|
+
error: Error message for failed jobs
|
|
179
|
+
|
|
180
|
+
result: Result data for completed jobs
|
|
181
|
+
|
|
182
|
+
extra_headers: Send extra headers
|
|
183
|
+
|
|
184
|
+
extra_query: Add additional query parameters to the request
|
|
185
|
+
|
|
186
|
+
extra_body: Add additional JSON properties to the request
|
|
187
|
+
|
|
188
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
189
|
+
"""
|
|
190
|
+
return self._post(
|
|
191
|
+
"/convert/v1/webhook",
|
|
192
|
+
body=maybe_transform(
|
|
193
|
+
{
|
|
194
|
+
"job_id": job_id,
|
|
195
|
+
"status": status,
|
|
196
|
+
"error": error,
|
|
197
|
+
"result": result,
|
|
198
|
+
},
|
|
199
|
+
v1_webhook_params.V1WebhookParams,
|
|
200
|
+
),
|
|
201
|
+
options=make_request_options(
|
|
202
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
203
|
+
),
|
|
204
|
+
cast_to=V1WebhookResponse,
|
|
205
|
+
)
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
class AsyncV1Resource(AsyncAPIResource):
|
|
209
|
+
@cached_property
|
|
210
|
+
def jobs(self) -> AsyncJobsResource:
|
|
211
|
+
return AsyncJobsResource(self._client)
|
|
212
|
+
|
|
213
|
+
@cached_property
|
|
214
|
+
def with_raw_response(self) -> AsyncV1ResourceWithRawResponse:
|
|
215
|
+
"""
|
|
216
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
217
|
+
the raw response object instead of the parsed content.
|
|
218
|
+
|
|
219
|
+
For more information, see https://www.github.com/CaseMark/casedev-python#accessing-raw-response-data-eg-headers
|
|
220
|
+
"""
|
|
221
|
+
return AsyncV1ResourceWithRawResponse(self)
|
|
222
|
+
|
|
223
|
+
@cached_property
|
|
224
|
+
def with_streaming_response(self) -> AsyncV1ResourceWithStreamingResponse:
|
|
225
|
+
"""
|
|
226
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
227
|
+
|
|
228
|
+
For more information, see https://www.github.com/CaseMark/casedev-python#with_streaming_response
|
|
229
|
+
"""
|
|
230
|
+
return AsyncV1ResourceWithStreamingResponse(self)
|
|
231
|
+
|
|
232
|
+
async def download(
|
|
233
|
+
self,
|
|
234
|
+
id: str,
|
|
235
|
+
*,
|
|
236
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
237
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
238
|
+
extra_headers: Headers | None = None,
|
|
239
|
+
extra_query: Query | None = None,
|
|
240
|
+
extra_body: Body | None = None,
|
|
241
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
242
|
+
) -> AsyncBinaryAPIResponse:
|
|
243
|
+
"""Download the converted M4A audio file from a completed FTR conversion job.
|
|
244
|
+
|
|
245
|
+
The
|
|
246
|
+
file is streamed directly to the client with appropriate headers for audio
|
|
247
|
+
playback or download.
|
|
248
|
+
|
|
249
|
+
Args:
|
|
250
|
+
extra_headers: Send extra headers
|
|
251
|
+
|
|
252
|
+
extra_query: Add additional query parameters to the request
|
|
253
|
+
|
|
254
|
+
extra_body: Add additional JSON properties to the request
|
|
255
|
+
|
|
256
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
257
|
+
"""
|
|
258
|
+
if not id:
|
|
259
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
260
|
+
extra_headers = {"Accept": "audio/mp4", **(extra_headers or {})}
|
|
261
|
+
return await self._get(
|
|
262
|
+
f"/convert/v1/download/{id}",
|
|
263
|
+
options=make_request_options(
|
|
264
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
265
|
+
),
|
|
266
|
+
cast_to=AsyncBinaryAPIResponse,
|
|
267
|
+
)
|
|
268
|
+
|
|
269
|
+
async def process(
|
|
270
|
+
self,
|
|
271
|
+
*,
|
|
272
|
+
input_url: str,
|
|
273
|
+
callback_url: str | Omit = omit,
|
|
274
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
275
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
276
|
+
extra_headers: Headers | None = None,
|
|
277
|
+
extra_query: Query | None = None,
|
|
278
|
+
extra_body: Body | None = None,
|
|
279
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
280
|
+
) -> V1ProcessResponse:
|
|
281
|
+
"""
|
|
282
|
+
Submit an FTR (ForensicTech Recording) file for conversion to M4A audio format.
|
|
283
|
+
This endpoint is commonly used to convert court recording files into standard
|
|
284
|
+
audio formats for transcription or playback. The conversion is processed
|
|
285
|
+
asynchronously - you'll receive a job ID to track the conversion status.
|
|
286
|
+
|
|
287
|
+
**Supported Input**: FTR files via S3 presigned URLs **Output Format**: M4A
|
|
288
|
+
audio **Processing**: Asynchronous with webhook callbacks
|
|
289
|
+
|
|
290
|
+
Args:
|
|
291
|
+
input_url: HTTPS URL to the FTR file (must be a valid S3 presigned URL)
|
|
292
|
+
|
|
293
|
+
callback_url: Optional webhook URL to receive conversion completion notification
|
|
294
|
+
|
|
295
|
+
extra_headers: Send extra headers
|
|
296
|
+
|
|
297
|
+
extra_query: Add additional query parameters to the request
|
|
298
|
+
|
|
299
|
+
extra_body: Add additional JSON properties to the request
|
|
300
|
+
|
|
301
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
302
|
+
"""
|
|
303
|
+
return await self._post(
|
|
304
|
+
"/convert/v1/process",
|
|
305
|
+
body=await async_maybe_transform(
|
|
306
|
+
{
|
|
307
|
+
"input_url": input_url,
|
|
308
|
+
"callback_url": callback_url,
|
|
309
|
+
},
|
|
310
|
+
v1_process_params.V1ProcessParams,
|
|
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=V1ProcessResponse,
|
|
316
|
+
)
|
|
317
|
+
|
|
318
|
+
async def webhook(
|
|
319
|
+
self,
|
|
320
|
+
*,
|
|
321
|
+
job_id: str,
|
|
322
|
+
status: Literal["completed", "failed"],
|
|
323
|
+
error: str | Omit = omit,
|
|
324
|
+
result: v1_webhook_params.Result | Omit = omit,
|
|
325
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
326
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
327
|
+
extra_headers: Headers | None = None,
|
|
328
|
+
extra_query: Query | None = None,
|
|
329
|
+
extra_body: Body | None = None,
|
|
330
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
331
|
+
) -> V1WebhookResponse:
|
|
332
|
+
"""
|
|
333
|
+
Internal webhook endpoint that receives completion notifications from the Modal
|
|
334
|
+
FTR converter service. This endpoint handles status updates for file conversion
|
|
335
|
+
jobs, including success and failure notifications. Requires valid Bearer token
|
|
336
|
+
authentication.
|
|
337
|
+
|
|
338
|
+
Args:
|
|
339
|
+
job_id: Unique identifier for the conversion job
|
|
340
|
+
|
|
341
|
+
status: Status of the conversion job
|
|
342
|
+
|
|
343
|
+
error: Error message for failed jobs
|
|
344
|
+
|
|
345
|
+
result: Result data for completed jobs
|
|
346
|
+
|
|
347
|
+
extra_headers: Send extra headers
|
|
348
|
+
|
|
349
|
+
extra_query: Add additional query parameters to the request
|
|
350
|
+
|
|
351
|
+
extra_body: Add additional JSON properties to the request
|
|
352
|
+
|
|
353
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
354
|
+
"""
|
|
355
|
+
return await self._post(
|
|
356
|
+
"/convert/v1/webhook",
|
|
357
|
+
body=await async_maybe_transform(
|
|
358
|
+
{
|
|
359
|
+
"job_id": job_id,
|
|
360
|
+
"status": status,
|
|
361
|
+
"error": error,
|
|
362
|
+
"result": result,
|
|
363
|
+
},
|
|
364
|
+
v1_webhook_params.V1WebhookParams,
|
|
365
|
+
),
|
|
366
|
+
options=make_request_options(
|
|
367
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
368
|
+
),
|
|
369
|
+
cast_to=V1WebhookResponse,
|
|
370
|
+
)
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
class V1ResourceWithRawResponse:
|
|
374
|
+
def __init__(self, v1: V1Resource) -> None:
|
|
375
|
+
self._v1 = v1
|
|
376
|
+
|
|
377
|
+
self.download = to_custom_raw_response_wrapper(
|
|
378
|
+
v1.download,
|
|
379
|
+
BinaryAPIResponse,
|
|
380
|
+
)
|
|
381
|
+
self.process = to_raw_response_wrapper(
|
|
382
|
+
v1.process,
|
|
383
|
+
)
|
|
384
|
+
self.webhook = to_raw_response_wrapper(
|
|
385
|
+
v1.webhook,
|
|
386
|
+
)
|
|
387
|
+
|
|
388
|
+
@cached_property
|
|
389
|
+
def jobs(self) -> JobsResourceWithRawResponse:
|
|
390
|
+
return JobsResourceWithRawResponse(self._v1.jobs)
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
class AsyncV1ResourceWithRawResponse:
|
|
394
|
+
def __init__(self, v1: AsyncV1Resource) -> None:
|
|
395
|
+
self._v1 = v1
|
|
396
|
+
|
|
397
|
+
self.download = async_to_custom_raw_response_wrapper(
|
|
398
|
+
v1.download,
|
|
399
|
+
AsyncBinaryAPIResponse,
|
|
400
|
+
)
|
|
401
|
+
self.process = async_to_raw_response_wrapper(
|
|
402
|
+
v1.process,
|
|
403
|
+
)
|
|
404
|
+
self.webhook = async_to_raw_response_wrapper(
|
|
405
|
+
v1.webhook,
|
|
406
|
+
)
|
|
407
|
+
|
|
408
|
+
@cached_property
|
|
409
|
+
def jobs(self) -> AsyncJobsResourceWithRawResponse:
|
|
410
|
+
return AsyncJobsResourceWithRawResponse(self._v1.jobs)
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
class V1ResourceWithStreamingResponse:
|
|
414
|
+
def __init__(self, v1: V1Resource) -> None:
|
|
415
|
+
self._v1 = v1
|
|
416
|
+
|
|
417
|
+
self.download = to_custom_streamed_response_wrapper(
|
|
418
|
+
v1.download,
|
|
419
|
+
StreamedBinaryAPIResponse,
|
|
420
|
+
)
|
|
421
|
+
self.process = to_streamed_response_wrapper(
|
|
422
|
+
v1.process,
|
|
423
|
+
)
|
|
424
|
+
self.webhook = to_streamed_response_wrapper(
|
|
425
|
+
v1.webhook,
|
|
426
|
+
)
|
|
427
|
+
|
|
428
|
+
@cached_property
|
|
429
|
+
def jobs(self) -> JobsResourceWithStreamingResponse:
|
|
430
|
+
return JobsResourceWithStreamingResponse(self._v1.jobs)
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
class AsyncV1ResourceWithStreamingResponse:
|
|
434
|
+
def __init__(self, v1: AsyncV1Resource) -> None:
|
|
435
|
+
self._v1 = v1
|
|
436
|
+
|
|
437
|
+
self.download = async_to_custom_streamed_response_wrapper(
|
|
438
|
+
v1.download,
|
|
439
|
+
AsyncStreamedBinaryAPIResponse,
|
|
440
|
+
)
|
|
441
|
+
self.process = async_to_streamed_response_wrapper(
|
|
442
|
+
v1.process,
|
|
443
|
+
)
|
|
444
|
+
self.webhook = async_to_streamed_response_wrapper(
|
|
445
|
+
v1.webhook,
|
|
446
|
+
)
|
|
447
|
+
|
|
448
|
+
@cached_property
|
|
449
|
+
def jobs(self) -> AsyncJobsResourceWithStreamingResponse:
|
|
450
|
+
return AsyncJobsResourceWithStreamingResponse(self._v1.jobs)
|
|
@@ -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 .format import (
|
|
12
|
+
FormatResource,
|
|
13
|
+
AsyncFormatResource,
|
|
14
|
+
FormatResourceWithRawResponse,
|
|
15
|
+
AsyncFormatResourceWithRawResponse,
|
|
16
|
+
FormatResourceWithStreamingResponse,
|
|
17
|
+
AsyncFormatResourceWithStreamingResponse,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
__all__ = [
|
|
21
|
+
"V1Resource",
|
|
22
|
+
"AsyncV1Resource",
|
|
23
|
+
"V1ResourceWithRawResponse",
|
|
24
|
+
"AsyncV1ResourceWithRawResponse",
|
|
25
|
+
"V1ResourceWithStreamingResponse",
|
|
26
|
+
"AsyncV1ResourceWithStreamingResponse",
|
|
27
|
+
"FormatResource",
|
|
28
|
+
"AsyncFormatResource",
|
|
29
|
+
"FormatResourceWithRawResponse",
|
|
30
|
+
"AsyncFormatResourceWithRawResponse",
|
|
31
|
+
"FormatResourceWithStreamingResponse",
|
|
32
|
+
"AsyncFormatResourceWithStreamingResponse",
|
|
33
|
+
]
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from .v1.v1 import (
|
|
6
|
+
V1Resource,
|
|
7
|
+
AsyncV1Resource,
|
|
8
|
+
V1ResourceWithRawResponse,
|
|
9
|
+
AsyncV1ResourceWithRawResponse,
|
|
10
|
+
V1ResourceWithStreamingResponse,
|
|
11
|
+
AsyncV1ResourceWithStreamingResponse,
|
|
12
|
+
)
|
|
13
|
+
from ..._compat import cached_property
|
|
14
|
+
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
15
|
+
|
|
16
|
+
__all__ = ["FormatResource", "AsyncFormatResource"]
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class FormatResource(SyncAPIResource):
|
|
20
|
+
@cached_property
|
|
21
|
+
def v1(self) -> V1Resource:
|
|
22
|
+
return V1Resource(self._client)
|
|
23
|
+
|
|
24
|
+
@cached_property
|
|
25
|
+
def with_raw_response(self) -> FormatResourceWithRawResponse:
|
|
26
|
+
"""
|
|
27
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
28
|
+
the raw response object instead of the parsed content.
|
|
29
|
+
|
|
30
|
+
For more information, see https://www.github.com/CaseMark/casedev-python#accessing-raw-response-data-eg-headers
|
|
31
|
+
"""
|
|
32
|
+
return FormatResourceWithRawResponse(self)
|
|
33
|
+
|
|
34
|
+
@cached_property
|
|
35
|
+
def with_streaming_response(self) -> FormatResourceWithStreamingResponse:
|
|
36
|
+
"""
|
|
37
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
38
|
+
|
|
39
|
+
For more information, see https://www.github.com/CaseMark/casedev-python#with_streaming_response
|
|
40
|
+
"""
|
|
41
|
+
return FormatResourceWithStreamingResponse(self)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class AsyncFormatResource(AsyncAPIResource):
|
|
45
|
+
@cached_property
|
|
46
|
+
def v1(self) -> AsyncV1Resource:
|
|
47
|
+
return AsyncV1Resource(self._client)
|
|
48
|
+
|
|
49
|
+
@cached_property
|
|
50
|
+
def with_raw_response(self) -> AsyncFormatResourceWithRawResponse:
|
|
51
|
+
"""
|
|
52
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
53
|
+
the raw response object instead of the parsed content.
|
|
54
|
+
|
|
55
|
+
For more information, see https://www.github.com/CaseMark/casedev-python#accessing-raw-response-data-eg-headers
|
|
56
|
+
"""
|
|
57
|
+
return AsyncFormatResourceWithRawResponse(self)
|
|
58
|
+
|
|
59
|
+
@cached_property
|
|
60
|
+
def with_streaming_response(self) -> AsyncFormatResourceWithStreamingResponse:
|
|
61
|
+
"""
|
|
62
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
63
|
+
|
|
64
|
+
For more information, see https://www.github.com/CaseMark/casedev-python#with_streaming_response
|
|
65
|
+
"""
|
|
66
|
+
return AsyncFormatResourceWithStreamingResponse(self)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
class FormatResourceWithRawResponse:
|
|
70
|
+
def __init__(self, format: FormatResource) -> None:
|
|
71
|
+
self._format = format
|
|
72
|
+
|
|
73
|
+
@cached_property
|
|
74
|
+
def v1(self) -> V1ResourceWithRawResponse:
|
|
75
|
+
return V1ResourceWithRawResponse(self._format.v1)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
class AsyncFormatResourceWithRawResponse:
|
|
79
|
+
def __init__(self, format: AsyncFormatResource) -> None:
|
|
80
|
+
self._format = format
|
|
81
|
+
|
|
82
|
+
@cached_property
|
|
83
|
+
def v1(self) -> AsyncV1ResourceWithRawResponse:
|
|
84
|
+
return AsyncV1ResourceWithRawResponse(self._format.v1)
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
class FormatResourceWithStreamingResponse:
|
|
88
|
+
def __init__(self, format: FormatResource) -> None:
|
|
89
|
+
self._format = format
|
|
90
|
+
|
|
91
|
+
@cached_property
|
|
92
|
+
def v1(self) -> V1ResourceWithStreamingResponse:
|
|
93
|
+
return V1ResourceWithStreamingResponse(self._format.v1)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
class AsyncFormatResourceWithStreamingResponse:
|
|
97
|
+
def __init__(self, format: AsyncFormatResource) -> None:
|
|
98
|
+
self._format = format
|
|
99
|
+
|
|
100
|
+
@cached_property
|
|
101
|
+
def v1(self) -> AsyncV1ResourceWithStreamingResponse:
|
|
102
|
+
return AsyncV1ResourceWithStreamingResponse(self._format.v1)
|
|
@@ -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 .templates import (
|
|
12
|
+
TemplatesResource,
|
|
13
|
+
AsyncTemplatesResource,
|
|
14
|
+
TemplatesResourceWithRawResponse,
|
|
15
|
+
AsyncTemplatesResourceWithRawResponse,
|
|
16
|
+
TemplatesResourceWithStreamingResponse,
|
|
17
|
+
AsyncTemplatesResourceWithStreamingResponse,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
__all__ = [
|
|
21
|
+
"TemplatesResource",
|
|
22
|
+
"AsyncTemplatesResource",
|
|
23
|
+
"TemplatesResourceWithRawResponse",
|
|
24
|
+
"AsyncTemplatesResourceWithRawResponse",
|
|
25
|
+
"TemplatesResourceWithStreamingResponse",
|
|
26
|
+
"AsyncTemplatesResourceWithStreamingResponse",
|
|
27
|
+
"V1Resource",
|
|
28
|
+
"AsyncV1Resource",
|
|
29
|
+
"V1ResourceWithRawResponse",
|
|
30
|
+
"AsyncV1ResourceWithRawResponse",
|
|
31
|
+
"V1ResourceWithStreamingResponse",
|
|
32
|
+
"AsyncV1ResourceWithStreamingResponse",
|
|
33
|
+
]
|