sarvamai 0.1.23a2__py3-none-any.whl → 0.1.23a4__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 +203 -405
- sarvamai/chat/raw_client.py +20 -20
- sarvamai/client.py +34 -186
- sarvamai/core/__init__.py +21 -76
- sarvamai/core/client_wrapper.py +3 -19
- sarvamai/core/force_multipart.py +2 -4
- sarvamai/core/http_client.py +97 -217
- sarvamai/core/http_response.py +1 -1
- sarvamai/core/jsonable_encoder.py +0 -8
- sarvamai/core/pydantic_utilities.py +4 -110
- sarvamai/errors/__init__.py +6 -40
- sarvamai/errors/bad_request_error.py +1 -1
- sarvamai/errors/forbidden_error.py +1 -1
- sarvamai/errors/internal_server_error.py +1 -1
- sarvamai/errors/service_unavailable_error.py +1 -1
- sarvamai/errors/too_many_requests_error.py +1 -1
- sarvamai/errors/unprocessable_entity_error.py +1 -1
- sarvamai/requests/__init__.py +62 -150
- sarvamai/requests/configure_connection.py +4 -0
- sarvamai/requests/configure_connection_data.py +40 -11
- sarvamai/requests/error_response_data.py +1 -1
- sarvamai/requests/file_signed_url_details.py +1 -1
- sarvamai/requests/speech_to_text_job_parameters.py +10 -1
- sarvamai/requests/speech_to_text_transcription_data.py +2 -2
- sarvamai/speech_to_text/client.py +29 -2
- sarvamai/speech_to_text/raw_client.py +81 -56
- sarvamai/speech_to_text_job/client.py +60 -15
- sarvamai/speech_to_text_job/raw_client.py +120 -120
- sarvamai/speech_to_text_streaming/__init__.py +10 -38
- sarvamai/speech_to_text_streaming/client.py +32 -6
- sarvamai/speech_to_text_streaming/raw_client.py +32 -6
- sarvamai/speech_to_text_streaming/types/__init__.py +8 -36
- sarvamai/speech_to_text_streaming/types/speech_to_text_streaming_mode.py +7 -0
- sarvamai/speech_to_text_streaming/types/speech_to_text_streaming_model.py +5 -0
- sarvamai/speech_to_text_translate_job/raw_client.py +120 -120
- sarvamai/speech_to_text_translate_streaming/__init__.py +5 -36
- sarvamai/speech_to_text_translate_streaming/types/__init__.py +3 -36
- sarvamai/text/raw_client.py +60 -60
- sarvamai/text_to_speech/client.py +100 -16
- sarvamai/text_to_speech/raw_client.py +120 -36
- sarvamai/text_to_speech_streaming/__init__.py +2 -29
- sarvamai/text_to_speech_streaming/client.py +19 -6
- sarvamai/text_to_speech_streaming/raw_client.py +19 -6
- sarvamai/text_to_speech_streaming/types/__init__.py +3 -31
- sarvamai/text_to_speech_streaming/types/text_to_speech_streaming_model.py +5 -0
- sarvamai/types/__init__.py +102 -222
- sarvamai/types/chat_completion_request_message.py +2 -6
- sarvamai/types/configure_connection.py +4 -0
- sarvamai/types/configure_connection_data.py +40 -11
- sarvamai/types/configure_connection_data_model.py +5 -0
- sarvamai/types/configure_connection_data_speaker.py +35 -1
- sarvamai/types/error_response_data.py +1 -1
- sarvamai/types/file_signed_url_details.py +1 -1
- sarvamai/types/mode.py +7 -0
- sarvamai/types/speech_to_text_job_parameters.py +10 -1
- sarvamai/types/speech_to_text_model.py +3 -1
- sarvamai/types/speech_to_text_transcription_data.py +2 -2
- sarvamai/types/speech_to_text_translate_model.py +1 -1
- sarvamai/types/text_to_speech_model.py +1 -1
- sarvamai/types/text_to_speech_speaker.py +35 -1
- {sarvamai-0.1.23a2.dist-info → sarvamai-0.1.23a4.dist-info}/METADATA +1 -2
- {sarvamai-0.1.23a2.dist-info → sarvamai-0.1.23a4.dist-info}/RECORD +63 -63
- sarvamai/core/http_sse/__init__.py +0 -42
- sarvamai/core/http_sse/_api.py +0 -112
- sarvamai/core/http_sse/_decoders.py +0 -61
- sarvamai/core/http_sse/_exceptions.py +0 -7
- sarvamai/core/http_sse/_models.py +0 -17
- {sarvamai-0.1.23a2.dist-info → sarvamai-0.1.23a4.dist-info}/WHEEL +0 -0
sarvamai/__init__.py
CHANGED
|
@@ -2,411 +2,204 @@
|
|
|
2
2
|
|
|
3
3
|
# isort: skip_file
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
_dynamic_imports: typing.Dict[str, str] = {
|
|
204
|
-
"AsyncSarvamAI": ".client",
|
|
205
|
-
"AudioData": ".types",
|
|
206
|
-
"AudioDataParams": ".requests",
|
|
207
|
-
"AudioMessage": ".types",
|
|
208
|
-
"AudioMessageParams": ".requests",
|
|
209
|
-
"AudioOutput": ".types",
|
|
210
|
-
"AudioOutputData": ".types",
|
|
211
|
-
"AudioOutputDataParams": ".requests",
|
|
212
|
-
"AudioOutputParams": ".requests",
|
|
213
|
-
"BadRequestError": ".errors",
|
|
214
|
-
"BaseJobParameters": ".types",
|
|
215
|
-
"BaseJobParametersParams": ".requests",
|
|
216
|
-
"BulkJobCallback": ".types",
|
|
217
|
-
"BulkJobCallbackParams": ".requests",
|
|
218
|
-
"BulkJobInitResponseV1": ".types",
|
|
219
|
-
"BulkJobInitResponseV1Params": ".requests",
|
|
220
|
-
"ChatCompletionRequestAssistantMessage": ".types",
|
|
221
|
-
"ChatCompletionRequestAssistantMessageParams": ".requests",
|
|
222
|
-
"ChatCompletionRequestMessage": ".types",
|
|
223
|
-
"ChatCompletionRequestMessageParams": ".requests",
|
|
224
|
-
"ChatCompletionRequestMessage_Assistant": ".types",
|
|
225
|
-
"ChatCompletionRequestMessage_AssistantParams": ".requests",
|
|
226
|
-
"ChatCompletionRequestMessage_System": ".types",
|
|
227
|
-
"ChatCompletionRequestMessage_SystemParams": ".requests",
|
|
228
|
-
"ChatCompletionRequestMessage_User": ".types",
|
|
229
|
-
"ChatCompletionRequestMessage_UserParams": ".requests",
|
|
230
|
-
"ChatCompletionRequestSystemMessage": ".types",
|
|
231
|
-
"ChatCompletionRequestSystemMessageParams": ".requests",
|
|
232
|
-
"ChatCompletionRequestUserMessage": ".types",
|
|
233
|
-
"ChatCompletionRequestUserMessageParams": ".requests",
|
|
234
|
-
"ChatCompletionResponseMessage": ".types",
|
|
235
|
-
"ChatCompletionResponseMessageParams": ".requests",
|
|
236
|
-
"Choice": ".types",
|
|
237
|
-
"ChoiceParams": ".requests",
|
|
238
|
-
"CompletionEventFlag": ".types",
|
|
239
|
-
"CompletionUsage": ".types",
|
|
240
|
-
"CompletionUsageParams": ".requests",
|
|
241
|
-
"ConfigMessage": ".types",
|
|
242
|
-
"ConfigMessageParams": ".requests",
|
|
243
|
-
"ConfigureConnection": ".types",
|
|
244
|
-
"ConfigureConnectionData": ".types",
|
|
245
|
-
"ConfigureConnectionDataOutputAudioBitrate": ".types",
|
|
246
|
-
"ConfigureConnectionDataOutputAudioCodec": ".types",
|
|
247
|
-
"ConfigureConnectionDataParams": ".requests",
|
|
248
|
-
"ConfigureConnectionDataSpeaker": ".types",
|
|
249
|
-
"ConfigureConnectionDataTargetLanguageCode": ".types",
|
|
250
|
-
"ConfigureConnectionParams": ".requests",
|
|
251
|
-
"ConnectionSampleRate": ".types",
|
|
252
|
-
"CreateChatCompletionResponse": ".types",
|
|
253
|
-
"CreateChatCompletionResponseParams": ".requests",
|
|
254
|
-
"DiarizedEntry": ".types",
|
|
255
|
-
"DiarizedEntryParams": ".requests",
|
|
256
|
-
"DiarizedTranscript": ".types",
|
|
257
|
-
"DiarizedTranscriptParams": ".requests",
|
|
258
|
-
"ErrorCode": ".types",
|
|
259
|
-
"ErrorData": ".types",
|
|
260
|
-
"ErrorDataParams": ".requests",
|
|
261
|
-
"ErrorDetails": ".types",
|
|
262
|
-
"ErrorDetailsParams": ".requests",
|
|
263
|
-
"ErrorMessage": ".types",
|
|
264
|
-
"ErrorMessageParams": ".requests",
|
|
265
|
-
"ErrorResponse": ".types",
|
|
266
|
-
"ErrorResponseData": ".types",
|
|
267
|
-
"ErrorResponseDataParams": ".requests",
|
|
268
|
-
"ErrorResponseParams": ".requests",
|
|
269
|
-
"EventResponse": ".types",
|
|
270
|
-
"EventResponseData": ".types",
|
|
271
|
-
"EventResponseDataParams": ".requests",
|
|
272
|
-
"EventResponseParams": ".requests",
|
|
273
|
-
"EventsData": ".types",
|
|
274
|
-
"EventsDataParams": ".requests",
|
|
275
|
-
"EventsDataSignalType": ".types",
|
|
276
|
-
"FileSignedUrlDetails": ".types",
|
|
277
|
-
"FileSignedUrlDetailsParams": ".requests",
|
|
278
|
-
"FilesDownloadResponse": ".types",
|
|
279
|
-
"FilesDownloadResponseParams": ".requests",
|
|
280
|
-
"FilesRequest": ".types",
|
|
281
|
-
"FilesRequestParams": ".requests",
|
|
282
|
-
"FilesUploadResponse": ".types",
|
|
283
|
-
"FilesUploadResponseParams": ".requests",
|
|
284
|
-
"FinishReason": ".types",
|
|
285
|
-
"FlushSignal": ".types",
|
|
286
|
-
"FlushSignalParams": ".requests",
|
|
287
|
-
"ForbiddenError": ".errors",
|
|
288
|
-
"InputAudioCodec": ".types",
|
|
289
|
-
"InternalServerError": ".errors",
|
|
290
|
-
"JobState": ".types",
|
|
291
|
-
"JobStatusV1Response": ".types",
|
|
292
|
-
"JobStatusV1ResponseParams": ".requests",
|
|
293
|
-
"LanguageIdentificationResponse": ".types",
|
|
294
|
-
"LanguageIdentificationResponseParams": ".requests",
|
|
295
|
-
"NumeralsFormat": ".types",
|
|
296
|
-
"PingSignal": ".types",
|
|
297
|
-
"PingSignalParams": ".requests",
|
|
298
|
-
"ReasoningEffort": ".types",
|
|
299
|
-
"ResponseType": ".types",
|
|
300
|
-
"Role": ".types",
|
|
301
|
-
"SarvamAI": ".client",
|
|
302
|
-
"SarvamAIEnvironment": ".environment",
|
|
303
|
-
"SarvamModelIds": ".types",
|
|
304
|
-
"SendText": ".types",
|
|
305
|
-
"SendTextData": ".types",
|
|
306
|
-
"SendTextDataParams": ".requests",
|
|
307
|
-
"SendTextParams": ".requests",
|
|
308
|
-
"ServiceUnavailableError": ".errors",
|
|
309
|
-
"SpeechSampleRate": ".types",
|
|
310
|
-
"SpeechToTextJobParameters": ".types",
|
|
311
|
-
"SpeechToTextJobParametersParams": ".requests",
|
|
312
|
-
"SpeechToTextLanguage": ".types",
|
|
313
|
-
"SpeechToTextModel": ".types",
|
|
314
|
-
"SpeechToTextResponse": ".types",
|
|
315
|
-
"SpeechToTextResponseData": ".types",
|
|
316
|
-
"SpeechToTextResponseDataParams": ".requests",
|
|
317
|
-
"SpeechToTextResponseParams": ".requests",
|
|
318
|
-
"SpeechToTextStreamingFlushSignal": ".speech_to_text_streaming",
|
|
319
|
-
"SpeechToTextStreamingHighVadSensitivity": ".speech_to_text_streaming",
|
|
320
|
-
"SpeechToTextStreamingLanguageCode": ".speech_to_text_streaming",
|
|
321
|
-
"SpeechToTextStreamingResponse": ".types",
|
|
322
|
-
"SpeechToTextStreamingResponseParams": ".requests",
|
|
323
|
-
"SpeechToTextStreamingVadSignals": ".speech_to_text_streaming",
|
|
324
|
-
"SpeechToTextTranscriptionData": ".types",
|
|
325
|
-
"SpeechToTextTranscriptionDataParams": ".requests",
|
|
326
|
-
"SpeechToTextTranslateJobParameters": ".types",
|
|
327
|
-
"SpeechToTextTranslateJobParametersParams": ".requests",
|
|
328
|
-
"SpeechToTextTranslateLanguage": ".types",
|
|
329
|
-
"SpeechToTextTranslateModel": ".types",
|
|
330
|
-
"SpeechToTextTranslateResponse": ".types",
|
|
331
|
-
"SpeechToTextTranslateResponseData": ".types",
|
|
332
|
-
"SpeechToTextTranslateResponseDataParams": ".requests",
|
|
333
|
-
"SpeechToTextTranslateResponseParams": ".requests",
|
|
334
|
-
"SpeechToTextTranslateStreamingFlushSignal": ".speech_to_text_translate_streaming",
|
|
335
|
-
"SpeechToTextTranslateStreamingHighVadSensitivity": ".speech_to_text_translate_streaming",
|
|
336
|
-
"SpeechToTextTranslateStreamingResponse": ".types",
|
|
337
|
-
"SpeechToTextTranslateStreamingResponseParams": ".requests",
|
|
338
|
-
"SpeechToTextTranslateStreamingVadSignals": ".speech_to_text_translate_streaming",
|
|
339
|
-
"SpeechToTextTranslateTranscriptionData": ".types",
|
|
340
|
-
"SpeechToTextTranslateTranscriptionDataParams": ".requests",
|
|
341
|
-
"SpokenFormNumeralsFormat": ".types",
|
|
342
|
-
"StopConfiguration": ".types",
|
|
343
|
-
"StopConfigurationParams": ".requests",
|
|
344
|
-
"StorageContainerType": ".types",
|
|
345
|
-
"SttFlushSignal": ".types",
|
|
346
|
-
"SttFlushSignalParams": ".requests",
|
|
347
|
-
"TaskDetailV1": ".types",
|
|
348
|
-
"TaskDetailV1Params": ".requests",
|
|
349
|
-
"TaskFileDetails": ".types",
|
|
350
|
-
"TaskFileDetailsParams": ".requests",
|
|
351
|
-
"TaskState": ".types",
|
|
352
|
-
"TextToSpeechLanguage": ".types",
|
|
353
|
-
"TextToSpeechModel": ".types",
|
|
354
|
-
"TextToSpeechOutputAudioCodec": ".types",
|
|
355
|
-
"TextToSpeechResponse": ".types",
|
|
356
|
-
"TextToSpeechResponseParams": ".requests",
|
|
357
|
-
"TextToSpeechSpeaker": ".types",
|
|
358
|
-
"TextToSpeechStreamingSendCompletionEvent": ".text_to_speech_streaming",
|
|
359
|
-
"TimestampsModel": ".types",
|
|
360
|
-
"TimestampsModelParams": ".requests",
|
|
361
|
-
"TooManyRequestsError": ".errors",
|
|
362
|
-
"TranscriptionMetrics": ".types",
|
|
363
|
-
"TranscriptionMetricsParams": ".requests",
|
|
364
|
-
"TranslateMode": ".types",
|
|
365
|
-
"TranslateModel": ".types",
|
|
366
|
-
"TranslateSourceLanguage": ".types",
|
|
367
|
-
"TranslateSpeakerGender": ".types",
|
|
368
|
-
"TranslateTargetLanguage": ".types",
|
|
369
|
-
"TranslationResponse": ".types",
|
|
370
|
-
"TranslationResponseParams": ".requests",
|
|
371
|
-
"TranslatiterateTargetLanguage": ".types",
|
|
372
|
-
"TransliterateMode": ".types",
|
|
373
|
-
"TransliterateSourceLanguage": ".types",
|
|
374
|
-
"TransliterationResponse": ".types",
|
|
375
|
-
"TransliterationResponseParams": ".requests",
|
|
376
|
-
"UnprocessableEntityError": ".errors",
|
|
377
|
-
"__version__": ".version",
|
|
378
|
-
"chat": ".chat",
|
|
379
|
-
"speech_to_text": ".speech_to_text",
|
|
380
|
-
"speech_to_text_job": ".speech_to_text_job",
|
|
381
|
-
"speech_to_text_streaming": ".speech_to_text_streaming",
|
|
382
|
-
"speech_to_text_translate_job": ".speech_to_text_translate_job",
|
|
383
|
-
"speech_to_text_translate_streaming": ".speech_to_text_translate_streaming",
|
|
384
|
-
"text": ".text",
|
|
385
|
-
"text_to_speech": ".text_to_speech",
|
|
386
|
-
"text_to_speech_streaming": ".text_to_speech_streaming",
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
def __getattr__(attr_name: str) -> typing.Any:
|
|
391
|
-
module_name = _dynamic_imports.get(attr_name)
|
|
392
|
-
if module_name is None:
|
|
393
|
-
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
|
|
394
|
-
try:
|
|
395
|
-
module = import_module(module_name, __package__)
|
|
396
|
-
if module_name == f".{attr_name}":
|
|
397
|
-
return module
|
|
398
|
-
else:
|
|
399
|
-
return getattr(module, attr_name)
|
|
400
|
-
except ImportError as e:
|
|
401
|
-
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
|
|
402
|
-
except AttributeError as e:
|
|
403
|
-
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
def __dir__():
|
|
407
|
-
lazy_attrs = list(_dynamic_imports.keys())
|
|
408
|
-
return sorted(lazy_attrs)
|
|
409
|
-
|
|
5
|
+
from .types import (
|
|
6
|
+
AudioData,
|
|
7
|
+
AudioMessage,
|
|
8
|
+
AudioOutput,
|
|
9
|
+
AudioOutputData,
|
|
10
|
+
BaseJobParameters,
|
|
11
|
+
BulkJobCallback,
|
|
12
|
+
BulkJobInitResponseV1,
|
|
13
|
+
ChatCompletionRequestAssistantMessage,
|
|
14
|
+
ChatCompletionRequestMessage,
|
|
15
|
+
ChatCompletionRequestMessage_Assistant,
|
|
16
|
+
ChatCompletionRequestMessage_System,
|
|
17
|
+
ChatCompletionRequestMessage_User,
|
|
18
|
+
ChatCompletionRequestSystemMessage,
|
|
19
|
+
ChatCompletionRequestUserMessage,
|
|
20
|
+
ChatCompletionResponseMessage,
|
|
21
|
+
Choice,
|
|
22
|
+
CompletionEventFlag,
|
|
23
|
+
CompletionUsage,
|
|
24
|
+
ConfigMessage,
|
|
25
|
+
ConfigureConnection,
|
|
26
|
+
ConfigureConnectionData,
|
|
27
|
+
ConfigureConnectionDataModel,
|
|
28
|
+
ConfigureConnectionDataOutputAudioBitrate,
|
|
29
|
+
ConfigureConnectionDataOutputAudioCodec,
|
|
30
|
+
ConfigureConnectionDataSpeaker,
|
|
31
|
+
ConfigureConnectionDataTargetLanguageCode,
|
|
32
|
+
ConnectionSampleRate,
|
|
33
|
+
CreateChatCompletionResponse,
|
|
34
|
+
DiarizedEntry,
|
|
35
|
+
DiarizedTranscript,
|
|
36
|
+
ErrorCode,
|
|
37
|
+
ErrorData,
|
|
38
|
+
ErrorDetails,
|
|
39
|
+
ErrorMessage,
|
|
40
|
+
ErrorResponse,
|
|
41
|
+
ErrorResponseData,
|
|
42
|
+
EventResponse,
|
|
43
|
+
EventResponseData,
|
|
44
|
+
EventsData,
|
|
45
|
+
EventsDataSignalType,
|
|
46
|
+
FileSignedUrlDetails,
|
|
47
|
+
FilesDownloadResponse,
|
|
48
|
+
FilesRequest,
|
|
49
|
+
FilesUploadResponse,
|
|
50
|
+
FinishReason,
|
|
51
|
+
FlushSignal,
|
|
52
|
+
InputAudioCodec,
|
|
53
|
+
JobState,
|
|
54
|
+
JobStatusV1Response,
|
|
55
|
+
LanguageIdentificationResponse,
|
|
56
|
+
Mode,
|
|
57
|
+
NumeralsFormat,
|
|
58
|
+
PingSignal,
|
|
59
|
+
ReasoningEffort,
|
|
60
|
+
ResponseType,
|
|
61
|
+
Role,
|
|
62
|
+
SarvamModelIds,
|
|
63
|
+
SendText,
|
|
64
|
+
SendTextData,
|
|
65
|
+
SpeechSampleRate,
|
|
66
|
+
SpeechToTextJobParameters,
|
|
67
|
+
SpeechToTextLanguage,
|
|
68
|
+
SpeechToTextModel,
|
|
69
|
+
SpeechToTextResponse,
|
|
70
|
+
SpeechToTextResponseData,
|
|
71
|
+
SpeechToTextStreamingResponse,
|
|
72
|
+
SpeechToTextTranscriptionData,
|
|
73
|
+
SpeechToTextTranslateJobParameters,
|
|
74
|
+
SpeechToTextTranslateLanguage,
|
|
75
|
+
SpeechToTextTranslateModel,
|
|
76
|
+
SpeechToTextTranslateResponse,
|
|
77
|
+
SpeechToTextTranslateResponseData,
|
|
78
|
+
SpeechToTextTranslateStreamingResponse,
|
|
79
|
+
SpeechToTextTranslateTranscriptionData,
|
|
80
|
+
SpokenFormNumeralsFormat,
|
|
81
|
+
StopConfiguration,
|
|
82
|
+
StorageContainerType,
|
|
83
|
+
SttFlushSignal,
|
|
84
|
+
TaskDetailV1,
|
|
85
|
+
TaskFileDetails,
|
|
86
|
+
TaskState,
|
|
87
|
+
TextToSpeechLanguage,
|
|
88
|
+
TextToSpeechModel,
|
|
89
|
+
TextToSpeechOutputAudioCodec,
|
|
90
|
+
TextToSpeechResponse,
|
|
91
|
+
TextToSpeechSpeaker,
|
|
92
|
+
TimestampsModel,
|
|
93
|
+
TranscriptionMetrics,
|
|
94
|
+
TranslateMode,
|
|
95
|
+
TranslateModel,
|
|
96
|
+
TranslateSourceLanguage,
|
|
97
|
+
TranslateSpeakerGender,
|
|
98
|
+
TranslateTargetLanguage,
|
|
99
|
+
TranslationResponse,
|
|
100
|
+
TranslatiterateTargetLanguage,
|
|
101
|
+
TransliterateMode,
|
|
102
|
+
TransliterateSourceLanguage,
|
|
103
|
+
TransliterationResponse,
|
|
104
|
+
)
|
|
105
|
+
from .errors import (
|
|
106
|
+
BadRequestError,
|
|
107
|
+
ForbiddenError,
|
|
108
|
+
InternalServerError,
|
|
109
|
+
ServiceUnavailableError,
|
|
110
|
+
TooManyRequestsError,
|
|
111
|
+
UnprocessableEntityError,
|
|
112
|
+
)
|
|
113
|
+
from . import (
|
|
114
|
+
chat,
|
|
115
|
+
speech_to_text,
|
|
116
|
+
speech_to_text_job,
|
|
117
|
+
speech_to_text_streaming,
|
|
118
|
+
speech_to_text_translate_job,
|
|
119
|
+
speech_to_text_translate_streaming,
|
|
120
|
+
text,
|
|
121
|
+
text_to_speech,
|
|
122
|
+
text_to_speech_streaming,
|
|
123
|
+
)
|
|
124
|
+
from .client import AsyncSarvamAI, SarvamAI
|
|
125
|
+
from .environment import SarvamAIEnvironment
|
|
126
|
+
from .requests import (
|
|
127
|
+
AudioDataParams,
|
|
128
|
+
AudioMessageParams,
|
|
129
|
+
AudioOutputDataParams,
|
|
130
|
+
AudioOutputParams,
|
|
131
|
+
BaseJobParametersParams,
|
|
132
|
+
BulkJobCallbackParams,
|
|
133
|
+
BulkJobInitResponseV1Params,
|
|
134
|
+
ChatCompletionRequestAssistantMessageParams,
|
|
135
|
+
ChatCompletionRequestMessageParams,
|
|
136
|
+
ChatCompletionRequestMessage_AssistantParams,
|
|
137
|
+
ChatCompletionRequestMessage_SystemParams,
|
|
138
|
+
ChatCompletionRequestMessage_UserParams,
|
|
139
|
+
ChatCompletionRequestSystemMessageParams,
|
|
140
|
+
ChatCompletionRequestUserMessageParams,
|
|
141
|
+
ChatCompletionResponseMessageParams,
|
|
142
|
+
ChoiceParams,
|
|
143
|
+
CompletionUsageParams,
|
|
144
|
+
ConfigMessageParams,
|
|
145
|
+
ConfigureConnectionDataParams,
|
|
146
|
+
ConfigureConnectionParams,
|
|
147
|
+
CreateChatCompletionResponseParams,
|
|
148
|
+
DiarizedEntryParams,
|
|
149
|
+
DiarizedTranscriptParams,
|
|
150
|
+
ErrorDataParams,
|
|
151
|
+
ErrorDetailsParams,
|
|
152
|
+
ErrorMessageParams,
|
|
153
|
+
ErrorResponseDataParams,
|
|
154
|
+
ErrorResponseParams,
|
|
155
|
+
EventResponseDataParams,
|
|
156
|
+
EventResponseParams,
|
|
157
|
+
EventsDataParams,
|
|
158
|
+
FileSignedUrlDetailsParams,
|
|
159
|
+
FilesDownloadResponseParams,
|
|
160
|
+
FilesRequestParams,
|
|
161
|
+
FilesUploadResponseParams,
|
|
162
|
+
FlushSignalParams,
|
|
163
|
+
JobStatusV1ResponseParams,
|
|
164
|
+
LanguageIdentificationResponseParams,
|
|
165
|
+
PingSignalParams,
|
|
166
|
+
SendTextDataParams,
|
|
167
|
+
SendTextParams,
|
|
168
|
+
SpeechToTextJobParametersParams,
|
|
169
|
+
SpeechToTextResponseDataParams,
|
|
170
|
+
SpeechToTextResponseParams,
|
|
171
|
+
SpeechToTextStreamingResponseParams,
|
|
172
|
+
SpeechToTextTranscriptionDataParams,
|
|
173
|
+
SpeechToTextTranslateJobParametersParams,
|
|
174
|
+
SpeechToTextTranslateResponseDataParams,
|
|
175
|
+
SpeechToTextTranslateResponseParams,
|
|
176
|
+
SpeechToTextTranslateStreamingResponseParams,
|
|
177
|
+
SpeechToTextTranslateTranscriptionDataParams,
|
|
178
|
+
StopConfigurationParams,
|
|
179
|
+
SttFlushSignalParams,
|
|
180
|
+
TaskDetailV1Params,
|
|
181
|
+
TaskFileDetailsParams,
|
|
182
|
+
TextToSpeechResponseParams,
|
|
183
|
+
TimestampsModelParams,
|
|
184
|
+
TranscriptionMetricsParams,
|
|
185
|
+
TranslationResponseParams,
|
|
186
|
+
TransliterationResponseParams,
|
|
187
|
+
)
|
|
188
|
+
from .speech_to_text_streaming import (
|
|
189
|
+
SpeechToTextStreamingFlushSignal,
|
|
190
|
+
SpeechToTextStreamingHighVadSensitivity,
|
|
191
|
+
SpeechToTextStreamingLanguageCode,
|
|
192
|
+
SpeechToTextStreamingMode,
|
|
193
|
+
SpeechToTextStreamingModel,
|
|
194
|
+
SpeechToTextStreamingVadSignals,
|
|
195
|
+
)
|
|
196
|
+
from .speech_to_text_translate_streaming import (
|
|
197
|
+
SpeechToTextTranslateStreamingFlushSignal,
|
|
198
|
+
SpeechToTextTranslateStreamingHighVadSensitivity,
|
|
199
|
+
SpeechToTextTranslateStreamingVadSignals,
|
|
200
|
+
)
|
|
201
|
+
from .text_to_speech_streaming import TextToSpeechStreamingModel, TextToSpeechStreamingSendCompletionEvent
|
|
202
|
+
from .version import __version__
|
|
410
203
|
|
|
411
204
|
__all__ = [
|
|
412
205
|
"AsyncSarvamAI",
|
|
@@ -450,6 +243,7 @@ __all__ = [
|
|
|
450
243
|
"ConfigMessageParams",
|
|
451
244
|
"ConfigureConnection",
|
|
452
245
|
"ConfigureConnectionData",
|
|
246
|
+
"ConfigureConnectionDataModel",
|
|
453
247
|
"ConfigureConnectionDataOutputAudioBitrate",
|
|
454
248
|
"ConfigureConnectionDataOutputAudioCodec",
|
|
455
249
|
"ConfigureConnectionDataParams",
|
|
@@ -500,6 +294,7 @@ __all__ = [
|
|
|
500
294
|
"JobStatusV1ResponseParams",
|
|
501
295
|
"LanguageIdentificationResponse",
|
|
502
296
|
"LanguageIdentificationResponseParams",
|
|
297
|
+
"Mode",
|
|
503
298
|
"NumeralsFormat",
|
|
504
299
|
"PingSignal",
|
|
505
300
|
"PingSignalParams",
|
|
@@ -526,6 +321,8 @@ __all__ = [
|
|
|
526
321
|
"SpeechToTextStreamingFlushSignal",
|
|
527
322
|
"SpeechToTextStreamingHighVadSensitivity",
|
|
528
323
|
"SpeechToTextStreamingLanguageCode",
|
|
324
|
+
"SpeechToTextStreamingMode",
|
|
325
|
+
"SpeechToTextStreamingModel",
|
|
529
326
|
"SpeechToTextStreamingResponse",
|
|
530
327
|
"SpeechToTextStreamingResponseParams",
|
|
531
328
|
"SpeechToTextStreamingVadSignals",
|
|
@@ -563,6 +360,7 @@ __all__ = [
|
|
|
563
360
|
"TextToSpeechResponse",
|
|
564
361
|
"TextToSpeechResponseParams",
|
|
565
362
|
"TextToSpeechSpeaker",
|
|
363
|
+
"TextToSpeechStreamingModel",
|
|
566
364
|
"TextToSpeechStreamingSendCompletionEvent",
|
|
567
365
|
"TimestampsModel",
|
|
568
366
|
"TimestampsModelParams",
|