sarvamai 0.1.22a4__py3-none-any.whl → 0.1.23a2__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 +405 -200
- sarvamai/chat/raw_client.py +20 -20
- sarvamai/client.py +186 -34
- sarvamai/core/__init__.py +76 -21
- sarvamai/core/client_wrapper.py +19 -3
- sarvamai/core/force_multipart.py +4 -2
- sarvamai/core/http_client.py +217 -97
- sarvamai/core/http_response.py +1 -1
- sarvamai/core/http_sse/__init__.py +42 -0
- sarvamai/core/http_sse/_api.py +112 -0
- sarvamai/core/http_sse/_decoders.py +61 -0
- sarvamai/core/http_sse/_exceptions.py +7 -0
- sarvamai/core/http_sse/_models.py +17 -0
- sarvamai/core/jsonable_encoder.py +8 -0
- sarvamai/core/pydantic_utilities.py +110 -4
- sarvamai/errors/__init__.py +40 -6
- 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 +150 -62
- sarvamai/requests/audio_data.py +0 -6
- sarvamai/requests/error_response_data.py +1 -1
- sarvamai/requests/file_signed_url_details.py +1 -1
- sarvamai/requests/speech_to_text_transcription_data.py +2 -2
- sarvamai/speech_to_text/raw_client.py +54 -52
- sarvamai/speech_to_text_job/raw_client.py +120 -120
- sarvamai/speech_to_text_streaming/__init__.py +38 -8
- sarvamai/speech_to_text_streaming/client.py +0 -13
- sarvamai/speech_to_text_streaming/raw_client.py +0 -13
- sarvamai/speech_to_text_streaming/types/__init__.py +36 -6
- sarvamai/speech_to_text_translate_job/raw_client.py +120 -120
- sarvamai/speech_to_text_translate_streaming/__init__.py +36 -7
- sarvamai/speech_to_text_translate_streaming/client.py +0 -13
- sarvamai/speech_to_text_translate_streaming/raw_client.py +0 -13
- sarvamai/speech_to_text_translate_streaming/types/__init__.py +36 -5
- sarvamai/text/client.py +0 -12
- sarvamai/text/raw_client.py +60 -72
- sarvamai/text_to_speech/client.py +18 -0
- sarvamai/text_to_speech/raw_client.py +38 -20
- sarvamai/text_to_speech_streaming/__init__.py +28 -1
- sarvamai/text_to_speech_streaming/types/__init__.py +30 -1
- sarvamai/types/__init__.py +222 -100
- sarvamai/types/audio_data.py +0 -6
- sarvamai/types/chat_completion_request_message.py +6 -2
- sarvamai/types/error_response_data.py +1 -1
- sarvamai/types/file_signed_url_details.py +1 -1
- sarvamai/types/speech_to_text_transcription_data.py +2 -2
- {sarvamai-0.1.22a4.dist-info → sarvamai-0.1.23a2.dist-info}/METADATA +2 -1
- {sarvamai-0.1.22a4.dist-info → sarvamai-0.1.23a2.dist-info}/RECORD +53 -51
- sarvamai/speech_to_text_streaming/types/speech_to_text_streaming_input_audio_codec.py +0 -33
- sarvamai/speech_to_text_translate_streaming/types/speech_to_text_translate_streaming_input_audio_codec.py +0 -33
- sarvamai/types/audio_data_input_audio_codec.py +0 -33
- {sarvamai-0.1.22a4.dist-info → sarvamai-0.1.23a2.dist-info}/WHEEL +0 -0
sarvamai/types/__init__.py
CHANGED
|
@@ -2,109 +2,231 @@
|
|
|
2
2
|
|
|
3
3
|
# isort: skip_file
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
from
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
from .
|
|
10
|
-
from .
|
|
11
|
-
from .
|
|
12
|
-
from .
|
|
13
|
-
from .
|
|
14
|
-
from .
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
from .
|
|
24
|
-
from .
|
|
25
|
-
from .
|
|
26
|
-
from .
|
|
27
|
-
from .
|
|
28
|
-
from .
|
|
29
|
-
from .
|
|
30
|
-
from .
|
|
31
|
-
from .
|
|
32
|
-
from .
|
|
33
|
-
from .
|
|
34
|
-
from .
|
|
35
|
-
from .
|
|
36
|
-
from .
|
|
37
|
-
from .
|
|
38
|
-
from .
|
|
39
|
-
from .
|
|
40
|
-
from .
|
|
41
|
-
from .
|
|
42
|
-
from .
|
|
43
|
-
from .
|
|
44
|
-
from .
|
|
45
|
-
from .
|
|
46
|
-
from .
|
|
47
|
-
from .
|
|
48
|
-
from .
|
|
49
|
-
from .
|
|
50
|
-
from .
|
|
51
|
-
from .
|
|
52
|
-
from .
|
|
53
|
-
from .
|
|
54
|
-
from .
|
|
55
|
-
from .
|
|
56
|
-
from .
|
|
57
|
-
from .
|
|
58
|
-
from .
|
|
59
|
-
from .
|
|
60
|
-
from .
|
|
61
|
-
from .
|
|
62
|
-
from .
|
|
63
|
-
from .
|
|
64
|
-
from .
|
|
65
|
-
from .
|
|
66
|
-
from .
|
|
67
|
-
from .
|
|
68
|
-
from .
|
|
69
|
-
from .
|
|
70
|
-
from .
|
|
71
|
-
from .
|
|
72
|
-
from .
|
|
73
|
-
from .
|
|
74
|
-
from .
|
|
75
|
-
from .
|
|
76
|
-
from .
|
|
77
|
-
from .
|
|
78
|
-
from .
|
|
79
|
-
from .
|
|
80
|
-
from .
|
|
81
|
-
from .
|
|
82
|
-
from .
|
|
83
|
-
from .
|
|
84
|
-
from .
|
|
85
|
-
from .
|
|
86
|
-
from .
|
|
87
|
-
from .
|
|
88
|
-
from .
|
|
89
|
-
from .
|
|
90
|
-
from .
|
|
91
|
-
from .
|
|
92
|
-
from .
|
|
93
|
-
from .
|
|
94
|
-
from .
|
|
95
|
-
from .
|
|
96
|
-
from .
|
|
97
|
-
from .
|
|
98
|
-
from .
|
|
99
|
-
from .
|
|
100
|
-
from .
|
|
101
|
-
from .
|
|
102
|
-
from .
|
|
103
|
-
from .
|
|
5
|
+
import typing
|
|
6
|
+
from importlib import import_module
|
|
7
|
+
|
|
8
|
+
if typing.TYPE_CHECKING:
|
|
9
|
+
from .audio_data import AudioData
|
|
10
|
+
from .audio_message import AudioMessage
|
|
11
|
+
from .audio_output import AudioOutput
|
|
12
|
+
from .audio_output_data import AudioOutputData
|
|
13
|
+
from .base_job_parameters import BaseJobParameters
|
|
14
|
+
from .bulk_job_callback import BulkJobCallback
|
|
15
|
+
from .bulk_job_init_response_v_1 import BulkJobInitResponseV1
|
|
16
|
+
from .chat_completion_request_assistant_message import ChatCompletionRequestAssistantMessage
|
|
17
|
+
from .chat_completion_request_message import (
|
|
18
|
+
ChatCompletionRequestMessage,
|
|
19
|
+
ChatCompletionRequestMessage_Assistant,
|
|
20
|
+
ChatCompletionRequestMessage_System,
|
|
21
|
+
ChatCompletionRequestMessage_User,
|
|
22
|
+
)
|
|
23
|
+
from .chat_completion_request_system_message import ChatCompletionRequestSystemMessage
|
|
24
|
+
from .chat_completion_request_user_message import ChatCompletionRequestUserMessage
|
|
25
|
+
from .chat_completion_response_message import ChatCompletionResponseMessage
|
|
26
|
+
from .choice import Choice
|
|
27
|
+
from .completion_event_flag import CompletionEventFlag
|
|
28
|
+
from .completion_usage import CompletionUsage
|
|
29
|
+
from .config_message import ConfigMessage
|
|
30
|
+
from .configure_connection import ConfigureConnection
|
|
31
|
+
from .configure_connection_data import ConfigureConnectionData
|
|
32
|
+
from .configure_connection_data_output_audio_bitrate import ConfigureConnectionDataOutputAudioBitrate
|
|
33
|
+
from .configure_connection_data_output_audio_codec import ConfigureConnectionDataOutputAudioCodec
|
|
34
|
+
from .configure_connection_data_speaker import ConfigureConnectionDataSpeaker
|
|
35
|
+
from .configure_connection_data_target_language_code import ConfigureConnectionDataTargetLanguageCode
|
|
36
|
+
from .connection_sample_rate import ConnectionSampleRate
|
|
37
|
+
from .create_chat_completion_response import CreateChatCompletionResponse
|
|
38
|
+
from .diarized_entry import DiarizedEntry
|
|
39
|
+
from .diarized_transcript import DiarizedTranscript
|
|
40
|
+
from .error_code import ErrorCode
|
|
41
|
+
from .error_data import ErrorData
|
|
42
|
+
from .error_details import ErrorDetails
|
|
43
|
+
from .error_message import ErrorMessage
|
|
44
|
+
from .error_response import ErrorResponse
|
|
45
|
+
from .error_response_data import ErrorResponseData
|
|
46
|
+
from .event_response import EventResponse
|
|
47
|
+
from .event_response_data import EventResponseData
|
|
48
|
+
from .events_data import EventsData
|
|
49
|
+
from .events_data_signal_type import EventsDataSignalType
|
|
50
|
+
from .file_signed_url_details import FileSignedUrlDetails
|
|
51
|
+
from .files_download_response import FilesDownloadResponse
|
|
52
|
+
from .files_request import FilesRequest
|
|
53
|
+
from .files_upload_response import FilesUploadResponse
|
|
54
|
+
from .finish_reason import FinishReason
|
|
55
|
+
from .flush_signal import FlushSignal
|
|
56
|
+
from .input_audio_codec import InputAudioCodec
|
|
57
|
+
from .job_state import JobState
|
|
58
|
+
from .job_status_v_1_response import JobStatusV1Response
|
|
59
|
+
from .language_identification_response import LanguageIdentificationResponse
|
|
60
|
+
from .numerals_format import NumeralsFormat
|
|
61
|
+
from .ping_signal import PingSignal
|
|
62
|
+
from .reasoning_effort import ReasoningEffort
|
|
63
|
+
from .response_type import ResponseType
|
|
64
|
+
from .role import Role
|
|
65
|
+
from .sarvam_model_ids import SarvamModelIds
|
|
66
|
+
from .send_text import SendText
|
|
67
|
+
from .send_text_data import SendTextData
|
|
68
|
+
from .speech_sample_rate import SpeechSampleRate
|
|
69
|
+
from .speech_to_text_job_parameters import SpeechToTextJobParameters
|
|
70
|
+
from .speech_to_text_language import SpeechToTextLanguage
|
|
71
|
+
from .speech_to_text_model import SpeechToTextModel
|
|
72
|
+
from .speech_to_text_response import SpeechToTextResponse
|
|
73
|
+
from .speech_to_text_response_data import SpeechToTextResponseData
|
|
74
|
+
from .speech_to_text_streaming_response import SpeechToTextStreamingResponse
|
|
75
|
+
from .speech_to_text_transcription_data import SpeechToTextTranscriptionData
|
|
76
|
+
from .speech_to_text_translate_job_parameters import SpeechToTextTranslateJobParameters
|
|
77
|
+
from .speech_to_text_translate_language import SpeechToTextTranslateLanguage
|
|
78
|
+
from .speech_to_text_translate_model import SpeechToTextTranslateModel
|
|
79
|
+
from .speech_to_text_translate_response import SpeechToTextTranslateResponse
|
|
80
|
+
from .speech_to_text_translate_response_data import SpeechToTextTranslateResponseData
|
|
81
|
+
from .speech_to_text_translate_streaming_response import SpeechToTextTranslateStreamingResponse
|
|
82
|
+
from .speech_to_text_translate_transcription_data import SpeechToTextTranslateTranscriptionData
|
|
83
|
+
from .spoken_form_numerals_format import SpokenFormNumeralsFormat
|
|
84
|
+
from .stop_configuration import StopConfiguration
|
|
85
|
+
from .storage_container_type import StorageContainerType
|
|
86
|
+
from .stt_flush_signal import SttFlushSignal
|
|
87
|
+
from .task_detail_v_1 import TaskDetailV1
|
|
88
|
+
from .task_file_details import TaskFileDetails
|
|
89
|
+
from .task_state import TaskState
|
|
90
|
+
from .text_to_speech_language import TextToSpeechLanguage
|
|
91
|
+
from .text_to_speech_model import TextToSpeechModel
|
|
92
|
+
from .text_to_speech_output_audio_codec import TextToSpeechOutputAudioCodec
|
|
93
|
+
from .text_to_speech_response import TextToSpeechResponse
|
|
94
|
+
from .text_to_speech_speaker import TextToSpeechSpeaker
|
|
95
|
+
from .timestamps_model import TimestampsModel
|
|
96
|
+
from .transcription_metrics import TranscriptionMetrics
|
|
97
|
+
from .translate_mode import TranslateMode
|
|
98
|
+
from .translate_model import TranslateModel
|
|
99
|
+
from .translate_source_language import TranslateSourceLanguage
|
|
100
|
+
from .translate_speaker_gender import TranslateSpeakerGender
|
|
101
|
+
from .translate_target_language import TranslateTargetLanguage
|
|
102
|
+
from .translation_response import TranslationResponse
|
|
103
|
+
from .translatiterate_target_language import TranslatiterateTargetLanguage
|
|
104
|
+
from .transliterate_mode import TransliterateMode
|
|
105
|
+
from .transliterate_source_language import TransliterateSourceLanguage
|
|
106
|
+
from .transliteration_response import TransliterationResponse
|
|
107
|
+
_dynamic_imports: typing.Dict[str, str] = {
|
|
108
|
+
"AudioData": ".audio_data",
|
|
109
|
+
"AudioMessage": ".audio_message",
|
|
110
|
+
"AudioOutput": ".audio_output",
|
|
111
|
+
"AudioOutputData": ".audio_output_data",
|
|
112
|
+
"BaseJobParameters": ".base_job_parameters",
|
|
113
|
+
"BulkJobCallback": ".bulk_job_callback",
|
|
114
|
+
"BulkJobInitResponseV1": ".bulk_job_init_response_v_1",
|
|
115
|
+
"ChatCompletionRequestAssistantMessage": ".chat_completion_request_assistant_message",
|
|
116
|
+
"ChatCompletionRequestMessage": ".chat_completion_request_message",
|
|
117
|
+
"ChatCompletionRequestMessage_Assistant": ".chat_completion_request_message",
|
|
118
|
+
"ChatCompletionRequestMessage_System": ".chat_completion_request_message",
|
|
119
|
+
"ChatCompletionRequestMessage_User": ".chat_completion_request_message",
|
|
120
|
+
"ChatCompletionRequestSystemMessage": ".chat_completion_request_system_message",
|
|
121
|
+
"ChatCompletionRequestUserMessage": ".chat_completion_request_user_message",
|
|
122
|
+
"ChatCompletionResponseMessage": ".chat_completion_response_message",
|
|
123
|
+
"Choice": ".choice",
|
|
124
|
+
"CompletionEventFlag": ".completion_event_flag",
|
|
125
|
+
"CompletionUsage": ".completion_usage",
|
|
126
|
+
"ConfigMessage": ".config_message",
|
|
127
|
+
"ConfigureConnection": ".configure_connection",
|
|
128
|
+
"ConfigureConnectionData": ".configure_connection_data",
|
|
129
|
+
"ConfigureConnectionDataOutputAudioBitrate": ".configure_connection_data_output_audio_bitrate",
|
|
130
|
+
"ConfigureConnectionDataOutputAudioCodec": ".configure_connection_data_output_audio_codec",
|
|
131
|
+
"ConfigureConnectionDataSpeaker": ".configure_connection_data_speaker",
|
|
132
|
+
"ConfigureConnectionDataTargetLanguageCode": ".configure_connection_data_target_language_code",
|
|
133
|
+
"ConnectionSampleRate": ".connection_sample_rate",
|
|
134
|
+
"CreateChatCompletionResponse": ".create_chat_completion_response",
|
|
135
|
+
"DiarizedEntry": ".diarized_entry",
|
|
136
|
+
"DiarizedTranscript": ".diarized_transcript",
|
|
137
|
+
"ErrorCode": ".error_code",
|
|
138
|
+
"ErrorData": ".error_data",
|
|
139
|
+
"ErrorDetails": ".error_details",
|
|
140
|
+
"ErrorMessage": ".error_message",
|
|
141
|
+
"ErrorResponse": ".error_response",
|
|
142
|
+
"ErrorResponseData": ".error_response_data",
|
|
143
|
+
"EventResponse": ".event_response",
|
|
144
|
+
"EventResponseData": ".event_response_data",
|
|
145
|
+
"EventsData": ".events_data",
|
|
146
|
+
"EventsDataSignalType": ".events_data_signal_type",
|
|
147
|
+
"FileSignedUrlDetails": ".file_signed_url_details",
|
|
148
|
+
"FilesDownloadResponse": ".files_download_response",
|
|
149
|
+
"FilesRequest": ".files_request",
|
|
150
|
+
"FilesUploadResponse": ".files_upload_response",
|
|
151
|
+
"FinishReason": ".finish_reason",
|
|
152
|
+
"FlushSignal": ".flush_signal",
|
|
153
|
+
"InputAudioCodec": ".input_audio_codec",
|
|
154
|
+
"JobState": ".job_state",
|
|
155
|
+
"JobStatusV1Response": ".job_status_v_1_response",
|
|
156
|
+
"LanguageIdentificationResponse": ".language_identification_response",
|
|
157
|
+
"NumeralsFormat": ".numerals_format",
|
|
158
|
+
"PingSignal": ".ping_signal",
|
|
159
|
+
"ReasoningEffort": ".reasoning_effort",
|
|
160
|
+
"ResponseType": ".response_type",
|
|
161
|
+
"Role": ".role",
|
|
162
|
+
"SarvamModelIds": ".sarvam_model_ids",
|
|
163
|
+
"SendText": ".send_text",
|
|
164
|
+
"SendTextData": ".send_text_data",
|
|
165
|
+
"SpeechSampleRate": ".speech_sample_rate",
|
|
166
|
+
"SpeechToTextJobParameters": ".speech_to_text_job_parameters",
|
|
167
|
+
"SpeechToTextLanguage": ".speech_to_text_language",
|
|
168
|
+
"SpeechToTextModel": ".speech_to_text_model",
|
|
169
|
+
"SpeechToTextResponse": ".speech_to_text_response",
|
|
170
|
+
"SpeechToTextResponseData": ".speech_to_text_response_data",
|
|
171
|
+
"SpeechToTextStreamingResponse": ".speech_to_text_streaming_response",
|
|
172
|
+
"SpeechToTextTranscriptionData": ".speech_to_text_transcription_data",
|
|
173
|
+
"SpeechToTextTranslateJobParameters": ".speech_to_text_translate_job_parameters",
|
|
174
|
+
"SpeechToTextTranslateLanguage": ".speech_to_text_translate_language",
|
|
175
|
+
"SpeechToTextTranslateModel": ".speech_to_text_translate_model",
|
|
176
|
+
"SpeechToTextTranslateResponse": ".speech_to_text_translate_response",
|
|
177
|
+
"SpeechToTextTranslateResponseData": ".speech_to_text_translate_response_data",
|
|
178
|
+
"SpeechToTextTranslateStreamingResponse": ".speech_to_text_translate_streaming_response",
|
|
179
|
+
"SpeechToTextTranslateTranscriptionData": ".speech_to_text_translate_transcription_data",
|
|
180
|
+
"SpokenFormNumeralsFormat": ".spoken_form_numerals_format",
|
|
181
|
+
"StopConfiguration": ".stop_configuration",
|
|
182
|
+
"StorageContainerType": ".storage_container_type",
|
|
183
|
+
"SttFlushSignal": ".stt_flush_signal",
|
|
184
|
+
"TaskDetailV1": ".task_detail_v_1",
|
|
185
|
+
"TaskFileDetails": ".task_file_details",
|
|
186
|
+
"TaskState": ".task_state",
|
|
187
|
+
"TextToSpeechLanguage": ".text_to_speech_language",
|
|
188
|
+
"TextToSpeechModel": ".text_to_speech_model",
|
|
189
|
+
"TextToSpeechOutputAudioCodec": ".text_to_speech_output_audio_codec",
|
|
190
|
+
"TextToSpeechResponse": ".text_to_speech_response",
|
|
191
|
+
"TextToSpeechSpeaker": ".text_to_speech_speaker",
|
|
192
|
+
"TimestampsModel": ".timestamps_model",
|
|
193
|
+
"TranscriptionMetrics": ".transcription_metrics",
|
|
194
|
+
"TranslateMode": ".translate_mode",
|
|
195
|
+
"TranslateModel": ".translate_model",
|
|
196
|
+
"TranslateSourceLanguage": ".translate_source_language",
|
|
197
|
+
"TranslateSpeakerGender": ".translate_speaker_gender",
|
|
198
|
+
"TranslateTargetLanguage": ".translate_target_language",
|
|
199
|
+
"TranslationResponse": ".translation_response",
|
|
200
|
+
"TranslatiterateTargetLanguage": ".translatiterate_target_language",
|
|
201
|
+
"TransliterateMode": ".transliterate_mode",
|
|
202
|
+
"TransliterateSourceLanguage": ".transliterate_source_language",
|
|
203
|
+
"TransliterationResponse": ".transliteration_response",
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
def __getattr__(attr_name: str) -> typing.Any:
|
|
208
|
+
module_name = _dynamic_imports.get(attr_name)
|
|
209
|
+
if module_name is None:
|
|
210
|
+
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
|
|
211
|
+
try:
|
|
212
|
+
module = import_module(module_name, __package__)
|
|
213
|
+
if module_name == f".{attr_name}":
|
|
214
|
+
return module
|
|
215
|
+
else:
|
|
216
|
+
return getattr(module, attr_name)
|
|
217
|
+
except ImportError as e:
|
|
218
|
+
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
|
|
219
|
+
except AttributeError as e:
|
|
220
|
+
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
def __dir__():
|
|
224
|
+
lazy_attrs = list(_dynamic_imports.keys())
|
|
225
|
+
return sorted(lazy_attrs)
|
|
226
|
+
|
|
104
227
|
|
|
105
228
|
__all__ = [
|
|
106
229
|
"AudioData",
|
|
107
|
-
"AudioDataInputAudioCodec",
|
|
108
230
|
"AudioMessage",
|
|
109
231
|
"AudioOutput",
|
|
110
232
|
"AudioOutputData",
|
sarvamai/types/audio_data.py
CHANGED
|
@@ -4,7 +4,6 @@ import typing
|
|
|
4
4
|
|
|
5
5
|
import pydantic
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
-
from .audio_data_input_audio_codec import AudioDataInputAudioCodec
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
class AudioData(UniversalBaseModel):
|
|
@@ -29,11 +28,6 @@ class AudioData(UniversalBaseModel):
|
|
|
29
28
|
Audio encoding format
|
|
30
29
|
"""
|
|
31
30
|
|
|
32
|
-
input_audio_codec: typing.Optional[AudioDataInputAudioCodec] = pydantic.Field(default=None)
|
|
33
|
-
"""
|
|
34
|
-
Audio codec/format of the input file. Our API automatically detects all codec formats, but for PCM files specifically (pcm_s16le, pcm_l16, pcm_raw), you must pass this parameter. PCM files supports sample rate 16000 and 8000.
|
|
35
|
-
"""
|
|
36
|
-
|
|
37
31
|
if IS_PYDANTIC_V2:
|
|
38
32
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
39
33
|
else:
|
|
@@ -5,6 +5,7 @@ from __future__ import annotations
|
|
|
5
5
|
import typing
|
|
6
6
|
|
|
7
7
|
import pydantic
|
|
8
|
+
import typing_extensions
|
|
8
9
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
9
10
|
|
|
10
11
|
|
|
@@ -50,6 +51,9 @@ class ChatCompletionRequestMessage_User(UniversalBaseModel):
|
|
|
50
51
|
extra = pydantic.Extra.allow
|
|
51
52
|
|
|
52
53
|
|
|
53
|
-
ChatCompletionRequestMessage =
|
|
54
|
-
|
|
54
|
+
ChatCompletionRequestMessage = typing_extensions.Annotated[
|
|
55
|
+
typing.Union[
|
|
56
|
+
ChatCompletionRequestMessage_Assistant, ChatCompletionRequestMessage_System, ChatCompletionRequestMessage_User
|
|
57
|
+
],
|
|
58
|
+
pydantic.Field(discriminator="role"),
|
|
55
59
|
]
|
|
@@ -13,7 +13,7 @@ class ErrorResponseData(UniversalBaseModel):
|
|
|
13
13
|
Optional error code for programmatic error handling
|
|
14
14
|
"""
|
|
15
15
|
|
|
16
|
-
details: typing.Optional[typing.Dict[str, typing.
|
|
16
|
+
details: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
|
|
17
17
|
"""
|
|
18
18
|
Additional error details and context information
|
|
19
19
|
"""
|
|
@@ -8,7 +8,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
|
8
8
|
|
|
9
9
|
class FileSignedUrlDetails(UniversalBaseModel):
|
|
10
10
|
file_url: str
|
|
11
|
-
file_metadata: typing.Optional[typing.Dict[str, typing.
|
|
11
|
+
file_metadata: typing.Optional[typing.Dict[str, typing.Any]] = None
|
|
12
12
|
|
|
13
13
|
if IS_PYDANTIC_V2:
|
|
14
14
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
@@ -18,12 +18,12 @@ class SpeechToTextTranscriptionData(UniversalBaseModel):
|
|
|
18
18
|
Transcript of the provided speech in original language
|
|
19
19
|
"""
|
|
20
20
|
|
|
21
|
-
timestamps: typing.Optional[typing.Dict[str, typing.
|
|
21
|
+
timestamps: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
|
|
22
22
|
"""
|
|
23
23
|
Timestamp information (if available)
|
|
24
24
|
"""
|
|
25
25
|
|
|
26
|
-
diarized_transcript: typing.Optional[typing.Dict[str, typing.
|
|
26
|
+
diarized_transcript: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
|
|
27
27
|
"""
|
|
28
28
|
Diarized transcript of the provided speech
|
|
29
29
|
"""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sarvamai
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.23a2
|
|
4
4
|
Summary:
|
|
5
5
|
Requires-Python: >=3.8,<4.0
|
|
6
6
|
Classifier: Intended Audience :: Developers
|
|
@@ -23,6 +23,7 @@ Requires-Dist: pydantic (>=1.9.2)
|
|
|
23
23
|
Requires-Dist: pydantic-core (>=2.18.2)
|
|
24
24
|
Requires-Dist: typing_extensions (>=4.0.0)
|
|
25
25
|
Requires-Dist: websockets (>=12.0)
|
|
26
|
+
Project-URL: Repository, https://github.com/sarvamai/sarvam-python-sdk
|
|
26
27
|
Description-Content-Type: text/markdown
|
|
27
28
|
|
|
28
29
|
# Sarvam Python Library
|