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.
Files changed (68) hide show
  1. sarvamai/__init__.py +203 -405
  2. sarvamai/chat/raw_client.py +20 -20
  3. sarvamai/client.py +34 -186
  4. sarvamai/core/__init__.py +21 -76
  5. sarvamai/core/client_wrapper.py +3 -19
  6. sarvamai/core/force_multipart.py +2 -4
  7. sarvamai/core/http_client.py +97 -217
  8. sarvamai/core/http_response.py +1 -1
  9. sarvamai/core/jsonable_encoder.py +0 -8
  10. sarvamai/core/pydantic_utilities.py +4 -110
  11. sarvamai/errors/__init__.py +6 -40
  12. sarvamai/errors/bad_request_error.py +1 -1
  13. sarvamai/errors/forbidden_error.py +1 -1
  14. sarvamai/errors/internal_server_error.py +1 -1
  15. sarvamai/errors/service_unavailable_error.py +1 -1
  16. sarvamai/errors/too_many_requests_error.py +1 -1
  17. sarvamai/errors/unprocessable_entity_error.py +1 -1
  18. sarvamai/requests/__init__.py +62 -150
  19. sarvamai/requests/configure_connection.py +4 -0
  20. sarvamai/requests/configure_connection_data.py +40 -11
  21. sarvamai/requests/error_response_data.py +1 -1
  22. sarvamai/requests/file_signed_url_details.py +1 -1
  23. sarvamai/requests/speech_to_text_job_parameters.py +10 -1
  24. sarvamai/requests/speech_to_text_transcription_data.py +2 -2
  25. sarvamai/speech_to_text/client.py +29 -2
  26. sarvamai/speech_to_text/raw_client.py +81 -56
  27. sarvamai/speech_to_text_job/client.py +60 -15
  28. sarvamai/speech_to_text_job/raw_client.py +120 -120
  29. sarvamai/speech_to_text_streaming/__init__.py +10 -38
  30. sarvamai/speech_to_text_streaming/client.py +32 -6
  31. sarvamai/speech_to_text_streaming/raw_client.py +32 -6
  32. sarvamai/speech_to_text_streaming/types/__init__.py +8 -36
  33. sarvamai/speech_to_text_streaming/types/speech_to_text_streaming_mode.py +7 -0
  34. sarvamai/speech_to_text_streaming/types/speech_to_text_streaming_model.py +5 -0
  35. sarvamai/speech_to_text_translate_job/raw_client.py +120 -120
  36. sarvamai/speech_to_text_translate_streaming/__init__.py +5 -36
  37. sarvamai/speech_to_text_translate_streaming/types/__init__.py +3 -36
  38. sarvamai/text/raw_client.py +60 -60
  39. sarvamai/text_to_speech/client.py +100 -16
  40. sarvamai/text_to_speech/raw_client.py +120 -36
  41. sarvamai/text_to_speech_streaming/__init__.py +2 -29
  42. sarvamai/text_to_speech_streaming/client.py +19 -6
  43. sarvamai/text_to_speech_streaming/raw_client.py +19 -6
  44. sarvamai/text_to_speech_streaming/types/__init__.py +3 -31
  45. sarvamai/text_to_speech_streaming/types/text_to_speech_streaming_model.py +5 -0
  46. sarvamai/types/__init__.py +102 -222
  47. sarvamai/types/chat_completion_request_message.py +2 -6
  48. sarvamai/types/configure_connection.py +4 -0
  49. sarvamai/types/configure_connection_data.py +40 -11
  50. sarvamai/types/configure_connection_data_model.py +5 -0
  51. sarvamai/types/configure_connection_data_speaker.py +35 -1
  52. sarvamai/types/error_response_data.py +1 -1
  53. sarvamai/types/file_signed_url_details.py +1 -1
  54. sarvamai/types/mode.py +7 -0
  55. sarvamai/types/speech_to_text_job_parameters.py +10 -1
  56. sarvamai/types/speech_to_text_model.py +3 -1
  57. sarvamai/types/speech_to_text_transcription_data.py +2 -2
  58. sarvamai/types/speech_to_text_translate_model.py +1 -1
  59. sarvamai/types/text_to_speech_model.py +1 -1
  60. sarvamai/types/text_to_speech_speaker.py +35 -1
  61. {sarvamai-0.1.23a2.dist-info → sarvamai-0.1.23a4.dist-info}/METADATA +1 -2
  62. {sarvamai-0.1.23a2.dist-info → sarvamai-0.1.23a4.dist-info}/RECORD +63 -63
  63. sarvamai/core/http_sse/__init__.py +0 -42
  64. sarvamai/core/http_sse/_api.py +0 -112
  65. sarvamai/core/http_sse/_decoders.py +0 -61
  66. sarvamai/core/http_sse/_exceptions.py +0 -7
  67. sarvamai/core/http_sse/_models.py +0 -17
  68. {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 typing
6
- from importlib import import_module
7
-
8
- if typing.TYPE_CHECKING:
9
- from .types import (
10
- AudioData,
11
- AudioMessage,
12
- AudioOutput,
13
- AudioOutputData,
14
- BaseJobParameters,
15
- BulkJobCallback,
16
- BulkJobInitResponseV1,
17
- ChatCompletionRequestAssistantMessage,
18
- ChatCompletionRequestMessage,
19
- ChatCompletionRequestMessage_Assistant,
20
- ChatCompletionRequestMessage_System,
21
- ChatCompletionRequestMessage_User,
22
- ChatCompletionRequestSystemMessage,
23
- ChatCompletionRequestUserMessage,
24
- ChatCompletionResponseMessage,
25
- Choice,
26
- CompletionEventFlag,
27
- CompletionUsage,
28
- ConfigMessage,
29
- ConfigureConnection,
30
- ConfigureConnectionData,
31
- ConfigureConnectionDataOutputAudioBitrate,
32
- ConfigureConnectionDataOutputAudioCodec,
33
- ConfigureConnectionDataSpeaker,
34
- ConfigureConnectionDataTargetLanguageCode,
35
- ConnectionSampleRate,
36
- CreateChatCompletionResponse,
37
- DiarizedEntry,
38
- DiarizedTranscript,
39
- ErrorCode,
40
- ErrorData,
41
- ErrorDetails,
42
- ErrorMessage,
43
- ErrorResponse,
44
- ErrorResponseData,
45
- EventResponse,
46
- EventResponseData,
47
- EventsData,
48
- EventsDataSignalType,
49
- FileSignedUrlDetails,
50
- FilesDownloadResponse,
51
- FilesRequest,
52
- FilesUploadResponse,
53
- FinishReason,
54
- FlushSignal,
55
- InputAudioCodec,
56
- JobState,
57
- JobStatusV1Response,
58
- LanguageIdentificationResponse,
59
- NumeralsFormat,
60
- PingSignal,
61
- ReasoningEffort,
62
- ResponseType,
63
- Role,
64
- SarvamModelIds,
65
- SendText,
66
- SendTextData,
67
- SpeechSampleRate,
68
- SpeechToTextJobParameters,
69
- SpeechToTextLanguage,
70
- SpeechToTextModel,
71
- SpeechToTextResponse,
72
- SpeechToTextResponseData,
73
- SpeechToTextStreamingResponse,
74
- SpeechToTextTranscriptionData,
75
- SpeechToTextTranslateJobParameters,
76
- SpeechToTextTranslateLanguage,
77
- SpeechToTextTranslateModel,
78
- SpeechToTextTranslateResponse,
79
- SpeechToTextTranslateResponseData,
80
- SpeechToTextTranslateStreamingResponse,
81
- SpeechToTextTranslateTranscriptionData,
82
- SpokenFormNumeralsFormat,
83
- StopConfiguration,
84
- StorageContainerType,
85
- SttFlushSignal,
86
- TaskDetailV1,
87
- TaskFileDetails,
88
- TaskState,
89
- TextToSpeechLanguage,
90
- TextToSpeechModel,
91
- TextToSpeechOutputAudioCodec,
92
- TextToSpeechResponse,
93
- TextToSpeechSpeaker,
94
- TimestampsModel,
95
- TranscriptionMetrics,
96
- TranslateMode,
97
- TranslateModel,
98
- TranslateSourceLanguage,
99
- TranslateSpeakerGender,
100
- TranslateTargetLanguage,
101
- TranslationResponse,
102
- TranslatiterateTargetLanguage,
103
- TransliterateMode,
104
- TransliterateSourceLanguage,
105
- TransliterationResponse,
106
- )
107
- from .errors import (
108
- BadRequestError,
109
- ForbiddenError,
110
- InternalServerError,
111
- ServiceUnavailableError,
112
- TooManyRequestsError,
113
- UnprocessableEntityError,
114
- )
115
- from . import (
116
- chat,
117
- speech_to_text,
118
- speech_to_text_job,
119
- speech_to_text_streaming,
120
- speech_to_text_translate_job,
121
- speech_to_text_translate_streaming,
122
- text,
123
- text_to_speech,
124
- text_to_speech_streaming,
125
- )
126
- from .client import AsyncSarvamAI, SarvamAI
127
- from .environment import SarvamAIEnvironment
128
- from .requests import (
129
- AudioDataParams,
130
- AudioMessageParams,
131
- AudioOutputDataParams,
132
- AudioOutputParams,
133
- BaseJobParametersParams,
134
- BulkJobCallbackParams,
135
- BulkJobInitResponseV1Params,
136
- ChatCompletionRequestAssistantMessageParams,
137
- ChatCompletionRequestMessageParams,
138
- ChatCompletionRequestMessage_AssistantParams,
139
- ChatCompletionRequestMessage_SystemParams,
140
- ChatCompletionRequestMessage_UserParams,
141
- ChatCompletionRequestSystemMessageParams,
142
- ChatCompletionRequestUserMessageParams,
143
- ChatCompletionResponseMessageParams,
144
- ChoiceParams,
145
- CompletionUsageParams,
146
- ConfigMessageParams,
147
- ConfigureConnectionDataParams,
148
- ConfigureConnectionParams,
149
- CreateChatCompletionResponseParams,
150
- DiarizedEntryParams,
151
- DiarizedTranscriptParams,
152
- ErrorDataParams,
153
- ErrorDetailsParams,
154
- ErrorMessageParams,
155
- ErrorResponseDataParams,
156
- ErrorResponseParams,
157
- EventResponseDataParams,
158
- EventResponseParams,
159
- EventsDataParams,
160
- FileSignedUrlDetailsParams,
161
- FilesDownloadResponseParams,
162
- FilesRequestParams,
163
- FilesUploadResponseParams,
164
- FlushSignalParams,
165
- JobStatusV1ResponseParams,
166
- LanguageIdentificationResponseParams,
167
- PingSignalParams,
168
- SendTextDataParams,
169
- SendTextParams,
170
- SpeechToTextJobParametersParams,
171
- SpeechToTextResponseDataParams,
172
- SpeechToTextResponseParams,
173
- SpeechToTextStreamingResponseParams,
174
- SpeechToTextTranscriptionDataParams,
175
- SpeechToTextTranslateJobParametersParams,
176
- SpeechToTextTranslateResponseDataParams,
177
- SpeechToTextTranslateResponseParams,
178
- SpeechToTextTranslateStreamingResponseParams,
179
- SpeechToTextTranslateTranscriptionDataParams,
180
- StopConfigurationParams,
181
- SttFlushSignalParams,
182
- TaskDetailV1Params,
183
- TaskFileDetailsParams,
184
- TextToSpeechResponseParams,
185
- TimestampsModelParams,
186
- TranscriptionMetricsParams,
187
- TranslationResponseParams,
188
- TransliterationResponseParams,
189
- )
190
- from .speech_to_text_streaming import (
191
- SpeechToTextStreamingFlushSignal,
192
- SpeechToTextStreamingHighVadSensitivity,
193
- SpeechToTextStreamingLanguageCode,
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 TextToSpeechStreamingSendCompletionEvent
202
- from .version import __version__
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",