sarvamai 0.1.10__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 (53) hide show
  1. sarvamai/__init__.py +62 -4
  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 +7 -7
  29. sarvamai/text_to_speech/raw_client.py +7 -7
  30. sarvamai/types/__init__.py +34 -4
  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_translate_job_parameters.py +40 -0
  44. sarvamai/types/storage_container_type.py +5 -0
  45. sarvamai/types/task_detail_v_1.py +25 -0
  46. sarvamai/types/task_file_details.py +20 -0
  47. sarvamai/types/task_state.py +5 -0
  48. sarvamai/types/text_to_speech_output_audio_codec.py +7 -0
  49. {sarvamai-0.1.10.dist-info → sarvamai-0.1.11.dist-info}/METADATA +1 -1
  50. {sarvamai-0.1.10.dist-info → sarvamai-0.1.11.dist-info}/RECORD +51 -16
  51. sarvamai/types/audio_codec.py +0 -5
  52. sarvamai/types/format.py +0 -5
  53. {sarvamai-0.1.10.dist-info → sarvamai-0.1.11.dist-info}/WHEEL +0 -0
@@ -4,10 +4,10 @@ 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
8
7
  from ..types.speech_sample_rate import SpeechSampleRate
9
8
  from ..types.text_to_speech_language import TextToSpeechLanguage
10
9
  from ..types.text_to_speech_model import TextToSpeechModel
10
+ from ..types.text_to_speech_output_audio_codec import TextToSpeechOutputAudioCodec
11
11
  from ..types.text_to_speech_response import TextToSpeechResponse
12
12
  from ..types.text_to_speech_speaker import TextToSpeechSpeaker
13
13
  from .raw_client import AsyncRawTextToSpeechClient, RawTextToSpeechClient
@@ -43,7 +43,7 @@ class TextToSpeechClient:
43
43
  speech_sample_rate: typing.Optional[SpeechSampleRate] = OMIT,
44
44
  enable_preprocessing: typing.Optional[bool] = OMIT,
45
45
  model: typing.Optional[TextToSpeechModel] = OMIT,
46
- audio_codec: typing.Optional[AudioCodec] = OMIT,
46
+ output_audio_codec: typing.Optional[TextToSpeechOutputAudioCodec] = OMIT,
47
47
  request_options: typing.Optional[RequestOptions] = None,
48
48
  ) -> TextToSpeechResponse:
49
49
  """
@@ -87,7 +87,7 @@ class TextToSpeechClient:
87
87
  model : typing.Optional[TextToSpeechModel]
88
88
  Specifies the model to use for text-to-speech conversion. Default is bulbul:v2.
89
89
 
90
- audio_codec : typing.Optional[AudioCodec]
90
+ output_audio_codec : typing.Optional[TextToSpeechOutputAudioCodec]
91
91
  Specifies the audio codec for the output audio file. Different codecs offer various compression and quality characteristics.
92
92
 
93
93
  request_options : typing.Optional[RequestOptions]
@@ -120,7 +120,7 @@ class TextToSpeechClient:
120
120
  speech_sample_rate=speech_sample_rate,
121
121
  enable_preprocessing=enable_preprocessing,
122
122
  model=model,
123
- audio_codec=audio_codec,
123
+ output_audio_codec=output_audio_codec,
124
124
  request_options=request_options,
125
125
  )
126
126
  return _response.data
@@ -153,7 +153,7 @@ class AsyncTextToSpeechClient:
153
153
  speech_sample_rate: typing.Optional[SpeechSampleRate] = OMIT,
154
154
  enable_preprocessing: typing.Optional[bool] = OMIT,
155
155
  model: typing.Optional[TextToSpeechModel] = OMIT,
156
- audio_codec: typing.Optional[AudioCodec] = OMIT,
156
+ output_audio_codec: typing.Optional[TextToSpeechOutputAudioCodec] = OMIT,
157
157
  request_options: typing.Optional[RequestOptions] = None,
158
158
  ) -> TextToSpeechResponse:
159
159
  """
