sarvamai 0.1.7a0__py3-none-any.whl → 0.1.8a0__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 +50 -52
- sarvamai/client.py +3 -3
- sarvamai/core/client_wrapper.py +2 -2
- sarvamai/errors/service_unavailable_error.py +2 -1
- sarvamai/requests/__init__.py +20 -22
- sarvamai/requests/audio_output.py +11 -0
- sarvamai/requests/audio_output_data.py +15 -0
- sarvamai/requests/{files_request.py → close_connection.py} +2 -3
- sarvamai/requests/error_response.py +11 -0
- sarvamai/requests/error_response_data.py +18 -0
- sarvamai/requests/initialize_connection.py +11 -0
- sarvamai/requests/initialize_connection_data.py +24 -0
- sarvamai/requests/ping_signal.py +9 -0
- sarvamai/requests/send_text.py +11 -0
- sarvamai/requests/{base_job_parameters.py → send_text_data.py} +2 -2
- sarvamai/speech_to_text/raw_client.py +9 -8
- sarvamai/text_to_speech_streaming/client.py +136 -0
- sarvamai/text_to_speech_streaming/raw_client.py +113 -0
- sarvamai/text_to_speech_streaming/socket_client.py +175 -0
- sarvamai/types/__init__.py +28 -28
- sarvamai/types/audio_output.py +21 -0
- sarvamai/types/{bulk_job_callback.py → audio_output_data.py} +5 -5
- sarvamai/types/{files_request.py → close_connection.py} +2 -3
- sarvamai/types/error_response.py +21 -0
- sarvamai/types/{files_download_response.py → error_response_data.py} +11 -8
- sarvamai/types/initialize_connection.py +21 -0
- sarvamai/types/initialize_connection_data.py +34 -0
- sarvamai/types/initialize_connection_data_model.py +5 -0
- sarvamai/types/initialize_connection_data_output_audio_bitrate.py +7 -0
- sarvamai/types/initialize_connection_data_speaker.py +28 -0
- sarvamai/types/initialize_connection_data_target_language_code.py +8 -0
- sarvamai/types/{task_file_details.py → ping_signal.py} +2 -3
- sarvamai/types/{file_signed_url_details.py → send_text.py} +4 -3
- sarvamai/types/{base_job_parameters.py → send_text_data.py} +3 -1
- {sarvamai-0.1.7a0.dist-info → sarvamai-0.1.8a0.dist-info}/METADATA +1 -1
- {sarvamai-0.1.7a0.dist-info → sarvamai-0.1.8a0.dist-info}/RECORD +38 -38
- sarvamai/requests/bulk_job_callback.py +0 -15
- sarvamai/requests/bulk_job_init_response_v_1.py +0 -27
- sarvamai/requests/file_signed_url_details.py +0 -10
- sarvamai/requests/files_download_response.py +0 -15
- sarvamai/requests/files_upload_response.py +0 -15
- sarvamai/requests/job_status_v_1.py +0 -70
- sarvamai/requests/speech_to_text_job_parameters.py +0 -32
- sarvamai/requests/task_detail_v_1.py +0 -15
- sarvamai/requests/task_file_details.py +0 -8
- sarvamai/speech_to_text_job/client.py +0 -454
- sarvamai/speech_to_text_job/raw_client.py +0 -1189
- sarvamai/types/bulk_job_init_response_v_1.py +0 -39
- sarvamai/types/files_upload_response.py +0 -25
- sarvamai/types/job_state.py +0 -5
- sarvamai/types/job_status_v_1.py +0 -80
- sarvamai/types/speech_to_text_job_parameters.py +0 -44
- sarvamai/types/storage_container_type.py +0 -5
- sarvamai/types/task_detail_v_1.py +0 -25
- sarvamai/types/task_state.py +0 -5
- /sarvamai/{speech_to_text_job → text_to_speech_streaming}/__init__.py +0 -0
- {sarvamai-0.1.7a0.dist-info → sarvamai-0.1.8a0.dist-info}/WHEEL +0 -0
sarvamai/__init__.py
CHANGED
|
@@ -5,9 +5,8 @@
|
|
|
5
5
|
from .types import (
|
|
6
6
|
AudioData,
|
|
7
7
|
AudioMessage,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
BulkJobInitResponseV1,
|
|
8
|
+
AudioOutput,
|
|
9
|
+
AudioOutputData,
|
|
11
10
|
ChatCompletionRequestAssistantMessage,
|
|
12
11
|
ChatCompletionRequestMessage,
|
|
13
12
|
ChatCompletionRequestMessage_Assistant,
|
|
@@ -17,6 +16,7 @@ from .types import (
|
|
|
17
16
|
ChatCompletionRequestUserMessage,
|
|
18
17
|
ChatCompletionResponseMessage,
|
|
19
18
|
Choice,
|
|
19
|
+
CloseConnection,
|
|
20
20
|
CompletionUsage,
|
|
21
21
|
ConfigMessage,
|
|
22
22
|
CreateChatCompletionResponse,
|
|
@@ -26,23 +26,27 @@ from .types import (
|
|
|
26
26
|
ErrorData,
|
|
27
27
|
ErrorDetails,
|
|
28
28
|
ErrorMessage,
|
|
29
|
+
ErrorResponse,
|
|
30
|
+
ErrorResponseData,
|
|
29
31
|
EventsData,
|
|
30
|
-
FileSignedUrlDetails,
|
|
31
|
-
FilesDownloadResponse,
|
|
32
|
-
FilesRequest,
|
|
33
|
-
FilesUploadResponse,
|
|
34
32
|
FinishReason,
|
|
35
33
|
Format,
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
InitializeConnection,
|
|
35
|
+
InitializeConnectionData,
|
|
36
|
+
InitializeConnectionDataModel,
|
|
37
|
+
InitializeConnectionDataOutputAudioBitrate,
|
|
38
|
+
InitializeConnectionDataSpeaker,
|
|
39
|
+
InitializeConnectionDataTargetLanguageCode,
|
|
38
40
|
LanguageIdentificationResponse,
|
|
39
41
|
NumeralsFormat,
|
|
42
|
+
PingSignal,
|
|
40
43
|
ReasoningEffort,
|
|
41
44
|
ResponseType,
|
|
42
45
|
Role,
|
|
43
46
|
SarvamModelIds,
|
|
47
|
+
SendText,
|
|
48
|
+
SendTextData,
|
|
44
49
|
SpeechSampleRate,
|
|
45
|
-
SpeechToTextJobParameters,
|
|
46
50
|
SpeechToTextLanguage,
|
|
47
51
|
SpeechToTextModel,
|
|
48
52
|
SpeechToTextResponse,
|
|
@@ -57,10 +61,6 @@ from .types import (
|
|
|
57
61
|
SpeechToTextTranslateTranscriptionData,
|
|
58
62
|
SpokenFormNumeralsFormat,
|
|
59
63
|
StopConfiguration,
|
|
60
|
-
StorageContainerType,
|
|
61
|
-
TaskDetailV1,
|
|
62
|
-
TaskFileDetails,
|
|
63
|
-
TaskState,
|
|
64
64
|
TextToSpeechLanguage,
|
|
65
65
|
TextToSpeechModel,
|
|
66
66
|
TextToSpeechResponse,
|
|
@@ -89,20 +89,19 @@ from .errors import (
|
|
|
89
89
|
from . import (
|
|
90
90
|
chat,
|
|
91
91
|
speech_to_text,
|
|
92
|
-
speech_to_text_job,
|
|
93
92
|
speech_to_text_streaming,
|
|
94
93
|
speech_to_text_translate_streaming,
|
|
95
94
|
text,
|
|
96
95
|
text_to_speech,
|
|
96
|
+
text_to_speech_streaming,
|
|
97
97
|
)
|
|
98
98
|
from .client import AsyncSarvamAI, SarvamAI
|
|
99
99
|
from .environment import SarvamAIEnvironment
|
|
100
100
|
from .requests import (
|
|
101
101
|
AudioDataParams,
|
|
102
102
|
AudioMessageParams,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
BulkJobInitResponseV1Params,
|
|
103
|
+
AudioOutputDataParams,
|
|
104
|
+
AudioOutputParams,
|
|
106
105
|
ChatCompletionRequestAssistantMessageParams,
|
|
107
106
|
ChatCompletionRequestMessageParams,
|
|
108
107
|
ChatCompletionRequestMessage_AssistantParams,
|
|
@@ -112,6 +111,7 @@ from .requests import (
|
|
|
112
111
|
ChatCompletionRequestUserMessageParams,
|
|
113
112
|
ChatCompletionResponseMessageParams,
|
|
114
113
|
ChoiceParams,
|
|
114
|
+
CloseConnectionParams,
|
|
115
115
|
CompletionUsageParams,
|
|
116
116
|
ConfigMessageParams,
|
|
117
117
|
CreateChatCompletionResponseParams,
|
|
@@ -120,14 +120,15 @@ from .requests import (
|
|
|
120
120
|
ErrorDataParams,
|
|
121
121
|
ErrorDetailsParams,
|
|
122
122
|
ErrorMessageParams,
|
|
123
|
+
ErrorResponseDataParams,
|
|
124
|
+
ErrorResponseParams,
|
|
123
125
|
EventsDataParams,
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
FilesRequestParams,
|
|
127
|
-
FilesUploadResponseParams,
|
|
128
|
-
JobStatusV1Params,
|
|
126
|
+
InitializeConnectionDataParams,
|
|
127
|
+
InitializeConnectionParams,
|
|
129
128
|
LanguageIdentificationResponseParams,
|
|
130
|
-
|
|
129
|
+
PingSignalParams,
|
|
130
|
+
SendTextDataParams,
|
|
131
|
+
SendTextParams,
|
|
131
132
|
SpeechToTextResponseDataParams,
|
|
132
133
|
SpeechToTextResponseParams,
|
|
133
134
|
SpeechToTextStreamingResponseParams,
|
|
@@ -137,8 +138,6 @@ from .requests import (
|
|
|
137
138
|
SpeechToTextTranslateStreamingResponseParams,
|
|
138
139
|
SpeechToTextTranslateTranscriptionDataParams,
|
|
139
140
|
StopConfigurationParams,
|
|
140
|
-
TaskDetailV1Params,
|
|
141
|
-
TaskFileDetailsParams,
|
|
142
141
|
TextToSpeechResponseParams,
|
|
143
142
|
TimestampsModelParams,
|
|
144
143
|
TranscriptionMetricsParams,
|
|
@@ -164,13 +163,11 @@ __all__ = [
|
|
|
164
163
|
"AudioDataParams",
|
|
165
164
|
"AudioMessage",
|
|
166
165
|
"AudioMessageParams",
|
|
166
|
+
"AudioOutput",
|
|
167
|
+
"AudioOutputData",
|
|
168
|
+
"AudioOutputDataParams",
|
|
169
|
+
"AudioOutputParams",
|
|
167
170
|
"BadRequestError",
|
|
168
|
-
"BaseJobParameters",
|
|
169
|
-
"BaseJobParametersParams",
|
|
170
|
-
"BulkJobCallback",
|
|
171
|
-
"BulkJobCallbackParams",
|
|
172
|
-
"BulkJobInitResponseV1",
|
|
173
|
-
"BulkJobInitResponseV1Params",
|
|
174
171
|
"ChatCompletionRequestAssistantMessage",
|
|
175
172
|
"ChatCompletionRequestAssistantMessageParams",
|
|
176
173
|
"ChatCompletionRequestMessage",
|
|
@@ -189,6 +186,8 @@ __all__ = [
|
|
|
189
186
|
"ChatCompletionResponseMessageParams",
|
|
190
187
|
"Choice",
|
|
191
188
|
"ChoiceParams",
|
|
189
|
+
"CloseConnection",
|
|
190
|
+
"CloseConnectionParams",
|
|
192
191
|
"CompletionUsage",
|
|
193
192
|
"CompletionUsageParams",
|
|
194
193
|
"ConfigMessage",
|
|
@@ -206,36 +205,41 @@ __all__ = [
|
|
|
206
205
|
"ErrorDetailsParams",
|
|
207
206
|
"ErrorMessage",
|
|
208
207
|
"ErrorMessageParams",
|
|
208
|
+
"ErrorResponse",
|
|
209
|
+
"ErrorResponseData",
|
|
210
|
+
"ErrorResponseDataParams",
|
|
211
|
+
"ErrorResponseParams",
|
|
209
212
|
"EventsData",
|
|
210
213
|
"EventsDataParams",
|
|
211
|
-
"FileSignedUrlDetails",
|
|
212
|
-
"FileSignedUrlDetailsParams",
|
|
213
|
-
"FilesDownloadResponse",
|
|
214
|
-
"FilesDownloadResponseParams",
|
|
215
|
-
"FilesRequest",
|
|
216
|
-
"FilesRequestParams",
|
|
217
|
-
"FilesUploadResponse",
|
|
218
|
-
"FilesUploadResponseParams",
|
|
219
214
|
"FinishReason",
|
|
220
215
|
"ForbiddenError",
|
|
221
216
|
"Format",
|
|
217
|
+
"InitializeConnection",
|
|
218
|
+
"InitializeConnectionData",
|
|
219
|
+
"InitializeConnectionDataModel",
|
|
220
|
+
"InitializeConnectionDataOutputAudioBitrate",
|
|
221
|
+
"InitializeConnectionDataParams",
|
|
222
|
+
"InitializeConnectionDataSpeaker",
|
|
223
|
+
"InitializeConnectionDataTargetLanguageCode",
|
|
224
|
+
"InitializeConnectionParams",
|
|
222
225
|
"InternalServerError",
|
|
223
|
-
"JobState",
|
|
224
|
-
"JobStatusV1",
|
|
225
|
-
"JobStatusV1Params",
|
|
226
226
|
"LanguageIdentificationResponse",
|
|
227
227
|
"LanguageIdentificationResponseParams",
|
|
228
228
|
"NumeralsFormat",
|
|
229
|
+
"PingSignal",
|
|
230
|
+
"PingSignalParams",
|
|
229
231
|
"ReasoningEffort",
|
|
230
232
|
"ResponseType",
|
|
231
233
|
"Role",
|
|
232
234
|
"SarvamAI",
|
|
233
235
|
"SarvamAIEnvironment",
|
|
234
236
|
"SarvamModelIds",
|
|
237
|
+
"SendText",
|
|
238
|
+
"SendTextData",
|
|
239
|
+
"SendTextDataParams",
|
|
240
|
+
"SendTextParams",
|
|
235
241
|
"ServiceUnavailableError",
|
|
236
242
|
"SpeechSampleRate",
|
|
237
|
-
"SpeechToTextJobParameters",
|
|
238
|
-
"SpeechToTextJobParametersParams",
|
|
239
243
|
"SpeechToTextLanguage",
|
|
240
244
|
"SpeechToTextModel",
|
|
241
245
|
"SpeechToTextResponse",
|
|
@@ -266,12 +270,6 @@ __all__ = [
|
|
|
266
270
|
"SpokenFormNumeralsFormat",
|
|
267
271
|
"StopConfiguration",
|
|
268
272
|
"StopConfigurationParams",
|
|
269
|
-
"StorageContainerType",
|
|
270
|
-
"TaskDetailV1",
|
|
271
|
-
"TaskDetailV1Params",
|
|
272
|
-
"TaskFileDetails",
|
|
273
|
-
"TaskFileDetailsParams",
|
|
274
|
-
"TaskState",
|
|
275
273
|
"TextToSpeechLanguage",
|
|
276
274
|
"TextToSpeechModel",
|
|
277
275
|
"TextToSpeechResponse",
|
|
@@ -298,9 +296,9 @@ __all__ = [
|
|
|
298
296
|
"__version__",
|
|
299
297
|
"chat",
|
|
300
298
|
"speech_to_text",
|
|
301
|
-
"speech_to_text_job",
|
|
302
299
|
"speech_to_text_streaming",
|
|
303
300
|
"speech_to_text_translate_streaming",
|
|
304
301
|
"text",
|
|
305
302
|
"text_to_speech",
|
|
303
|
+
"text_to_speech_streaming",
|
|
306
304
|
]
|
sarvamai/client.py
CHANGED
|
@@ -9,7 +9,6 @@ from .core.api_error import ApiError
|
|
|
9
9
|
from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
10
10
|
from .environment import SarvamAIEnvironment
|
|
11
11
|
from .speech_to_text.client import AsyncSpeechToTextClient, SpeechToTextClient
|
|
12
|
-
from .speech_to_text_job.client import AsyncSpeechToTextJobClient, SpeechToTextJobClient
|
|
13
12
|
from .speech_to_text_streaming.client import AsyncSpeechToTextStreamingClient, SpeechToTextStreamingClient
|
|
14
13
|
from .speech_to_text_translate_streaming.client import (
|
|
15
14
|
AsyncSpeechToTextTranslateStreamingClient,
|
|
@@ -17,6 +16,7 @@ from .speech_to_text_translate_streaming.client import (
|
|
|
17
16
|
)
|
|
18
17
|
from .text.client import AsyncTextClient, TextClient
|
|
19
18
|
from .text_to_speech.client import AsyncTextToSpeechClient, TextToSpeechClient
|
|
19
|
+
from .text_to_speech_streaming.client import AsyncTextToSpeechStreamingClient, TextToSpeechStreamingClient
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
class SarvamAI:
|
|
@@ -83,11 +83,11 @@ class SarvamAI:
|
|
|
83
83
|
self.speech_to_text = SpeechToTextClient(client_wrapper=self._client_wrapper)
|
|
84
84
|
self.text_to_speech = TextToSpeechClient(client_wrapper=self._client_wrapper)
|
|
85
85
|
self.chat = ChatClient(client_wrapper=self._client_wrapper)
|
|
86
|
-
self.speech_to_text_job = SpeechToTextJobClient(client_wrapper=self._client_wrapper)
|
|
87
86
|
self.speech_to_text_streaming = SpeechToTextStreamingClient(client_wrapper=self._client_wrapper)
|
|
88
87
|
self.speech_to_text_translate_streaming = SpeechToTextTranslateStreamingClient(
|
|
89
88
|
client_wrapper=self._client_wrapper
|
|
90
89
|
)
|
|
90
|
+
self.text_to_speech_streaming = TextToSpeechStreamingClient(client_wrapper=self._client_wrapper)
|
|
91
91
|
|
|
92
92
|
|
|
93
93
|
class AsyncSarvamAI:
|
|
@@ -154,8 +154,8 @@ class AsyncSarvamAI:
|
|
|
154
154
|
self.speech_to_text = AsyncSpeechToTextClient(client_wrapper=self._client_wrapper)
|
|
155
155
|
self.text_to_speech = AsyncTextToSpeechClient(client_wrapper=self._client_wrapper)
|
|
156
156
|
self.chat = AsyncChatClient(client_wrapper=self._client_wrapper)
|
|
157
|
-
self.speech_to_text_job = AsyncSpeechToTextJobClient(client_wrapper=self._client_wrapper)
|
|
158
157
|
self.speech_to_text_streaming = AsyncSpeechToTextStreamingClient(client_wrapper=self._client_wrapper)
|
|
159
158
|
self.speech_to_text_translate_streaming = AsyncSpeechToTextTranslateStreamingClient(
|
|
160
159
|
client_wrapper=self._client_wrapper
|
|
161
160
|
)
|
|
161
|
+
self.text_to_speech_streaming = AsyncTextToSpeechStreamingClient(client_wrapper=self._client_wrapper)
|
sarvamai/core/client_wrapper.py
CHANGED
|
@@ -17,10 +17,10 @@ class BaseClientWrapper:
|
|
|
17
17
|
|
|
18
18
|
def get_headers(self) -> typing.Dict[str, str]:
|
|
19
19
|
headers: typing.Dict[str, str] = {
|
|
20
|
-
"User-Agent": "sarvamai/0.1.
|
|
20
|
+
"User-Agent": "sarvamai/0.1.8a0",
|
|
21
21
|
"X-Fern-Language": "Python",
|
|
22
22
|
"X-Fern-SDK-Name": "sarvamai",
|
|
23
|
-
"X-Fern-SDK-Version": "0.1.
|
|
23
|
+
"X-Fern-SDK-Version": "0.1.8a0",
|
|
24
24
|
}
|
|
25
25
|
headers["api-subscription-key"] = self.api_subscription_key
|
|
26
26
|
return headers
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
import typing
|
|
4
4
|
|
|
5
5
|
from ..core.api_error import ApiError
|
|
6
|
+
from ..types.error_message import ErrorMessage
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
class ServiceUnavailableError(ApiError):
|
|
9
|
-
def __init__(self, body:
|
|
10
|
+
def __init__(self, body: ErrorMessage, headers: typing.Optional[typing.Dict[str, str]] = None):
|
|
10
11
|
super().__init__(status_code=503, headers=headers, body=body)
|
sarvamai/requests/__init__.py
CHANGED
|
@@ -4,9 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
from .audio_data import AudioDataParams
|
|
6
6
|
from .audio_message import AudioMessageParams
|
|
7
|
-
from .
|
|
8
|
-
from .
|
|
9
|
-
from .bulk_job_init_response_v_1 import BulkJobInitResponseV1Params
|
|
7
|
+
from .audio_output import AudioOutputParams
|
|
8
|
+
from .audio_output_data import AudioOutputDataParams
|
|
10
9
|
from .chat_completion_request_assistant_message import ChatCompletionRequestAssistantMessageParams
|
|
11
10
|
from .chat_completion_request_message import (
|
|
12
11
|
ChatCompletionRequestMessageParams,
|
|
@@ -18,6 +17,7 @@ from .chat_completion_request_system_message import ChatCompletionRequestSystemM
|
|
|
18
17
|
from .chat_completion_request_user_message import ChatCompletionRequestUserMessageParams
|
|
19
18
|
from .chat_completion_response_message import ChatCompletionResponseMessageParams
|
|
20
19
|
from .choice import ChoiceParams
|
|
20
|
+
from .close_connection import CloseConnectionParams
|
|
21
21
|
from .completion_usage import CompletionUsageParams
|
|
22
22
|
from .config_message import ConfigMessageParams
|
|
23
23
|
from .create_chat_completion_response import CreateChatCompletionResponseParams
|
|
@@ -26,14 +26,15 @@ from .diarized_transcript import DiarizedTranscriptParams
|
|
|
26
26
|
from .error_data import ErrorDataParams
|
|
27
27
|
from .error_details import ErrorDetailsParams
|
|
28
28
|
from .error_message import ErrorMessageParams
|
|
29
|
+
from .error_response import ErrorResponseParams
|
|
30
|
+
from .error_response_data import ErrorResponseDataParams
|
|
29
31
|
from .events_data import EventsDataParams
|
|
30
|
-
from .
|
|
31
|
-
from .
|
|
32
|
-
from .files_request import FilesRequestParams
|
|
33
|
-
from .files_upload_response import FilesUploadResponseParams
|
|
34
|
-
from .job_status_v_1 import JobStatusV1Params
|
|
32
|
+
from .initialize_connection import InitializeConnectionParams
|
|
33
|
+
from .initialize_connection_data import InitializeConnectionDataParams
|
|
35
34
|
from .language_identification_response import LanguageIdentificationResponseParams
|
|
36
|
-
from .
|
|
35
|
+
from .ping_signal import PingSignalParams
|
|
36
|
+
from .send_text import SendTextParams
|
|
37
|
+
from .send_text_data import SendTextDataParams
|
|
37
38
|
from .speech_to_text_response import SpeechToTextResponseParams
|
|
38
39
|
from .speech_to_text_response_data import SpeechToTextResponseDataParams
|
|
39
40
|
from .speech_to_text_streaming_response import SpeechToTextStreamingResponseParams
|
|
@@ -43,8 +44,6 @@ from .speech_to_text_translate_response_data import SpeechToTextTranslateRespons
|
|
|
43
44
|
from .speech_to_text_translate_streaming_response import SpeechToTextTranslateStreamingResponseParams
|
|
44
45
|
from .speech_to_text_translate_transcription_data import SpeechToTextTranslateTranscriptionDataParams
|
|
45
46
|
from .stop_configuration import StopConfigurationParams
|
|
46
|
-
from .task_detail_v_1 import TaskDetailV1Params
|
|
47
|
-
from .task_file_details import TaskFileDetailsParams
|
|
48
47
|
from .text_to_speech_response import TextToSpeechResponseParams
|
|
49
48
|
from .timestamps_model import TimestampsModelParams
|
|
50
49
|
from .transcription_metrics import TranscriptionMetricsParams
|
|
@@ -54,9 +53,8 @@ from .transliteration_response import TransliterationResponseParams
|
|
|
54
53
|
__all__ = [
|
|
55
54
|
"AudioDataParams",
|
|
56
55
|
"AudioMessageParams",
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"BulkJobInitResponseV1Params",
|
|
56
|
+
"AudioOutputDataParams",
|
|
57
|
+
"AudioOutputParams",
|
|
60
58
|
"ChatCompletionRequestAssistantMessageParams",
|
|
61
59
|
"ChatCompletionRequestMessageParams",
|
|
62
60
|
"ChatCompletionRequestMessage_AssistantParams",
|
|
@@ -66,6 +64,7 @@ __all__ = [
|
|
|
66
64
|
"ChatCompletionRequestUserMessageParams",
|
|
67
65
|
"ChatCompletionResponseMessageParams",
|
|
68
66
|
"ChoiceParams",
|
|
67
|
+
"CloseConnectionParams",
|
|
69
68
|
"CompletionUsageParams",
|
|
70
69
|
"ConfigMessageParams",
|
|
71
70
|
"CreateChatCompletionResponseParams",
|
|
@@ -74,14 +73,15 @@ __all__ = [
|
|
|
74
73
|
"ErrorDataParams",
|
|
75
74
|
"ErrorDetailsParams",
|
|
76
75
|
"ErrorMessageParams",
|
|
76
|
+
"ErrorResponseDataParams",
|
|
77
|
+
"ErrorResponseParams",
|
|
77
78
|
"EventsDataParams",
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"FilesRequestParams",
|
|
81
|
-
"FilesUploadResponseParams",
|
|
82
|
-
"JobStatusV1Params",
|
|
79
|
+
"InitializeConnectionDataParams",
|
|
80
|
+
"InitializeConnectionParams",
|
|
83
81
|
"LanguageIdentificationResponseParams",
|
|
84
|
-
"
|
|
82
|
+
"PingSignalParams",
|
|
83
|
+
"SendTextDataParams",
|
|
84
|
+
"SendTextParams",
|
|
85
85
|
"SpeechToTextResponseDataParams",
|
|
86
86
|
"SpeechToTextResponseParams",
|
|
87
87
|
"SpeechToTextStreamingResponseParams",
|
|
@@ -91,8 +91,6 @@ __all__ = [
|
|
|
91
91
|
"SpeechToTextTranslateStreamingResponseParams",
|
|
92
92
|
"SpeechToTextTranslateTranscriptionDataParams",
|
|
93
93
|
"StopConfigurationParams",
|
|
94
|
-
"TaskDetailV1Params",
|
|
95
|
-
"TaskFileDetailsParams",
|
|
96
94
|
"TextToSpeechResponseParams",
|
|
97
95
|
"TimestampsModelParams",
|
|
98
96
|
"TranscriptionMetricsParams",
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import typing_extensions
|
|
6
|
+
from .audio_output_data import AudioOutputDataParams
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class AudioOutputParams(typing_extensions.TypedDict):
|
|
10
|
+
type: typing.Literal["audio"]
|
|
11
|
+
data: AudioOutputDataParams
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing_extensions
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class AudioOutputDataParams(typing_extensions.TypedDict):
|
|
7
|
+
content_type: str
|
|
8
|
+
"""
|
|
9
|
+
MIME type of the audio content (e.g., 'audio/mp3', 'audio/wav')
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
audio: str
|
|
13
|
+
"""
|
|
14
|
+
Base64-encoded audio data ready for playback or download
|
|
15
|
+
"""
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import typing_extensions
|
|
6
|
+
from .error_response_data import ErrorResponseDataParams
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ErrorResponseParams(typing_extensions.TypedDict):
|
|
10
|
+
type: typing.Literal["error"]
|
|
11
|
+
data: ErrorResponseDataParams
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import typing_extensions
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ErrorResponseDataParams(typing_extensions.TypedDict):
|
|
9
|
+
message: str
|
|
10
|
+
code: typing_extensions.NotRequired[int]
|
|
11
|
+
"""
|
|
12
|
+
Optional error code for programmatic error handling
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
details: typing_extensions.NotRequired[typing.Dict[str, typing.Optional[typing.Any]]]
|
|
16
|
+
"""
|
|
17
|
+
Additional error details and context information
|
|
18
|
+
"""
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import typing_extensions
|
|
6
|
+
from .initialize_connection_data import InitializeConnectionDataParams
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class InitializeConnectionParams(typing_extensions.TypedDict):
|
|
10
|
+
type: typing.Literal["config"]
|
|
11
|
+
data: InitializeConnectionDataParams
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import typing_extensions
|
|
6
|
+
from ..types.initialize_connection_data_model import InitializeConnectionDataModel
|
|
7
|
+
from ..types.initialize_connection_data_output_audio_bitrate import InitializeConnectionDataOutputAudioBitrate
|
|
8
|
+
from ..types.initialize_connection_data_speaker import InitializeConnectionDataSpeaker
|
|
9
|
+
from ..types.initialize_connection_data_target_language_code import InitializeConnectionDataTargetLanguageCode
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class InitializeConnectionDataParams(typing_extensions.TypedDict):
|
|
13
|
+
target_language_code: InitializeConnectionDataTargetLanguageCode
|
|
14
|
+
speaker: InitializeConnectionDataSpeaker
|
|
15
|
+
pitch: typing_extensions.NotRequired[float]
|
|
16
|
+
pace: typing_extensions.NotRequired[float]
|
|
17
|
+
loudness: typing_extensions.NotRequired[float]
|
|
18
|
+
speech_sample_rate: typing_extensions.NotRequired[int]
|
|
19
|
+
enable_preprocessing: typing_extensions.NotRequired[bool]
|
|
20
|
+
model: InitializeConnectionDataModel
|
|
21
|
+
output_audio_codec: typing_extensions.NotRequired[typing.Literal["mp3"]]
|
|
22
|
+
output_audio_bitrate: typing_extensions.NotRequired[InitializeConnectionDataOutputAudioBitrate]
|
|
23
|
+
min_buffer_size: typing_extensions.NotRequired[int]
|
|
24
|
+
max_chunk_length: typing_extensions.NotRequired[int]
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import typing_extensions
|
|
6
|
+
from .send_text_data import SendTextDataParams
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class SendTextParams(typing_extensions.TypedDict):
|
|
10
|
+
type: typing.Literal["text"]
|
|
11
|
+
data: SendTextDataParams
|
|
@@ -15,6 +15,7 @@ from ..errors.internal_server_error import InternalServerError
|
|
|
15
15
|
from ..errors.service_unavailable_error import ServiceUnavailableError
|
|
16
16
|
from ..errors.too_many_requests_error import TooManyRequestsError
|
|
17
17
|
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
|
18
|
+
from ..types.error_message import ErrorMessage
|
|
18
19
|
from ..types.speech_to_text_language import SpeechToTextLanguage
|
|
19
20
|
from ..types.speech_to_text_model import SpeechToTextModel
|
|
20
21
|
from ..types.speech_to_text_response import SpeechToTextResponse
|
|
@@ -160,9 +161,9 @@ class RawSpeechToTextClient:
|
|
|
160
161
|
raise ServiceUnavailableError(
|
|
161
162
|
headers=dict(_response.headers),
|
|
162
163
|
body=typing.cast(
|
|
163
|
-
|
|
164
|
+
ErrorMessage,
|
|
164
165
|
parse_obj_as(
|
|
165
|
-
type_=
|
|
166
|
+
type_=ErrorMessage, # type: ignore
|
|
166
167
|
object_=_response.json(),
|
|
167
168
|
),
|
|
168
169
|
),
|
|
@@ -298,9 +299,9 @@ class RawSpeechToTextClient:
|
|
|
298
299
|
raise ServiceUnavailableError(
|
|
299
300
|
headers=dict(_response.headers),
|
|
300
301
|
body=typing.cast(
|
|
301
|
-
|
|
302
|
+
ErrorMessage,
|
|
302
303
|
parse_obj_as(
|
|
303
|
-
type_=
|
|
304
|
+
type_=ErrorMessage, # type: ignore
|
|
304
305
|
object_=_response.json(),
|
|
305
306
|
),
|
|
306
307
|
),
|
|
@@ -446,9 +447,9 @@ class AsyncRawSpeechToTextClient:
|
|
|
446
447
|
raise ServiceUnavailableError(
|
|
447
448
|
headers=dict(_response.headers),
|
|
448
449
|
body=typing.cast(
|
|
449
|
-
|
|
450
|
+
ErrorMessage,
|
|
450
451
|
parse_obj_as(
|
|
451
|
-
type_=
|
|
452
|
+
type_=ErrorMessage, # type: ignore
|
|
452
453
|
object_=_response.json(),
|
|
453
454
|
),
|
|
454
455
|
),
|
|
@@ -584,9 +585,9 @@ class AsyncRawSpeechToTextClient:
|
|
|
584
585
|
raise ServiceUnavailableError(
|
|
585
586
|
headers=dict(_response.headers),
|
|
586
587
|
body=typing.cast(
|
|
587
|
-
|
|
588
|
+
ErrorMessage,
|
|
588
589
|
parse_obj_as(
|
|
589
|
-
type_=
|
|
590
|
+
type_=ErrorMessage, # type: ignore
|
|
590
591
|
object_=_response.json(),
|
|
591
592
|
),
|
|
592
593
|
),
|