sarvamai 0.1.9a2__py3-none-any.whl → 0.1.11__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 +62 -2
- sarvamai/client.py +6 -0
- sarvamai/core/client_wrapper.py +2 -2
- sarvamai/errors/service_unavailable_error.py +1 -2
- sarvamai/requests/__init__.py +24 -0
- sarvamai/requests/base_job_parameters.py +7 -0
- sarvamai/requests/bulk_job_callback.py +15 -0
- sarvamai/requests/bulk_job_init_response_v_1.py +27 -0
- sarvamai/requests/configure_connection_data.py +2 -3
- sarvamai/requests/file_signed_url_details.py +10 -0
- sarvamai/requests/files_download_response.py +15 -0
- sarvamai/requests/files_request.py +10 -0
- sarvamai/requests/files_upload_response.py +15 -0
- sarvamai/requests/job_status_v_1.py +70 -0
- sarvamai/requests/speech_to_text_job_parameters.py +32 -0
- sarvamai/requests/speech_to_text_translate_job_parameters.py +28 -0
- sarvamai/requests/task_detail_v_1.py +15 -0
- sarvamai/requests/task_file_details.py +8 -0
- sarvamai/speech_to_text/raw_client.py +8 -9
- sarvamai/speech_to_text_job/__init__.py +4 -0
- sarvamai/speech_to_text_job/client.py +633 -0
- sarvamai/speech_to_text_job/job.py +472 -0
- sarvamai/speech_to_text_job/raw_client.py +1189 -0
- sarvamai/speech_to_text_translate_job/__init__.py +4 -0
- sarvamai/speech_to_text_translate_job/client.py +651 -0
- sarvamai/speech_to_text_translate_job/job.py +479 -0
- sarvamai/speech_to_text_translate_job/raw_client.py +1241 -0
- sarvamai/text_to_speech/client.py +11 -0
- sarvamai/text_to_speech/raw_client.py +11 -0
- sarvamai/types/__init__.py +34 -2
- sarvamai/types/base_job_parameters.py +17 -0
- sarvamai/types/bulk_job_callback.py +27 -0
- sarvamai/types/bulk_job_init_response_v_1.py +39 -0
- sarvamai/types/configure_connection_data.py +2 -1
- sarvamai/types/configure_connection_data_output_audio_codec.py +7 -0
- sarvamai/types/file_signed_url_details.py +20 -0
- sarvamai/types/files_download_response.py +25 -0
- sarvamai/types/files_request.py +20 -0
- sarvamai/types/files_upload_response.py +25 -0
- sarvamai/types/job_state.py +5 -0
- sarvamai/types/job_status_v_1.py +80 -0
- sarvamai/types/speech_to_text_job_parameters.py +44 -0
- sarvamai/types/speech_to_text_model.py +3 -1
- sarvamai/types/speech_to_text_translate_job_parameters.py +40 -0
- sarvamai/types/speech_to_text_translate_model.py +3 -1
- sarvamai/types/storage_container_type.py +5 -0
- sarvamai/types/task_detail_v_1.py +25 -0
- sarvamai/types/task_file_details.py +20 -0
- sarvamai/types/task_state.py +5 -0
- sarvamai/types/text_to_speech_output_audio_codec.py +7 -0
- {sarvamai-0.1.9a2.dist-info → sarvamai-0.1.11.dist-info}/METADATA +1 -1
- {sarvamai-0.1.9a2.dist-info → sarvamai-0.1.11.dist-info}/RECORD +53 -17
- sarvamai/types/format.py +0 -5
- {sarvamai-0.1.9a2.dist-info → sarvamai-0.1.11.dist-info}/WHEEL +0 -0
sarvamai/__init__.py
CHANGED
|
@@ -7,6 +7,9 @@ from .types import (
|
|
|
7
7
|
AudioMessage,
|
|
8
8
|
AudioOutput,
|
|
9
9
|
AudioOutputData,
|
|
10
|
+
BaseJobParameters,
|
|
11
|
+
BulkJobCallback,
|
|
12
|
+
BulkJobInitResponseV1,
|
|
10
13
|
ChatCompletionRequestAssistantMessage,
|
|
11
14
|
ChatCompletionRequestMessage,
|
|
12
15
|
ChatCompletionRequestMessage_Assistant,
|
|
@@ -21,6 +24,7 @@ from .types import (
|
|
|
21
24
|
ConfigureConnection,
|
|
22
25
|
ConfigureConnectionData,
|
|
23
26
|
ConfigureConnectionDataOutputAudioBitrate,
|
|
27
|
+
ConfigureConnectionDataOutputAudioCodec,
|
|
24
28
|
ConfigureConnectionDataSpeaker,
|
|
25
29
|
ConfigureConnectionDataTargetLanguageCode,
|
|
26
30
|
CreateChatCompletionResponse,
|
|
@@ -33,9 +37,14 @@ from .types import (
|
|
|
33
37
|
ErrorResponse,
|
|
34
38
|
ErrorResponseData,
|
|
35
39
|
EventsData,
|
|
40
|
+
FileSignedUrlDetails,
|
|
41
|
+
FilesDownloadResponse,
|
|
42
|
+
FilesRequest,
|
|
43
|
+
FilesUploadResponse,
|
|
36
44
|
FinishReason,
|
|
37
45
|
FlushSignal,
|
|
38
|
-
|
|
46
|
+
JobState,
|
|
47
|
+
JobStatusV1,
|
|
39
48
|
LanguageIdentificationResponse,
|
|
40
49
|
NumeralsFormat,
|
|
41
50
|
PingSignal,
|
|
@@ -46,12 +55,14 @@ from .types import (
|
|
|
46
55
|
SendText,
|
|
47
56
|
SendTextData,
|
|
48
57
|
SpeechSampleRate,
|
|
58
|
+
SpeechToTextJobParameters,
|
|
49
59
|
SpeechToTextLanguage,
|
|
50
60
|
SpeechToTextModel,
|
|
51
61
|
SpeechToTextResponse,
|
|
52
62
|
SpeechToTextResponseData,
|
|
53
63
|
SpeechToTextStreamingResponse,
|
|
54
64
|
SpeechToTextTranscriptionData,
|
|
65
|
+
SpeechToTextTranslateJobParameters,
|
|
55
66
|
SpeechToTextTranslateLanguage,
|
|
56
67
|
SpeechToTextTranslateModel,
|
|
57
68
|
SpeechToTextTranslateResponse,
|
|
@@ -60,8 +71,13 @@ from .types import (
|
|
|
60
71
|
SpeechToTextTranslateTranscriptionData,
|
|
61
72
|
SpokenFormNumeralsFormat,
|
|
62
73
|
StopConfiguration,
|
|
74
|
+
StorageContainerType,
|
|
75
|
+
TaskDetailV1,
|
|
76
|
+
TaskFileDetails,
|
|
77
|
+
TaskState,
|
|
63
78
|
TextToSpeechLanguage,
|
|
64
79
|
TextToSpeechModel,
|
|
80
|
+
TextToSpeechOutputAudioCodec,
|
|
65
81
|
TextToSpeechResponse,
|
|
66
82
|
TextToSpeechSpeaker,
|
|
67
83
|
TimestampsModel,
|
|
@@ -88,7 +104,9 @@ from .errors import (
|
|
|
88
104
|
from . import (
|
|
89
105
|
chat,
|
|
90
106
|
speech_to_text,
|
|
107
|
+
speech_to_text_job,
|
|
91
108
|
speech_to_text_streaming,
|
|
109
|
+
speech_to_text_translate_job,
|
|
92
110
|
speech_to_text_translate_streaming,
|
|
93
111
|
text,
|
|
94
112
|
text_to_speech,
|
|
@@ -101,6 +119,9 @@ from .requests import (
|
|
|
101
119
|
AudioMessageParams,
|
|
102
120
|
AudioOutputDataParams,
|
|
103
121
|
AudioOutputParams,
|
|
122
|
+
BaseJobParametersParams,
|
|
123
|
+
BulkJobCallbackParams,
|
|
124
|
+
BulkJobInitResponseV1Params,
|
|
104
125
|
ChatCompletionRequestAssistantMessageParams,
|
|
105
126
|
ChatCompletionRequestMessageParams,
|
|
106
127
|
ChatCompletionRequestMessage_AssistantParams,
|
|
@@ -123,20 +144,29 @@ from .requests import (
|
|
|
123
144
|
ErrorResponseDataParams,
|
|
124
145
|
ErrorResponseParams,
|
|
125
146
|
EventsDataParams,
|
|
147
|
+
FileSignedUrlDetailsParams,
|
|
148
|
+
FilesDownloadResponseParams,
|
|
149
|
+
FilesRequestParams,
|
|
150
|
+
FilesUploadResponseParams,
|
|
126
151
|
FlushSignalParams,
|
|
152
|
+
JobStatusV1Params,
|
|
127
153
|
LanguageIdentificationResponseParams,
|
|
128
154
|
PingSignalParams,
|
|
129
155
|
SendTextDataParams,
|
|
130
156
|
SendTextParams,
|
|
157
|
+
SpeechToTextJobParametersParams,
|
|
131
158
|
SpeechToTextResponseDataParams,
|
|
132
159
|
SpeechToTextResponseParams,
|
|
133
160
|
SpeechToTextStreamingResponseParams,
|
|
134
161
|
SpeechToTextTranscriptionDataParams,
|
|
162
|
+
SpeechToTextTranslateJobParametersParams,
|
|
135
163
|
SpeechToTextTranslateResponseDataParams,
|
|
136
164
|
SpeechToTextTranslateResponseParams,
|
|
137
165
|
SpeechToTextTranslateStreamingResponseParams,
|
|
138
166
|
SpeechToTextTranslateTranscriptionDataParams,
|
|
139
167
|
StopConfigurationParams,
|
|
168
|
+
TaskDetailV1Params,
|
|
169
|
+
TaskFileDetailsParams,
|
|
140
170
|
TextToSpeechResponseParams,
|
|
141
171
|
TimestampsModelParams,
|
|
142
172
|
TranscriptionMetricsParams,
|
|
@@ -167,6 +197,12 @@ __all__ = [
|
|
|
167
197
|
"AudioOutputDataParams",
|
|
168
198
|
"AudioOutputParams",
|
|
169
199
|
"BadRequestError",
|
|
200
|
+
"BaseJobParameters",
|
|
201
|
+
"BaseJobParametersParams",
|
|
202
|
+
"BulkJobCallback",
|
|
203
|
+
"BulkJobCallbackParams",
|
|
204
|
+
"BulkJobInitResponseV1",
|
|
205
|
+
"BulkJobInitResponseV1Params",
|
|
170
206
|
"ChatCompletionRequestAssistantMessage",
|
|
171
207
|
"ChatCompletionRequestAssistantMessageParams",
|
|
172
208
|
"ChatCompletionRequestMessage",
|
|
@@ -192,6 +228,7 @@ __all__ = [
|
|
|
192
228
|
"ConfigureConnection",
|
|
193
229
|
"ConfigureConnectionData",
|
|
194
230
|
"ConfigureConnectionDataOutputAudioBitrate",
|
|
231
|
+
"ConfigureConnectionDataOutputAudioCodec",
|
|
195
232
|
"ConfigureConnectionDataParams",
|
|
196
233
|
"ConfigureConnectionDataSpeaker",
|
|
197
234
|
"ConfigureConnectionDataTargetLanguageCode",
|
|
@@ -215,12 +252,22 @@ __all__ = [
|
|
|
215
252
|
"ErrorResponseParams",
|
|
216
253
|
"EventsData",
|
|
217
254
|
"EventsDataParams",
|
|
255
|
+
"FileSignedUrlDetails",
|
|
256
|
+
"FileSignedUrlDetailsParams",
|
|
257
|
+
"FilesDownloadResponse",
|
|
258
|
+
"FilesDownloadResponseParams",
|
|
259
|
+
"FilesRequest",
|
|
260
|
+
"FilesRequestParams",
|
|
261
|
+
"FilesUploadResponse",
|
|
262
|
+
"FilesUploadResponseParams",
|
|
218
263
|
"FinishReason",
|
|
219
264
|
"FlushSignal",
|
|
220
265
|
"FlushSignalParams",
|
|
221
266
|
"ForbiddenError",
|
|
222
|
-
"Format",
|
|
223
267
|
"InternalServerError",
|
|
268
|
+
"JobState",
|
|
269
|
+
"JobStatusV1",
|
|
270
|
+
"JobStatusV1Params",
|
|
224
271
|
"LanguageIdentificationResponse",
|
|
225
272
|
"LanguageIdentificationResponseParams",
|
|
226
273
|
"NumeralsFormat",
|
|
@@ -238,6 +285,8 @@ __all__ = [
|
|
|
238
285
|
"SendTextParams",
|
|
239
286
|
"ServiceUnavailableError",
|
|
240
287
|
"SpeechSampleRate",
|
|
288
|
+
"SpeechToTextJobParameters",
|
|
289
|
+
"SpeechToTextJobParametersParams",
|
|
241
290
|
"SpeechToTextLanguage",
|
|
242
291
|
"SpeechToTextModel",
|
|
243
292
|
"SpeechToTextResponse",
|
|
@@ -252,6 +301,8 @@ __all__ = [
|
|
|
252
301
|
"SpeechToTextStreamingVadSignals",
|
|
253
302
|
"SpeechToTextTranscriptionData",
|
|
254
303
|
"SpeechToTextTranscriptionDataParams",
|
|
304
|
+
"SpeechToTextTranslateJobParameters",
|
|
305
|
+
"SpeechToTextTranslateJobParametersParams",
|
|
255
306
|
"SpeechToTextTranslateLanguage",
|
|
256
307
|
"SpeechToTextTranslateModel",
|
|
257
308
|
"SpeechToTextTranslateResponse",
|
|
@@ -268,8 +319,15 @@ __all__ = [
|
|
|
268
319
|
"SpokenFormNumeralsFormat",
|
|
269
320
|
"StopConfiguration",
|
|
270
321
|
"StopConfigurationParams",
|
|
322
|
+
"StorageContainerType",
|
|
323
|
+
"TaskDetailV1",
|
|
324
|
+
"TaskDetailV1Params",
|
|
325
|
+
"TaskFileDetails",
|
|
326
|
+
"TaskFileDetailsParams",
|
|
327
|
+
"TaskState",
|
|
271
328
|
"TextToSpeechLanguage",
|
|
272
329
|
"TextToSpeechModel",
|
|
330
|
+
"TextToSpeechOutputAudioCodec",
|
|
273
331
|
"TextToSpeechResponse",
|
|
274
332
|
"TextToSpeechResponseParams",
|
|
275
333
|
"TextToSpeechSpeaker",
|
|
@@ -294,7 +352,9 @@ __all__ = [
|
|
|
294
352
|
"__version__",
|
|
295
353
|
"chat",
|
|
296
354
|
"speech_to_text",
|
|
355
|
+
"speech_to_text_job",
|
|
297
356
|
"speech_to_text_streaming",
|
|
357
|
+
"speech_to_text_translate_job",
|
|
298
358
|
"speech_to_text_translate_streaming",
|
|
299
359
|
"text",
|
|
300
360
|
"text_to_speech",
|
sarvamai/client.py
CHANGED
|
@@ -9,7 +9,9 @@ from .core.api_error import ApiError
|
|
|
9
9
|
from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
10
10
|
from .environment import SarvamAIEnvironment
|
|
11
11
|
from .speech_to_text.client import AsyncSpeechToTextClient, SpeechToTextClient
|
|
12
|
+
from .speech_to_text_job.client import AsyncSpeechToTextJobClient, SpeechToTextJobClient
|
|
12
13
|
from .speech_to_text_streaming.client import AsyncSpeechToTextStreamingClient, SpeechToTextStreamingClient
|
|
14
|
+
from .speech_to_text_translate_job.client import AsyncSpeechToTextTranslateJobClient, SpeechToTextTranslateJobClient
|
|
13
15
|
from .speech_to_text_translate_streaming.client import (
|
|
14
16
|
AsyncSpeechToTextTranslateStreamingClient,
|
|
15
17
|
SpeechToTextTranslateStreamingClient,
|
|
@@ -88,6 +90,8 @@ class SarvamAI:
|
|
|
88
90
|
self.speech_to_text = SpeechToTextClient(client_wrapper=self._client_wrapper)
|
|
89
91
|
self.text_to_speech = TextToSpeechClient(client_wrapper=self._client_wrapper)
|
|
90
92
|
self.chat = ChatClient(client_wrapper=self._client_wrapper)
|
|
93
|
+
self.speech_to_text_job = SpeechToTextJobClient(client_wrapper=self._client_wrapper)
|
|
94
|
+
self.speech_to_text_translate_job = SpeechToTextTranslateJobClient(client_wrapper=self._client_wrapper)
|
|
91
95
|
self.speech_to_text_streaming = SpeechToTextStreamingClient(client_wrapper=self._client_wrapper)
|
|
92
96
|
self.speech_to_text_translate_streaming = SpeechToTextTranslateStreamingClient(
|
|
93
97
|
client_wrapper=self._client_wrapper
|
|
@@ -164,6 +168,8 @@ class AsyncSarvamAI:
|
|
|
164
168
|
self.speech_to_text = AsyncSpeechToTextClient(client_wrapper=self._client_wrapper)
|
|
165
169
|
self.text_to_speech = AsyncTextToSpeechClient(client_wrapper=self._client_wrapper)
|
|
166
170
|
self.chat = AsyncChatClient(client_wrapper=self._client_wrapper)
|
|
171
|
+
self.speech_to_text_job = AsyncSpeechToTextJobClient(client_wrapper=self._client_wrapper)
|
|
172
|
+
self.speech_to_text_translate_job = AsyncSpeechToTextTranslateJobClient(client_wrapper=self._client_wrapper)
|
|
167
173
|
self.speech_to_text_streaming = AsyncSpeechToTextStreamingClient(client_wrapper=self._client_wrapper)
|
|
168
174
|
self.speech_to_text_translate_streaming = AsyncSpeechToTextTranslateStreamingClient(
|
|
169
175
|
client_wrapper=self._client_wrapper
|
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.11",
|
|
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.11",
|
|
30
30
|
**(self.get_custom_headers() or {}),
|
|
31
31
|
}
|
|
32
32
|
headers["api-subscription-key"] = self.api_subscription_key
|
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
import typing
|
|
4
4
|
|
|
5
5
|
from ..core.api_error import ApiError
|
|
6
|
-
from ..types.error_message import ErrorMessage
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
class ServiceUnavailableError(ApiError):
|
|
10
|
-
def __init__(self, body:
|
|
9
|
+
def __init__(self, body: typing.Optional[typing.Any], headers: typing.Optional[typing.Dict[str, str]] = None):
|
|
11
10
|
super().__init__(status_code=503, headers=headers, body=body)
|
sarvamai/requests/__init__.py
CHANGED
|
@@ -6,6 +6,9 @@ from .audio_data import AudioDataParams
|
|
|
6
6
|
from .audio_message import AudioMessageParams
|
|
7
7
|
from .audio_output import AudioOutputParams
|
|
8
8
|
from .audio_output_data import AudioOutputDataParams
|
|
9
|
+
from .base_job_parameters import BaseJobParametersParams
|
|
10
|
+
from .bulk_job_callback import BulkJobCallbackParams
|
|
11
|
+
from .bulk_job_init_response_v_1 import BulkJobInitResponseV1Params
|
|
9
12
|
from .chat_completion_request_assistant_message import ChatCompletionRequestAssistantMessageParams
|
|
10
13
|
from .chat_completion_request_message import (
|
|
11
14
|
ChatCompletionRequestMessageParams,
|
|
@@ -30,20 +33,29 @@ from .error_message import ErrorMessageParams
|
|
|
30
33
|
from .error_response import ErrorResponseParams
|
|
31
34
|
from .error_response_data import ErrorResponseDataParams
|
|
32
35
|
from .events_data import EventsDataParams
|
|
36
|
+
from .file_signed_url_details import FileSignedUrlDetailsParams
|
|
37
|
+
from .files_download_response import FilesDownloadResponseParams
|
|
38
|
+
from .files_request import FilesRequestParams
|
|
39
|
+
from .files_upload_response import FilesUploadResponseParams
|
|
33
40
|
from .flush_signal import FlushSignalParams
|
|
41
|
+
from .job_status_v_1 import JobStatusV1Params
|
|
34
42
|
from .language_identification_response import LanguageIdentificationResponseParams
|
|
35
43
|
from .ping_signal import PingSignalParams
|
|
36
44
|
from .send_text import SendTextParams
|
|
37
45
|
from .send_text_data import SendTextDataParams
|
|
46
|
+
from .speech_to_text_job_parameters import SpeechToTextJobParametersParams
|
|
38
47
|
from .speech_to_text_response import SpeechToTextResponseParams
|
|
39
48
|
from .speech_to_text_response_data import SpeechToTextResponseDataParams
|
|
40
49
|
from .speech_to_text_streaming_response import SpeechToTextStreamingResponseParams
|
|
41
50
|
from .speech_to_text_transcription_data import SpeechToTextTranscriptionDataParams
|
|
51
|
+
from .speech_to_text_translate_job_parameters import SpeechToTextTranslateJobParametersParams
|
|
42
52
|
from .speech_to_text_translate_response import SpeechToTextTranslateResponseParams
|
|
43
53
|
from .speech_to_text_translate_response_data import SpeechToTextTranslateResponseDataParams
|
|
44
54
|
from .speech_to_text_translate_streaming_response import SpeechToTextTranslateStreamingResponseParams
|
|
45
55
|
from .speech_to_text_translate_transcription_data import SpeechToTextTranslateTranscriptionDataParams
|
|
46
56
|
from .stop_configuration import StopConfigurationParams
|
|
57
|
+
from .task_detail_v_1 import TaskDetailV1Params
|
|
58
|
+
from .task_file_details import TaskFileDetailsParams
|
|
47
59
|
from .text_to_speech_response import TextToSpeechResponseParams
|
|
48
60
|
from .timestamps_model import TimestampsModelParams
|
|
49
61
|
from .transcription_metrics import TranscriptionMetricsParams
|
|
@@ -55,6 +67,9 @@ __all__ = [
|
|
|
55
67
|
"AudioMessageParams",
|
|
56
68
|
"AudioOutputDataParams",
|
|
57
69
|
"AudioOutputParams",
|
|
70
|
+
"BaseJobParametersParams",
|
|
71
|
+
"BulkJobCallbackParams",
|
|
72
|
+
"BulkJobInitResponseV1Params",
|
|
58
73
|
"ChatCompletionRequestAssistantMessageParams",
|
|
59
74
|
"ChatCompletionRequestMessageParams",
|
|
60
75
|
"ChatCompletionRequestMessage_AssistantParams",
|
|
@@ -77,20 +92,29 @@ __all__ = [
|
|
|
77
92
|
"ErrorResponseDataParams",
|
|
78
93
|
"ErrorResponseParams",
|
|
79
94
|
"EventsDataParams",
|
|
95
|
+
"FileSignedUrlDetailsParams",
|
|
96
|
+
"FilesDownloadResponseParams",
|
|
97
|
+
"FilesRequestParams",
|
|
98
|
+
"FilesUploadResponseParams",
|
|
80
99
|
"FlushSignalParams",
|
|
100
|
+
"JobStatusV1Params",
|
|
81
101
|
"LanguageIdentificationResponseParams",
|
|
82
102
|
"PingSignalParams",
|
|
83
103
|
"SendTextDataParams",
|
|
84
104
|
"SendTextParams",
|
|
105
|
+
"SpeechToTextJobParametersParams",
|
|
85
106
|
"SpeechToTextResponseDataParams",
|
|
86
107
|
"SpeechToTextResponseParams",
|
|
87
108
|
"SpeechToTextStreamingResponseParams",
|
|
88
109
|
"SpeechToTextTranscriptionDataParams",
|
|
110
|
+
"SpeechToTextTranslateJobParametersParams",
|
|
89
111
|
"SpeechToTextTranslateResponseDataParams",
|
|
90
112
|
"SpeechToTextTranslateResponseParams",
|
|
91
113
|
"SpeechToTextTranslateStreamingResponseParams",
|
|
92
114
|
"SpeechToTextTranslateTranscriptionDataParams",
|
|
93
115
|
"StopConfigurationParams",
|
|
116
|
+
"TaskDetailV1Params",
|
|
117
|
+
"TaskFileDetailsParams",
|
|
94
118
|
"TextToSpeechResponseParams",
|
|
95
119
|
"TimestampsModelParams",
|
|
96
120
|
"TranscriptionMetricsParams",
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing_extensions
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class BulkJobCallbackParams(typing_extensions.TypedDict):
|
|
7
|
+
url: str
|
|
8
|
+
"""
|
|
9
|
+
Webhook url to call upon job completion
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
auth_token: typing_extensions.NotRequired[str]
|
|
13
|
+
"""
|
|
14
|
+
Authorization token required for the callback Url
|
|
15
|
+
"""
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing_extensions
|
|
4
|
+
from ..types.job_state import JobState
|
|
5
|
+
from ..types.storage_container_type import StorageContainerType
|
|
6
|
+
from .base_job_parameters import BaseJobParametersParams
|
|
7
|
+
from .bulk_job_callback import BulkJobCallbackParams
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class BulkJobInitResponseV1Params(typing_extensions.TypedDict):
|
|
11
|
+
job_id: str
|
|
12
|
+
"""
|
|
13
|
+
Job UUID.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
storage_container_type: StorageContainerType
|
|
17
|
+
"""
|
|
18
|
+
Storage Container Type
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
job_parameters: BaseJobParametersParams
|
|
22
|
+
job_state: JobState
|
|
23
|
+
owner_id: str
|
|
24
|
+
callback: typing_extensions.NotRequired[BulkJobCallbackParams]
|
|
25
|
+
"""
|
|
26
|
+
Parameters for callback URL
|
|
27
|
+
"""
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
import typing
|
|
4
|
-
|
|
5
3
|
import typing_extensions
|
|
6
4
|
from ..types.configure_connection_data_output_audio_bitrate import ConfigureConnectionDataOutputAudioBitrate
|
|
5
|
+
from ..types.configure_connection_data_output_audio_codec import ConfigureConnectionDataOutputAudioCodec
|
|
7
6
|
from ..types.configure_connection_data_speaker import ConfigureConnectionDataSpeaker
|
|
8
7
|
from ..types.configure_connection_data_target_language_code import ConfigureConnectionDataTargetLanguageCode
|
|
9
8
|
|
|
@@ -62,7 +61,7 @@ class ConfigureConnectionDataParams(typing_extensions.TypedDict):
|
|
|
62
61
|
of mixed-language text. Default is false.
|
|
63
62
|
"""
|
|
64
63
|
|
|
65
|
-
output_audio_codec: typing_extensions.NotRequired[
|
|
64
|
+
output_audio_codec: typing_extensions.NotRequired[ConfigureConnectionDataOutputAudioCodec]
|
|
66
65
|
"""
|
|
67
66
|
Audio codec (currently supports MP3 only, optimized for real-time playback)
|
|
68
67
|
"""
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import typing_extensions
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class FileSignedUrlDetailsParams(typing_extensions.TypedDict):
|
|
9
|
+
file_url: str
|
|
10
|
+
file_metadata: typing_extensions.NotRequired[typing.Dict[str, typing.Optional[typing.Any]]]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import typing_extensions
|
|
6
|
+
from ..types.job_state import JobState
|
|
7
|
+
from ..types.storage_container_type import StorageContainerType
|
|
8
|
+
from .file_signed_url_details import FileSignedUrlDetailsParams
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class FilesDownloadResponseParams(typing_extensions.TypedDict):
|
|
12
|
+
job_id: str
|
|
13
|
+
job_state: JobState
|
|
14
|
+
download_urls: typing.Dict[str, FileSignedUrlDetailsParams]
|
|
15
|
+
storage_container_type: StorageContainerType
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import typing_extensions
|
|
6
|
+
from ..types.job_state import JobState
|
|
7
|
+
from ..types.storage_container_type import StorageContainerType
|
|
8
|
+
from .file_signed_url_details import FileSignedUrlDetailsParams
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class FilesUploadResponseParams(typing_extensions.TypedDict):
|
|
12
|
+
job_id: str
|
|
13
|
+
job_state: JobState
|
|
14
|
+
upload_urls: typing.Dict[str, FileSignedUrlDetailsParams]
|
|
15
|
+
storage_container_type: StorageContainerType
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import typing_extensions
|
|
6
|
+
from ..types.job_state import JobState
|
|
7
|
+
from ..types.storage_container_type import StorageContainerType
|
|
8
|
+
from .task_detail_v_1 import TaskDetailV1Params
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class JobStatusV1Params(typing_extensions.TypedDict):
|
|
12
|
+
job_state: JobState
|
|
13
|
+
"""
|
|
14
|
+
Job State
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
created_at: str
|
|
18
|
+
"""
|
|
19
|
+
Created At
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
updated_at: str
|
|
23
|
+
"""
|
|
24
|
+
Updated At
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
job_id: str
|
|
28
|
+
"""
|
|
29
|
+
Job Id
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
total_files: typing_extensions.NotRequired[int]
|
|
33
|
+
"""
|
|
34
|
+
Total Files
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
successful_files_count: typing_extensions.NotRequired[int]
|
|
38
|
+
"""
|
|
39
|
+
Success Count
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
failed_files_count: typing_extensions.NotRequired[int]
|
|
43
|
+
"""
|
|
44
|
+
Failed Count
|
|
45
|
+
"""
|
|
46
|
+
|
|
47
|
+
owner_id: str
|
|
48
|
+
"""
|
|
49
|
+
Owner of the job
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
storage_container_type: StorageContainerType
|
|
53
|
+
"""
|
|
54
|
+
Storage Container Type
|
|
55
|
+
"""
|
|
56
|
+
|
|
57
|
+
error_message: typing_extensions.NotRequired[str]
|
|
58
|
+
"""
|
|
59
|
+
Error Message
|
|
60
|
+
"""
|
|
61
|
+
|
|
62
|
+
job_details: typing_extensions.NotRequired[typing.Sequence[TaskDetailV1Params]]
|
|
63
|
+
"""
|
|
64
|
+
Job details at file level.
|
|
65
|
+
"""
|
|
66
|
+
|
|
67
|
+
num_internal_retries: typing_extensions.NotRequired[int]
|
|
68
|
+
"""
|
|
69
|
+
Number of internal retries
|
|
70
|
+
"""
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing_extensions
|
|
4
|
+
from ..types.speech_to_text_model import SpeechToTextModel
|
|
5
|
+
from ..types.speech_to_text_translate_language import SpeechToTextTranslateLanguage
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class SpeechToTextJobParametersParams(typing_extensions.TypedDict):
|
|
9
|
+
language_code: typing_extensions.NotRequired[SpeechToTextTranslateLanguage]
|
|
10
|
+
"""
|
|
11
|
+
Language code
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
model: typing_extensions.NotRequired[SpeechToTextModel]
|
|
15
|
+
"""
|
|
16
|
+
Model to be used for speech to text
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
with_timestamps: typing_extensions.NotRequired[bool]
|
|
20
|
+
"""
|
|
21
|
+
Whether to include timestamps in the response
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
with_diarization: typing_extensions.NotRequired[bool]
|
|
25
|
+
"""
|
|
26
|
+
Enables speaker diarization, which identifies and separates different speakers in the audio. In beta mode
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
num_speakers: typing_extensions.NotRequired[int]
|
|
30
|
+
"""
|
|
31
|
+
Number of speakers to be detected in the audio. This is used when with_diarization is true.
|
|
32
|
+
"""
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing_extensions
|
|
4
|
+
from ..types.speech_to_text_translate_model import SpeechToTextTranslateModel
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class SpeechToTextTranslateJobParametersParams(typing_extensions.TypedDict):
|
|
8
|
+
prompt: typing_extensions.NotRequired[str]
|
|
9
|
+
"""
|
|
10
|
+
Prompt to assist the transcription
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
model: typing_extensions.NotRequired[SpeechToTextTranslateModel]
|
|
14
|
+
"""
|
|
15
|
+
Model to be used for converting speech to text in target language
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
with_diarization: typing_extensions.NotRequired[bool]
|
|
19
|
+
"""
|
|
20
|
+
Enables speaker diarization, which identifies and separates different speakers in the audio.
|
|
21
|
+
When set to true, the API will provide speaker-specific segments in the response.
|
|
22
|
+
Note: This parameter is currently in Beta mode.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
num_speakers: typing_extensions.NotRequired[int]
|
|
26
|
+
"""
|
|
27
|
+
Number of speakers to be detected in the audio. This is used when with_diarization is set to true.
|
|
28
|
+
"""
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import typing_extensions
|
|
6
|
+
from ..types.task_state import TaskState
|
|
7
|
+
from .task_file_details import TaskFileDetailsParams
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class TaskDetailV1Params(typing_extensions.TypedDict):
|
|
11
|
+
inputs: typing_extensions.NotRequired[typing.Sequence[TaskFileDetailsParams]]
|
|
12
|
+
outputs: typing_extensions.NotRequired[typing.Sequence[TaskFileDetailsParams]]
|
|
13
|
+
state: typing_extensions.NotRequired[TaskState]
|
|
14
|
+
error_message: typing_extensions.NotRequired[str]
|
|
15
|
+
exception_name: typing_extensions.NotRequired[str]
|
|
@@ -15,7 +15,6 @@ from ..errors.internal_server_error import InternalServerError
|
|
|
15
15
|
from ..errors.service_unavailable_error import ServiceUnavailableError
|
|
16
16
|
from ..errors.too_many_requests_error import TooManyRequestsError
|
|
17
17
|
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
|
18
|
-
from ..types.error_message import ErrorMessage
|
|
19
18
|
from ..types.speech_to_text_language import SpeechToTextLanguage
|
|
20
19
|
from ..types.speech_to_text_model import SpeechToTextModel
|
|
21
20
|
from ..types.speech_to_text_response import SpeechToTextResponse
|
|
@@ -159,9 +158,9 @@ class RawSpeechToTextClient:
|
|
|
159
158
|
raise ServiceUnavailableError(
|
|
160
159
|
headers=dict(_response.headers),
|
|
161
160
|
body=typing.cast(
|
|
162
|
-
|
|
161
|
+
typing.Optional[typing.Any],
|
|
163
162
|
parse_obj_as(
|
|
164
|
-
type_=
|
|
163
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
165
164
|
object_=_response.json(),
|
|
166
165
|
),
|
|
167
166
|
),
|
|
@@ -297,9 +296,9 @@ class RawSpeechToTextClient:
|
|
|
297
296
|
raise ServiceUnavailableError(
|
|
298
297
|
headers=dict(_response.headers),
|
|
299
298
|
body=typing.cast(
|
|
300
|
-
|
|
299
|
+
typing.Optional[typing.Any],
|
|
301
300
|
parse_obj_as(
|
|
302
|
-
type_=
|
|
301
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
303
302
|
object_=_response.json(),
|
|
304
303
|
),
|
|
305
304
|
),
|
|
@@ -443,9 +442,9 @@ class AsyncRawSpeechToTextClient:
|
|
|
443
442
|
raise ServiceUnavailableError(
|
|
444
443
|
headers=dict(_response.headers),
|
|
445
444
|
body=typing.cast(
|
|
446
|
-
|
|
445
|
+
typing.Optional[typing.Any],
|
|
447
446
|
parse_obj_as(
|
|
448
|
-
type_=
|
|
447
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
449
448
|
object_=_response.json(),
|
|
450
449
|
),
|
|
451
450
|
),
|
|
@@ -581,9 +580,9 @@ class AsyncRawSpeechToTextClient:
|
|
|
581
580
|
raise ServiceUnavailableError(
|
|
582
581
|
headers=dict(_response.headers),
|
|
583
582
|
body=typing.cast(
|
|
584
|
-
|
|
583
|
+
typing.Optional[typing.Any],
|
|
585
584
|
parse_obj_as(
|
|
586
|
-
type_=
|
|
585
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
587
586
|
object_=_response.json(),
|
|
588
587
|
),
|
|
589
588
|
),
|