sarvamai 0.1.5a5__py3-none-any.whl → 0.1.5a6__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 +1 -45
- sarvamai/chat/__init__.py +0 -2
- sarvamai/chat/client.py +10 -9
- sarvamai/chat/raw_client.py +37 -48
- sarvamai/client.py +31 -13
- sarvamai/core/__init__.py +0 -5
- sarvamai/core/api_error.py +5 -13
- sarvamai/core/client_wrapper.py +20 -17
- sarvamai/core/http_client.py +24 -70
- sarvamai/core/http_response.py +11 -19
- sarvamai/core/pydantic_utilities.py +108 -69
- sarvamai/environment.py +3 -10
- sarvamai/errors/__init__.py +0 -2
- sarvamai/errors/bad_request_error.py +3 -4
- sarvamai/errors/forbidden_error.py +3 -4
- sarvamai/errors/internal_server_error.py +3 -4
- sarvamai/errors/service_unavailable_error.py +2 -4
- sarvamai/errors/too_many_requests_error.py +3 -4
- sarvamai/errors/unprocessable_entity_error.py +3 -4
- sarvamai/requests/__init__.py +0 -18
- sarvamai/requests/chat_completion_request_message.py +1 -3
- sarvamai/requests/create_chat_completion_response.py +2 -2
- sarvamai/requests/diarized_transcript.py +1 -2
- sarvamai/requests/error_details.py +1 -0
- sarvamai/requests/language_identification_response.py +1 -0
- sarvamai/requests/speech_to_text_response.py +2 -1
- sarvamai/requests/speech_to_text_translate_response.py +1 -0
- sarvamai/requests/text_to_speech_response.py +2 -2
- sarvamai/requests/timestamps_model.py +1 -2
- sarvamai/requests/translation_response.py +1 -0
- sarvamai/requests/transliteration_response.py +1 -0
- sarvamai/speech_to_text/__init__.py +0 -2
- sarvamai/speech_to_text/client.py +14 -13
- sarvamai/speech_to_text/raw_client.py +68 -99
- sarvamai/text/__init__.py +0 -2
- sarvamai/text/client.py +25 -24
- sarvamai/text/raw_client.py +91 -126
- sarvamai/text_to_speech/__init__.py +0 -2
- sarvamai/text_to_speech/client.py +11 -10
- sarvamai/text_to_speech/raw_client.py +38 -49
- sarvamai/types/__init__.py +0 -24
- sarvamai/types/chat_completion_request_assistant_message.py +3 -3
- sarvamai/types/chat_completion_request_message.py +2 -3
- sarvamai/types/chat_completion_request_system_message.py +3 -3
- sarvamai/types/chat_completion_request_user_message.py +3 -3
- sarvamai/types/chat_completion_response_message.py +3 -3
- sarvamai/types/choice.py +4 -4
- sarvamai/types/completion_usage.py +3 -3
- sarvamai/types/create_chat_completion_response.py +3 -3
- sarvamai/types/diarized_entry.py +3 -3
- sarvamai/types/diarized_transcript.py +3 -3
- sarvamai/types/error_details.py +3 -3
- sarvamai/types/error_message.py +4 -4
- sarvamai/types/language_identification_response.py +2 -2
- sarvamai/types/speech_to_text_response.py +3 -3
- sarvamai/types/speech_to_text_translate_response.py +3 -3
- sarvamai/types/text_to_speech_response.py +2 -2
- sarvamai/types/timestamps_model.py +2 -2
- sarvamai/types/translation_response.py +2 -2
- sarvamai/types/transliteration_response.py +2 -2
- sarvamai-0.1.5a6.dist-info/METADATA +174 -0
- sarvamai-0.1.5a6.dist-info/RECORD +106 -0
- sarvamai/core/events.py +0 -30
- sarvamai/core/force_multipart.py +0 -16
- sarvamai/requests/audio_data.py +0 -21
- sarvamai/requests/audio_message.py +0 -8
- sarvamai/requests/error_data.py +0 -15
- sarvamai/requests/events_data.py +0 -17
- sarvamai/requests/speech_to_text_streaming_response.py +0 -10
- sarvamai/requests/speech_to_text_streaming_response_data.py +0 -9
- sarvamai/requests/transcription_data.py +0 -35
- sarvamai/requests/transcription_metrics.py +0 -15
- sarvamai/speech_to_text_streaming/__init__.py +0 -7
- sarvamai/speech_to_text_streaming/client.py +0 -189
- sarvamai/speech_to_text_streaming/raw_client.py +0 -166
- sarvamai/speech_to_text_streaming/socket_client.py +0 -129
- sarvamai/speech_to_text_streaming/types/__init__.py +0 -8
- sarvamai/speech_to_text_streaming/types/speech_to_text_streaming_language_code.py +0 -8
- sarvamai/speech_to_text_streaming/types/speech_to_text_streaming_model.py +0 -5
- sarvamai/types/audio_data.py +0 -33
- sarvamai/types/audio_data_encoding.py +0 -5
- sarvamai/types/audio_message.py +0 -20
- sarvamai/types/error_data.py +0 -27
- sarvamai/types/events_data.py +0 -28
- sarvamai/types/format.py +0 -5
- sarvamai/types/speech_to_text_streaming_response.py +0 -22
- sarvamai/types/speech_to_text_streaming_response_data.py +0 -9
- sarvamai/types/speech_to_text_streaming_response_type.py +0 -5
- sarvamai/types/transcription_data.py +0 -45
- sarvamai/types/transcription_metrics.py +0 -27
- sarvamai-0.1.5a5.dist-info/METADATA +0 -28
- sarvamai-0.1.5a5.dist-info/RECORD +0 -134
- {sarvamai-0.1.5a5.dist-info → sarvamai-0.1.5a6.dist-info}/WHEEL +0 -0
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
import typing
|
|
4
|
-
|
|
5
3
|
from ..core.api_error import ApiError
|
|
4
|
+
import typing
|
|
6
5
|
|
|
7
6
|
|
|
8
7
|
class TooManyRequestsError(ApiError):
|
|
9
|
-
def __init__(self, body: typing.Optional[typing.Any]
|
|
10
|
-
super().__init__(status_code=429,
|
|
8
|
+
def __init__(self, body: typing.Optional[typing.Any]):
|
|
9
|
+
super().__init__(status_code=429, body=body)
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
import typing
|
|
4
|
-
|
|
5
3
|
from ..core.api_error import ApiError
|
|
4
|
+
import typing
|
|
6
5
|
|
|
7
6
|
|
|
8
7
|
class UnprocessableEntityError(ApiError):
|
|
9
|
-
def __init__(self, body: typing.Optional[typing.Any]
|
|
10
|
-
super().__init__(status_code=422,
|
|
8
|
+
def __init__(self, body: typing.Optional[typing.Any]):
|
|
9
|
+
super().__init__(status_code=422, body=body)
|
sarvamai/requests/__init__.py
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
# isort: skip_file
|
|
4
|
-
|
|
5
|
-
from .audio_data import AudioDataParams
|
|
6
|
-
from .audio_message import AudioMessageParams
|
|
7
3
|
from .chat_completion_request_assistant_message import ChatCompletionRequestAssistantMessageParams
|
|
8
4
|
from .chat_completion_request_message import (
|
|
9
5
|
ChatCompletionRequestMessageParams,
|
|
@@ -19,26 +15,18 @@ from .completion_usage import CompletionUsageParams
|
|
|
19
15
|
from .create_chat_completion_response import CreateChatCompletionResponseParams
|
|
20
16
|
from .diarized_entry import DiarizedEntryParams
|
|
21
17
|
from .diarized_transcript import DiarizedTranscriptParams
|
|
22
|
-
from .error_data import ErrorDataParams
|
|
23
18
|
from .error_details import ErrorDetailsParams
|
|
24
19
|
from .error_message import ErrorMessageParams
|
|
25
|
-
from .events_data import EventsDataParams
|
|
26
20
|
from .language_identification_response import LanguageIdentificationResponseParams
|
|
27
21
|
from .speech_to_text_response import SpeechToTextResponseParams
|
|
28
|
-
from .speech_to_text_streaming_response import SpeechToTextStreamingResponseParams
|
|
29
|
-
from .speech_to_text_streaming_response_data import SpeechToTextStreamingResponseDataParams
|
|
30
22
|
from .speech_to_text_translate_response import SpeechToTextTranslateResponseParams
|
|
31
23
|
from .stop_configuration import StopConfigurationParams
|
|
32
24
|
from .text_to_speech_response import TextToSpeechResponseParams
|
|
33
25
|
from .timestamps_model import TimestampsModelParams
|
|
34
|
-
from .transcription_data import TranscriptionDataParams
|
|
35
|
-
from .transcription_metrics import TranscriptionMetricsParams
|
|
36
26
|
from .translation_response import TranslationResponseParams
|
|
37
27
|
from .transliteration_response import TransliterationResponseParams
|
|
38
28
|
|
|
39
29
|
__all__ = [
|
|
40
|
-
"AudioDataParams",
|
|
41
|
-
"AudioMessageParams",
|
|
42
30
|
"ChatCompletionRequestAssistantMessageParams",
|
|
43
31
|
"ChatCompletionRequestMessageParams",
|
|
44
32
|
"ChatCompletionRequestMessage_AssistantParams",
|
|
@@ -52,20 +40,14 @@ __all__ = [
|
|
|
52
40
|
"CreateChatCompletionResponseParams",
|
|
53
41
|
"DiarizedEntryParams",
|
|
54
42
|
"DiarizedTranscriptParams",
|
|
55
|
-
"ErrorDataParams",
|
|
56
43
|
"ErrorDetailsParams",
|
|
57
44
|
"ErrorMessageParams",
|
|
58
|
-
"EventsDataParams",
|
|
59
45
|
"LanguageIdentificationResponseParams",
|
|
60
46
|
"SpeechToTextResponseParams",
|
|
61
|
-
"SpeechToTextStreamingResponseDataParams",
|
|
62
|
-
"SpeechToTextStreamingResponseParams",
|
|
63
47
|
"SpeechToTextTranslateResponseParams",
|
|
64
48
|
"StopConfigurationParams",
|
|
65
49
|
"TextToSpeechResponseParams",
|
|
66
50
|
"TimestampsModelParams",
|
|
67
|
-
"TranscriptionDataParams",
|
|
68
|
-
"TranscriptionMetricsParams",
|
|
69
51
|
"TranslationResponseParams",
|
|
70
52
|
"TransliterationResponseParams",
|
|
71
53
|
]
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
3
|
import typing_extensions
|
|
4
|
-
|
|
4
|
+
import typing_extensions
|
|
5
5
|
from .timestamps_model import TimestampsModelParams
|
|
6
|
+
from .diarized_transcript import DiarizedTranscriptParams
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
class SpeechToTextResponseParams(typing_extensions.TypedDict):
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
3
|
import typing
|
|
4
|
-
|
|
4
|
+
from ..core.client_wrapper import SyncClientWrapper
|
|
5
|
+
from .raw_client import RawSpeechToTextClient
|
|
5
6
|
from .. import core
|
|
6
|
-
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
7
|
-
from ..core.request_options import RequestOptions
|
|
8
|
-
from ..types.speech_to_text_language import SpeechToTextLanguage
|
|
9
7
|
from ..types.speech_to_text_model import SpeechToTextModel
|
|
8
|
+
from ..types.speech_to_text_language import SpeechToTextLanguage
|
|
9
|
+
from ..core.request_options import RequestOptions
|
|
10
10
|
from ..types.speech_to_text_response import SpeechToTextResponse
|
|
11
11
|
from ..types.speech_to_text_translate_model import SpeechToTextTranslateModel
|
|
12
12
|
from ..types.speech_to_text_translate_response import SpeechToTextTranslateResponse
|
|
13
|
-
from .
|
|
13
|
+
from ..core.client_wrapper import AsyncClientWrapper
|
|
14
|
+
from .raw_client import AsyncRawSpeechToTextClient
|
|
14
15
|
|
|
15
16
|
# this is used as the default value for optional parameters
|
|
16
17
|
OMIT = typing.cast(typing.Any, ...)
|
|
@@ -87,10 +88,10 @@ class SpeechToTextClient:
|
|
|
87
88
|
)
|
|
88
89
|
client.speech_to_text.transcribe()
|
|
89
90
|
"""
|
|
90
|
-
|
|
91
|
+
response = self._raw_client.transcribe(
|
|
91
92
|
file=file, model=model, language_code=language_code, request_options=request_options
|
|
92
93
|
)
|
|
93
|
-
return
|
|
94
|
+
return response.data
|
|
94
95
|
|
|
95
96
|
def translate(
|
|
96
97
|
self,
|
|
@@ -143,8 +144,8 @@ class SpeechToTextClient:
|
|
|
143
144
|
)
|
|
144
145
|
client.speech_to_text.translate()
|
|
145
146
|
"""
|
|
146
|
-
|
|
147
|
-
return
|
|
147
|
+
response = self._raw_client.translate(file=file, prompt=prompt, model=model, request_options=request_options)
|
|
148
|
+
return response.data
|
|
148
149
|
|
|
149
150
|
|
|
150
151
|
class AsyncSpeechToTextClient:
|
|
@@ -226,10 +227,10 @@ class AsyncSpeechToTextClient:
|
|
|
226
227
|
|
|
227
228
|
asyncio.run(main())
|
|
228
229
|
"""
|
|
229
|
-
|
|
230
|
+
response = await self._raw_client.transcribe(
|
|
230
231
|
file=file, model=model, language_code=language_code, request_options=request_options
|
|
231
232
|
)
|
|
232
|
-
return
|
|
233
|
+
return response.data
|
|
233
234
|
|
|
234
235
|
async def translate(
|
|
235
236
|
self,
|
|
@@ -290,7 +291,7 @@ class AsyncSpeechToTextClient:
|
|
|
290
291
|
|
|
291
292
|
asyncio.run(main())
|
|
292
293
|
"""
|
|
293
|
-
|
|
294
|
+
response = await self._raw_client.translate(
|
|
294
295
|
file=file, prompt=prompt, model=model, request_options=request_options
|
|
295
296
|
)
|
|
296
|
-
return
|
|
297
|
+
return response.data
|