@@ -197,7 +197,7 @@ class AsyncTextToSpeechClient:
197
197
  model : typing.Optional[TextToSpeechModel]
198
198
  Specifies the model to use for text-to-speech conversion. Default is bulbul:v2.
199
199
 
200
- audio_codec : typing.Optional[AudioCodec]
200
+ output_audio_codec : typing.Optional[TextToSpeechOutputAudioCodec]
201
201
  Specifies the audio codec for the output audio file. Different codecs offer various compression and quality characteristics.
202
202
 
203
203
  request_options : typing.Optional[RequestOptions]
@@ -238,7 +238,7 @@ class AsyncTextToSpeechClient:
238
238
  speech_sample_rate=speech_sample_rate,
239
239
  enable_preprocessing=enable_preprocessing,
240
240
  model=model,
241
- audio_codec=audio_codec,
241
+ output_audio_codec=output_audio_codec,
242
242
  request_options=request_options,
243
243
  )
244
244
  return _response.data
@@ -13,10 +13,10 @@ 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
17
16
  from ..types.speech_sample_rate import SpeechSampleRate
18
17
  from ..types.text_to_speech_language import TextToSpeechLanguage
19
18
  from ..types.text_to_speech_model import TextToSpeechModel
19
+ from ..types.text_to_speech_output_audio_codec import TextToSpeechOutputAudioCodec
20
20
  from ..types.text_to_speech_response import TextToSpeechResponse
21
21
  from ..types.text_to_speech_speaker import TextToSpeechSpeaker
22
22
 
@@ -40,7 +40,7 @@ class RawTextToSpeechClient:
40
40
  speech_sample_rate: typing.Optional[SpeechSampleRate] = OMIT,
41
41
  enable_preprocessing: typing.Optional[bool] = OMIT,
42
42
  model: typing.Optional[TextToSpeechModel] = OMIT,
43
- audio_codec: typing.Optional[AudioCodec] = OMIT,
43
+ output_audio_codec: typing.Optional[TextToSpeechOutputAudioCodec] = OMIT,
44
44
  request_options: typing.Optional[RequestOptions] = None,
45
45
  ) -> HttpResponse[TextToSpeechResponse]:
46
46
  """
@@ -84,7 +84,7 @@ class RawTextToSpeechClient:
84
84
  model : typing.Optional[TextToSpeechModel]
85
85
  Specifies the model to use for text-to-speech conversion. Default is bulbul:v2.
86
86
 
87
- audio_codec : typing.Optional[AudioCodec]
87
+ output_audio_codec : typing.Optional[TextToSpeechOutputAudioCodec]
88
88
  Specifies the audio codec for the output audio file. Different codecs offer various compression and quality characteristics.
89
89
 
90
90
  request_options : typing.Optional[RequestOptions]
@@ -109,7 +109,7 @@ class RawTextToSpeechClient:
109
109
  "speech_sample_rate": speech_sample_rate,
110
110
  "enable_preprocessing": enable_preprocessing,
111
111
  "model": model,
112
- "audio_codec": audio_codec,
112
+ "output_audio_codec": output_audio_codec,
113
113
  },
114
114
  headers={
115
115
  "content-type": "application/json",
@@ -204,7 +204,7 @@ class AsyncRawTextToSpeechClient:
204
204
  speech_sample_rate: typing.Optional[SpeechSampleRate] = OMIT,
205
205
  enable_preprocessing: typing.Optional[bool] = OMIT,
206
206
  model: typing.Optional[TextToSpeechModel] = OMIT,
207
- audio_codec: typing.Optional[AudioCodec] = OMIT,
207
+ output_audio_codec: typing.Optional[TextToSpeechOutputAudioCodec] = OMIT,
208
208
  request_options: typing.Optional[RequestOptions] = None,
209
209
  ) -> AsyncHttpResponse[TextToSpeechResponse]:
210
210
  """
