sarvamai 0.1.6__py3-none-any.whl → 0.1.7a0__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 +60 -1
- sarvamai/client.py +3 -0
- sarvamai/core/client_wrapper.py +2 -2
- sarvamai/errors/service_unavailable_error.py +1 -2
- sarvamai/requests/__init__.py +22 -0
- sarvamai/requests/base_job_parameters.py +7 -0
- sarvamai/requests/bulk_job_callback.py +15 -0
- sarvamai/requests/bulk_job_init_response_v_1.py +27 -0
- sarvamai/requests/file_signed_url_details.py +10 -0
- sarvamai/requests/files_download_response.py +15 -0
- sarvamai/requests/files_request.py +10 -0
- sarvamai/requests/files_upload_response.py +15 -0
- sarvamai/requests/job_status_v_1.py +70 -0
- sarvamai/requests/speech_to_text_job_parameters.py +32 -0
- sarvamai/requests/task_detail_v_1.py +15 -0
- sarvamai/requests/task_file_details.py +8 -0
- sarvamai/speech_to_text/raw_client.py +8 -9
- sarvamai/speech_to_text_job/__init__.py +4 -0
- sarvamai/speech_to_text_job/client.py +454 -0
- sarvamai/speech_to_text_job/raw_client.py +1189 -0
- sarvamai/types/__init__.py +28 -0
- sarvamai/types/base_job_parameters.py +17 -0
- sarvamai/types/bulk_job_callback.py +27 -0
- sarvamai/types/bulk_job_init_response_v_1.py +39 -0
- sarvamai/types/file_signed_url_details.py +20 -0
- sarvamai/types/files_download_response.py +25 -0
- sarvamai/types/files_request.py +20 -0
- sarvamai/types/files_upload_response.py +25 -0
- sarvamai/types/job_state.py +5 -0
- sarvamai/types/job_status_v_1.py +80 -0
- sarvamai/types/speech_to_text_job_parameters.py +44 -0
- sarvamai/types/storage_container_type.py +5 -0
- sarvamai/types/task_detail_v_1.py +25 -0
- sarvamai/types/task_file_details.py +20 -0
- sarvamai/types/task_state.py +5 -0
- sarvamai-0.1.7a0.dist-info/METADATA +1192 -0
- {sarvamai-0.1.6.dist-info → sarvamai-0.1.7a0.dist-info}/RECORD +38 -10
- sarvamai-0.1.6.dist-info/METADATA +0 -28
- {sarvamai-0.1.6.dist-info → sarvamai-0.1.7a0.dist-info}/WHEEL +0 -0
sarvamai/__init__.py
CHANGED
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
from .types import (
|
|
6
6
|
AudioData,
|
|
7
7
|
AudioMessage,
|
|
8
|
+
BaseJobParameters,
|
|
9
|
+
BulkJobCallback,
|
|
10
|
+
BulkJobInitResponseV1,
|
|
8
11
|
ChatCompletionRequestAssistantMessage,
|
|
9
12
|
ChatCompletionRequestMessage,
|
|
10
13
|
ChatCompletionRequestMessage_Assistant,
|
|
@@ -24,8 +27,14 @@ from .types import (
|
|
|
24
27
|
ErrorDetails,
|
|
25
28
|
ErrorMessage,
|
|
26
29
|
EventsData,
|
|
30
|
+
FileSignedUrlDetails,
|
|
31
|
+
FilesDownloadResponse,
|
|
32
|
+
FilesRequest,
|
|
33
|
+
FilesUploadResponse,
|
|
27
34
|
FinishReason,
|
|
28
35
|
Format,
|
|
36
|
+
JobState,
|
|
37
|
+
JobStatusV1,
|
|
29
38
|
LanguageIdentificationResponse,
|
|
30
39
|
NumeralsFormat,
|
|
31
40
|
ReasoningEffort,
|
|
@@ -33,6 +42,7 @@ from .types import (
|
|
|
33
42
|
Role,
|
|
34
43
|
SarvamModelIds,
|
|
35
44
|
SpeechSampleRate,
|
|
45
|
+
SpeechToTextJobParameters,
|
|
36
46
|
SpeechToTextLanguage,
|
|
37
47
|
SpeechToTextModel,
|
|
38
48
|
SpeechToTextResponse,
|
|
@@ -47,6 +57,10 @@ from .types import (
|
|
|
47
57
|
SpeechToTextTranslateTranscriptionData,
|
|
48
58
|
SpokenFormNumeralsFormat,
|
|
49
59
|
StopConfiguration,
|
|
60
|
+
StorageContainerType,
|
|
61
|
+
TaskDetailV1,
|
|
62
|
+
TaskFileDetails,
|
|
63
|
+
TaskState,
|
|
50
64
|
TextToSpeechLanguage,
|
|
51
65
|
TextToSpeechModel,
|
|
52
66
|
TextToSpeechResponse,
|
|
@@ -72,12 +86,23 @@ from .errors import (
|
|
|
72
86
|
TooManyRequestsError,
|
|
73
87
|
UnprocessableEntityError,
|
|
74
88
|
)
|
|
75
|
-
from . import
|
|
89
|
+
from . import (
|
|
90
|
+
chat,
|
|
91
|
+
speech_to_text,
|
|
92
|
+
speech_to_text_job,
|
|
93
|
+
speech_to_text_streaming,
|
|
94
|
+
speech_to_text_translate_streaming,
|
|
95
|
+
text,
|
|
96
|
+
text_to_speech,
|
|
97
|
+
)
|
|
76
98
|
from .client import AsyncSarvamAI, SarvamAI
|
|
77
99
|
from .environment import SarvamAIEnvironment
|
|
78
100
|
from .requests import (
|
|
79
101
|
AudioDataParams,
|
|
80
102
|
AudioMessageParams,
|
|
103
|
+
BaseJobParametersParams,
|
|
104
|
+
BulkJobCallbackParams,
|
|
105
|
+
BulkJobInitResponseV1Params,
|
|
81
106
|
ChatCompletionRequestAssistantMessageParams,
|
|
82
107
|
ChatCompletionRequestMessageParams,
|
|
83
108
|
ChatCompletionRequestMessage_AssistantParams,
|
|
@@ -96,7 +121,13 @@ from .requests import (
|
|
|
96
121
|
ErrorDetailsParams,
|
|
97
122
|
ErrorMessageParams,
|
|
98
123
|
EventsDataParams,
|
|
124
|
+
FileSignedUrlDetailsParams,
|
|
125
|
+
FilesDownloadResponseParams,
|
|
126
|
+
FilesRequestParams,
|
|
127
|
+
FilesUploadResponseParams,
|
|
128
|
+
JobStatusV1Params,
|
|
99
129
|
LanguageIdentificationResponseParams,
|
|
130
|
+
SpeechToTextJobParametersParams,
|
|
100
131
|
SpeechToTextResponseDataParams,
|
|
101
132
|
SpeechToTextResponseParams,
|
|
102
133
|
SpeechToTextStreamingResponseParams,
|
|
@@ -106,6 +137,8 @@ from .requests import (
|
|
|
106
137
|
SpeechToTextTranslateStreamingResponseParams,
|
|
107
138
|
SpeechToTextTranslateTranscriptionDataParams,
|
|
108
139
|
StopConfigurationParams,
|
|
140
|
+
TaskDetailV1Params,
|
|
141
|
+
TaskFileDetailsParams,
|
|
109
142
|
TextToSpeechResponseParams,
|
|
110
143
|
TimestampsModelParams,
|
|
111
144
|
TranscriptionMetricsParams,
|
|
@@ -132,6 +165,12 @@ __all__ = [
|
|
|
132
165
|
"AudioMessage",
|
|
133
166
|
"AudioMessageParams",
|
|
134
167
|
"BadRequestError",
|
|
168
|
+
"BaseJobParameters",
|
|
169
|
+
"BaseJobParametersParams",
|
|
170
|
+
"BulkJobCallback",
|
|
171
|
+
"BulkJobCallbackParams",
|
|
172
|
+
"BulkJobInitResponseV1",
|
|
173
|
+
"BulkJobInitResponseV1Params",
|
|
135
174
|
"ChatCompletionRequestAssistantMessage",
|
|
136
175
|
"ChatCompletionRequestAssistantMessageParams",
|
|
137
176
|
"ChatCompletionRequestMessage",
|
|
@@ -169,10 +208,21 @@ __all__ = [
|
|
|
169
208
|
"ErrorMessageParams",
|
|
170
209
|
"EventsData",
|
|
171
210
|
"EventsDataParams",
|
|
211
|
+
"FileSignedUrlDetails",
|
|
212
|
+
"FileSignedUrlDetailsParams",
|
|
213
|
+
"FilesDownloadResponse",
|
|
214
|
+
"FilesDownloadResponseParams",
|
|
215
|
+
"FilesRequest",
|
|
216
|
+
"FilesRequestParams",
|
|
217
|
+
"FilesUploadResponse",
|
|
218
|
+
"FilesUploadResponseParams",
|
|
172
219
|
"FinishReason",
|
|
173
220
|
"ForbiddenError",
|
|
174
221
|
"Format",
|
|
175
222
|
"InternalServerError",
|
|
223
|
+
"JobState",
|
|
224
|
+
"JobStatusV1",
|
|
225
|
+
"JobStatusV1Params",
|
|
176
226
|
"LanguageIdentificationResponse",
|
|
177
227
|
"LanguageIdentificationResponseParams",
|
|
178
228
|
"NumeralsFormat",
|
|
@@ -184,6 +234,8 @@ __all__ = [
|
|
|
184
234
|
"SarvamModelIds",
|
|
185
235
|
"ServiceUnavailableError",
|
|
186
236
|
"SpeechSampleRate",
|
|
237
|
+
"SpeechToTextJobParameters",
|
|
238
|
+
"SpeechToTextJobParametersParams",
|
|
187
239
|
"SpeechToTextLanguage",
|
|
188
240
|
"SpeechToTextModel",
|
|
189
241
|
"SpeechToTextResponse",
|
|
@@ -214,6 +266,12 @@ __all__ = [
|
|
|
214
266
|
"SpokenFormNumeralsFormat",
|
|
215
267
|
"StopConfiguration",
|
|
216
268
|
"StopConfigurationParams",
|
|
269
|
+
"StorageContainerType",
|
|
270
|
+
"TaskDetailV1",
|
|
271
|
+
"TaskDetailV1Params",
|
|
272
|
+
"TaskFileDetails",
|
|
273
|
+
"TaskFileDetailsParams",
|
|
274
|
+
"TaskState",
|
|
217
275
|
"TextToSpeechLanguage",
|
|
218
276
|
"TextToSpeechModel",
|
|
219
277
|
"TextToSpeechResponse",
|
|
@@ -240,6 +298,7 @@ __all__ = [
|
|
|
240
298
|
"__version__",
|
|
241
299
|
"chat",
|
|
242
300
|
"speech_to_text",
|
|
301
|
+
"speech_to_text_job",
|
|
243
302
|
"speech_to_text_streaming",
|
|
244
303
|
"speech_to_text_translate_streaming",
|
|
245
304
|
"text",
|
sarvamai/client.py
CHANGED
|
@@ -9,6 +9,7 @@ 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
|
|
12
13
|
from .speech_to_text_streaming.client import AsyncSpeechToTextStreamingClient, SpeechToTextStreamingClient
|
|
13
14
|
from .speech_to_text_translate_streaming.client import (
|
|
14
15
|
AsyncSpeechToTextTranslateStreamingClient,
|
|
@@ -82,6 +83,7 @@ class SarvamAI:
|
|
|
82
83
|
self.speech_to_text = SpeechToTextClient(client_wrapper=self._client_wrapper)
|
|
83
84
|
self.text_to_speech = TextToSpeechClient(client_wrapper=self._client_wrapper)
|
|
84
85
|
self.chat = ChatClient(client_wrapper=self._client_wrapper)
|
|
86
|
+
self.speech_to_text_job = SpeechToTextJobClient(client_wrapper=self._client_wrapper)
|
|
85
87
|
self.speech_to_text_streaming = SpeechToTextStreamingClient(client_wrapper=self._client_wrapper)
|
|
86
88
|
self.speech_to_text_translate_streaming = SpeechToTextTranslateStreamingClient(
|
|
87
89
|
client_wrapper=self._client_wrapper
|
|
@@ -152,6 +154,7 @@ class AsyncSarvamAI:
|
|
|
152
154
|
self.speech_to_text = AsyncSpeechToTextClient(client_wrapper=self._client_wrapper)
|
|
153
155
|
self.text_to_speech = AsyncTextToSpeechClient(client_wrapper=self._client_wrapper)
|
|
154
156
|
self.chat = AsyncChatClient(client_wrapper=self._client_wrapper)
|
|
157
|
+
self.speech_to_text_job = AsyncSpeechToTextJobClient(client_wrapper=self._client_wrapper)
|
|
155
158
|
self.speech_to_text_streaming = AsyncSpeechToTextStreamingClient(client_wrapper=self._client_wrapper)
|
|
156
159
|
self.speech_to_text_translate_streaming = AsyncSpeechToTextTranslateStreamingClient(
|
|
157
160
|
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.7a0",
|
|
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.7a0",
|
|
24
24
|
}
|
|
25
25
|
headers["api-subscription-key"] = self.api_subscription_key
|
|
26
26
|
return headers
|
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
import typing
|
|
4
4
|
|
|
5
5
|
from ..core.api_error import ApiError
|
|
6
|
-
from ..types.error_message import ErrorMessage
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
class ServiceUnavailableError(ApiError):
|
|
10
|
-
def __init__(self, body:
|
|
9
|
+
def __init__(self, body: typing.Optional[typing.Any], headers: typing.Optional[typing.Dict[str, str]] = None):
|
|
11
10
|
super().__init__(status_code=503, headers=headers, body=body)
|
sarvamai/requests/__init__.py
CHANGED
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
from .audio_data import AudioDataParams
|
|
6
6
|
from .audio_message import AudioMessageParams
|
|
7
|
+
from .base_job_parameters import BaseJobParametersParams
|
|
8
|
+
from .bulk_job_callback import BulkJobCallbackParams
|
|
9
|
+
from .bulk_job_init_response_v_1 import BulkJobInitResponseV1Params
|
|
7
10
|
from .chat_completion_request_assistant_message import ChatCompletionRequestAssistantMessageParams
|
|
8
11
|
from .chat_completion_request_message import (
|
|
9
12
|
ChatCompletionRequestMessageParams,
|
|
@@ -24,7 +27,13 @@ from .error_data import ErrorDataParams
|
|
|
24
27
|
from .error_details import ErrorDetailsParams
|
|
25
28
|
from .error_message import ErrorMessageParams
|
|
26
29
|
from .events_data import EventsDataParams
|
|
30
|
+
from .file_signed_url_details import FileSignedUrlDetailsParams
|
|
31
|
+
from .files_download_response import FilesDownloadResponseParams
|
|
32
|
+
from .files_request import FilesRequestParams
|
|
33
|
+
from .files_upload_response import FilesUploadResponseParams
|
|
34
|
+
from .job_status_v_1 import JobStatusV1Params
|
|
27
35
|
from .language_identification_response import LanguageIdentificationResponseParams
|
|
36
|
+
from .speech_to_text_job_parameters import SpeechToTextJobParametersParams
|
|
28
37
|
from .speech_to_text_response import SpeechToTextResponseParams
|
|
29
38
|
from .speech_to_text_response_data import SpeechToTextResponseDataParams
|
|
30
39
|
from .speech_to_text_streaming_response import SpeechToTextStreamingResponseParams
|
|
@@ -34,6 +43,8 @@ from .speech_to_text_translate_response_data import SpeechToTextTranslateRespons
|
|
|
34
43
|
from .speech_to_text_translate_streaming_response import SpeechToTextTranslateStreamingResponseParams
|
|
35
44
|
from .speech_to_text_translate_transcription_data import SpeechToTextTranslateTranscriptionDataParams
|
|
36
45
|
from .stop_configuration import StopConfigurationParams
|
|
46
|
+
from .task_detail_v_1 import TaskDetailV1Params
|
|
47
|
+
from .task_file_details import TaskFileDetailsParams
|
|
37
48
|
from .text_to_speech_response import TextToSpeechResponseParams
|
|
38
49
|
from .timestamps_model import TimestampsModelParams
|
|
39
50
|
from .transcription_metrics import TranscriptionMetricsParams
|
|
@@ -43,6 +54,9 @@ from .transliteration_response import TransliterationResponseParams
|
|
|
43
54
|
__all__ = [
|
|
44
55
|
"AudioDataParams",
|
|
45
56
|
"AudioMessageParams",
|
|
57
|
+
"BaseJobParametersParams",
|
|
58
|
+
"BulkJobCallbackParams",
|
|
59
|
+
"BulkJobInitResponseV1Params",
|
|
46
60
|
"ChatCompletionRequestAssistantMessageParams",
|
|
47
61
|
"ChatCompletionRequestMessageParams",
|
|
48
62
|
"ChatCompletionRequestMessage_AssistantParams",
|
|
@@ -61,7 +75,13 @@ __all__ = [
|
|
|
61
75
|
"ErrorDetailsParams",
|
|
62
76
|
"ErrorMessageParams",
|
|
63
77
|
"EventsDataParams",
|
|
78
|
+
"FileSignedUrlDetailsParams",
|
|
79
|
+
"FilesDownloadResponseParams",
|
|
80
|
+
"FilesRequestParams",
|
|
81
|
+
"FilesUploadResponseParams",
|
|
82
|
+
"JobStatusV1Params",
|
|
64
83
|
"LanguageIdentificationResponseParams",
|
|
84
|
+
"SpeechToTextJobParametersParams",
|
|
65
85
|
"SpeechToTextResponseDataParams",
|
|
66
86
|
"SpeechToTextResponseParams",
|
|
67
87
|
"SpeechToTextStreamingResponseParams",
|
|
@@ -71,6 +91,8 @@ __all__ = [
|
|
|
71
91
|
"SpeechToTextTranslateStreamingResponseParams",
|
|
72
92
|
"SpeechToTextTranslateTranscriptionDataParams",
|
|
73
93
|
"StopConfigurationParams",
|
|
94
|
+
"TaskDetailV1Params",
|
|
95
|
+
"TaskFileDetailsParams",
|
|
74
96
|
"TextToSpeechResponseParams",
|
|
75
97
|
"TimestampsModelParams",
|
|
76
98
|
"TranscriptionMetricsParams",
|
|
@@ -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 BulkJobCallbackParams(typing_extensions.TypedDict):
|
|
7
|
+
url: str
|
|
8
|
+
"""
|
|
9
|
+
Webhook url to call upon job completion
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
auth_token: typing_extensions.NotRequired[str]
|
|
13
|
+
"""
|
|
14
|
+
Authorization token required for the callback Url
|
|
15
|
+
"""
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing_extensions
|
|
4
|
+
from ..types.job_state import JobState
|
|
5
|
+
from ..types.storage_container_type import StorageContainerType
|
|
6
|
+
from .base_job_parameters import BaseJobParametersParams
|
|
7
|
+
from .bulk_job_callback import BulkJobCallbackParams
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class BulkJobInitResponseV1Params(typing_extensions.TypedDict):
|
|
11
|
+
job_id: str
|
|
12
|
+
"""
|
|
13
|
+
Job UUID.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
storage_container_type: StorageContainerType
|
|
17
|
+
"""
|
|
18
|
+
Storage Container Type
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
job_parameters: BaseJobParametersParams
|
|
22
|
+
job_state: JobState
|
|
23
|
+
owner_id: str
|
|
24
|
+
callback: typing_extensions.NotRequired[BulkJobCallbackParams]
|
|
25
|
+
"""
|
|
26
|
+
Parameters for callback URL
|
|
27
|
+
"""
|
|
@@ -0,0 +1,10 @@
|
|
|
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 FileSignedUrlDetailsParams(typing_extensions.TypedDict):
|
|
9
|
+
file_url: str
|
|
10
|
+
file_metadata: typing_extensions.NotRequired[typing.Dict[str, typing.Optional[typing.Any]]]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import typing_extensions
|
|
6
|
+
from ..types.job_state import JobState
|
|
7
|
+
from ..types.storage_container_type import StorageContainerType
|
|
8
|
+
from .file_signed_url_details import FileSignedUrlDetailsParams
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class FilesDownloadResponseParams(typing_extensions.TypedDict):
|
|
12
|
+
job_id: str
|
|
13
|
+
job_state: JobState
|
|
14
|
+
download_urls: typing.Dict[str, FileSignedUrlDetailsParams]
|
|
15
|
+
storage_container_type: StorageContainerType
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import typing_extensions
|
|
6
|
+
from ..types.job_state import JobState
|
|
7
|
+
from ..types.storage_container_type import StorageContainerType
|
|
8
|
+
from .file_signed_url_details import FileSignedUrlDetailsParams
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class FilesUploadResponseParams(typing_extensions.TypedDict):
|
|
12
|
+
job_id: str
|
|
13
|
+
job_state: JobState
|
|
14
|
+
upload_urls: typing.Dict[str, FileSignedUrlDetailsParams]
|
|
15
|
+
storage_container_type: StorageContainerType
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import typing_extensions
|
|
6
|
+
from ..types.job_state import JobState
|
|
7
|
+
from ..types.storage_container_type import StorageContainerType
|
|
8
|
+
from .task_detail_v_1 import TaskDetailV1Params
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class JobStatusV1Params(typing_extensions.TypedDict):
|
|
12
|
+
job_state: JobState
|
|
13
|
+
"""
|
|
14
|
+
Job State
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
created_at: str
|
|
18
|
+
"""
|
|
19
|
+
Created At
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
updated_at: str
|
|
23
|
+
"""
|
|
24
|
+
Updated At
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
job_id: str
|
|
28
|
+
"""
|
|
29
|
+
Job Id
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
total_files: typing_extensions.NotRequired[int]
|
|
33
|
+
"""
|
|
34
|
+
Total Files
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
successful_files_count: typing_extensions.NotRequired[int]
|
|
38
|
+
"""
|
|
39
|
+
Success Count
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
failed_files_count: typing_extensions.NotRequired[int]
|
|
43
|
+
"""
|
|
44
|
+
Failed Count
|
|
45
|
+
"""
|
|
46
|
+
|
|
47
|
+
owner_id: str
|
|
48
|
+
"""
|
|
49
|
+
Owner of the job
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
storage_container_type: StorageContainerType
|
|
53
|
+
"""
|
|
54
|
+
Storage Container Type
|
|
55
|
+
"""
|
|
56
|
+
|
|
57
|
+
error_message: typing_extensions.NotRequired[str]
|
|
58
|
+
"""
|
|
59
|
+
Error Message
|
|
60
|
+
"""
|
|
61
|
+
|
|
62
|
+
job_details: typing_extensions.NotRequired[typing.Sequence[TaskDetailV1Params]]
|
|
63
|
+
"""
|
|
64
|
+
Job details at file level.
|
|
65
|
+
"""
|
|
66
|
+
|
|
67
|
+
num_internal_retries: typing_extensions.NotRequired[int]
|
|
68
|
+
"""
|
|
69
|
+
Number of internal retries
|
|
70
|
+
"""
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing_extensions
|
|
4
|
+
from ..types.speech_to_text_model import SpeechToTextModel
|
|
5
|
+
from ..types.speech_to_text_translate_language import SpeechToTextTranslateLanguage
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class SpeechToTextJobParametersParams(typing_extensions.TypedDict):
|
|
9
|
+
language_code: typing_extensions.NotRequired[SpeechToTextTranslateLanguage]
|
|
10
|
+
"""
|
|
11
|
+
Language code
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
model: typing_extensions.NotRequired[SpeechToTextModel]
|
|
15
|
+
"""
|
|
16
|
+
Model to be used for speech to text
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
with_timestamps: typing_extensions.NotRequired[bool]
|
|
20
|
+
"""
|
|
21
|
+
Whether to include timestamps in the response
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
with_diarization: typing_extensions.NotRequired[bool]
|
|
25
|
+
"""
|
|
26
|
+
Enables speaker diarization, which identifies and separates different speakers in the audio. In beta mode
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
num_speakers: typing_extensions.NotRequired[int]
|
|
30
|
+
"""
|
|
31
|
+
Number of speakers to be detected in the audio. This is used when with_diarization is true.
|
|
32
|
+
"""
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import typing_extensions
|
|
6
|
+
from ..types.task_state import TaskState
|
|
7
|
+
from .task_file_details import TaskFileDetailsParams
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class TaskDetailV1Params(typing_extensions.TypedDict):
|
|
11
|
+
inputs: typing_extensions.NotRequired[typing.Sequence[TaskFileDetailsParams]]
|
|
12
|
+
outputs: typing_extensions.NotRequired[typing.Sequence[TaskFileDetailsParams]]
|
|
13
|
+
state: typing_extensions.NotRequired[TaskState]
|
|
14
|
+
error_message: typing_extensions.NotRequired[str]
|
|
15
|
+
exception_name: typing_extensions.NotRequired[str]
|
|
@@ -15,7 +15,6 @@ 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
|
|
19
18
|
from ..types.speech_to_text_language import SpeechToTextLanguage
|
|
20
19
|
from ..types.speech_to_text_model import SpeechToTextModel
|
|
21
20
|
from ..types.speech_to_text_response import SpeechToTextResponse
|
|
@@ -161,9 +160,9 @@ class RawSpeechToTextClient:
|
|
|
161
160
|
raise ServiceUnavailableError(
|
|
162
161
|
headers=dict(_response.headers),
|
|
163
162
|
body=typing.cast(
|
|
164
|
-
|
|
163
|
+
typing.Optional[typing.Any],
|
|
165
164
|
parse_obj_as(
|
|
166
|
-
type_=
|
|
165
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
167
166
|
object_=_response.json(),
|
|
168
167
|
),
|
|
169
168
|
),
|
|
@@ -299,9 +298,9 @@ class RawSpeechToTextClient:
|
|
|
299
298
|
raise ServiceUnavailableError(
|
|
300
299
|
headers=dict(_response.headers),
|
|
301
300
|
body=typing.cast(
|
|
302
|
-
|
|
301
|
+
typing.Optional[typing.Any],
|
|
303
302
|
parse_obj_as(
|
|
304
|
-
type_=
|
|
303
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
305
304
|
object_=_response.json(),
|
|
306
305
|
),
|
|
307
306
|
),
|
|
@@ -447,9 +446,9 @@ class AsyncRawSpeechToTextClient:
|
|
|
447
446
|
raise ServiceUnavailableError(
|
|
448
447
|
headers=dict(_response.headers),
|
|
449
448
|
body=typing.cast(
|
|
450
|
-
|
|
449
|
+
typing.Optional[typing.Any],
|
|
451
450
|
parse_obj_as(
|
|
452
|
-
type_=
|
|
451
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
453
452
|
object_=_response.json(),
|
|
454
453
|
),
|
|
455
454
|
),
|
|
@@ -585,9 +584,9 @@ class AsyncRawSpeechToTextClient:
|
|
|
585
584
|
raise ServiceUnavailableError(
|
|
586
585
|
headers=dict(_response.headers),
|
|
587
586
|
body=typing.cast(
|
|
588
|
-
|
|
587
|
+
typing.Optional[typing.Any],
|
|
589
588
|
parse_obj_as(
|
|
590
|
-
type_=
|
|
589
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
591
590
|
object_=_response.json(),
|
|
592
591
|
),
|
|
593
592
|
),
|