sarvamai 0.1.22a3__py3-none-any.whl → 0.1.22a7__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 -9
- 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 +776 -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_transcription_data.py +0 -6
- sarvamai/requests/speech_to_text_translate_job_parameters.py +4 -1
- sarvamai/requests/speech_to_text_translate_transcription_data.py +0 -6
- 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_job/job.py +100 -2
- sarvamai/speech_to_text_job/raw_client.py +14 -10
- sarvamai/speech_to_text_streaming/__init__.py +4 -2
- sarvamai/speech_to_text_streaming/client.py +100 -47
- sarvamai/speech_to_text_streaming/raw_client.py +100 -47
- sarvamai/speech_to_text_streaming/types/__init__.py +4 -2
- 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_job/job.py +100 -2
- sarvamai/speech_to_text_translate_job/raw_client.py +14 -10
- sarvamai/speech_to_text_translate_streaming/__init__.py +0 -2
- sarvamai/speech_to_text_translate_streaming/client.py +18 -41
- sarvamai/speech_to_text_translate_streaming/raw_client.py +18 -41
- sarvamai/speech_to_text_translate_streaming/types/__init__.py +0 -4
- 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 -4
- sarvamai/types/audio_data.py +0 -6
- sarvamai/types/completion_event_flag.py +3 -1
- 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_transcription_data.py +0 -6
- sarvamai/types/speech_to_text_translate_job_parameters.py +4 -1
- sarvamai/types/speech_to_text_translate_transcription_data.py +0 -6
- sarvamai/types/text_to_speech_model.py +1 -1
- sarvamai/types/text_to_speech_speaker.py +35 -1
- {sarvamai-0.1.22a3.dist-info → sarvamai-0.1.22a7.dist-info}/METADATA +1 -1
- {sarvamai-0.1.22a3.dist-info → sarvamai-0.1.22a7.dist-info}/RECORD +86 -56
- sarvamai/speech_to_text_streaming/types/speech_to_text_streaming_stream_ongoing_speech_results.py +0 -5
- sarvamai/speech_to_text_translate_streaming/types/speech_to_text_translate_streaming_stream_ongoing_speech_results.py +0 -5
- sarvamai/types/audio_data_input_audio_codec.py +0 -33
- sarvamai/types/response_speech_state.py +0 -7
- {sarvamai-0.1.22a3.dist-info → sarvamai-0.1.22a7.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,10 +68,10 @@ from .types import (
|
|
|
53
68
|
JobState,
|
|
54
69
|
JobStatusV1Response,
|
|
55
70
|
LanguageIdentificationResponse,
|
|
71
|
+
Mode,
|
|
56
72
|
NumeralsFormat,
|
|
57
73
|
PingSignal,
|
|
58
74
|
ReasoningEffort,
|
|
59
|
-
ResponseSpeechState,
|
|
60
75
|
ResponseType,
|
|
61
76
|
Role,
|
|
62
77
|
SarvamModelIds,
|
|
@@ -112,6 +127,7 @@ from .errors import (
|
|
|
112
127
|
)
|
|
113
128
|
from . import (
|
|
114
129
|
chat,
|
|
130
|
+
doc_digitization_job,
|
|
115
131
|
speech_to_text,
|
|
116
132
|
speech_to_text_job,
|
|
117
133
|
speech_to_text_streaming,
|
|
@@ -147,6 +163,16 @@ from .requests import (
|
|
|
147
163
|
CreateChatCompletionResponseParams,
|
|
148
164
|
DiarizedEntryParams,
|
|
149
165
|
DiarizedTranscriptParams,
|
|
166
|
+
DocDigitizationCreateJobResponseParams,
|
|
167
|
+
DocDigitizationDownloadFilesResponseParams,
|
|
168
|
+
DocDigitizationErrorDetailsParams,
|
|
169
|
+
DocDigitizationErrorMessageParams,
|
|
170
|
+
DocDigitizationJobDetailParams,
|
|
171
|
+
DocDigitizationJobParametersParams,
|
|
172
|
+
DocDigitizationJobStatusResponseParams,
|
|
173
|
+
DocDigitizationPageErrorParams,
|
|
174
|
+
DocDigitizationUploadFilesResponseParams,
|
|
175
|
+
DocDigitizationWebhookCallbackParams,
|
|
150
176
|
ErrorDataParams,
|
|
151
177
|
ErrorDetailsParams,
|
|
152
178
|
ErrorMessageParams,
|
|
@@ -190,23 +216,22 @@ from .speech_to_text_streaming import (
|
|
|
190
216
|
SpeechToTextStreamingHighVadSensitivity,
|
|
191
217
|
SpeechToTextStreamingInputAudioCodec,
|
|
192
218
|
SpeechToTextStreamingLanguageCode,
|
|
193
|
-
|
|
219
|
+
SpeechToTextStreamingMode,
|
|
220
|
+
SpeechToTextStreamingModel,
|
|
194
221
|
SpeechToTextStreamingVadSignals,
|
|
195
222
|
)
|
|
196
223
|
from .speech_to_text_translate_streaming import (
|
|
197
224
|
SpeechToTextTranslateStreamingFlushSignal,
|
|
198
225
|
SpeechToTextTranslateStreamingHighVadSensitivity,
|
|
199
226
|
SpeechToTextTranslateStreamingInputAudioCodec,
|
|
200
|
-
SpeechToTextTranslateStreamingStreamOngoingSpeechResults,
|
|
201
227
|
SpeechToTextTranslateStreamingVadSignals,
|
|
202
228
|
)
|
|
203
|
-
from .text_to_speech_streaming import TextToSpeechStreamingSendCompletionEvent
|
|
229
|
+
from .text_to_speech_streaming import TextToSpeechStreamingModel, TextToSpeechStreamingSendCompletionEvent
|
|
204
230
|
from .version import __version__
|
|
205
231
|
|
|
206
232
|
__all__ = [
|
|
207
233
|
"AsyncSarvamAI",
|
|
208
234
|
"AudioData",
|
|
209
|
-
"AudioDataInputAudioCodec",
|
|
210
235
|
"AudioDataParams",
|
|
211
236
|
"AudioMessage",
|
|
212
237
|
"AudioMessageParams",
|
|
@@ -246,6 +271,7 @@ __all__ = [
|
|
|
246
271
|
"ConfigMessageParams",
|
|
247
272
|
"ConfigureConnection",
|
|
248
273
|
"ConfigureConnectionData",
|
|
274
|
+
"ConfigureConnectionDataModel",
|
|
249
275
|
"ConfigureConnectionDataOutputAudioBitrate",
|
|
250
276
|
"ConfigureConnectionDataOutputAudioCodec",
|
|
251
277
|
"ConfigureConnectionDataParams",
|
|
@@ -259,6 +285,31 @@ __all__ = [
|
|
|
259
285
|
"DiarizedEntryParams",
|
|
260
286
|
"DiarizedTranscript",
|
|
261
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",
|
|
262
313
|
"ErrorCode",
|
|
263
314
|
"ErrorData",
|
|
264
315
|
"ErrorDataParams",
|
|
@@ -296,11 +347,11 @@ __all__ = [
|
|
|
296
347
|
"JobStatusV1ResponseParams",
|
|
297
348
|
"LanguageIdentificationResponse",
|
|
298
349
|
"LanguageIdentificationResponseParams",
|
|
350
|
+
"Mode",
|
|
299
351
|
"NumeralsFormat",
|
|
300
352
|
"PingSignal",
|
|
301
353
|
"PingSignalParams",
|
|
302
354
|
"ReasoningEffort",
|
|
303
|
-
"ResponseSpeechState",
|
|
304
355
|
"ResponseType",
|
|
305
356
|
"Role",
|
|
306
357
|
"SarvamAI",
|
|
@@ -324,9 +375,10 @@ __all__ = [
|
|
|
324
375
|
"SpeechToTextStreamingHighVadSensitivity",
|
|
325
376
|
"SpeechToTextStreamingInputAudioCodec",
|
|
326
377
|
"SpeechToTextStreamingLanguageCode",
|
|
378
|
+
"SpeechToTextStreamingMode",
|
|
379
|
+
"SpeechToTextStreamingModel",
|
|
327
380
|
"SpeechToTextStreamingResponse",
|
|
328
381
|
"SpeechToTextStreamingResponseParams",
|
|
329
|
-
"SpeechToTextStreamingStreamOngoingSpeechResults",
|
|
330
382
|
"SpeechToTextStreamingVadSignals",
|
|
331
383
|
"SpeechToTextTranscriptionData",
|
|
332
384
|
"SpeechToTextTranscriptionDataParams",
|
|
@@ -343,7 +395,6 @@ __all__ = [
|
|
|
343
395
|
"SpeechToTextTranslateStreamingInputAudioCodec",
|
|
344
396
|
"SpeechToTextTranslateStreamingResponse",
|
|
345
397
|
"SpeechToTextTranslateStreamingResponseParams",
|
|
346
|
-
"SpeechToTextTranslateStreamingStreamOngoingSpeechResults",
|
|
347
398
|
"SpeechToTextTranslateStreamingVadSignals",
|
|
348
399
|
"SpeechToTextTranslateTranscriptionData",
|
|
349
400
|
"SpeechToTextTranslateTranscriptionDataParams",
|
|
@@ -364,6 +415,7 @@ __all__ = [
|
|
|
364
415
|
"TextToSpeechResponse",
|
|
365
416
|
"TextToSpeechResponseParams",
|
|
366
417
|
"TextToSpeechSpeaker",
|
|
418
|
+
"TextToSpeechStreamingModel",
|
|
367
419
|
"TextToSpeechStreamingSendCompletionEvent",
|
|
368
420
|
"TimestampsModel",
|
|
369
421
|
"TimestampsModelParams",
|
|
@@ -385,6 +437,7 @@ __all__ = [
|
|
|
385
437
|
"UnprocessableEntityError",
|
|
386
438
|
"__version__",
|
|
387
439
|
"chat",
|
|
440
|
+
"doc_digitization_job",
|
|
388
441
|
"speech_to_text",
|
|
389
442
|
"speech_to_text_job",
|
|
390
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.22a7",
|
|
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.22a7",
|
|
30
30
|
**(self.get_custom_headers() or {}),
|
|
31
31
|
}
|
|
32
32
|
headers["api-subscription-key"] = self.api_subscription_key
|