sarvamai 0.1.9a2__py3-none-any.whl → 0.1.11a0__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.
Files changed (43) hide show
  1. sarvamai/__init__.py +54 -0
  2. sarvamai/client.py +3 -0
  3. sarvamai/core/client_wrapper.py +2 -2
  4. sarvamai/errors/service_unavailable_error.py +1 -2
  5. sarvamai/requests/__init__.py +22 -0
  6. sarvamai/requests/base_job_parameters.py +7 -0
  7. sarvamai/requests/bulk_job_callback.py +15 -0
  8. sarvamai/requests/bulk_job_init_response_v_1.py +27 -0
  9. sarvamai/requests/file_signed_url_details.py +10 -0
  10. sarvamai/requests/files_download_response.py +15 -0
  11. sarvamai/requests/files_request.py +10 -0
  12. sarvamai/requests/files_upload_response.py +15 -0
  13. sarvamai/requests/job_status_v_1.py +70 -0
  14. sarvamai/requests/speech_to_text_job_parameters.py +32 -0
  15. sarvamai/requests/task_detail_v_1.py +15 -0
  16. sarvamai/requests/task_file_details.py +8 -0
  17. sarvamai/speech_to_text/raw_client.py +8 -9
  18. sarvamai/speech_to_text_job/__init__.py +4 -0
  19. sarvamai/speech_to_text_job/client.py +454 -0
  20. sarvamai/speech_to_text_job/raw_client.py +1189 -0
  21. sarvamai/text_to_speech/client.py +11 -0
  22. sarvamai/text_to_speech/raw_client.py +11 -0
  23. sarvamai/types/__init__.py +30 -0
  24. sarvamai/types/audio_codec.py +5 -0
  25. sarvamai/types/base_job_parameters.py +17 -0
  26. sarvamai/types/bulk_job_callback.py +27 -0
  27. sarvamai/types/bulk_job_init_response_v_1.py +39 -0
  28. sarvamai/types/file_signed_url_details.py +20 -0
  29. sarvamai/types/files_download_response.py +25 -0
  30. sarvamai/types/files_request.py +20 -0
  31. sarvamai/types/files_upload_response.py +25 -0
  32. sarvamai/types/job_state.py +5 -0
  33. sarvamai/types/job_status_v_1.py +80 -0
  34. sarvamai/types/speech_to_text_job_parameters.py +44 -0
  35. sarvamai/types/speech_to_text_model.py +3 -1
  36. sarvamai/types/speech_to_text_translate_model.py +3 -1
  37. sarvamai/types/storage_container_type.py +5 -0
  38. sarvamai/types/task_detail_v_1.py +25 -0
  39. sarvamai/types/task_file_details.py +20 -0
  40. sarvamai/types/task_state.py +5 -0
  41. {sarvamai-0.1.9a2.dist-info → sarvamai-0.1.11a0.dist-info}/METADATA +1 -1
  42. {sarvamai-0.1.9a2.dist-info → sarvamai-0.1.11a0.dist-info}/RECORD +43 -14
  43. {sarvamai-0.1.9a2.dist-info → sarvamai-0.1.11a0.dist-info}/WHEEL +0 -0
@@ -4,6 +4,7 @@ import typing
4
4
 
5
5
  from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
6
6
  from ..core.request_options import RequestOptions
7
+ from ..types.audio_codec import AudioCodec
7
8
  from ..types.speech_sample_rate import SpeechSampleRate
8
9
  from ..types.text_to_speech_language import TextToSpeechLanguage
9
10
  from ..types.text_to_speech_model import TextToSpeechModel
@@ -42,6 +43,7 @@ class TextToSpeechClient:
42
43
  speech_sample_rate: typing.Optional[SpeechSampleRate] = OMIT,
43
44
  enable_preprocessing: typing.Optional[bool] = OMIT,
44
45
  model: typing.Optional[TextToSpeechModel] = OMIT,
46
+ audio_codec: typing.Optional[AudioCodec] = OMIT,
45
47
  request_options: typing.Optional[RequestOptions] = None,
46
48
  ) -> TextToSpeechResponse:
