sarvamai 0.1.22a4__py3-none-any.whl → 0.1.22a8__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 +62 -3
- sarvamai/client.py +3 -0
- sarvamai/core/client_wrapper.py +2 -2
- sarvamai/doc_digitization_job/__init__.py +4 -0
- sarvamai/doc_digitization_job/client.py +775 -0
- sarvamai/doc_digitization_job/job.py +496 -0
- sarvamai/doc_digitization_job/raw_client.py +1176 -0
- sarvamai/requests/__init__.py +20 -0
- sarvamai/requests/audio_data.py +0 -6
- sarvamai/requests/configure_connection.py +4 -0
- sarvamai/requests/configure_connection_data.py +40 -11
- sarvamai/requests/doc_digitization_create_job_response.py +25 -0
- sarvamai/requests/doc_digitization_download_files_response.py +37 -0
- sarvamai/requests/doc_digitization_error_details.py +21 -0
- sarvamai/requests/doc_digitization_error_message.py +11 -0
- sarvamai/requests/doc_digitization_job_detail.py +64 -0
- sarvamai/requests/doc_digitization_job_parameters.py +21 -0
- sarvamai/requests/doc_digitization_job_status_response.py +65 -0
- sarvamai/requests/doc_digitization_page_error.py +24 -0
- sarvamai/requests/doc_digitization_upload_files_response.py +34 -0
- sarvamai/requests/doc_digitization_webhook_callback.py +19 -0
- sarvamai/requests/speech_to_text_job_parameters.py +43 -2
- sarvamai/requests/speech_to_text_translate_job_parameters.py +4 -1
- sarvamai/speech_to_text/client.py +95 -10
- sarvamai/speech_to_text/raw_client.py +95 -10
- sarvamai/speech_to_text_job/client.py +60 -15
- sarvamai/speech_to_text_streaming/__init__.py +4 -0
- sarvamai/speech_to_text_streaming/client.py +102 -18
- sarvamai/speech_to_text_streaming/raw_client.py +102 -18
- sarvamai/speech_to_text_streaming/types/__init__.py +4 -0
- sarvamai/speech_to_text_streaming/types/speech_to_text_streaming_input_audio_codec.py +1 -27
- sarvamai/speech_to_text_streaming/types/speech_to_text_streaming_mode.py +7 -0
- sarvamai/speech_to_text_streaming/types/speech_to_text_streaming_model.py +5 -0
- sarvamai/speech_to_text_translate_streaming/client.py +20 -12
- sarvamai/speech_to_text_translate_streaming/raw_client.py +20 -12
- sarvamai/speech_to_text_translate_streaming/types/speech_to_text_translate_streaming_input_audio_codec.py +1 -27
- sarvamai/text/client.py +0 -12
- sarvamai/text/raw_client.py +0 -12
- sarvamai/text_to_speech/client.py +116 -14
- sarvamai/text_to_speech/raw_client.py +116 -14
- sarvamai/text_to_speech_streaming/__init__.py +2 -2
- sarvamai/text_to_speech_streaming/client.py +19 -6
- sarvamai/text_to_speech_streaming/raw_client.py +19 -6
- sarvamai/text_to_speech_streaming/types/__init__.py +2 -1
- sarvamai/text_to_speech_streaming/types/text_to_speech_streaming_model.py +5 -0
- sarvamai/types/__init__.py +34 -2
- sarvamai/types/audio_data.py +0 -6
- sarvamai/types/configure_connection.py +4 -0
- sarvamai/types/configure_connection_data.py +40 -11
- sarvamai/types/configure_connection_data_model.py +5 -0
- sarvamai/types/configure_connection_data_speaker.py +35 -1
- sarvamai/types/doc_digitization_create_job_response.py +37 -0
- sarvamai/types/doc_digitization_download_files_response.py +47 -0
- sarvamai/types/doc_digitization_error_code.py +15 -0
- sarvamai/types/doc_digitization_error_details.py +33 -0
- sarvamai/types/doc_digitization_error_message.py +23 -0
- sarvamai/types/doc_digitization_job_detail.py +74 -0
- sarvamai/types/doc_digitization_job_detail_state.py +7 -0
- sarvamai/types/doc_digitization_job_parameters.py +33 -0
- sarvamai/types/doc_digitization_job_state.py +7 -0
- sarvamai/types/doc_digitization_job_status_response.py +75 -0
- sarvamai/types/doc_digitization_output_format.py +5 -0
- sarvamai/types/doc_digitization_page_error.py +36 -0
- sarvamai/types/doc_digitization_supported_language.py +32 -0
- sarvamai/types/doc_digitization_upload_files_response.py +44 -0
- sarvamai/types/doc_digitization_webhook_callback.py +31 -0
- sarvamai/types/mode.py +5 -0
- sarvamai/types/speech_to_text_job_parameters.py +43 -2
- sarvamai/types/speech_to_text_model.py +1 -1
- sarvamai/types/speech_to_text_translate_job_parameters.py +4 -1
- sarvamai/types/text_to_speech_model.py +1 -1
- sarvamai/types/text_to_speech_speaker.py +35 -1
- {sarvamai-0.1.22a4.dist-info → sarvamai-0.1.22a8.dist-info}/METADATA +1 -1
- {sarvamai-0.1.22a4.dist-info → sarvamai-0.1.22a8.dist-info}/RECORD +75 -42
- sarvamai/types/audio_data_input_audio_codec.py +0 -33
- {sarvamai-0.1.22a4.dist-info → sarvamai-0.1.22a8.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,37 @@
|
|
|
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 .doc_digitization_job_parameters import DocDigitizationJobParameters
|
|
8
|
+
from .doc_digitization_job_state import DocDigitizationJobState
|
|
9
|
+
from .storage_container_type import StorageContainerType
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class DocDigitizationCreateJobResponse(UniversalBaseModel):
|
|
13
|
+
job_id: str = pydantic.Field()
|
|
14
|
+
"""
|
|
15
|
+
Unique job identifier (UUID)
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
storage_container_type: StorageContainerType = pydantic.Field()
|
|
19
|
+
"""
|
|
20
|
+
Storage Container Type
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
job_parameters: DocDigitizationJobParameters = pydantic.Field()
|
|
24
|
+
"""
|
|
25
|
+
Job configuration parameters
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
job_state: DocDigitizationJobState
|
|
29
|
+
|
|
30
|
+
if IS_PYDANTIC_V2:
|
|
31
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
32
|
+
else:
|
|
33
|
+
|
|
34
|
+
class Config:
|
|
35
|
+
frozen = True
|
|
36
|
+
smart_union = True
|
|
37
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,47 @@
|
|
|
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 .doc_digitization_job_state import DocDigitizationJobState
|
|
8
|
+
from .file_signed_url_details import FileSignedUrlDetails
|
|
9
|
+
from .storage_container_type import StorageContainerType
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class DocDigitizationDownloadFilesResponse(UniversalBaseModel):
|
|
13
|
+
"""
|
|
14
|
+
Response for download-files endpoint.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
job_id: str = pydantic.Field()
|
|
18
|
+
"""
|
|
19
|
+
Job identifier (UUID)
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
job_state: DocDigitizationJobState = pydantic.Field()
|
|
23
|
+
"""
|
|
24
|
+
Current job state
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
storage_container_type: StorageContainerType = pydantic.Field()
|
|
28
|
+
"""
|
|
29
|
+
Storage backend type
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
download_urls: typing.Dict[str, FileSignedUrlDetails] = pydantic.Field()
|
|
33
|
+
"""
|
|
34
|
+
Map of filename to presigned download URL details
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
error_code: typing.Optional[str] = None
|
|
38
|
+
error_message: typing.Optional[str] = None
|
|
39
|
+
|
|
40
|
+
if IS_PYDANTIC_V2:
|
|
41
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
42
|
+
else:
|
|
43
|
+
|
|
44
|
+
class Config:
|
|
45
|
+
frozen = True
|
|
46
|
+
smart_union = True
|
|
47
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
DocDigitizationErrorCode = typing.Union[
|
|
6
|
+
typing.Literal[
|
|
7
|
+
"invalid_request_error",
|
|
8
|
+
"internal_server_error",
|
|
9
|
+
"insufficient_quota_error",
|
|
10
|
+
"invalid_api_key_error",
|
|
11
|
+
"rate_limit_exceeded_error",
|
|
12
|
+
"high_load_error",
|
|
13
|
+
],
|
|
14
|
+
typing.Any,
|
|
15
|
+
]
|
|
@@ -0,0 +1,33 @@
|
|
|
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 .doc_digitization_error_code import DocDigitizationErrorCode
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class DocDigitizationErrorDetails(UniversalBaseModel):
|
|
11
|
+
message: str = pydantic.Field()
|
|
12
|
+
"""
|
|
13
|
+
Message describing the error
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
code: DocDigitizationErrorCode = pydantic.Field()
|
|
17
|
+
"""
|
|
18
|
+
Error code for the specific error that has occurred.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
request_id: typing.Optional[str] = pydantic.Field(default=None)
|
|
22
|
+
"""
|
|
23
|
+
Unique identifier for the request. Format: date_UUID4
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
if IS_PYDANTIC_V2:
|
|
27
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
28
|
+
else:
|
|
29
|
+
|
|
30
|
+
class Config:
|
|
31
|
+
frozen = True
|
|
32
|
+
smart_union = True
|
|
33
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,23 @@
|
|
|
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 .doc_digitization_error_details import DocDigitizationErrorDetails
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class DocDigitizationErrorMessage(UniversalBaseModel):
|
|
11
|
+
error: DocDigitizationErrorDetails = pydantic.Field()
|
|
12
|
+
"""
|
|
13
|
+
Error details
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
if IS_PYDANTIC_V2:
|
|
17
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
18
|
+
else:
|
|
19
|
+
|
|
20
|
+
class Config:
|
|
21
|
+
frozen = True
|
|
22
|
+
smart_union = True
|
|
23
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,74 @@
|
|
|
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 .doc_digitization_job_detail_state import DocDigitizationJobDetailState
|
|
8
|
+
from .doc_digitization_page_error import DocDigitizationPageError
|
|
9
|
+
from .task_file_details import TaskFileDetails
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class DocDigitizationJobDetail(UniversalBaseModel):
|
|
13
|
+
"""
|
|
14
|
+
Processing details for a single input file with page-level metrics.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
inputs: typing.List[TaskFileDetails] = pydantic.Field()
|
|
18
|
+
"""
|
|
19
|
+
Input file(s) for this task
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
outputs: typing.List[TaskFileDetails] = pydantic.Field()
|
|
23
|
+
"""
|
|
24
|
+
Output file(s) produced
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
state: DocDigitizationJobDetailState = pydantic.Field()
|
|
28
|
+
"""
|
|
29
|
+
Processing state for this file
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
total_pages: typing.Optional[int] = pydantic.Field(default=None)
|
|
33
|
+
"""
|
|
34
|
+
Total pages/images in the input file
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
pages_processed: typing.Optional[int] = pydantic.Field(default=None)
|
|
38
|
+
"""
|
|
39
|
+
Number of pages processed so far
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
pages_succeeded: typing.Optional[int] = pydantic.Field(default=None)
|
|
43
|
+
"""
|
|
44
|
+
Number of pages successfully processed
|
|
45
|
+
"""
|
|
46
|
+
|
|
47
|
+
pages_failed: typing.Optional[int] = pydantic.Field(default=None)
|
|
48
|
+
"""
|
|
49
|
+
Number of pages that failed processing
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
error_message: typing.Optional[str] = pydantic.Field(default=None)
|
|
53
|
+
"""
|
|
54
|
+
Error message if processing failed
|
|
55
|
+
"""
|
|
56
|
+
|
|
57
|
+
error_code: typing.Optional[str] = pydantic.Field(default=None)
|
|
58
|
+
"""
|
|
59
|
+
Standardized error code if failed
|
|
60
|
+
"""
|
|
61
|
+
|
|
62
|
+
page_errors: typing.Optional[typing.List[DocDigitizationPageError]] = pydantic.Field(default=None)
|
|
63
|
+
"""
|
|
64
|
+
Detailed errors for each failed page
|
|
65
|
+
"""
|
|
66
|
+
|
|
67
|
+
if IS_PYDANTIC_V2:
|
|
68
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
69
|
+
else:
|
|
70
|
+
|
|
71
|
+
class Config:
|
|
72
|
+
frozen = True
|
|
73
|
+
smart_union = True
|
|
74
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,33 @@
|
|
|
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 .doc_digitization_output_format import DocDigitizationOutputFormat
|
|
8
|
+
from .doc_digitization_supported_language import DocDigitizationSupportedLanguage
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class DocDigitizationJobParameters(UniversalBaseModel):
|
|
12
|
+
"""
|
|
13
|
+
Job parameters for document digitization.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
language: typing.Optional[DocDigitizationSupportedLanguage] = pydantic.Field(default=None)
|
|
17
|
+
"""
|
|
18
|
+
ISO language code for the document
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
output_format: typing.Optional[DocDigitizationOutputFormat] = pydantic.Field(default=None)
|
|
22
|
+
"""
|
|
23
|
+
Output format: html or md
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
if IS_PYDANTIC_V2:
|
|
27
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
28
|
+
else:
|
|
29
|
+
|
|
30
|
+
class Config:
|
|
31
|
+
frozen = True
|
|
32
|
+
smart_union = True
|
|
33
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
import pydantic
|
|
7
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
8
|
+
from .doc_digitization_job_detail import DocDigitizationJobDetail
|
|
9
|
+
from .doc_digitization_job_state import DocDigitizationJobState
|
|
10
|
+
from .storage_container_type import StorageContainerType
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class DocDigitizationJobStatusResponse(UniversalBaseModel):
|
|
14
|
+
"""
|
|
15
|
+
Response model for job status endpoint.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
job_id: str = pydantic.Field()
|
|
19
|
+
"""
|
|
20
|
+
Job identifier (UUID)
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
job_state: DocDigitizationJobState = pydantic.Field()
|
|
24
|
+
"""
|
|
25
|
+
Current job state
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
created_at: dt.datetime = pydantic.Field()
|
|
29
|
+
"""
|
|
30
|
+
Job creation timestamp (ISO 8601)
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
updated_at: dt.datetime = pydantic.Field()
|
|
34
|
+
"""
|
|
35
|
+
Last update timestamp (ISO 8601)
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
storage_container_type: StorageContainerType = pydantic.Field()
|
|
39
|
+
"""
|
|
40
|
+
Storage backend type
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
total_files: typing.Optional[int] = pydantic.Field(default=None)
|
|
44
|
+
"""
|
|
45
|
+
Total input files (always 1)
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
successful_files_count: typing.Optional[int] = pydantic.Field(default=None)
|
|
49
|
+
"""
|
|
50
|
+
Files that completed successfully
|
|
51
|
+
"""
|
|
52
|
+
|
|
53
|
+
failed_files_count: typing.Optional[int] = pydantic.Field(default=None)
|
|
54
|
+
"""
|
|
55
|
+
Files that failed
|
|
56
|
+
"""
|
|
57
|
+
|
|
58
|
+
error_message: typing.Optional[str] = pydantic.Field(default=None)
|
|
59
|
+
"""
|
|
60
|
+
Job-level error message
|
|
61
|
+
"""
|
|
62
|
+
|
|
63
|
+
job_details: typing.Optional[typing.List[DocDigitizationJobDetail]] = pydantic.Field(default=None)
|
|
64
|
+
"""
|
|
65
|
+
Per-file processing details with page metrics
|
|
66
|
+
"""
|
|
67
|
+
|
|
68
|
+
if IS_PYDANTIC_V2:
|
|
69
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
70
|
+
else:
|
|
71
|
+
|
|
72
|
+
class Config:
|
|
73
|
+
frozen = True
|
|
74
|
+
smart_union = True
|
|
75
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,36 @@
|
|
|
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 DocDigitizationPageError(UniversalBaseModel):
|
|
10
|
+
"""
|
|
11
|
+
Error details for a specific page.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
page_number: int = pydantic.Field()
|
|
15
|
+
"""
|
|
16
|
+
Page number that failed
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
error_code: str = pydantic.Field()
|
|
20
|
+
"""
|
|
21
|
+
Standardized error code
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
error_message: str = pydantic.Field()
|
|
25
|
+
"""
|
|
26
|
+
Human-readable error description
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
if IS_PYDANTIC_V2:
|
|
30
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
31
|
+
else:
|
|
32
|
+
|
|
33
|
+
class Config:
|
|
34
|
+
frozen = True
|
|
35
|
+
smart_union = True
|
|
36
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
DocDigitizationSupportedLanguage = typing.Union[
|
|
6
|
+
typing.Literal[
|
|
7
|
+
"hi",
|
|
8
|
+
"en",
|
|
9
|
+
"bn",
|
|
10
|
+
"gu",
|
|
11
|
+
"kn",
|
|
12
|
+
"ml",
|
|
13
|
+
"mr",
|
|
14
|
+
"or",
|
|
15
|
+
"pa",
|
|
16
|
+
"ta",
|
|
17
|
+
"te",
|
|
18
|
+
"ur",
|
|
19
|
+
"as",
|
|
20
|
+
"bodo",
|
|
21
|
+
"doi",
|
|
22
|
+
"ks",
|
|
23
|
+
"kok",
|
|
24
|
+
"mai",
|
|
25
|
+
"mni",
|
|
26
|
+
"ne",
|
|
27
|
+
"sa",
|
|
28
|
+
"sat",
|
|
29
|
+
"sd",
|
|
30
|
+
],
|
|
31
|
+
typing.Any,
|
|
32
|
+
]
|
|
@@ -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 .doc_digitization_job_state import DocDigitizationJobState
|
|
8
|
+
from .file_signed_url_details import FileSignedUrlDetails
|
|
9
|
+
from .storage_container_type import StorageContainerType
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class DocDigitizationUploadFilesResponse(UniversalBaseModel):
|
|
13
|
+
"""
|
|
14
|
+
Response with presigned upload URLs
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
job_id: str = pydantic.Field()
|
|
18
|
+
"""
|
|
19
|
+
Job identifier
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
job_state: DocDigitizationJobState = pydantic.Field()
|
|
23
|
+
"""
|
|
24
|
+
Current job state
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
upload_urls: typing.Dict[str, FileSignedUrlDetails] = pydantic.Field()
|
|
28
|
+
"""
|
|
29
|
+
Map of filename to presigned upload URL details
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
storage_container_type: StorageContainerType = pydantic.Field()
|
|
33
|
+
"""
|
|
34
|
+
Storage backend type
|
|
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,31 @@
|
|
|
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 DocDigitizationWebhookCallback(UniversalBaseModel):
|
|
10
|
+
"""
|
|
11
|
+
Webhook configuration for job completion notification
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
url: str = pydantic.Field()
|
|
15
|
+
"""
|
|
16
|
+
HTTPS webhook URL to call upon job completion (HTTP not allowed)
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
auth_token: typing.Optional[str] = pydantic.Field(default=None)
|
|
20
|
+
"""
|
|
21
|
+
Authorization token sent as X-SARVAM-JOB-CALLBACK-TOKEN header
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
if IS_PYDANTIC_V2:
|
|
25
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
26
|
+
else:
|
|
27
|
+
|
|
28
|
+
class Config:
|
|
29
|
+
frozen = True
|
|
30
|
+
smart_union = True
|
|
31
|
+
extra = pydantic.Extra.allow
|
sarvamai/types/mode.py
ADDED
|
@@ -4,6 +4,7 @@ import typing
|
|
|
4
4
|
|
|
5
5
|
import pydantic
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
+
from .mode import Mode
|
|
7
8
|
from .speech_to_text_model import SpeechToTextModel
|
|
8
9
|
from .speech_to_text_translate_language import SpeechToTextTranslateLanguage
|
|
9
10
|
|
|
@@ -11,12 +12,52 @@ from .speech_to_text_translate_language import SpeechToTextTranslateLanguage
|
|
|
11
12
|
class SpeechToTextJobParameters(UniversalBaseModel):
|
|
12
13
|
language_code: typing.Optional[SpeechToTextTranslateLanguage] = pydantic.Field(default=None)
|
|
13
14
|
"""
|
|
14
|
-
|
|
15
|
+
Specifies the language of the input audio in BCP-47 format.
|
|
16
|
+
|
|
17
|
+
**Available Options:**
|
|
18
|
+
- `unknown` (default): Use when the language is not known; the API will auto-detect.
|
|
19
|
+
- `hi-IN`: Hindi
|
|
20
|
+
- `bn-IN`: Bengali
|
|
21
|
+
- `kn-IN`: Kannada
|
|
22
|
+
- `ml-IN`: Malayalam
|
|
23
|
+
- `mr-IN`: Marathi
|
|
24
|
+
- `od-IN`: Odia
|
|
25
|
+
- `pa-IN`: Punjabi
|
|
26
|
+
- `ta-IN`: Tamil
|
|
27
|
+
- `te-IN`: Telugu
|
|
28
|
+
- `en-IN`: English
|
|
29
|
+
- `gu-IN`: Gujarati
|
|
15
30
|
"""
|
|
16
31
|
|
|
17
32
|
model: typing.Optional[SpeechToTextModel] = pydantic.Field(default=None)
|
|
18
33
|
"""
|
|
19
|
-
Model to be used for speech to text
|
|
34
|
+
Model to be used for speech to text.
|
|
35
|
+
|
|
36
|
+
- **saarika:v2.5** (default): Transcribes audio in the spoken language.
|
|
37
|
+
|
|
38
|
+
- **saaras:v3**: State-of-the-art model with flexible output formats. Supports multiple modes via the `mode` parameter: transcribe, translate, verbatim, translit, codemix.
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
mode: typing.Optional[Mode] = pydantic.Field(default=None)
|
|
42
|
+
"""
|
|
43
|
+
Mode of operation. **Only applicable when using saaras:v3 model.**
|
|
44
|
+
|
|
45
|
+
Example audio: 'मेरा फोन नंबर है 9840950950'
|
|
46
|
+
|
|
47
|
+
- **transcribe** (default): Standard transcription in the original language with proper formatting and number normalization.
|
|
48
|
+
- Output: `मेरा फोन नंबर है 9840950950`
|
|
49
|
+
|
|
50
|
+
- **translate**: Translates speech from any supported Indic language to English.
|
|
51
|
+
- Output: `My phone number is 9840950950`
|
|
52
|
+
|
|
53
|
+
- **verbatim**: Exact word-for-word transcription without normalization, preserving filler words and spoken numbers as-is.
|
|
54
|
+
- Output: `मेरा फोन नंबर है नौ आठ चार zero नौ पांच zero नौ पांच zero`
|
|
55
|
+
|
|
56
|
+
- **translit**: Romanization - Transliterates speech to Latin/Roman script only.
|
|
57
|
+
- Output: `mera phone number hai 9840950950`
|
|
58
|
+
|
|
59
|
+
- **codemix**: Code-mixed text with English words in English and Indic words in native script.
|
|
60
|
+
- Output: `मेरा phone number है 9840950950`
|
|
20
61
|
"""
|
|
21
62
|
|
|
22
63
|
with_timestamps: typing.Optional[bool] = pydantic.Field(default=None)
|
|
@@ -15,7 +15,10 @@ class SpeechToTextTranslateJobParameters(UniversalBaseModel):
|
|
|
15
15
|
|
|
16
16
|
model: typing.Optional[SpeechToTextTranslateModel] = pydantic.Field(default=None)
|
|
17
17
|
"""
|
|
18
|
-
Model to be used for
|
|
18
|
+
Model to be used for speech to text translation.
|
|
19
|
+
|
|
20
|
+
- **saaras:v2.5** (default): Translation model that translates audio from any spoken Indic language to English.
|
|
21
|
+
- Example: Hindi audio → English text output
|
|
19
22
|
"""
|
|
20
23
|
|
|
21
24
|
with_diarization: typing.Optional[bool] = pydantic.Field(default=None)
|
|
@@ -3,5 +3,39 @@
|
|
|
3
3
|
import typing
|
|
4
4
|
|
|
5
5
|
TextToSpeechSpeaker = typing.Union[
|
|
6
|
-
typing.Literal[
|
|
6
|
+
typing.Literal[
|
|
7
|
+
"anushka",
|
|
8
|
+
"abhilash",
|
|
9
|
+
"manisha",
|
|
10
|
+
"vidya",
|
|
11
|
+
"arya",
|
|
12
|
+
"karun",
|
|
13
|
+
"hitesh",
|
|
14
|
+
"aditya",
|
|
15
|
+
"ritu",
|
|
16
|
+
"priya",
|
|
17
|
+
"neha",
|
|
18
|
+
"rahul",
|
|
19
|
+
"pooja",
|
|
20
|
+
"rohan",
|
|
21
|
+
"simran",
|
|
22
|
+
"kavya",
|
|
23
|
+
"amit",
|
|
24
|
+
"dev",
|
|
25
|
+
"ishita",
|
|
26
|
+
"shreya",
|
|
27
|
+
"ratan",
|
|
28
|
+
"varun",
|
|
29
|
+
"manan",
|
|
30
|
+
"sumit",
|
|
31
|
+
"roopa",
|
|
32
|
+
"kabir",
|
|
33
|
+
"aayan",
|
|
34
|
+
"shubh",
|
|
35
|
+
"ashutosh",
|
|
36
|
+
"advait",
|
|
37
|
+
"amelia",
|
|
38
|
+
"sophia",
|
|
39
|
+
],
|
|
40
|
+
typing.Any,
|
|
7
41
|
]
|