sarvamai 0.1.23a3__py3-none-any.whl → 0.1.23a5__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 +203 -405
- sarvamai/chat/raw_client.py +20 -20
- sarvamai/client.py +34 -186
- sarvamai/core/__init__.py +21 -76
- sarvamai/core/client_wrapper.py +3 -19
- sarvamai/core/force_multipart.py +2 -4
- sarvamai/core/http_client.py +97 -217
- sarvamai/core/http_response.py +1 -1
- sarvamai/core/jsonable_encoder.py +0 -8
- sarvamai/core/pydantic_utilities.py +4 -110
- sarvamai/errors/__init__.py +6 -40
- 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 +62 -150
- sarvamai/requests/configure_connection.py +4 -0
- sarvamai/requests/configure_connection_data.py +40 -11
- sarvamai/requests/error_response_data.py +1 -1
- sarvamai/requests/file_signed_url_details.py +1 -1
- sarvamai/requests/speech_to_text_job_parameters.py +43 -2
- sarvamai/requests/speech_to_text_transcription_data.py +2 -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 +147 -64
- sarvamai/speech_to_text_job/client.py +60 -15
- sarvamai/speech_to_text_job/raw_client.py +120 -120
- sarvamai/speech_to_text_streaming/__init__.py +10 -38
- sarvamai/speech_to_text_streaming/client.py +90 -8
- sarvamai/speech_to_text_streaming/raw_client.py +90 -8
- sarvamai/speech_to_text_streaming/types/__init__.py +8 -36
- 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/raw_client.py +120 -120
- sarvamai/speech_to_text_translate_streaming/__init__.py +5 -36
- sarvamai/speech_to_text_translate_streaming/client.py +8 -2
- sarvamai/speech_to_text_translate_streaming/raw_client.py +8 -2
- sarvamai/speech_to_text_translate_streaming/types/__init__.py +3 -36
- sarvamai/text/raw_client.py +60 -60
- sarvamai/text_to_speech/client.py +100 -16
- sarvamai/text_to_speech/raw_client.py +120 -36
- sarvamai/text_to_speech_streaming/__init__.py +2 -29
- 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 +3 -31
- sarvamai/text_to_speech_streaming/types/text_to_speech_streaming_model.py +5 -0
- sarvamai/types/__init__.py +102 -222
- sarvamai/types/chat_completion_request_message.py +2 -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/error_response_data.py +1 -1
- sarvamai/types/file_signed_url_details.py +1 -1
- 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 +2 -2
- 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.23a3.dist-info → sarvamai-0.1.23a5.dist-info}/METADATA +1 -2
- {sarvamai-0.1.23a3.dist-info → sarvamai-0.1.23a5.dist-info}/RECORD +66 -66
- sarvamai/core/http_sse/__init__.py +0 -42
- sarvamai/core/http_sse/_api.py +0 -112
- sarvamai/core/http_sse/_decoders.py +0 -61
- sarvamai/core/http_sse/_exceptions.py +0 -7
- sarvamai/core/http_sse/_models.py +0 -17
- {sarvamai-0.1.23a3.dist-info → sarvamai-0.1.23a5.dist-info}/WHEEL +0 -0
|
@@ -11,6 +11,7 @@ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
|
11
11
|
from ..core.request_options import RequestOptions
|
|
12
12
|
from .raw_client import AsyncRawTextToSpeechStreamingClient, RawTextToSpeechStreamingClient
|
|
13
13
|
from .socket_client import AsyncTextToSpeechStreamingSocketClient, TextToSpeechStreamingSocketClient
|
|
14
|
+
from .types.text_to_speech_streaming_model import TextToSpeechStreamingModel
|
|
14
15
|
from .types.text_to_speech_streaming_send_completion_event import TextToSpeechStreamingSendCompletionEvent
|
|
15
16
|
|
|
16
17
|
try:
|
|
@@ -38,7 +39,7 @@ class TextToSpeechStreamingClient:
|
|
|
38
39
|
def connect(
|
|
39
40
|
self,
|
|
40
41
|
*,
|
|
41
|
-
model: typing.Optional[
|
|
42
|
+
model: typing.Optional[TextToSpeechStreamingModel] = None,
|
|
42
43
|
send_completion_event: typing.Optional[TextToSpeechStreamingSendCompletionEvent] = None,
|
|
43
44
|
api_subscription_key: typing.Optional[str] = None,
|
|
44
45
|
request_options: typing.Optional[RequestOptions] = None,
|
|
@@ -50,10 +51,16 @@ class TextToSpeechStreamingClient:
|
|
|
50
51
|
The Try It playground may not provide the best experience for streaming audio.
|
|
51
52
|
For optimal streaming performance, please use the SDK or implement your own WebSocket client.
|
|
52
53
|
|
|
54
|
+
**Model-Specific Notes:**
|
|
55
|
+
- **bulbul:v2:** Supports pitch, loudness, pace (0.3-3.0). Default sample rate: 22050 Hz.
|
|
56
|
+
- **bulbul:v3-beta:** Does NOT support pitch/loudness. Pace range: 0.5-2.0. Supports temperature parameter. Default sample rate: 24000 Hz. Preprocessing is always enabled.
|
|
57
|
+
|
|
53
58
|
Parameters
|
|
54
59
|
----------
|
|
55
|
-
model : typing.Optional[
|
|
56
|
-
Text to speech model to use
|
|
60
|
+
model : typing.Optional[TextToSpeechStreamingModel]
|
|
61
|
+
Text to speech model to use.
|
|
62
|
+
- **bulbul:v2** (default): Standard TTS model with pitch/loudness support
|
|
63
|
+
- **bulbul:v3-beta**: Advanced model with temperature control (no pitch/loudness)
|
|
57
64
|
|
|
58
65
|
send_completion_event : typing.Optional[TextToSpeechStreamingSendCompletionEvent]
|
|
59
66
|
Enable completion event notifications when TTS generation finishes. When set to true, an event message will be sent when the final audio chunk has been generated.
|
|
@@ -117,7 +124,7 @@ class AsyncTextToSpeechStreamingClient:
|
|
|
117
124
|
async def connect(
|
|
118
125
|
self,
|
|
119
126
|
*,
|
|
120
|
-
model: typing.Optional[
|
|
127
|
+
model: typing.Optional[TextToSpeechStreamingModel] = None,
|
|
121
128
|
send_completion_event: typing.Optional[TextToSpeechStreamingSendCompletionEvent] = None,
|
|
122
129
|
api_subscription_key: typing.Optional[str] = None,
|
|
123
130
|
request_options: typing.Optional[RequestOptions] = None,
|
|
@@ -129,10 +136,16 @@ class AsyncTextToSpeechStreamingClient:
|
|
|
129
136
|
The Try It playground may not provide the best experience for streaming audio.
|
|
130
137
|
For optimal streaming performance, please use the SDK or implement your own WebSocket client.
|
|
131
138
|
|
|
139
|
+
**Model-Specific Notes:**
|
|
140
|
+
- **bulbul:v2:** Supports pitch, loudness, pace (0.3-3.0). Default sample rate: 22050 Hz.
|
|
141
|
+
- **bulbul:v3-beta:** Does NOT support pitch/loudness. Pace range: 0.5-2.0. Supports temperature parameter. Default sample rate: 24000 Hz. Preprocessing is always enabled.
|
|
142
|
+
|
|
132
143
|
Parameters
|
|
133
144
|
----------
|
|
134
|
-
model : typing.Optional[
|
|
135
|
-
Text to speech model to use
|
|
145
|
+
model : typing.Optional[TextToSpeechStreamingModel]
|
|
146
|
+
Text to speech model to use.
|
|
147
|
+
- **bulbul:v2** (default): Standard TTS model with pitch/loudness support
|
|
148
|
+
- **bulbul:v3-beta**: Advanced model with temperature control (no pitch/loudness)
|
|
136
149
|
|
|
137
150
|
send_completion_event : typing.Optional[TextToSpeechStreamingSendCompletionEvent]
|
|
138
151
|
Enable completion event notifications when TTS generation finishes. When set to true, an event message will be sent when the final audio chunk has been generated.
|
|
@@ -10,6 +10,7 @@ from ..core.api_error import ApiError
|
|
|
10
10
|
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
11
11
|
from ..core.request_options import RequestOptions
|
|
12
12
|
from .socket_client import AsyncTextToSpeechStreamingSocketClient, TextToSpeechStreamingSocketClient
|
|
13
|
+
from .types.text_to_speech_streaming_model import TextToSpeechStreamingModel
|
|
13
14
|
from .types.text_to_speech_streaming_send_completion_event import TextToSpeechStreamingSendCompletionEvent
|
|
14
15
|
|
|
15
16
|
try:
|
|
@@ -26,7 +27,7 @@ class RawTextToSpeechStreamingClient:
|
|
|
26
27
|
def connect(
|
|
27
28
|
self,
|
|
28
29
|
*,
|
|
29
|
-
model: typing.Optional[
|
|
30
|
+
model: typing.Optional[TextToSpeechStreamingModel] = None,
|
|
30
31
|
send_completion_event: typing.Optional[TextToSpeechStreamingSendCompletionEvent] = None,
|
|
31
32
|
api_subscription_key: typing.Optional[str] = None,
|
|
32
33
|
request_options: typing.Optional[RequestOptions] = None,
|
|
@@ -38,10 +39,16 @@ class RawTextToSpeechStreamingClient:
|
|
|
38
39
|
The Try It playground may not provide the best experience for streaming audio.
|
|
39
40
|
For optimal streaming performance, please use the SDK or implement your own WebSocket client.
|
|
40
41
|
|
|
42
|
+
**Model-Specific Notes:**
|
|
43
|
+
- **bulbul:v2:** Supports pitch, loudness, pace (0.3-3.0). Default sample rate: 22050 Hz.
|
|
44
|
+
- **bulbul:v3-beta:** Does NOT support pitch/loudness. Pace range: 0.5-2.0. Supports temperature parameter. Default sample rate: 24000 Hz. Preprocessing is always enabled.
|
|
45
|
+
|
|
41
46
|
Parameters
|
|
42
47
|
----------
|
|
43
|
-
model : typing.Optional[
|
|
44
|
-
Text to speech model to use
|
|
48
|
+
model : typing.Optional[TextToSpeechStreamingModel]
|
|
49
|
+
Text to speech model to use.
|
|
50
|
+
- **bulbul:v2** (default): Standard TTS model with pitch/loudness support
|
|
51
|
+
- **bulbul:v3-beta**: Advanced model with temperature control (no pitch/loudness)
|
|
45
52
|
|
|
46
53
|
send_completion_event : typing.Optional[TextToSpeechStreamingSendCompletionEvent]
|
|
47
54
|
Enable completion event notifications when TTS generation finishes. When set to true, an event message will be sent when the final audio chunk has been generated.
|
|
@@ -94,7 +101,7 @@ class AsyncRawTextToSpeechStreamingClient:
|
|
|
94
101
|
async def connect(
|
|
95
102
|
self,
|
|
96
103
|
*,
|
|
97
|
-
model: typing.Optional[
|
|
104
|
+
model: typing.Optional[TextToSpeechStreamingModel] = None,
|
|
98
105
|
send_completion_event: typing.Optional[TextToSpeechStreamingSendCompletionEvent] = None,
|
|
99
106
|
api_subscription_key: typing.Optional[str] = None,
|
|
100
107
|
request_options: typing.Optional[RequestOptions] = None,
|
|
@@ -106,10 +113,16 @@ class AsyncRawTextToSpeechStreamingClient:
|
|
|
106
113
|
The Try It playground may not provide the best experience for streaming audio.
|
|
107
114
|
For optimal streaming performance, please use the SDK or implement your own WebSocket client.
|
|
108
115
|
|
|
116
|
+
**Model-Specific Notes:**
|
|
117
|
+
- **bulbul:v2:** Supports pitch, loudness, pace (0.3-3.0). Default sample rate: 22050 Hz.
|
|
118
|
+
- **bulbul:v3-beta:** Does NOT support pitch/loudness. Pace range: 0.5-2.0. Supports temperature parameter. Default sample rate: 24000 Hz. Preprocessing is always enabled.
|
|
119
|
+
|
|
109
120
|
Parameters
|
|
110
121
|
----------
|
|
111
|
-
model : typing.Optional[
|
|
112
|
-
Text to speech model to use
|
|
122
|
+
model : typing.Optional[TextToSpeechStreamingModel]
|
|
123
|
+
Text to speech model to use.
|
|
124
|
+
- **bulbul:v2** (default): Standard TTS model with pitch/loudness support
|
|
125
|
+
- **bulbul:v3-beta**: Advanced model with temperature control (no pitch/loudness)
|
|
113
126
|
|
|
114
127
|
send_completion_event : typing.Optional[TextToSpeechStreamingSendCompletionEvent]
|
|
115
128
|
Enable completion event notifications when TTS generation finishes. When set to true, an event message will be sent when the final audio chunk has been generated.
|
|
@@ -2,35 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# isort: skip_file
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
from
|
|
5
|
+
from .text_to_speech_streaming_model import TextToSpeechStreamingModel
|
|
6
|
+
from .text_to_speech_streaming_send_completion_event import TextToSpeechStreamingSendCompletionEvent
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
from .text_to_speech_streaming_send_completion_event import TextToSpeechStreamingSendCompletionEvent
|
|
10
|
-
_dynamic_imports: typing.Dict[str, str] = {
|
|
11
|
-
"TextToSpeechStreamingSendCompletionEvent": ".text_to_speech_streaming_send_completion_event"
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
def __getattr__(attr_name: str) -> typing.Any:
|
|
16
|
-
module_name = _dynamic_imports.get(attr_name)
|
|
17
|
-
if module_name is None:
|
|
18
|
-
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
|
|
19
|
-
try:
|
|
20
|
-
module = import_module(module_name, __package__)
|
|
21
|
-
if module_name == f".{attr_name}":
|
|
22
|
-
return module
|
|
23
|
-
else:
|
|
24
|
-
return getattr(module, attr_name)
|
|
25
|
-
except ImportError as e:
|
|
26
|
-
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
|
|
27
|
-
except AttributeError as e:
|
|
28
|
-
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
def __dir__():
|
|
32
|
-
lazy_attrs = list(_dynamic_imports.keys())
|
|
33
|
-
return sorted(lazy_attrs)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
__all__ = ["TextToSpeechStreamingSendCompletionEvent"]
|
|
8
|
+
__all__ = ["TextToSpeechStreamingModel", "TextToSpeechStreamingSendCompletionEvent"]
|
sarvamai/types/__init__.py
CHANGED
|
@@ -2,228 +2,106 @@
|
|
|
2
2
|
|
|
3
3
|
# isort: skip_file
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
from
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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
|
-
|
|
5
|
+
from .audio_data import AudioData
|
|
6
|
+
from .audio_message import AudioMessage
|
|
7
|
+
from .audio_output import AudioOutput
|
|
8
|
+
from .audio_output_data import AudioOutputData
|
|
9
|
+
from .base_job_parameters import BaseJobParameters
|
|
10
|
+
from .bulk_job_callback import BulkJobCallback
|
|
11
|
+
from .bulk_job_init_response_v_1 import BulkJobInitResponseV1
|
|
12
|
+
from .chat_completion_request_assistant_message import ChatCompletionRequestAssistantMessage
|
|
13
|
+
from .chat_completion_request_message import (
|
|
14
|
+
ChatCompletionRequestMessage,
|
|
15
|
+
ChatCompletionRequestMessage_Assistant,
|
|
16
|
+
ChatCompletionRequestMessage_System,
|
|
17
|
+
ChatCompletionRequestMessage_User,
|
|
18
|
+
)
|
|
19
|
+
from .chat_completion_request_system_message import ChatCompletionRequestSystemMessage
|
|
20
|
+
from .chat_completion_request_user_message import ChatCompletionRequestUserMessage
|
|
21
|
+
from .chat_completion_response_message import ChatCompletionResponseMessage
|
|
22
|
+
from .choice import Choice
|
|
23
|
+
from .completion_event_flag import CompletionEventFlag
|
|
24
|
+
from .completion_usage import CompletionUsage
|
|
25
|
+
from .config_message import ConfigMessage
|
|
26
|
+
from .configure_connection import ConfigureConnection
|
|
27
|
+
from .configure_connection_data import ConfigureConnectionData
|
|
28
|
+
from .configure_connection_data_model import ConfigureConnectionDataModel
|
|
29
|
+
from .configure_connection_data_output_audio_bitrate import ConfigureConnectionDataOutputAudioBitrate
|
|
30
|
+
from .configure_connection_data_output_audio_codec import ConfigureConnectionDataOutputAudioCodec
|
|
31
|
+
from .configure_connection_data_speaker import ConfigureConnectionDataSpeaker
|
|
32
|
+
from .configure_connection_data_target_language_code import ConfigureConnectionDataTargetLanguageCode
|
|
33
|
+
from .connection_sample_rate import ConnectionSampleRate
|
|
34
|
+
from .create_chat_completion_response import CreateChatCompletionResponse
|
|
35
|
+
from .diarized_entry import DiarizedEntry
|
|
36
|
+
from .diarized_transcript import DiarizedTranscript
|
|
37
|
+
from .error_code import ErrorCode
|
|
38
|
+
from .error_data import ErrorData
|
|
39
|
+
from .error_details import ErrorDetails
|
|
40
|
+
from .error_message import ErrorMessage
|
|
41
|
+
from .error_response import ErrorResponse
|
|
42
|
+
from .error_response_data import ErrorResponseData
|
|
43
|
+
from .event_response import EventResponse
|
|
44
|
+
from .event_response_data import EventResponseData
|
|
45
|
+
from .events_data import EventsData
|
|
46
|
+
from .events_data_signal_type import EventsDataSignalType
|
|
47
|
+
from .file_signed_url_details import FileSignedUrlDetails
|
|
48
|
+
from .files_download_response import FilesDownloadResponse
|
|
49
|
+
from .files_request import FilesRequest
|
|
50
|
+
from .files_upload_response import FilesUploadResponse
|
|
51
|
+
from .finish_reason import FinishReason
|
|
52
|
+
from .flush_signal import FlushSignal
|
|
53
|
+
from .input_audio_codec import InputAudioCodec
|
|
54
|
+
from .job_state import JobState
|
|
55
|
+
from .job_status_v_1_response import JobStatusV1Response
|
|
56
|
+
from .language_identification_response import LanguageIdentificationResponse
|
|
57
|
+
from .mode import Mode
|
|
58
|
+
from .numerals_format import NumeralsFormat
|
|
59
|
+
from .ping_signal import PingSignal
|
|
60
|
+
from .reasoning_effort import ReasoningEffort
|
|
61
|
+
from .response_type import ResponseType
|
|
62
|
+
from .role import Role
|
|
63
|
+
from .sarvam_model_ids import SarvamModelIds
|
|
64
|
+
from .send_text import SendText
|
|
65
|
+
from .send_text_data import SendTextData
|
|
66
|
+
from .speech_sample_rate import SpeechSampleRate
|
|
67
|
+
from .speech_to_text_job_parameters import SpeechToTextJobParameters
|
|
68
|
+
from .speech_to_text_language import SpeechToTextLanguage
|
|
69
|
+
from .speech_to_text_model import SpeechToTextModel
|
|
70
|
+
from .speech_to_text_response import SpeechToTextResponse
|
|
71
|
+
from .speech_to_text_response_data import SpeechToTextResponseData
|
|
72
|
+
from .speech_to_text_streaming_response import SpeechToTextStreamingResponse
|
|
73
|
+
from .speech_to_text_transcription_data import SpeechToTextTranscriptionData
|
|
74
|
+
from .speech_to_text_translate_job_parameters import SpeechToTextTranslateJobParameters
|
|
75
|
+
from .speech_to_text_translate_language import SpeechToTextTranslateLanguage
|
|
76
|
+
from .speech_to_text_translate_model import SpeechToTextTranslateModel
|
|
77
|
+
from .speech_to_text_translate_response import SpeechToTextTranslateResponse
|
|
78
|
+
from .speech_to_text_translate_response_data import SpeechToTextTranslateResponseData
|
|
79
|
+
from .speech_to_text_translate_streaming_response import SpeechToTextTranslateStreamingResponse
|
|
80
|
+
from .speech_to_text_translate_transcription_data import SpeechToTextTranslateTranscriptionData
|
|
81
|
+
from .spoken_form_numerals_format import SpokenFormNumeralsFormat
|
|
82
|
+
from .stop_configuration import StopConfiguration
|
|
83
|
+
from .storage_container_type import StorageContainerType
|
|
84
|
+
from .stt_flush_signal import SttFlushSignal
|
|
85
|
+
from .task_detail_v_1 import TaskDetailV1
|
|
86
|
+
from .task_file_details import TaskFileDetails
|
|
87
|
+
from .task_state import TaskState
|
|
88
|
+
from .text_to_speech_language import TextToSpeechLanguage
|
|
89
|
+
from .text_to_speech_model import TextToSpeechModel
|
|
90
|
+
from .text_to_speech_output_audio_codec import TextToSpeechOutputAudioCodec
|
|
91
|
+
from .text_to_speech_response import TextToSpeechResponse
|
|
92
|
+
from .text_to_speech_speaker import TextToSpeechSpeaker
|
|
93
|
+
from .timestamps_model import TimestampsModel
|
|
94
|
+
from .transcription_metrics import TranscriptionMetrics
|
|
95
|
+
from .translate_mode import TranslateMode
|
|
96
|
+
from .translate_model import TranslateModel
|
|
97
|
+
from .translate_source_language import TranslateSourceLanguage
|
|
98
|
+
from .translate_speaker_gender import TranslateSpeakerGender
|
|
99
|
+
from .translate_target_language import TranslateTargetLanguage
|
|
100
|
+
from .translation_response import TranslationResponse
|
|
101
|
+
from .translatiterate_target_language import TranslatiterateTargetLanguage
|
|
102
|
+
from .transliterate_mode import TransliterateMode
|
|
103
|
+
from .transliterate_source_language import TransliterateSourceLanguage
|
|
104
|
+
from .transliteration_response import TransliterationResponse
|
|
227
105
|
|
|
228
106
|
__all__ = [
|
|
229
107
|
"AudioData",
|
|
@@ -247,6 +125,7 @@ __all__ = [
|
|
|
247
125
|
"ConfigMessage",
|
|
248
126
|
"ConfigureConnection",
|
|
249
127
|
"ConfigureConnectionData",
|
|
128
|
+
"ConfigureConnectionDataModel",
|
|
250
129
|
"ConfigureConnectionDataOutputAudioBitrate",
|
|
251
130
|
"ConfigureConnectionDataOutputAudioCodec",
|
|
252
131
|
"ConfigureConnectionDataSpeaker",
|
|
@@ -275,6 +154,7 @@ __all__ = [
|
|
|
275
154
|
"JobState",
|
|
276
155
|
"JobStatusV1Response",
|
|
277
156
|
"LanguageIdentificationResponse",
|
|
157
|
+
"Mode",
|
|
278
158
|
"NumeralsFormat",
|
|
279
159
|
"PingSignal",
|
|
280
160
|
"ReasoningEffort",
|
|
@@ -5,7 +5,6 @@ from __future__ import annotations
|
|
|
5
5
|
import typing
|
|
6
6
|
|
|
7
7
|
import pydantic
|
|
8
|
-
import typing_extensions
|
|
9
8
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
10
9
|
|
|
11
10
|
|
|
@@ -51,9 +50,6 @@ class ChatCompletionRequestMessage_User(UniversalBaseModel):
|
|
|
51
50
|
extra = pydantic.Extra.allow
|
|
52
51
|
|
|
53
52
|
|
|
54
|
-
ChatCompletionRequestMessage =
|
|
55
|
-
|
|
56
|
-
ChatCompletionRequestMessage_Assistant, ChatCompletionRequestMessage_System, ChatCompletionRequestMessage_User
|
|
57
|
-
],
|
|
58
|
-
pydantic.Field(discriminator="role"),
|
|
53
|
+
ChatCompletionRequestMessage = typing.Union[
|
|
54
|
+
ChatCompletionRequestMessage_Assistant, ChatCompletionRequestMessage_System, ChatCompletionRequestMessage_User
|
|
59
55
|
]
|
|
@@ -13,6 +13,10 @@ class ConfigureConnection(UniversalBaseModel):
|
|
|
13
13
|
This initializes TTS parameters and can be updated at any time during the WebSocket lifecycle
|
|
14
14
|
by sending a new config message. When a config update is sent, any text currently in the buffer
|
|
15
15
|
will be automatically flushed and processed before applying the new configuration.
|
|
16
|
+
|
|
17
|
+
**Model-Specific Notes:**
|
|
18
|
+
- **bulbul:v2:** Supports pitch, loudness, pace (0.3-3.0). Default sample rate: 22050 Hz.
|
|
19
|
+
- **bulbul:v3-beta:** Does NOT support pitch/loudness. Pace range: 0.5-2.0. Supports temperature. Default sample rate: 24000 Hz.
|
|
16
20
|
"""
|
|
17
21
|
|
|
18
22
|
type: typing.Literal["config"] = "config"
|