sarvamai 0.1.9a2__py3-none-any.whl → 0.1.11__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 (54) hide show
  1. sarvamai/__init__.py +62 -2
  2. sarvamai/client.py +6 -0
  3. sarvamai/core/client_wrapper.py +2 -2
  4. sarvamai/errors/service_unavailable_error.py +1 -2
  5. sarvamai/requests/__init__.py +24 -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/configure_connection_data.py +2 -3
  10. sarvamai/requests/file_signed_url_details.py +10 -0
  11. sarvamai/requests/files_download_response.py +15 -0
  12. sarvamai/requests/files_request.py +10 -0
  13. sarvamai/requests/files_upload_response.py +15 -0
  14. sarvamai/requests/job_status_v_1.py +70 -0
  15. sarvamai/requests/speech_to_text_job_parameters.py +32 -0
  16. sarvamai/requests/speech_to_text_translate_job_parameters.py +28 -0
  17. sarvamai/requests/task_detail_v_1.py +15 -0
  18. sarvamai/requests/task_file_details.py +8 -0
  19. sarvamai/speech_to_text/raw_client.py +8 -9
  20. sarvamai/speech_to_text_job/__init__.py +4 -0
  21. sarvamai/speech_to_text_job/client.py +633 -0
  22. sarvamai/speech_to_text_job/job.py +472 -0
  23. sarvamai/speech_to_text_job/raw_client.py +1189 -0
  24. sarvamai/speech_to_text_translate_job/__init__.py +4 -0
  25. sarvamai/speech_to_text_translate_job/client.py +651 -0
  26. sarvamai/speech_to_text_translate_job/job.py +479 -0
  27. sarvamai/speech_to_text_translate_job/raw_client.py +1241 -0
  28. sarvamai/text_to_speech/client.py +11 -0
  29. sarvamai/text_to_speech/raw_client.py +11 -0
  30. sarvamai/types/__init__.py +34 -2
  31. sarvamai/types/base_job_parameters.py +17 -0
  32. sarvamai/types/bulk_job_callback.py +27 -0
  33. sarvamai/types/bulk_job_init_response_v_1.py +39 -0
  34. sarvamai/types/configure_connection_data.py +2 -1
  35. sarvamai/types/configure_connection_data_output_audio_codec.py +7 -0
  36. sarvamai/types/file_signed_url_details.py +20 -0
  37. sarvamai/types/files_download_response.py +25 -0
  38. sarvamai/types/files_request.py +20 -0
  39. sarvamai/types/files_upload_response.py +25 -0
  40. sarvamai/types/job_state.py +5 -0
  41. sarvamai/types/job_status_v_1.py +80 -0
  42. sarvamai/types/speech_to_text_job_parameters.py +44 -0
  43. sarvamai/types/speech_to_text_model.py +3 -1
  44. sarvamai/types/speech_to_text_translate_job_parameters.py +40 -0
  45. sarvamai/types/speech_to_text_translate_model.py +3 -1
  46. sarvamai/types/storage_container_type.py +5 -0
  47. sarvamai/types/task_detail_v_1.py +25 -0
  48. sarvamai/types/task_file_details.py +20 -0
  49. sarvamai/types/task_state.py +5 -0
  50. sarvamai/types/text_to_speech_output_audio_codec.py +7 -0
  51. {sarvamai-0.1.9a2.dist-info → sarvamai-0.1.11.dist-info}/METADATA +1 -1
  52. {sarvamai-0.1.9a2.dist-info → sarvamai-0.1.11.dist-info}/RECORD +53 -17
  53. sarvamai/types/format.py +0 -5
  54. {sarvamai-0.1.9a2.dist-info → sarvamai-0.1.11.dist-info}/WHEEL +0 -0
@@ -7,6 +7,7 @@ from ..core.request_options import RequestOptions
7
7
  from ..types.speech_sample_rate import SpeechSampleRate
8
8
  from ..types.text_to_speech_language import TextToSpeechLanguage
9
9
  from ..types.text_to_speech_model import TextToSpeechModel
10
+ from ..types.text_to_speech_output_audio_codec import TextToSpeechOutputAudioCodec
10
11
  from ..types.text_to_speech_response import TextToSpeechResponse
11
12
  from ..types.text_to_speech_speaker import TextToSpeechSpeaker
12
13
  from .raw_client import AsyncRawTextToSpeechClient, RawTextToSpeechClient
@@ -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
+ output_audio_codec: typing.Optional[TextToSpeechOutputAudioCodec] = 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
+ output_audio_codec : typing.Optional[TextToSpeechOutputAudioCodec]
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
+ output_audio_codec=output_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
+ output_audio_codec: typing.Optional[TextToSpeechOutputAudioCodec] = 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
+ output_audio_codec : typing.Optional[TextToSpeechOutputAudioCodec]
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
+ output_audio_codec=output_audio_codec,
231
242
  request_options=request_options,