47
49
  """
@@ -85,6 +87,9 @@ class TextToSpeechClient:
85
87
  model : typing.Optional[TextToSpeechModel]
86
88
  Specifies the model to use for text-to-speech conversion. Default is bulbul:v2.
87
89
 
90
+ audio_codec : typing.Optional[AudioCodec]
91
+ Specifies the audio codec for the output audio file. Different codecs offer various compression and quality characteristics.
92
+
88
93
  request_options : typing.Optional[RequestOptions]
89
94
  Request-specific configuration.
90
95
 
@@ -115,6 +120,7 @@ class TextToSpeechClient:
115
120
  speech_sample_rate=speech_sample_rate,
116
121
  enable_preprocessing=enable_preprocessing,
117
122
  model=model,
123
+ audio_codec=audio_codec,
118
124
  request_options=request_options,
119
125
  )
120
126
  return _response.data
@@ -147,6 +153,7 @@ class AsyncTextToSpeechClient:
147
153
  speech_sample_rate: typing.Optional[SpeechSampleRate] = OMIT,
148
154
  enable_preprocessing: typing.Optional[bool] = OMIT,
149
155
  model: typing.Optional[TextToSpeechModel] = OMIT,
156
+ audio_codec: typing.Optional[AudioCodec] = OMIT,
150
157
  request_options: typing.Optional[RequestOptions] = None,
151
158
  ) -> TextToSpeechResponse:
152
159
  """
@@ -190,6 +197,9 @@ class AsyncTextToSpeechClient:
190
197
  model : typing.Optional[TextToSpeechModel]
191
198
  Specifies the model to use for text-to-speech conversion. Default is bulbul:v2.
192
199
 
200
+ audio_codec : typing.Optional[AudioCodec]
201
+ Specifies the audio codec for the output audio file. Different codecs offer various compression and quality characteristics.
202
+
193
203
  request_options : typing.Optional[RequestOptions]
194
204
  Request-specific configuration.
195
205
 
@@ -228,6 +238,7 @@ class AsyncTextToSpeechClient:
228
238
  speech_sample_rate=speech_sample_rate,
229
239
  enable_preprocessing=enable_preprocessing,
230
240
  model=model,
241
+ audio_codec=audio_codec,
231
242
  request_options=request_options,
232
243
  )
233
244
  return _response.data
@@ -13,6 +13,7 @@ from ..errors.forbidden_error import ForbiddenError
13
13
  from ..errors.internal_server_error import InternalServerError
14
14
  from ..errors.too_many_requests_error import TooManyRequestsError
15
15
  from ..errors.unprocessable_entity_error import UnprocessableEntityError
16
+ from ..types.audio_codec import AudioCodec
16
17
  from ..types.speech_sample_rate import SpeechSampleRate
17
18
  from ..types.text_to_speech_language import TextToSpeechLanguage
18
19
  from ..types.text_to_speech_model import TextToSpeechModel
@@ -39,6 +40,7 @@ class RawTextToSpeechClient:
39
40
  speech_sample_rate: typing.Optional[SpeechSampleRate] = OMIT,
40
41
  enable_preprocessing: typing.Optional[bool] = OMIT,
41
42
  model: typing.Optional[TextToSpeechModel] = OMIT,
43
+ audio_codec: typing.Optional[AudioCodec] = OMIT,
42
44
  request_options: typing.Optional[RequestOptions] = None,
43
45
  ) -> HttpResponse[TextToSpeechResponse]:
44
46
  """
@@ -82,6 +84,9 @@ class RawTextToSpeechClient:
82
84
  model : typing.Optional[TextToSpeechModel]
83
85
  Specifies the model to use for text-to-speech conversion. Default is bulbul:v2.
84
86
 
87
+ audio_codec : typing.Optional[AudioCodec]
88
+ Specifies the audio codec for the output audio file. Different codecs offer various compression and quality characteristics.
89
+
85
90
  request_options : typing.Optional[RequestOptions]
86
91
  Request-specific configuration.
87
92
 
@@ -104,6 +109,7 @@ class RawTextToSpeechClient:
104
109
  "speech_sample_rate": speech_sample_rate,
105
110
  "enable_preprocessing": enable_preprocessing,
106
111
  "model": model,
112
+ "audio_codec": audio_codec,
107
113
  },
108
114
  headers={
109
115
  "content-type": "application/json",
@@ -198,6 +204,7 @@ class AsyncRawTextToSpeechClient:
198
204
  speech_sample_rate: typing.Optional[SpeechSampleRate] = OMIT,
199
205
  enable_preprocessing: typing.Optional[bool] = OMIT,
200
206
  model: typing.Optional[TextToSpeechModel] = OMIT,
207
+ audio_codec: typing.Optional[AudioCodec] = OMIT,
201
208
  request_options: typing.Optional[RequestOptions] = None,
202
209
  ) -> AsyncHttpResponse[TextToSpeechResponse]:
203
210
  """
