sarvamai 0.1.12a0__py3-none-any.whl → 0.1.13a2__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.
- sarvamai/__init__.py +4 -4
- sarvamai/core/client_wrapper.py +2 -2
- sarvamai/requests/__init__.py +2 -2
- sarvamai/requests/bulk_job_init_response_v_1.py +0 -6
- sarvamai/requests/{job_status_v_1.py → job_status_v_1_response.py} +1 -11
- sarvamai/speech_to_text_job/client.py +21 -196
- sarvamai/speech_to_text_job/raw_client.py +17 -17
- sarvamai/speech_to_text_translate_job/client.py +18 -171
- sarvamai/speech_to_text_translate_job/raw_client.py +17 -17
- sarvamai/types/__init__.py +2 -2
- sarvamai/types/bulk_job_init_response_v_1.py +0 -6
- sarvamai/types/{job_status_v_1.py → job_status_v_1_response.py} +1 -11
- {sarvamai-0.1.12a0.dist-info → sarvamai-0.1.13a2.dist-info}/METADATA +1 -1
- {sarvamai-0.1.12a0.dist-info → sarvamai-0.1.13a2.dist-info}/RECORD +15 -17
- sarvamai/speech_to_text_job/job.py +0 -472
- sarvamai/speech_to_text_translate_job/job.py +0 -479
- {sarvamai-0.1.12a0.dist-info → sarvamai-0.1.13a2.dist-info}/WHEEL +0 -0
sarvamai/__init__.py
CHANGED
|
@@ -44,7 +44,7 @@ from .types import (
|
|
|
44
44
|
FinishReason,
|
|
45
45
|
FlushSignal,
|
|
46
46
|
JobState,
|
|
47
|
-
|
|
47
|
+
JobStatusV1Response,
|
|
48
48
|
LanguageIdentificationResponse,
|
|
49
49
|
NumeralsFormat,
|
|
50
50
|
PingSignal,
|
|
@@ -149,7 +149,7 @@ from .requests import (
|
|
|
149
149
|
FilesRequestParams,
|
|
150
150
|
FilesUploadResponseParams,
|
|
151
151
|
FlushSignalParams,
|
|
152
|
-
|
|
152
|
+
JobStatusV1ResponseParams,
|
|
153
153
|
LanguageIdentificationResponseParams,
|
|
154
154
|
PingSignalParams,
|
|
155
155
|
SendTextDataParams,
|
|
@@ -266,8 +266,8 @@ __all__ = [
|
|
|
266
266
|
"ForbiddenError",
|
|
267
267
|
"InternalServerError",
|
|
268
268
|
"JobState",
|
|
269
|
-
"
|
|
270
|
-
"
|
|
269
|
+
"JobStatusV1Response",
|
|
270
|
+
"JobStatusV1ResponseParams",
|
|
271
271
|
"LanguageIdentificationResponse",
|
|
272
272
|
"LanguageIdentificationResponseParams",
|
|
273
273
|
"NumeralsFormat",
|
sarvamai/core/client_wrapper.py
CHANGED
|
@@ -23,10 +23,10 @@ class BaseClientWrapper:
|
|
|
23
23
|
|
|
24
24
|
def get_headers(self) -> typing.Dict[str, str]:
|
|
25
25
|
headers: typing.Dict[str, str] = {
|
|
26
|
-
"User-Agent": "sarvamai/0.1.
|
|
26
|
+
"User-Agent": "sarvamai/0.1.13a2",
|
|
27
27
|
"X-Fern-Language": "Python",
|
|
28
28
|
"X-Fern-SDK-Name": "sarvamai",
|
|
29
|
-
"X-Fern-SDK-Version": "0.1.
|
|
29
|
+
"X-Fern-SDK-Version": "0.1.13a2",
|
|
30
30
|
**(self.get_custom_headers() or {}),
|
|
31
31
|
}
|
|
32
32
|
headers["api-subscription-key"] = self.api_subscription_key
|
sarvamai/requests/__init__.py
CHANGED
|
@@ -38,7 +38,7 @@ from .files_download_response import FilesDownloadResponseParams
|
|
|
38
38
|
from .files_request import FilesRequestParams
|
|
39
39
|
from .files_upload_response import FilesUploadResponseParams
|
|
40
40
|
from .flush_signal import FlushSignalParams
|
|
41
|
-
from .
|
|
41
|
+
from .job_status_v_1_response import JobStatusV1ResponseParams
|
|
42
42
|
from .language_identification_response import LanguageIdentificationResponseParams
|
|
43
43
|
from .ping_signal import PingSignalParams
|
|
44
44
|
from .send_text import SendTextParams
|
|
@@ -97,7 +97,7 @@ __all__ = [
|
|
|
97
97
|
"FilesRequestParams",
|
|
98
98
|
"FilesUploadResponseParams",
|
|
99
99
|
"FlushSignalParams",
|
|
100
|
-
"
|
|
100
|
+
"JobStatusV1ResponseParams",
|
|
101
101
|
"LanguageIdentificationResponseParams",
|
|
102
102
|
"PingSignalParams",
|
|
103
103
|
"SendTextDataParams",
|
|
@@ -4,7 +4,6 @@ import typing_extensions
|
|
|
4
4
|
from ..types.job_state import JobState
|
|
5
5
|
from ..types.storage_container_type import StorageContainerType
|
|
6
6
|
from .base_job_parameters import BaseJobParametersParams
|
|
7
|
-
from .bulk_job_callback import BulkJobCallbackParams
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
class BulkJobInitResponseV1Params(typing_extensions.TypedDict):
|
|
@@ -20,8 +19,3 @@ class BulkJobInitResponseV1Params(typing_extensions.TypedDict):
|
|
|
20
19
|
|
|
21
20
|
job_parameters: BaseJobParametersParams
|
|
22
21
|
job_state: JobState
|
|
23
|
-
owner_id: str
|
|
24
|
-
callback: typing_extensions.NotRequired[BulkJobCallbackParams]
|
|
25
|
-
"""
|
|
26
|
-
Parameters for callback URL
|
|
27
|
-
"""
|
|
@@ -8,7 +8,7 @@ from ..types.storage_container_type import StorageContainerType
|
|
|
8
8
|
from .task_detail_v_1 import TaskDetailV1Params
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
class
|
|
11
|
+
class JobStatusV1ResponseParams(typing_extensions.TypedDict):
|
|
12
12
|
job_state: JobState
|
|
13
13
|
"""
|
|
14
14
|
Job State
|
|
@@ -44,11 +44,6 @@ class JobStatusV1Params(typing_extensions.TypedDict):
|
|
|
44
44
|
Failed Count
|
|
45
45
|
"""
|
|
46
46
|
|
|
47
|
-
owner_id: str
|
|
48
|
-
"""
|
|
49
|
-
Owner of the job
|
|
50
|
-
"""
|
|
51
|
-
|
|
52
47
|
storage_container_type: StorageContainerType
|
|
53
48
|
"""
|
|
54
49
|
Storage Container Type
|
|
@@ -63,8 +58,3 @@ class JobStatusV1Params(typing_extensions.TypedDict):
|
|
|
63
58
|
"""
|
|
64
59
|
Job details at file level.
|
|
65
60
|
"""
|
|
66
|
-
|
|
67
|
-
num_internal_retries: typing_extensions.NotRequired[int]
|
|
68
|
-
"""
|
|
69
|
-
Number of internal retries
|
|
70
|
-
"""
|
|
@@ -9,11 +9,8 @@ from ..requests.speech_to_text_job_parameters import SpeechToTextJobParametersPa
|
|
|
9
9
|
from ..types.bulk_job_init_response_v_1 import BulkJobInitResponseV1
|
|
10
10
|
from ..types.files_download_response import FilesDownloadResponse
|
|
11
11
|
from ..types.files_upload_response import FilesUploadResponse
|
|
12
|
-
from ..types.
|
|
13
|
-
from ..types.speech_to_text_model import SpeechToTextModel
|
|
14
|
-
from ..types.speech_to_text_language import SpeechToTextLanguage
|
|
12
|
+
from ..types.job_status_v_1_response import JobStatusV1Response
|
|
15
13
|
from .raw_client import AsyncRawSpeechToTextJobClient, RawSpeechToTextJobClient
|
|
16
|
-
from .job import AsyncSpeechToTextJob, SpeechToTextJob
|
|
17
14
|
|
|
18
15
|
# this is used as the default value for optional parameters
|
|
19
16
|
OMIT = typing.cast(typing.Any, ...)
|
|
@@ -72,15 +69,13 @@ class SpeechToTextJobClient:
|
|
|
72
69
|
)
|
|
73
70
|
"""
|
|
74
71
|
_response = self._raw_client.initialise(
|
|
75
|
-
job_parameters=job_parameters,
|
|
76
|
-
callback=callback,
|
|
77
|
-
request_options=request_options,
|
|
72
|
+
job_parameters=job_parameters, callback=callback, request_options=request_options
|
|
78
73
|
)
|
|
79
74
|
return _response.data
|
|
80
75
|
|
|
81
76
|
def get_status(
|
|
82
77
|
self, job_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
83
|
-
) ->
|
|
78
|
+
) -> JobStatusV1Response:
|
|
84
79
|
"""
|
|
85
80
|
Get the status of a speech to text bulk job V1
|
|
86
81
|
|
|
@@ -94,7 +89,7 @@ class SpeechToTextJobClient:
|
|
|
94
89
|
|
|
95
90
|
Returns
|
|
96
91
|
-------
|
|
97
|
-
|
|
92
|
+
JobStatusV1Response
|
|
98
93
|
Successful Response
|
|
99
94
|
|
|
100
95
|
Examples
|
|
@@ -117,7 +112,7 @@ class SpeechToTextJobClient:
|
|
|
117
112
|
*,
|
|
118
113
|
ptu_id: typing.Optional[int] = None,
|
|
119
114
|
request_options: typing.Optional[RequestOptions] = None,
|
|
120
|
-
) ->
|
|
115
|
+
) -> JobStatusV1Response:
|
|
121
116
|
"""
|
|
122
117
|
Start a speech to text bulk job V1
|
|
123
118
|
|
|
@@ -133,7 +128,7 @@ class SpeechToTextJobClient:
|
|
|
133
128
|
|
|
134
129
|
Returns
|
|
135
130
|
-------
|
|
136
|
-
|
|
131
|
+
JobStatusV1Response
|
|
137
132
|
Successful Response
|
|
138
133
|
|
|
139
134
|
Examples
|
|
@@ -147,17 +142,11 @@ class SpeechToTextJobClient:
|
|
|
147
142
|
job_id="job_id",
|
|
148
143
|
)
|
|
149
144
|
"""
|
|
150
|
-
_response = self._raw_client.start(
|
|
151
|
-
job_id, ptu_id=ptu_id, request_options=request_options
|
|
152
|
-
)
|
|
145
|
+
_response = self._raw_client.start(job_id, ptu_id=ptu_id, request_options=request_options)
|
|
153
146
|
return _response.data
|
|
154
147
|
|
|
155
148
|
def get_upload_links(
|
|
156
|
-
self,
|
|
157
|
-
*,
|
|
158
|
-
job_id: str,
|
|
159
|
-
files: typing.Sequence[str],
|
|
160
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
149
|
+
self, *, job_id: str, files: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None
|
|
161
150
|
) -> FilesUploadResponse:
|
|
162
151
|
"""
|
|
163
152
|
Start a speech to text bulk job V1
|
|
@@ -188,17 +177,11 @@ class SpeechToTextJobClient:
|
|
|
188
177
|
files=["files"],
|
|
189
178
|
)
|
|
190
179
|
"""
|
|
191
|
-
_response = self._raw_client.get_upload_links(
|
|
192
|
-
job_id=job_id, files=files, request_options=request_options
|
|
193
|
-
)
|
|
180
|
+
_response = self._raw_client.get_upload_links(job_id=job_id, files=files, request_options=request_options)
|
|
194
181
|
return _response.data
|
|
195
182
|
|
|
196
183
|
def get_download_links(
|
|
197
|
-
self,
|
|
198
|
-
*,
|
|
199
|
-
job_id: str,
|
|
200
|
-
files: typing.Sequence[str],
|
|
201
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
184
|
+
self, *, job_id: str, files: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None
|
|
202
185
|
) -> FilesDownloadResponse:
|
|
203
186
|
"""
|
|
204
187
|
Start a speech to text bulk job V1
|
|
@@ -229,81 +212,9 @@ class SpeechToTextJobClient:
|
|
|
229
212
|
files=["files"],
|
|
230
213
|
)
|
|
231
214
|
"""
|
|
232
|
-
_response = self._raw_client.get_download_links(
|
|
233
|
-
job_id=job_id, files=files, request_options=request_options
|
|
234
|
-
)
|
|
215
|
+
_response = self._raw_client.get_download_links(job_id=job_id, files=files, request_options=request_options)
|
|
235
216
|
return _response.data
|
|
236
217
|
|
|
237
|
-
def create_job(
|
|
238
|
-
self,
|
|
239
|
-
model: SpeechToTextModel = "saarika:v2.5",
|
|
240
|
-
with_diarization: bool = False,
|
|
241
|
-
with_timestamps: bool = False,
|
|
242
|
-
language_code: typing.Optional[SpeechToTextLanguage] = None,
|
|
243
|
-
num_speakers: typing.Optional[int] = None,
|
|
244
|
-
callback: typing.Optional[BulkJobCallbackParams] = OMIT,
|
|
245
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
246
|
-
) -> SpeechToTextJob:
|
|
247
|
-
"""
|
|
248
|
-
Create a new Speech-to-Text bulk job.
|
|
249
|
-
|
|
250
|
-
Parameters
|
|
251
|
-
----------
|
|
252
|
-
model : SpeechToTextModel, default="saarika:v2.5"
|
|
253
|
-
The model to use for transcription.
|
|
254
|
-
|
|
255
|
-
with_diarization : typing.Optional[bool], default=False
|
|
256
|
-
Whether to enable speaker diarization (distinguishing who said what).
|
|
257
|
-
|
|
258
|
-
with_timestamps : typing.Optional[bool], default=False
|
|
259
|
-
Whether to include word-level timestamps in the transcription output.
|
|
260
|
-
|
|
261
|
-
language_code : typing.Optional[SpeechToTextLanguage], default=None
|
|
262
|
-
The language code of the input audio (e.g., "hi-IN", "bn-IN").
|
|
263
|
-
|
|
264
|
-
num_speakers : typing.Optional[int], default=None
|
|
265
|
-
The number of distinct speakers in the audio, if known.
|
|
266
|
-
|
|
267
|
-
callback : typing.Optional[BulkJobCallbackParams], default=OMIT
|
|
268
|
-
Optional callback configuration to receive job completion events.
|
|
269
|
-
|
|
270
|
-
request_options : typing.Optional[RequestOptions], default=None
|
|
271
|
-
Request-specific configuration.
|
|
272
|
-
|
|
273
|
-
Returns
|
|
274
|
-
-------
|
|
275
|
-
SpeechToTextJob
|
|
276
|
-
A handle to the newly created Speech-to-Text job.
|
|
277
|
-
"""
|
|
278
|
-
response = self.initialise(
|
|
279
|
-
job_parameters=SpeechToTextJobParametersParams(
|
|
280
|
-
language_code=language_code,
|
|
281
|
-
model=model,
|
|
282
|
-
num_speakers=num_speakers, # type: ignore[typeddict-item]
|
|
283
|
-
with_diarization=with_diarization,
|
|
284
|
-
with_timestamps=with_timestamps,
|
|
285
|
-
),
|
|
286
|
-
callback=callback,
|
|
287
|
-
request_options=request_options,
|
|
288
|
-
)
|
|
289
|
-
return SpeechToTextJob(job_id=response.job_id, client=self)
|
|
290
|
-
|
|
291
|
-
def get_job(self, job_id: str) -> SpeechToTextJob:
|
|
292
|
-
"""
|
|
293
|
-
Get an existing Speech-to-Text job handle by job ID.
|
|
294
|
-
|
|
295
|
-
Parameters
|
|
296
|
-
----------
|
|
297
|
-
job_id : str
|
|
298
|
-
The job ID of the previously created Speech-to-Text job.
|
|
299
|
-
|
|
300
|
-
Returns
|
|
301
|
-
-------
|
|
302
|
-
SpeechToTextJob
|
|
303
|
-
A job handle which can be used to check status or retrieve results.
|
|
304
|
-
"""
|
|
305
|
-
return SpeechToTextJob(job_id=job_id, client=self)
|
|
306
|
-
|
|
307
218
|
|
|
308
219
|
class AsyncSpeechToTextJobClient:
|
|
309
220
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
@@ -366,15 +277,13 @@ class AsyncSpeechToTextJobClient:
|
|
|
366
277
|
asyncio.run(main())
|
|
367
278
|
"""
|
|
368
279
|
_response = await self._raw_client.initialise(
|
|
369
|
-
job_parameters=job_parameters,
|
|
370
|
-
callback=callback,
|
|
371
|
-
request_options=request_options,
|
|
280
|
+
job_parameters=job_parameters, callback=callback, request_options=request_options
|
|
372
281
|
)
|
|
373
282
|
return _response.data
|
|
374
283
|
|
|
375
284
|
async def get_status(
|
|
376
285
|
self, job_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
377
|
-
) ->
|
|
286
|
+
) -> JobStatusV1Response:
|
|
378
287
|
"""
|
|
379
288
|
Get the status of a speech to text bulk job V1
|
|
380
289
|
|
|
@@ -388,7 +297,7 @@ class AsyncSpeechToTextJobClient:
|
|
|
388
297
|
|
|
389
298
|
Returns
|
|
390
299
|
-------
|
|
391
|
-
|
|
300
|
+
JobStatusV1Response
|
|
392
301
|
Successful Response
|
|
393
302
|
|
|
394
303
|
Examples
|
|
@@ -410,9 +319,7 @@ class AsyncSpeechToTextJobClient:
|
|
|
410
319
|
|
|
411
320
|
asyncio.run(main())
|
|
412
321
|
"""
|
|
413
|
-
_response = await self._raw_client.get_status(
|
|
414
|
-
job_id, request_options=request_options
|
|
415
|
-
)
|
|
322
|
+
_response = await self._raw_client.get_status(job_id, request_options=request_options)
|
|
416
323
|
return _response.data
|
|
417
324
|
|
|
418
325
|
async def start(
|
|
@@ -421,7 +328,7 @@ class AsyncSpeechToTextJobClient:
|
|
|
421
328
|
*,
|
|
422
329
|
ptu_id: typing.Optional[int] = None,
|
|
423
330
|
request_options: typing.Optional[RequestOptions] = None,
|
|
424
|
-
) ->
|
|
331
|
+
) -> JobStatusV1Response:
|
|
425
332
|
"""
|
|
426
333
|
Start a speech to text bulk job V1
|
|
427
334
|
|
|
@@ -437,7 +344,7 @@ class AsyncSpeechToTextJobClient:
|
|
|
437
344
|
|
|
438
345
|
Returns
|
|
439
346
|
-------
|
|
440
|
-
|
|
347
|
+
JobStatusV1Response
|
|
441
348
|
Successful Response
|
|
442
349
|
|
|
443
350
|
Examples
|
|
@@ -459,17 +366,11 @@ class AsyncSpeechToTextJobClient:
|
|
|
459
366
|
|
|
460
367
|
asyncio.run(main())
|
|
461
368
|
"""
|
|
462
|
-
_response = await self._raw_client.start(
|
|
463
|
-
job_id, ptu_id=ptu_id, request_options=request_options
|
|
464
|
-
)
|
|
369
|
+
_response = await self._raw_client.start(job_id, ptu_id=ptu_id, request_options=request_options)
|
|
465
370
|
return _response.data
|
|
466
371
|
|
|
467
372
|
async def get_upload_links(
|
|
468
|
-
self,
|
|
469
|
-
*,
|
|
470
|
-
job_id: str,
|
|
471
|
-
files: typing.Sequence[str],
|
|
472
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
373
|
+
self, *, job_id: str, files: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None
|
|
473
374
|
) -> FilesUploadResponse:
|
|
474
375
|
"""
|
|
475
376
|
Start a speech to text bulk job V1
|
|
@@ -508,17 +409,11 @@ class AsyncSpeechToTextJobClient:
|
|
|
508
409
|
|
|
509
410
|
asyncio.run(main())
|
|
510
411
|
"""
|
|
511
|
-
_response = await self._raw_client.get_upload_links(
|
|
512
|
-
job_id=job_id, files=files, request_options=request_options
|
|
513
|
-
)
|
|
412
|
+
_response = await self._raw_client.get_upload_links(job_id=job_id, files=files, request_options=request_options)
|
|
514
413
|
return _response.data
|
|
515
414
|
|
|
516
415
|
async def get_download_links(
|
|
517
|
-
self,
|
|
518
|
-
*,
|
|
519
|
-
job_id: str,
|
|
520
|
-
files: typing.Sequence[str],
|
|
521
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
416
|
+
self, *, job_id: str, files: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None
|
|
522
417
|
) -> FilesDownloadResponse:
|
|
523
418
|
"""
|
|
524
419
|
Start a speech to text bulk job V1
|
|
@@ -561,73 +456,3 @@ class AsyncSpeechToTextJobClient:
|
|
|
561
456
|
job_id=job_id, files=files, request_options=request_options
|
|
562
457
|
)
|
|
563
458
|
return _response.data
|
|
564
|
-
|
|
565
|
-
async def create_job(
|
|
566
|
-
self,
|
|
567
|
-
model: SpeechToTextModel = "saarika:v2.5",
|
|
568
|
-
with_diarization: bool = False,
|
|
569
|
-
with_timestamps: bool = False,
|
|
570
|
-
language_code: typing.Optional[SpeechToTextLanguage] = None,
|
|
571
|
-
num_speakers: typing.Optional[int] = None,
|
|
572
|
-
callback: typing.Optional[BulkJobCallbackParams] = OMIT,
|
|
573
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
574
|
-
) -> "AsyncSpeechToTextJob":
|
|
575
|
-
"""
|
|
576
|
-
Create a new Speech-to-Text bulk job.
|
|
577
|
-
|
|
578
|
-
Parameters
|
|
579
|
-
----------
|
|
580
|
-
model : SpeechToTextModel, default="saarika:v2.5"
|
|
581
|
-
The model to use for transcription.
|
|
582
|
-
|
|
583
|
-
with_diarization : typing.Optional[bool], default=False
|
|
584
|
-
Whether to enable speaker diarization (distinguishing who said what).
|
|
585
|
-
|
|
586
|
-
with_timestamps : typing.Optional[bool], default=False
|
|
587
|
-
Whether to include word-level timestamps in the transcription output.
|
|
588
|
-
|
|
589
|
-
language_code : typing.Optional[SpeechToTextLanguage], default=None
|
|
590
|
-
The language code of the input audio (e.g., "hi-IN", "bn-IN").
|
|
591
|
-
|
|
592
|
-
num_speakers : typing.Optional[int], default=None
|
|
593
|
-
The number of distinct speakers in the audio, if known.
|
|
594
|
-
|
|
595
|
-
callback : typing.Optional[BulkJobCallbackParams], default=OMIT
|
|
596
|
-
Optional callback configuration to receive job completion events.
|
|
597
|
-
|
|
598
|
-
request_options : typing.Optional[RequestOptions], default=None
|
|
599
|
-
Request-specific configuration.
|
|
600
|
-
|
|
601
|
-
Returns
|
|
602
|
-
-------
|
|
603
|
-
AsyncSpeechToTextJob
|
|
604
|
-
A handle to the newly created job.
|
|
605
|
-
"""
|
|
606
|
-
response = await self.initialise(
|
|
607
|
-
job_parameters=SpeechToTextJobParametersParams(
|
|
608
|
-
language_code=language_code,
|
|
609
|
-
model=model,
|
|
610
|
-
with_diarization=with_diarization,
|
|
611
|
-
with_timestamps=with_timestamps,
|
|
612
|
-
num_speakers=num_speakers, # type: ignore[typeddict-item]
|
|
613
|
-
),
|
|
614
|
-
callback=callback,
|
|
615
|
-
request_options=request_options,
|
|
616
|
-
)
|
|
617
|
-
return AsyncSpeechToTextJob(job_id=response.job_id, client=self)
|
|
618
|
-
|
|
619
|
-
async def get_job(self, job_id: str) -> "AsyncSpeechToTextJob":
|
|
620
|
-
"""
|
|
621
|
-
Get an existing Speech-to-Text job handle by job ID.
|
|
622
|
-
|
|
623
|
-
Parameters
|
|
624
|
-
----------
|
|
625
|
-
job_id : str
|
|
626
|
-
The job ID of the previously created speech-to-text job.
|
|
627
|
-
|
|
628
|
-
Returns
|
|
629
|
-
-------
|
|
630
|
-
AsyncSpeechToTextJob
|
|
631
|
-
A job handle which can be used to check status or retrieve results.
|
|
632
|
-
"""
|
|
633
|
-
return AsyncSpeechToTextJob(job_id=job_id, client=self)
|
|
@@ -21,7 +21,7 @@ from ..requests.speech_to_text_job_parameters import SpeechToTextJobParametersPa
|
|
|
21
21
|
from ..types.bulk_job_init_response_v_1 import BulkJobInitResponseV1
|
|
22
22
|
from ..types.files_download_response import FilesDownloadResponse
|
|
23
23
|
from ..types.files_upload_response import FilesUploadResponse
|
|
24
|
-
from ..types.
|
|
24
|
+
from ..types.job_status_v_1_response import JobStatusV1Response
|
|
25
25
|
|
|
26
26
|
# this is used as the default value for optional parameters
|
|
27
27
|
OMIT = typing.cast(typing.Any, ...)
|
|
@@ -158,7 +158,7 @@ class RawSpeechToTextJobClient:
|
|
|
158
158
|
|
|
159
159
|
def get_status(
|
|
160
160
|
self, job_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
161
|
-
) -> HttpResponse[
|
|
161
|
+
) -> HttpResponse[JobStatusV1Response]:
|
|
162
162
|
"""
|
|
163
163
|
Get the status of a speech to text bulk job V1
|
|
164
164
|
|
|
@@ -172,7 +172,7 @@ class RawSpeechToTextJobClient:
|
|
|
172
172
|
|
|
173
173
|
Returns
|
|
174
174
|
-------
|
|
175
|
-
HttpResponse[
|
|
175
|
+
HttpResponse[JobStatusV1Response]
|
|
176
176
|
Successful Response
|
|
177
177
|
"""
|
|
178
178
|
_response = self._client_wrapper.httpx_client.request(
|
|
@@ -184,9 +184,9 @@ class RawSpeechToTextJobClient:
|
|
|
184
184
|
try:
|
|
185
185
|
if 200 <= _response.status_code < 300:
|
|
186
186
|
_data = typing.cast(
|
|
187
|
-
|
|
187
|
+
JobStatusV1Response,
|
|
188
188
|
parse_obj_as(
|
|
189
|
-
type_=
|
|
189
|
+
type_=JobStatusV1Response, # type: ignore
|
|
190
190
|
object_=_response.json(),
|
|
191
191
|
),
|
|
192
192
|
)
|
|
@@ -268,7 +268,7 @@ class RawSpeechToTextJobClient:
|
|
|
268
268
|
*,
|
|
269
269
|
ptu_id: typing.Optional[int] = None,
|
|
270
270
|
request_options: typing.Optional[RequestOptions] = None,
|
|
271
|
-
) -> HttpResponse[
|
|
271
|
+
) -> HttpResponse[JobStatusV1Response]:
|
|
272
272
|
"""
|
|
273
273
|
Start a speech to text bulk job V1
|
|
274
274
|
|
|
@@ -284,7 +284,7 @@ class RawSpeechToTextJobClient:
|
|
|
284
284
|
|
|
285
285
|
Returns
|
|
286
286
|
-------
|
|
287
|
-
HttpResponse[
|
|
287
|
+
HttpResponse[JobStatusV1Response]
|
|
288
288
|
Successful Response
|
|
289
289
|
"""
|
|
290
290
|
_response = self._client_wrapper.httpx_client.request(
|
|
@@ -299,9 +299,9 @@ class RawSpeechToTextJobClient:
|
|
|
299
299
|
try:
|
|
300
300
|
if 200 <= _response.status_code < 300:
|
|
301
301
|
_data = typing.cast(
|
|
302
|
-
|
|
302
|
+
JobStatusV1Response,
|
|
303
303
|
parse_obj_as(
|
|
304
|
-
type_=
|
|
304
|
+
type_=JobStatusV1Response, # type: ignore
|
|
305
305
|
object_=_response.json(),
|
|
306
306
|
),
|
|
307
307
|
)
|
|
@@ -739,7 +739,7 @@ class AsyncRawSpeechToTextJobClient:
|
|
|
739
739
|
|
|
740
740
|
async def get_status(
|
|
741
741
|
self, job_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
742
|
-
) -> AsyncHttpResponse[
|
|
742
|
+
) -> AsyncHttpResponse[JobStatusV1Response]:
|
|
743
743
|
"""
|
|
744
744
|
Get the status of a speech to text bulk job V1
|
|
745
745
|
|
|
@@ -753,7 +753,7 @@ class AsyncRawSpeechToTextJobClient:
|
|
|
753
753
|
|
|
754
754
|
Returns
|
|
755
755
|
-------
|
|
756
|
-
AsyncHttpResponse[
|
|
756
|
+
AsyncHttpResponse[JobStatusV1Response]
|
|
757
757
|
Successful Response
|
|
758
758
|
"""
|
|
759
759
|
_response = await self._client_wrapper.httpx_client.request(
|
|
@@ -765,9 +765,9 @@ class AsyncRawSpeechToTextJobClient:
|
|
|
765
765
|
try:
|
|
766
766
|
if 200 <= _response.status_code < 300:
|
|
767
767
|
_data = typing.cast(
|
|
768
|
-
|
|
768
|
+
JobStatusV1Response,
|
|
769
769
|
parse_obj_as(
|
|
770
|
-
type_=
|
|
770
|
+
type_=JobStatusV1Response, # type: ignore
|
|
771
771
|
object_=_response.json(),
|
|
772
772
|
),
|
|
773
773
|
)
|
|
@@ -849,7 +849,7 @@ class AsyncRawSpeechToTextJobClient:
|
|
|
849
849
|
*,
|
|
850
850
|
ptu_id: typing.Optional[int] = None,
|
|
851
851
|
request_options: typing.Optional[RequestOptions] = None,
|
|
852
|
-
) -> AsyncHttpResponse[
|
|
852
|
+
) -> AsyncHttpResponse[JobStatusV1Response]:
|
|
853
853
|
"""
|
|
854
854
|
Start a speech to text bulk job V1
|
|
855
855
|
|
|
@@ -865,7 +865,7 @@ class AsyncRawSpeechToTextJobClient:
|
|
|
865
865
|
|
|
866
866
|
Returns
|
|
867
867
|
-------
|
|
868
|
-
AsyncHttpResponse[
|
|
868
|
+
AsyncHttpResponse[JobStatusV1Response]
|
|
869
869
|
Successful Response
|
|
870
870
|
"""
|
|
871
871
|
_response = await self._client_wrapper.httpx_client.request(
|
|
@@ -880,9 +880,9 @@ class AsyncRawSpeechToTextJobClient:
|
|
|
880
880
|
try:
|
|
881
881
|
if 200 <= _response.status_code < 300:
|
|
882
882
|
_data = typing.cast(
|
|
883
|
-
|
|
883
|
+
JobStatusV1Response,
|
|
884
884
|
parse_obj_as(
|
|
885
|
-
type_=
|
|
885
|
+
type_=JobStatusV1Response, # type: ignore
|
|
886
886
|
object_=_response.json(),
|
|
887
887
|
),
|
|
888
888
|
)
|