sarvamai 0.1.22a4__py3-none-any.whl → 0.1.22a8__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 -3
- sarvamai/client.py +3 -0
- sarvamai/core/client_wrapper.py +2 -2
- sarvamai/doc_digitization_job/__init__.py +4 -0
- sarvamai/doc_digitization_job/client.py +775 -0
- sarvamai/doc_digitization_job/job.py +496 -0
- sarvamai/doc_digitization_job/raw_client.py +1176 -0
- sarvamai/requests/__init__.py +20 -0
- sarvamai/requests/audio_data.py +0 -6
- sarvamai/requests/configure_connection.py +4 -0
- sarvamai/requests/configure_connection_data.py +40 -11
- sarvamai/requests/doc_digitization_create_job_response.py +25 -0
- sarvamai/requests/doc_digitization_download_files_response.py +37 -0
- sarvamai/requests/doc_digitization_error_details.py +21 -0
- sarvamai/requests/doc_digitization_error_message.py +11 -0
- sarvamai/requests/doc_digitization_job_detail.py +64 -0
- sarvamai/requests/doc_digitization_job_parameters.py +21 -0
- sarvamai/requests/doc_digitization_job_status_response.py +65 -0
- sarvamai/requests/doc_digitization_page_error.py +24 -0
- sarvamai/requests/doc_digitization_upload_files_response.py +34 -0
- sarvamai/requests/doc_digitization_webhook_callback.py +19 -0
- sarvamai/requests/speech_to_text_job_parameters.py +43 -2
- sarvamai/requests/speech_to_text_translate_job_parameters.py +4 -1
- sarvamai/speech_to_text/client.py +95 -10
- sarvamai/speech_to_text/raw_client.py +95 -10
- sarvamai/speech_to_text_job/client.py +60 -15
- sarvamai/speech_to_text_streaming/__init__.py +4 -0
- sarvamai/speech_to_text_streaming/client.py +102 -18
- sarvamai/speech_to_text_streaming/raw_client.py +102 -18
- sarvamai/speech_to_text_streaming/types/__init__.py +4 -0
- sarvamai/speech_to_text_streaming/types/speech_to_text_streaming_input_audio_codec.py +1 -27
- 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_streaming/client.py +20 -12
- sarvamai/speech_to_text_translate_streaming/raw_client.py +20 -12
- sarvamai/speech_to_text_translate_streaming/types/speech_to_text_translate_streaming_input_audio_codec.py +1 -27
- sarvamai/text/client.py +0 -12
- sarvamai/text/raw_client.py +0 -12
- sarvamai/text_to_speech/client.py +116 -14
- sarvamai/text_to_speech/raw_client.py +116 -14
- sarvamai/text_to_speech_streaming/__init__.py +2 -2
- 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 +2 -1
- sarvamai/text_to_speech_streaming/types/text_to_speech_streaming_model.py +5 -0
- sarvamai/types/__init__.py +34 -2
- sarvamai/types/audio_data.py +0 -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/doc_digitization_create_job_response.py +37 -0
- sarvamai/types/doc_digitization_download_files_response.py +47 -0
- sarvamai/types/doc_digitization_error_code.py +15 -0
- sarvamai/types/doc_digitization_error_details.py +33 -0
- sarvamai/types/doc_digitization_error_message.py +23 -0
- sarvamai/types/doc_digitization_job_detail.py +74 -0
- sarvamai/types/doc_digitization_job_detail_state.py +7 -0
- sarvamai/types/doc_digitization_job_parameters.py +33 -0
- sarvamai/types/doc_digitization_job_state.py +7 -0
- sarvamai/types/doc_digitization_job_status_response.py +75 -0
- sarvamai/types/doc_digitization_output_format.py +5 -0
- sarvamai/types/doc_digitization_page_error.py +36 -0
- sarvamai/types/doc_digitization_supported_language.py +32 -0
- sarvamai/types/doc_digitization_upload_files_response.py +44 -0
- sarvamai/types/doc_digitization_webhook_callback.py +31 -0
- sarvamai/types/mode.py +5 -0
- sarvamai/types/speech_to_text_job_parameters.py +43 -2
- sarvamai/types/speech_to_text_model.py +1 -1
- sarvamai/types/speech_to_text_translate_job_parameters.py +4 -1
- sarvamai/types/text_to_speech_model.py +1 -1
- sarvamai/types/text_to_speech_speaker.py +35 -1
- {sarvamai-0.1.22a4.dist-info → sarvamai-0.1.22a8.dist-info}/METADATA +1 -1
- {sarvamai-0.1.22a4.dist-info → sarvamai-0.1.22a8.dist-info}/RECORD +75 -42
- sarvamai/types/audio_data_input_audio_codec.py +0 -33
- {sarvamai-0.1.22a4.dist-info → sarvamai-0.1.22a8.dist-info}/WHEEL +0 -0
sarvamai/__init__.py
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
from .types import (
|
|
6
6
|
AudioData,
|
|
7
|
-
AudioDataInputAudioCodec,
|
|
8
7
|
AudioMessage,
|
|
9
8
|
AudioOutput,
|
|
10
9
|
AudioOutputData,
|
|
@@ -25,6 +24,7 @@ from .types import (
|
|
|
25
24
|
ConfigMessage,
|
|
26
25
|
ConfigureConnection,
|
|
27
26
|
ConfigureConnectionData,
|
|
27
|
+
ConfigureConnectionDataModel,
|
|
28
28
|
ConfigureConnectionDataOutputAudioBitrate,
|
|
29
29
|
ConfigureConnectionDataOutputAudioCodec,
|
|
30
30
|
ConfigureConnectionDataSpeaker,
|
|
@@ -33,6 +33,21 @@ from .types import (
|
|
|
33
33
|
CreateChatCompletionResponse,
|
|
34
34
|
DiarizedEntry,
|
|
35
35
|
DiarizedTranscript,
|
|
36
|
+
DocDigitizationCreateJobResponse,
|
|
37
|
+
DocDigitizationDownloadFilesResponse,
|
|
38
|
+
DocDigitizationErrorCode,
|
|
39
|
+
DocDigitizationErrorDetails,
|
|
40
|
+
DocDigitizationErrorMessage,
|
|
41
|
+
DocDigitizationJobDetail,
|
|
42
|
+
DocDigitizationJobDetailState,
|
|
43
|
+
DocDigitizationJobParameters,
|
|
44
|
+
DocDigitizationJobState,
|
|
45
|
+
DocDigitizationJobStatusResponse,
|
|
46
|
+
DocDigitizationOutputFormat,
|
|
47
|
+
DocDigitizationPageError,
|
|
48
|
+
DocDigitizationSupportedLanguage,
|
|
49
|
+
DocDigitizationUploadFilesResponse,
|
|
50
|
+
DocDigitizationWebhookCallback,
|
|
36
51
|
ErrorCode,
|
|
37
52
|
ErrorData,
|
|
38
53
|
ErrorDetails,
|
|
@@ -53,6 +68,7 @@ from .types import (
|
|
|
53
68
|
JobState,
|
|
54
69
|
JobStatusV1Response,
|
|
55
70
|
LanguageIdentificationResponse,
|
|
71
|
+
Mode,
|
|
56
72
|
NumeralsFormat,
|
|
57
73
|
PingSignal,
|
|
58
74
|
ReasoningEffort,
|
|
@@ -111,6 +127,7 @@ from .errors import (
|
|
|
111
127
|
)
|
|
112
128
|
from . import (
|
|
113
129
|
chat,
|
|
130
|
+
doc_digitization_job,
|
|
114
131
|
speech_to_text,
|
|
115
132
|
speech_to_text_job,
|
|
116
133
|
speech_to_text_streaming,
|
|
@@ -146,6 +163,16 @@ from .requests import (
|
|
|
146
163
|
CreateChatCompletionResponseParams,
|
|
147
164
|
DiarizedEntryParams,
|
|
148
165
|
DiarizedTranscriptParams,
|
|
166
|
+
DocDigitizationCreateJobResponseParams,
|
|
167
|
+
DocDigitizationDownloadFilesResponseParams,
|
|
168
|
+
DocDigitizationErrorDetailsParams,
|
|
169
|
+
DocDigitizationErrorMessageParams,
|
|
170
|
+
DocDigitizationJobDetailParams,
|
|
171
|
+
DocDigitizationJobParametersParams,
|
|
172
|
+
DocDigitizationJobStatusResponseParams,
|
|
173
|
+
DocDigitizationPageErrorParams,
|
|
174
|
+
DocDigitizationUploadFilesResponseParams,
|
|
175
|
+
DocDigitizationWebhookCallbackParams,
|
|
149
176
|
ErrorDataParams,
|
|
150
177
|
ErrorDetailsParams,
|
|
151
178
|
ErrorMessageParams,
|
|
@@ -189,6 +216,8 @@ from .speech_to_text_streaming import (
|
|
|
189
216
|
SpeechToTextStreamingHighVadSensitivity,
|
|
190
217
|
SpeechToTextStreamingInputAudioCodec,
|
|
191
218
|
SpeechToTextStreamingLanguageCode,
|
|
219
|
+
SpeechToTextStreamingMode,
|
|
220
|
+
SpeechToTextStreamingModel,
|
|
192
221
|
SpeechToTextStreamingVadSignals,
|
|
193
222
|
)
|
|
194
223
|
from .speech_to_text_translate_streaming import (
|
|
@@ -197,13 +226,12 @@ from .speech_to_text_translate_streaming import (
|
|
|
197
226
|
SpeechToTextTranslateStreamingInputAudioCodec,
|
|
198
227
|
SpeechToTextTranslateStreamingVadSignals,
|
|
199
228
|
)
|
|
200
|
-
from .text_to_speech_streaming import TextToSpeechStreamingSendCompletionEvent
|
|
229
|
+
from .text_to_speech_streaming import TextToSpeechStreamingModel, TextToSpeechStreamingSendCompletionEvent
|
|
201
230
|
from .version import __version__
|
|
202
231
|
|
|
203
232
|
__all__ = [
|
|
204
233
|
"AsyncSarvamAI",
|
|
205
234
|
"AudioData",
|
|
206
|
-
"AudioDataInputAudioCodec",
|
|
207
235
|
"AudioDataParams",
|
|
208
236
|
"AudioMessage",
|
|
209
237
|
"AudioMessageParams",
|
|
@@ -243,6 +271,7 @@ __all__ = [
|
|
|
243
271
|
"ConfigMessageParams",
|
|
244
272
|
"ConfigureConnection",
|
|
245
273
|
"ConfigureConnectionData",
|
|
274
|
+
"ConfigureConnectionDataModel",
|
|
246
275
|
"ConfigureConnectionDataOutputAudioBitrate",
|
|
247
276
|
"ConfigureConnectionDataOutputAudioCodec",
|
|
248
277
|
"ConfigureConnectionDataParams",
|
|
@@ -256,6 +285,31 @@ __all__ = [
|
|
|
256
285
|
"DiarizedEntryParams",
|
|
257
286
|
"DiarizedTranscript",
|
|
258
287
|
"DiarizedTranscriptParams",
|
|
288
|
+
"DocDigitizationCreateJobResponse",
|
|
289
|
+
"DocDigitizationCreateJobResponseParams",
|
|
290
|
+
"DocDigitizationDownloadFilesResponse",
|
|
291
|
+
"DocDigitizationDownloadFilesResponseParams",
|
|
292
|
+
"DocDigitizationErrorCode",
|
|
293
|
+
"DocDigitizationErrorDetails",
|
|
294
|
+
"DocDigitizationErrorDetailsParams",
|
|
295
|
+
"DocDigitizationErrorMessage",
|
|
296
|
+
"DocDigitizationErrorMessageParams",
|
|
297
|
+
"DocDigitizationJobDetail",
|
|
298
|
+
"DocDigitizationJobDetailParams",
|
|
299
|
+
"DocDigitizationJobDetailState",
|
|
300
|
+
"DocDigitizationJobParameters",
|
|
301
|
+
"DocDigitizationJobParametersParams",
|
|
302
|
+
"DocDigitizationJobState",
|
|
303
|
+
"DocDigitizationJobStatusResponse",
|
|
304
|
+
"DocDigitizationJobStatusResponseParams",
|
|
305
|
+
"DocDigitizationOutputFormat",
|
|
306
|
+
"DocDigitizationPageError",
|
|
307
|
+
"DocDigitizationPageErrorParams",
|
|
308
|
+
"DocDigitizationSupportedLanguage",
|
|
309
|
+
"DocDigitizationUploadFilesResponse",
|
|
310
|
+
"DocDigitizationUploadFilesResponseParams",
|
|
311
|
+
"DocDigitizationWebhookCallback",
|
|
312
|
+
"DocDigitizationWebhookCallbackParams",
|
|
259
313
|
"ErrorCode",
|
|
260
314
|
"ErrorData",
|
|
261
315
|
"ErrorDataParams",
|
|
@@ -293,6 +347,7 @@ __all__ = [
|
|
|
293
347
|
"JobStatusV1ResponseParams",
|
|
294
348
|
"LanguageIdentificationResponse",
|
|
295
349
|
"LanguageIdentificationResponseParams",
|
|
350
|
+
"Mode",
|
|
296
351
|
"NumeralsFormat",
|
|
297
352
|
"PingSignal",
|
|
298
353
|
"PingSignalParams",
|
|
@@ -320,6 +375,8 @@ __all__ = [
|
|
|
320
375
|
"SpeechToTextStreamingHighVadSensitivity",
|
|
321
376
|
"SpeechToTextStreamingInputAudioCodec",
|
|
322
377
|
"SpeechToTextStreamingLanguageCode",
|
|
378
|
+
"SpeechToTextStreamingMode",
|
|
379
|
+
"SpeechToTextStreamingModel",
|
|
323
380
|
"SpeechToTextStreamingResponse",
|
|
324
381
|
"SpeechToTextStreamingResponseParams",
|
|
325
382
|
"SpeechToTextStreamingVadSignals",
|
|
@@ -358,6 +415,7 @@ __all__ = [
|
|
|
358
415
|
"TextToSpeechResponse",
|
|
359
416
|
"TextToSpeechResponseParams",
|
|
360
417
|
"TextToSpeechSpeaker",
|
|
418
|
+
"TextToSpeechStreamingModel",
|
|
361
419
|
"TextToSpeechStreamingSendCompletionEvent",
|
|
362
420
|
"TimestampsModel",
|
|
363
421
|
"TimestampsModelParams",
|
|
@@ -379,6 +437,7 @@ __all__ = [
|
|
|
379
437
|
"UnprocessableEntityError",
|
|
380
438
|
"__version__",
|
|
381
439
|
"chat",
|
|
440
|
+
"doc_digitization_job",
|
|
382
441
|
"speech_to_text",
|
|
383
442
|
"speech_to_text_job",
|
|
384
443
|
"speech_to_text_streaming",
|
sarvamai/client.py
CHANGED
|
@@ -7,6 +7,7 @@ import httpx
|
|
|
7
7
|
from .chat.client import AsyncChatClient, ChatClient
|
|
8
8
|
from .core.api_error import ApiError
|
|
9
9
|
from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
10
|
+
from .doc_digitization_job.client import AsyncDocDigitizationJobClient, DocDigitizationJobClient
|
|
10
11
|
from .environment import SarvamAIEnvironment
|
|
11
12
|
from .speech_to_text.client import AsyncSpeechToTextClient, SpeechToTextClient
|
|
12
13
|
from .speech_to_text_job.client import AsyncSpeechToTextJobClient, SpeechToTextJobClient
|
|
@@ -92,6 +93,7 @@ class SarvamAI:
|
|
|
92
93
|
self.chat = ChatClient(client_wrapper=self._client_wrapper)
|
|
93
94
|
self.speech_to_text_job = SpeechToTextJobClient(client_wrapper=self._client_wrapper)
|
|
94
95
|
self.speech_to_text_translate_job = SpeechToTextTranslateJobClient(client_wrapper=self._client_wrapper)
|
|
96
|
+
self.doc_digitization_job = DocDigitizationJobClient(client_wrapper=self._client_wrapper)
|
|
95
97
|
self.speech_to_text_streaming = SpeechToTextStreamingClient(client_wrapper=self._client_wrapper)
|
|
96
98
|
self.speech_to_text_translate_streaming = SpeechToTextTranslateStreamingClient(
|
|
97
99
|
client_wrapper=self._client_wrapper
|
|
@@ -170,6 +172,7 @@ class AsyncSarvamAI:
|
|
|
170
172
|
self.chat = AsyncChatClient(client_wrapper=self._client_wrapper)
|
|
171
173
|
self.speech_to_text_job = AsyncSpeechToTextJobClient(client_wrapper=self._client_wrapper)
|
|
172
174
|
self.speech_to_text_translate_job = AsyncSpeechToTextTranslateJobClient(client_wrapper=self._client_wrapper)
|
|
175
|
+
self.doc_digitization_job = AsyncDocDigitizationJobClient(client_wrapper=self._client_wrapper)
|
|
173
176
|
self.speech_to_text_streaming = AsyncSpeechToTextStreamingClient(client_wrapper=self._client_wrapper)
|
|
174
177
|
self.speech_to_text_translate_streaming = AsyncSpeechToTextTranslateStreamingClient(
|
|
175
178
|
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.22a8",
|
|
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.22a8",
|
|
30
30
|
**(self.get_custom_headers() or {}),
|
|
31
31
|
}
|
|
32
32
|
headers["api-subscription-key"] = self.api_subscription_key
|