@@ -241,6 +248,9 @@ class AsyncRawTextToSpeechClient:
241
248
  model : typing.Optional[TextToSpeechModel]
242
249
  Specifies the model to use for text-to-speech conversion. Default is bulbul:v2.
243
250
 
251
+ audio_codec : typing.Optional[AudioCodec]
252
+ Specifies the audio codec for the output audio file. Different codecs offer various compression and quality characteristics.
253
+
244
254
  request_options : typing.Optional[RequestOptions]
245
255
  Request-specific configuration.
246
256
 
@@ -263,6 +273,7 @@ class AsyncRawTextToSpeechClient:
263
273
  "speech_sample_rate": speech_sample_rate,
264
274
  "enable_preprocessing": enable_preprocessing,
265
275
  "model": model,
276
+ "audio_codec": audio_codec,
266
277
  },
267
278
  headers={
268
279
  "content-type": "application/json",
@@ -2,10 +2,14 @@
2
2
 
3
3
  # isort: skip_file
4
4
 
5
+ from .audio_codec import AudioCodec
5
6
  from .audio_data import AudioData
6
7
  from .audio_message import AudioMessage
7
8
  from .audio_output import AudioOutput
8
9
  from .audio_output_data import AudioOutputData
10
+ from .base_job_parameters import BaseJobParameters
11
+ from .bulk_job_callback import BulkJobCallback
12
+ from .bulk_job_init_response_v_1 import BulkJobInitResponseV1
9
13
  from .chat_completion_request_assistant_message import ChatCompletionRequestAssistantMessage
10
14
  from .chat_completion_request_message import (
11
15
  ChatCompletionRequestMessage,
@@ -34,9 +38,15 @@ from .error_message import ErrorMessage
34
38
  from .error_response import ErrorResponse
35
39
  from .error_response_data import ErrorResponseData
36
40
  from .events_data import EventsData
41
+ from .file_signed_url_details import FileSignedUrlDetails
42
+ from .files_download_response import FilesDownloadResponse
43
+ from .files_request import FilesRequest
44
+ from .files_upload_response import FilesUploadResponse
37
45
  from .finish_reason import FinishReason
38
46
  from .flush_signal import FlushSignal
39
47
  from .format import Format
48
+ from .job_state import JobState
49
+ from .job_status_v_1 import JobStatusV1
40
50
  from .language_identification_response import LanguageIdentificationResponse
41
51
  from .numerals_format import NumeralsFormat
42
52
  from .ping_signal import PingSignal
@@ -47,6 +57,7 @@ from .sarvam_model_ids import SarvamModelIds
47
57
  from .send_text import SendText
48
58
  from .send_text_data import SendTextData
49
59
  from .speech_sample_rate import SpeechSampleRate
60
+ from .speech_to_text_job_parameters import SpeechToTextJobParameters
50
61
  from .speech_to_text_language import SpeechToTextLanguage
51
62
  from .speech_to_text_model import SpeechToTextModel
52
63
  from .speech_to_text_response import SpeechToTextResponse
@@ -61,6 +72,10 @@ from .speech_to_text_translate_streaming_response import SpeechToTextTranslateSt
61
72
  from .speech_to_text_translate_transcription_data import SpeechToTextTranslateTranscriptionData
62
73
  from .spoken_form_numerals_format import SpokenFormNumeralsFormat
63
74
  from .stop_configuration import StopConfiguration
75
+ from .storage_container_type import StorageContainerType
76
+ from .task_detail_v_1 import TaskDetailV1
77
+ from .task_file_details import TaskFileDetails
78
+ from .task_state import TaskState
64
79
  from .text_to_speech_language import TextToSpeechLanguage
65
80
  from .text_to_speech_model import TextToSpeechModel
66
81
  from .text_to_speech_response import TextToSpeechResponse
@@ -79,10 +94,14 @@ from .transliterate_source_language import TransliterateSourceLanguage
79
94
  from .transliteration_response import TransliterationResponse
80
95
 
81
96
  __all__ = [
97
+ "AudioCodec",
82
98
  "AudioData",
83
99
  "AudioMessage",
84
100
  "AudioOutput",
85
101
  "AudioOutputData",
102
+ "BaseJobParameters",
103
+ "BulkJobCallback",
104
+ "BulkJobInitResponseV1",
86
105
  "ChatCompletionRequestAssistantMessage",
87
106
  "ChatCompletionRequestMessage",
88
107
  "ChatCompletionRequestMessage_Assistant",
@@ -109,9 +128,15 @@ __all__ = [
109
128
  "ErrorResponse",
110
129
  "ErrorResponseData",
111
130
  "EventsData",
131
+ "FileSignedUrlDetails",
132
+ "FilesDownloadResponse",
133
+ "FilesRequest",
134
+ "FilesUploadResponse",
112
135
  "FinishReason",
113
136
  "FlushSignal",
114
137
  "Format",
138
+ "JobState",
139
+ "JobStatusV1",
115
140
  "LanguageIdentificationResponse",
116
141
  "NumeralsFormat",
117
142
  "PingSignal",
@@ -122,6 +147,7 @@ __all__ = [
122
147
  "SendText",
123
148
  "SendTextData",
124
149
  "SpeechSampleRate",
150
+ "SpeechToTextJobParameters",
125
151
  "SpeechToTextLanguage",
126
152
  "SpeechToTextModel",
127
153
  "SpeechToTextResponse",
@@ -136,6 +162,10 @@ __all__ = [
136
162
  "SpeechToTextTranslateTranscriptionData",
137
163
  "SpokenFormNumeralsFormat",
138
164
  "StopConfiguration",
165
+ "StorageContainerType",
166
+ "TaskDetailV1",
167
+ "TaskFileDetails",
168
+ "TaskState",
139
169
  "TextToSpeechLanguage",
140
170
  "TextToSpeechModel",
141
171
  "TextToSpeechResponse",
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ AudioCodec = typing.Union[typing.Literal["mp3", "linear16", "mulaw", "alaw", "opus", "flac", "aac", "wav"], typing.Any]
@@ -0,0 +1,17 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+
8
+
9
+ class BaseJobParameters(UniversalBaseModel):
10
+ if IS_PYDANTIC_V2:
11
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
12
+ else:
13
+
14
+ class Config:
15
+ frozen = True
16
+ smart_union = True
17
+ extra = pydantic.Extra.allow
@@ -0,0 +1,27 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+
8
+
9
+ class BulkJobCallback(UniversalBaseModel):
10
+ url: str = pydantic.Field()
11
+ """
12
+ Webhook url to call upon job completion
13
+ """
14
+
15
+ auth_token: typing.Optional[str] = pydantic.Field(default=None)
16
+ """
17
+ Authorization token required for the callback Url
18
+ """
19
+
20
+ if IS_PYDANTIC_V2:
21
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
22
+ else:
23
+
24
+ class Config:
25
+ frozen = True
26
+ smart_union = True
27
+ extra = pydantic.Extra.allow
@@ -0,0 +1,39 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+ from .base_job_parameters import BaseJobParameters
8
+ from .bulk_job_callback import BulkJobCallback
9
+ from .job_state import JobState
10
+ from .storage_container_type import StorageContainerType
11
+
12
+
13
+ class BulkJobInitResponseV1(UniversalBaseModel):
14
+ job_id: str = pydantic.Field()
15
+ """
16
+ Job UUID.
17
+ """
18
+
19
+ storage_container_type: StorageContainerType = pydantic.Field()
20
+ """
21
+ Storage Container Type
22
+ """
23
+
24
+ job_parameters: BaseJobParameters
25
+ job_state: JobState
26
+ owner_id: str
27
+ callback: typing.Optional[BulkJobCallback] = pydantic.Field(default=None)
28
+ """
29
+ Parameters for callback URL
30
+ """
31
+
32
+ if IS_PYDANTIC_V2:
33
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
34
+ else:
35
+
36
+ class Config:
37
+ frozen = True
38
+ smart_union = True
39
+ extra = pydantic.Extra.allow
@@ -0,0 +1,20 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+
8
+
9
+ class FileSignedUrlDetails(UniversalBaseModel):
10
+ file_url: str
11
+ file_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
12
+
13
+ if IS_PYDANTIC_V2:
14
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
15
+ else:
16
+
17
+ class Config:
18
+ frozen = True
19
+ smart_union = True
20
+ extra = pydantic.Extra.allow
@@ -0,0 +1,25 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+ from .file_signed_url_details import FileSignedUrlDetails
8
+ from .job_state import JobState
9
+ from .storage_container_type import StorageContainerType
10
+
11
+
12
+ class FilesDownloadResponse(UniversalBaseModel):
13
+ job_id: str
14
+ job_state: JobState
15
+ download_urls: typing.Dict[str, FileSignedUrlDetails]
16
+ storage_container_type: StorageContainerType
17
+
18
+ if IS_PYDANTIC_V2:
19
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
20
+ else:
21
+
22
+ class Config:
23
+ frozen = True
24
+ smart_union = True
25
+ extra = pydantic.Extra.allow
@@ -0,0 +1,20 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+
8
+
9
+ class FilesRequest(UniversalBaseModel):
10
+ job_id: str
11
+ files: typing.List[str]
12
+
13
+ if IS_PYDANTIC_V2:
14
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
15
+ else:
16
+
17
+ class Config:
18
+ frozen = True
19
+ smart_union = True
20
+ extra = pydantic.Extra.allow
@@ -0,0 +1,25 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+ from .file_signed_url_details import FileSignedUrlDetails
8
+ from .job_state import JobState
9
+ from .storage_container_type import StorageContainerType
10
+
11
+
12
+ class FilesUploadResponse(UniversalBaseModel):
13
+ job_id: str
14
+ job_state: JobState
15
+ upload_urls: typing.Dict[str, FileSignedUrlDetails]
16
+ storage_container_type: StorageContainerType
17
+
18
+ if IS_PYDANTIC_V2:
19
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
20
+ else:
21
+
22
+ class Config:
23
+ frozen = True
24
+ smart_union = True
25
+ extra = pydantic.Extra.allow
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ JobState = typing.Union[typing.Literal["Accepted", "Pending", "Running", "Completed", "Failed"], typing.Any]
@@ -0,0 +1,80 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+ from .job_state import JobState
8
+ from .storage_container_type import StorageContainerType
9
+ from .task_detail_v_1 import TaskDetailV1
10
+
11
+
12
+ class JobStatusV1(UniversalBaseModel):
13
+ job_state: JobState = pydantic.Field()
14
+ """
15
+ Job State
16
+ """
17
+
18
+ created_at: str = pydantic.Field()
19
+ """
20
+ Created At
21
+ """
22
+
23
+ updated_at: str = pydantic.Field()
24
+ """
25
+ Updated At
26
+ """
27
+
28
+ job_id: str = pydantic.Field()
29
+ """
30
+ Job Id
31
+ """
32
+
33
+ total_files: typing.Optional[int] = pydantic.Field(default=None)
34
+ """
35
+ Total Files
36
+ """
37
+
38
+ successful_files_count: typing.Optional[int] = pydantic.Field(default=None)
39
+ """
40
+ Success Count
41
+ """
42
+
43
+ failed_files_count: typing.Optional[int] = pydantic.Field(default=None)
44
+ """
45
+ Failed Count
46
+ """
47
+
48
+ owner_id: str = pydantic.Field()
49
+ """
50
+ Owner of the job
51
+ """
52
+
53
+ storage_container_type: StorageContainerType = pydantic.Field()
54
+ """
55
+ Storage Container Type
56
+ """
57
+
58
+ error_message: typing.Optional[str] = pydantic.Field(default=None)
59
+ """
60
+ Error Message
61
+ """
62
+
63
+ job_details: typing.Optional[typing.List[TaskDetailV1]] = pydantic.Field(default=None)
64
+ """
65
+ Job details at file level.
66
+ """
67
+
68
+ num_internal_retries: typing.Optional[int] = pydantic.Field(default=None)
69
+ """
70
+ Number of internal retries
71
+ """
72
+
73
+ if IS_PYDANTIC_V2:
74
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
75
+ else:
76
+
77
+ class Config:
78
+ frozen = True
79
+ smart_union = True
80
+ extra = pydantic.Extra.allow
@@ -0,0 +1,44 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+ from .speech_to_text_model import SpeechToTextModel
8
+ from .speech_to_text_translate_language import SpeechToTextTranslateLanguage
9
+
10
+
11
+ class SpeechToTextJobParameters(UniversalBaseModel):
12
+ language_code: typing.Optional[SpeechToTextTranslateLanguage] = pydantic.Field(default=None)
13
+ """
14
+ Language code
15
+ """
16
+
17
+ model: typing.Optional[SpeechToTextModel] = pydantic.Field(default=None)
18
+ """
19
+ Model to be used for speech to text
20
+ """
21
+
22
+ with_timestamps: typing.Optional[bool] = pydantic.Field(default=None)
23
+ """
24
+ Whether to include timestamps in the response
25
+ """
26
+
27
+ with_diarization: typing.Optional[bool] = pydantic.Field(default=None)
28
+ """
29
+ Enables speaker diarization, which identifies and separates different speakers in the audio. In beta mode
30
+ """
31
+
32
+ num_speakers: typing.Optional[int] = pydantic.Field(default=None)
33
+ """
34
+ Number of speakers to be detected in the audio. This is used when with_diarization is true.
35
+ """
36
+
37
+ if IS_PYDANTIC_V2:
38
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
39
+ else:
40
+
41
+ class Config:
42
+ frozen = True
43
+ smart_union = True
44
+ extra = pydantic.Extra.allow
@@ -2,4 +2,6 @@
2
2
 
3
3
  import typing
4
4
 
5
- SpeechToTextModel = typing.Union[typing.Literal["saarika:v2", "saarika:v2.5"], typing.Any]
5
+ SpeechToTextModel = typing.Union[
6
+ typing.Literal["saarika:v1", "saarika:v2", "saarika:v2.5", "saarika:flash"], typing.Any
7
+ ]
@@ -2,4 +2,6 @@
2
2
 
3
3
  import typing
4
4
 
5
- SpeechToTextTranslateModel = typing.Union[typing.Literal["saaras:v2", "saaras:v2.5"], typing.Any]
5
+ SpeechToTextTranslateModel = typing.Union[
6
+ typing.Literal["saaras:v1", "saaras:v2", "saaras:v2.5", "saaras:flash"], typing.Any
7
+ ]
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ StorageContainerType = typing.Union[typing.Literal["Azure", "Local", "Google", "Azure_V1"], typing.Any]
@@ -0,0 +1,25 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+ from .task_file_details import TaskFileDetails
8
+ from .task_state import TaskState
9
+
10
+
11
+ class TaskDetailV1(UniversalBaseModel):
12
+ inputs: typing.Optional[typing.List[TaskFileDetails]] = None
13
+ outputs: typing.Optional[typing.List[TaskFileDetails]] = None
14
+ state: typing.Optional[TaskState] = None
15
+ error_message: typing.Optional[str] = None
16
+ exception_name: typing.Optional[str] = None
17
+
18
+ if IS_PYDANTIC_V2:
19
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
20
+ else:
21
+
22
+ class Config:
23
+ frozen = True
24
+ smart_union = True
25
+ extra = pydantic.Extra.allow
@@ -0,0 +1,20 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
+
8
+
9
+ class TaskFileDetails(UniversalBaseModel):
10
+ file_name: str
11
+ file_id: str
12
+
13
+ if IS_PYDANTIC_V2:
14
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
15
+ else:
16
+
17
+ class Config:
18
+ frozen = True
19
+ smart_union = True
20
+ extra = pydantic.Extra.allow
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ TaskState = typing.Union[typing.Literal["Success", "API Error", "Internal Server Error"], typing.Any]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sarvamai
3
- Version: 0.1.9a2
3
+ Version: 0.1.11a0
4
4
  Summary:
5
5
  Requires-Python: >=3.8,<4.0
6
6
  Classifier: Intended Audience :: Developers