232
243
  )
233
244
  return _response.data
@@ -16,6 +16,7 @@ from ..errors.unprocessable_entity_error import UnprocessableEntityError
16
16
  from ..types.speech_sample_rate import SpeechSampleRate
17
17
  from ..types.text_to_speech_language import TextToSpeechLanguage
18
18
  from ..types.text_to_speech_model import TextToSpeechModel
19
+ from ..types.text_to_speech_output_audio_codec import TextToSpeechOutputAudioCodec
19
20
  from ..types.text_to_speech_response import TextToSpeechResponse
20
21
  from ..types.text_to_speech_speaker import TextToSpeechSpeaker
21
22
 
@@ -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
+ output_audio_codec: typing.Optional[TextToSpeechOutputAudioCodec] = 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
+ output_audio_codec : typing.Optional[TextToSpeechOutputAudioCodec]
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
+ "output_audio_codec": output_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
+ output_audio_codec: typing.Optional[TextToSpeechOutputAudioCodec] = 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
+ output_audio_codec : typing.Optional[TextToSpeechOutputAudioCodec]
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
+ "output_audio_codec": output_audio_codec,
266
277
  },
267
278
  headers={
268
279
  "content-type": "application/json",
@@ -6,6 +6,9 @@ from .audio_data import AudioData
6
6
  from .audio_message import AudioMessage
7
7
  from .audio_output import AudioOutput
8
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
9
12
  from .chat_completion_request_assistant_message import ChatCompletionRequestAssistantMessage
10
13
  from .chat_completion_request_message import (
11
14
  ChatCompletionRequestMessage,
@@ -22,6 +25,7 @@ from .config_message import ConfigMessage
22
25
  from .configure_connection import ConfigureConnection
23
26
  from .configure_connection_data import ConfigureConnectionData
24
27
  from .configure_connection_data_output_audio_bitrate import ConfigureConnectionDataOutputAudioBitrate
28
+ from .configure_connection_data_output_audio_codec import ConfigureConnectionDataOutputAudioCodec
25
29
  from .configure_connection_data_speaker import ConfigureConnectionDataSpeaker
26
30
  from .configure_connection_data_target_language_code import ConfigureConnectionDataTargetLanguageCode
27
31
  from .create_chat_completion_response import CreateChatCompletionResponse
@@ -34,9 +38,14 @@ 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
- from .format import Format
47
+ from .job_state import JobState
48
+ from .job_status_v_1 import JobStatusV1
40
49
  from .language_identification_response import LanguageIdentificationResponse
41
50
  from .numerals_format import NumeralsFormat
42
51
  from .ping_signal import PingSignal
@@ -47,12 +56,14 @@ from .sarvam_model_ids import SarvamModelIds
47
56
  from .send_text import SendText
48
57
  from .send_text_data import SendTextData
49
58
  from .speech_sample_rate import SpeechSampleRate
59
+ from .speech_to_text_job_parameters import SpeechToTextJobParameters
50
60
  from .speech_to_text_language import SpeechToTextLanguage
51
61
  from .speech_to_text_model import SpeechToTextModel
52
62
  from .speech_to_text_response import SpeechToTextResponse
53
63
  from .speech_to_text_response_data import SpeechToTextResponseData
54
64
  from .speech_to_text_streaming_response import SpeechToTextStreamingResponse
55
65
  from .speech_to_text_transcription_data import SpeechToTextTranscriptionData
66
+ from .speech_to_text_translate_job_parameters import SpeechToTextTranslateJobParameters
56
67
  from .speech_to_text_translate_language import SpeechToTextTranslateLanguage
57
68
  from .speech_to_text_translate_model import SpeechToTextTranslateModel
58
69
  from .speech_to_text_translate_response import SpeechToTextTranslateResponse
@@ -61,8 +72,13 @@ 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
81
+ from .text_to_speech_output_audio_codec import TextToSpeechOutputAudioCodec
66
82
  from .text_to_speech_response import TextToSpeechResponse
67
83
  from .text_to_speech_speaker import TextToSpeechSpeaker
68
84
  from .timestamps_model import TimestampsModel
@@ -83,6 +99,9 @@ __all__ = [
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",
@@ -97,6 +116,7 @@ __all__ = [
97
116
  "ConfigureConnection",
98
117
  "ConfigureConnectionData",
99
118
  "ConfigureConnectionDataOutputAudioBitrate",
119
+ "ConfigureConnectionDataOutputAudioCodec",
100
120
  "ConfigureConnectionDataSpeaker",
101
121
  "ConfigureConnectionDataTargetLanguageCode",
102
122
  "CreateChatCompletionResponse",
@@ -109,9 +129,14 @@ __all__ = [
109
129
  "ErrorResponse",
110
130
  "ErrorResponseData",
111
131
  "EventsData",
132
+ "FileSignedUrlDetails",
133
+ "FilesDownloadResponse",
134
+ "FilesRequest",
135
+ "FilesUploadResponse",
112
136
  "FinishReason",
113
137
  "FlushSignal",
114
- "Format",
138
+ "JobState",
139
+ "JobStatusV1",
115
140
  "LanguageIdentificationResponse",
116
141
  "NumeralsFormat",
117
142
  "PingSignal",
@@ -122,12 +147,14 @@ __all__ = [
122
147
  "SendText",
123
148
  "SendTextData",
124
149
  "SpeechSampleRate",
150
+ "SpeechToTextJobParameters",
125
151
  "SpeechToTextLanguage",
126
152
  "SpeechToTextModel",
127
153
  "SpeechToTextResponse",
128
154
  "SpeechToTextResponseData",
129
155
  "SpeechToTextStreamingResponse",
130
156
  "SpeechToTextTranscriptionData",
157
+ "SpeechToTextTranslateJobParameters",
131
158
  "SpeechToTextTranslateLanguage",
132
159
  "SpeechToTextTranslateModel",
133
160
  "SpeechToTextTranslateResponse",
@@ -136,8 +163,13 @@ __all__ = [
136
163
  "SpeechToTextTranslateTranscriptionData",
137
164
  "SpokenFormNumeralsFormat",
138
165
  "StopConfiguration",
166
+ "StorageContainerType",
167
+ "TaskDetailV1",
168
+ "TaskFileDetails",
169
+ "TaskState",
139
170
  "TextToSpeechLanguage",
140
171
  "TextToSpeechModel",
172
+ "TextToSpeechOutputAudioCodec",
141
173
  "TextToSpeechResponse",
142
174
  "TextToSpeechSpeaker",
143
175
  "TimestampsModel",
@@ -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
@@ -5,6 +5,7 @@ import typing
5
5
  import pydantic
6
6
  from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
7
  from .configure_connection_data_output_audio_bitrate import ConfigureConnectionDataOutputAudioBitrate
8
+ from .configure_connection_data_output_audio_codec import ConfigureConnectionDataOutputAudioCodec
8
9
  from .configure_connection_data_speaker import ConfigureConnectionDataSpeaker
9
10
  from .configure_connection_data_target_language_code import ConfigureConnectionDataTargetLanguageCode
10
11
 
@@ -63,7 +64,7 @@ class ConfigureConnectionData(UniversalBaseModel):
63
64
  of mixed-language text. Default is false.
64
65
  """
65
66
 
66
- output_audio_codec: typing.Optional[typing.Literal["mp3"]] = pydantic.Field(default=None)
67
+ output_audio_codec: typing.Optional[ConfigureConnectionDataOutputAudioCodec] = pydantic.Field(default=None)
67
68
  """
68
69
  Audio codec (currently supports MP3 only, optimized for real-time playback)
69
70
  """
@@ -0,0 +1,7 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ ConfigureConnectionDataOutputAudioCodec = typing.Union[
6
+ typing.Literal["linear16", "mulaw", "alaw", "opus", "flac", "aac", "wav"], typing.Any
7
+ ]
@@ -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
+ ]
@@ -0,0 +1,40 @@
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_translate_model import SpeechToTextTranslateModel
8
+
9
+
10
+ class SpeechToTextTranslateJobParameters(UniversalBaseModel):
11
+ prompt: typing.Optional[str] = pydantic.Field(default=None)
12
+ """
13
+ Prompt to assist the transcription
14
+ """
15
+
16
+ model: typing.Optional[SpeechToTextTranslateModel] = pydantic.Field(default=None)
17
+ """
18
+ Model to be used for converting speech to text in target language
19
+ """
20
+
21
+ with_diarization: typing.Optional[bool] = pydantic.Field(default=None)
22
+ """
23
+ Enables speaker diarization, which identifies and separates different speakers in the audio.
24
+ When set to true, the API will provide speaker-specific segments in the response.
25
+ Note: This parameter is currently in Beta mode.
26
+ """
27
+
28
+ num_speakers: typing.Optional[int] = pydantic.Field(default=None)
29
+ """
30
+ Number of speakers to be detected in the audio. This is used when with_diarization is set to true.
31
+ """
32
+
33
+ if IS_PYDANTIC_V2:
34
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
35
+ else:
36
+
37
+ class Config:
38
+ frozen = True
39
+ smart_union = True
40
+ extra = pydantic.Extra.allow
@@ -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