@@ -248,7 +248,7 @@ class AsyncRawTextToSpeechClient:
248
248
  model : typing.Optional[TextToSpeechModel]
249
249
  Specifies the model to use for text-to-speech conversion. Default is bulbul:v2.
250
250
 
251
- audio_codec : typing.Optional[AudioCodec]
251
+ output_audio_codec : typing.Optional[TextToSpeechOutputAudioCodec]
252
252
  Specifies the audio codec for the output audio file. Different codecs offer various compression and quality characteristics.
253
253
 
254
254
  request_options : typing.Optional[RequestOptions]
@@ -273,7 +273,7 @@ class AsyncRawTextToSpeechClient:
273
273
  "speech_sample_rate": speech_sample_rate,
274
274
  "enable_preprocessing": enable_preprocessing,
275
275
  "model": model,
276
- "audio_codec": audio_codec,
276
+ "output_audio_codec": output_audio_codec,
277
277
  },
278
278
  headers={
279
279
  "content-type": "application/json",
@@ -2,11 +2,13 @@
2
2
 
3
3
  # isort: skip_file
4
4
 
5
- from .audio_codec import AudioCodec
6
5
  from .audio_data import AudioData
7
6
  from .audio_message import AudioMessage
8
7
  from .audio_output import AudioOutput
9
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
10
12
  from .chat_completion_request_assistant_message import ChatCompletionRequestAssistantMessage
11
13
  from .chat_completion_request_message import (
12
14
  ChatCompletionRequestMessage,
@@ -23,6 +25,7 @@ from .config_message import ConfigMessage
23
25
  from .configure_connection import ConfigureConnection
24
26
  from .configure_connection_data import ConfigureConnectionData
25
27
  from .configure_connection_data_output_audio_bitrate import ConfigureConnectionDataOutputAudioBitrate
28
+ from .configure_connection_data_output_audio_codec import ConfigureConnectionDataOutputAudioCodec
26
29
  from .configure_connection_data_speaker import ConfigureConnectionDataSpeaker
27
30
  from .configure_connection_data_target_language_code import ConfigureConnectionDataTargetLanguageCode
28
31
  from .create_chat_completion_response import CreateChatCompletionResponse
@@ -35,9 +38,14 @@ from .error_message import ErrorMessage
35
38
  from .error_response import ErrorResponse
36
39
  from .error_response_data import ErrorResponseData
37
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
38
45
  from .finish_reason import FinishReason
39
46
  from .flush_signal import FlushSignal
40
- from .format import Format
47
+ from .job_state import JobState
48
+ from .job_status_v_1 import JobStatusV1
41
49
  from .language_identification_response import LanguageIdentificationResponse
42
50
  from .numerals_format import NumeralsFormat
43
51
  from .ping_signal import PingSignal
@@ -48,12 +56,14 @@ from .sarvam_model_ids import SarvamModelIds
48
56
  from .send_text import SendText
49
57
  from .send_text_data import SendTextData
50
58
  from .speech_sample_rate import SpeechSampleRate
59
+ from .speech_to_text_job_parameters import SpeechToTextJobParameters
51
60
  from .speech_to_text_language import SpeechToTextLanguage
52
61
  from .speech_to_text_model import SpeechToTextModel
53
62
  from .speech_to_text_response import SpeechToTextResponse
54
63
  from .speech_to_text_response_data import SpeechToTextResponseData
55
64
  from .speech_to_text_streaming_response import SpeechToTextStreamingResponse
56
65
  from .speech_to_text_transcription_data import SpeechToTextTranscriptionData
66
+ from .speech_to_text_translate_job_parameters import SpeechToTextTranslateJobParameters
57
67
  from .speech_to_text_translate_language import SpeechToTextTranslateLanguage
58
68
  from .speech_to_text_translate_model import SpeechToTextTranslateModel
59
69
  from .speech_to_text_translate_response import SpeechToTextTranslateResponse
@@ -62,8 +72,13 @@ from .speech_to_text_translate_streaming_response import SpeechToTextTranslateSt
62
72
  from .speech_to_text_translate_transcription_data import SpeechToTextTranslateTranscriptionData
63
73
  from .spoken_form_numerals_format import SpokenFormNumeralsFormat
64
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
65
79
  from .text_to_speech_language import TextToSpeechLanguage
66
80
  from .text_to_speech_model import TextToSpeechModel
81
+ from .text_to_speech_output_audio_codec import TextToSpeechOutputAudioCodec
67
82
  from .text_to_speech_response import TextToSpeechResponse
68
83
  from .text_to_speech_speaker import TextToSpeechSpeaker
69
84
  from .timestamps_model import TimestampsModel
@@ -80,11 +95,13 @@ from .transliterate_source_language import TransliterateSourceLanguage
80
95
  from .transliteration_response import TransliterationResponse
81
96
 
82
97
  __all__ = [
83
- "AudioCodec",
84
98
  "AudioData",
85
99
  "AudioMessage",
86
100
  "AudioOutput",
87
101
  "AudioOutputData",
102
+ "BaseJobParameters",
103
+ "BulkJobCallback",
104
+ "BulkJobInitResponseV1",
88
105
  "ChatCompletionRequestAssistantMessage",
89
106
  "ChatCompletionRequestMessage",
90
107
  "ChatCompletionRequestMessage_Assistant",
@@ -99,6 +116,7 @@ __all__ = [
99
116
  "ConfigureConnection",
100
117
  "ConfigureConnectionData",
101
118
  "ConfigureConnectionDataOutputAudioBitrate",
119
+ "ConfigureConnectionDataOutputAudioCodec",
102
120
  "ConfigureConnectionDataSpeaker",
103
121
  "ConfigureConnectionDataTargetLanguageCode",
104
122
  "CreateChatCompletionResponse",
@@ -111,9 +129,14 @@ __all__ = [
111
129
  "ErrorResponse",
112
130
  "ErrorResponseData",
113
131
  "EventsData",
132
+ "FileSignedUrlDetails",
133
+ "FilesDownloadResponse",
134
+ "FilesRequest",
135
+ "FilesUploadResponse",
114
136
  "FinishReason",
115
137
  "FlushSignal",
116
- "Format",
138
+ "JobState",
139
+ "JobStatusV1",
117
140
  "LanguageIdentificationResponse",
118
141
  "NumeralsFormat",
119
142
  "PingSignal",
@@ -124,12 +147,14 @@ __all__ = [
124
147
  "SendText",
125
148
  "SendTextData",
126
149
  "SpeechSampleRate",
150
+ "SpeechToTextJobParameters",
127
151
  "SpeechToTextLanguage",
128
152
  "SpeechToTextModel",
129
153
  "SpeechToTextResponse",
130
154
  "SpeechToTextResponseData",
131
155
  "SpeechToTextStreamingResponse",
132
156
  "SpeechToTextTranscriptionData",
157
+ "SpeechToTextTranslateJobParameters",
133
158
  "SpeechToTextTranslateLanguage",
134
159
  "SpeechToTextTranslateModel",
135
160
  "SpeechToTextTranslateResponse",
@@ -138,8 +163,13 @@ __all__ = [
138
163
  "SpeechToTextTranslateTranscriptionData",
139
164
  "SpokenFormNumeralsFormat",
140
165
  "StopConfiguration",
166
+ "StorageContainerType",
167
+ "TaskDetailV1",
168
+ "TaskFileDetails",
169
+ "TaskState",
141
170
  "TextToSpeechLanguage",
142
171
  "TextToSpeechModel",
172
+ "TextToSpeechOutputAudioCodec",
143
173
  "TextToSpeechResponse",
144
174
  "TextToSpeechSpeaker",
145
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
@@ -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
@@ -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