speechall 0.1.0__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 (37) hide show
  1. speechall/__init__.py +56 -0
  2. speechall/api/__init__.py +6 -0
  3. speechall/api/replacement_rules_api.py +199 -0
  4. speechall/api/speech_to_text_api.py +603 -0
  5. speechall/api_client.py +766 -0
  6. speechall/api_response.py +25 -0
  7. speechall/configuration.py +443 -0
  8. speechall/exceptions.py +166 -0
  9. speechall/models/__init__.py +38 -0
  10. speechall/models/base_transcription_configuration.py +106 -0
  11. speechall/models/create_replacement_ruleset201_response.py +71 -0
  12. speechall/models/create_replacement_ruleset_request.py +81 -0
  13. speechall/models/error_response.py +83 -0
  14. speechall/models/exact_rule.py +84 -0
  15. speechall/models/open_ai_create_translation_request_model.py +139 -0
  16. speechall/models/openai_compatible_create_transcription200_response.py +139 -0
  17. speechall/models/openai_compatible_create_translation200_response.py +139 -0
  18. speechall/models/regex_group_rule.py +95 -0
  19. speechall/models/regex_rule.py +95 -0
  20. speechall/models/remote_transcription_configuration.py +118 -0
  21. speechall/models/replacement_rule.py +158 -0
  22. speechall/models/speech_to_text_model.py +294 -0
  23. speechall/models/transcript_language_code.py +141 -0
  24. speechall/models/transcript_output_format.py +43 -0
  25. speechall/models/transcription_detailed.py +99 -0
  26. speechall/models/transcription_model_identifier.py +108 -0
  27. speechall/models/transcription_only_text.py +73 -0
  28. speechall/models/transcription_provider.py +53 -0
  29. speechall/models/transcription_response.py +142 -0
  30. speechall/models/transcription_segment.py +79 -0
  31. speechall/models/transcription_word.py +79 -0
  32. speechall/py.typed +0 -0
  33. speechall/rest.py +329 -0
  34. speechall-0.1.0.dist-info/METADATA +183 -0
  35. speechall-0.1.0.dist-info/RECORD +37 -0
  36. speechall-0.1.0.dist-info/WHEEL +4 -0
  37. speechall-0.1.0.dist-info/licenses/LICENSE +21 -0
speechall/__init__.py ADDED
@@ -0,0 +1,56 @@
1
+ # coding: utf-8
2
+
3
+ # flake8: noqa
4
+
5
+ """
6
+ Speechall API
7
+
8
+ The Speechall REST API provides powerful and flexible speech-to-text capabilities. It allows you to transcribe audio files using various underlying STT providers and models, optionally apply custom text replacement rules, and access results in multiple formats. The API includes standard endpoints for transcription and endpoints compatible with the OpenAI API structure.
9
+
10
+ The version of the OpenAPI document: 0.1.0
11
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
12
+
13
+ Do not edit the class manually.
14
+ """ # noqa: E501
15
+
16
+
17
+ __version__ = "0.1.0"
18
+
19
+ # import apis into sdk package
20
+ from speechall.api.replacement_rules_api import ReplacementRulesApi
21
+ from speechall.api.speech_to_text_api import SpeechToTextApi
22
+
23
+ # import ApiClient
24
+ from speechall.api_response import ApiResponse
25
+ from speechall.api_client import ApiClient
26
+ from speechall.configuration import Configuration
27
+ from speechall.exceptions import OpenApiException
28
+ from speechall.exceptions import ApiTypeError
29
+ from speechall.exceptions import ApiValueError
30
+ from speechall.exceptions import ApiKeyError
31
+ from speechall.exceptions import ApiAttributeError
32
+ from speechall.exceptions import ApiException
33
+
34
+ # import models into sdk package
35
+ from speechall.models.base_transcription_configuration import BaseTranscriptionConfiguration
36
+ from speechall.models.create_replacement_ruleset201_response import CreateReplacementRuleset201Response
37
+ from speechall.models.create_replacement_ruleset_request import CreateReplacementRulesetRequest
38
+ from speechall.models.error_response import ErrorResponse
39
+ from speechall.models.exact_rule import ExactRule
40
+ from speechall.models.open_ai_create_translation_request_model import OpenAICreateTranslationRequestModel
41
+ from speechall.models.openai_compatible_create_transcription200_response import OpenaiCompatibleCreateTranscription200Response
42
+ from speechall.models.openai_compatible_create_translation200_response import OpenaiCompatibleCreateTranslation200Response
43
+ from speechall.models.regex_group_rule import RegexGroupRule
44
+ from speechall.models.regex_rule import RegexRule
45
+ from speechall.models.remote_transcription_configuration import RemoteTranscriptionConfiguration
46
+ from speechall.models.replacement_rule import ReplacementRule
47
+ from speechall.models.speech_to_text_model import SpeechToTextModel
48
+ from speechall.models.transcript_language_code import TranscriptLanguageCode
49
+ from speechall.models.transcript_output_format import TranscriptOutputFormat
50
+ from speechall.models.transcription_detailed import TranscriptionDetailed
51
+ from speechall.models.transcription_model_identifier import TranscriptionModelIdentifier
52
+ from speechall.models.transcription_only_text import TranscriptionOnlyText
53
+ from speechall.models.transcription_provider import TranscriptionProvider
54
+ from speechall.models.transcription_response import TranscriptionResponse
55
+ from speechall.models.transcription_segment import TranscriptionSegment
56
+ from speechall.models.transcription_word import TranscriptionWord
@@ -0,0 +1,6 @@
1
+ # flake8: noqa
2
+
3
+ # import apis into api package
4
+ from speechall.api.replacement_rules_api import ReplacementRulesApi
5
+ from speechall.api.speech_to_text_api import SpeechToTextApi
6
+
@@ -0,0 +1,199 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Speechall API
5
+
6
+ The Speechall REST API provides powerful and flexible speech-to-text capabilities. It allows you to transcribe audio files using various underlying STT providers and models, optionally apply custom text replacement rules, and access results in multiple formats. The API includes standard endpoints for transcription and endpoints compatible with the OpenAI API structure.
7
+
8
+ The version of the OpenAPI document: 0.1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ import re # noqa: F401
16
+ import io
17
+ import warnings
18
+
19
+ from pydantic import validate_arguments, ValidationError
20
+
21
+ from typing_extensions import Annotated
22
+ from pydantic import Field
23
+
24
+ from speechall.models.create_replacement_ruleset201_response import CreateReplacementRuleset201Response
25
+ from speechall.models.create_replacement_ruleset_request import CreateReplacementRulesetRequest
26
+
27
+ from speechall.api_client import ApiClient
28
+ from speechall.api_response import ApiResponse
29
+ from speechall.exceptions import ( # noqa: F401
30
+ ApiTypeError,
31
+ ApiValueError
32
+ )
33
+
34
+
35
+ class ReplacementRulesApi:
36
+ """NOTE: This class is auto generated by OpenAPI Generator
37
+ Ref: https://openapi-generator.tech
38
+
39
+ Do not edit the class manually.
40
+ """
41
+
42
+ def __init__(self, api_client=None) -> None:
43
+ if api_client is None:
44
+ api_client = ApiClient.get_default()
45
+ self.api_client = api_client
46
+
47
+ @validate_arguments
48
+ def create_replacement_ruleset(self, create_replacement_ruleset_request : Annotated[CreateReplacementRulesetRequest, Field(..., description="JSON object containing the name for the ruleset and an array of replacement rule objects.")], **kwargs) -> CreateReplacementRuleset201Response: # noqa: E501
49
+ """Create a reusable set of text replacement rules. # noqa: E501
50
+
51
+ Defines a named set of replacement rules (exact match, regex) that can be applied during transcription requests using its `ruleset_id`. Rules within a set are applied sequentially to the transcription text. # noqa: E501
52
+ This method makes a synchronous HTTP request by default. To make an
53
+ asynchronous HTTP request, please pass async_req=True
54
+
55
+ >>> thread = api.create_replacement_ruleset(create_replacement_ruleset_request, async_req=True)
56
+ >>> result = thread.get()
57
+
58
+ :param create_replacement_ruleset_request: JSON object containing the name for the ruleset and an array of replacement rule objects. (required)
59
+ :type create_replacement_ruleset_request: CreateReplacementRulesetRequest
60
+ :param async_req: Whether to execute the request asynchronously.
61
+ :type async_req: bool, optional
62
+ :param _request_timeout: timeout setting for this request.
63
+ If one number provided, it will be total request
64
+ timeout. It can also be a pair (tuple) of
65
+ (connection, read) timeouts.
66
+ :return: Returns the result object.
67
+ If the method is called asynchronously,
68
+ returns the request thread.
69
+ :rtype: CreateReplacementRuleset201Response
70
+ """
71
+ kwargs['_return_http_data_only'] = True
72
+ if '_preload_content' in kwargs:
73
+ message = "Error! Please call the create_replacement_ruleset_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
74
+ raise ValueError(message)
75
+ return self.create_replacement_ruleset_with_http_info(create_replacement_ruleset_request, **kwargs) # noqa: E501
76
+
77
+ @validate_arguments
78
+ def create_replacement_ruleset_with_http_info(self, create_replacement_ruleset_request : Annotated[CreateReplacementRulesetRequest, Field(..., description="JSON object containing the name for the ruleset and an array of replacement rule objects.")], **kwargs) -> ApiResponse: # noqa: E501
79
+ """Create a reusable set of text replacement rules. # noqa: E501
80
+
81
+ Defines a named set of replacement rules (exact match, regex) that can be applied during transcription requests using its `ruleset_id`. Rules within a set are applied sequentially to the transcription text. # noqa: E501
82
+ This method makes a synchronous HTTP request by default. To make an
83
+ asynchronous HTTP request, please pass async_req=True
84
+
85
+ >>> thread = api.create_replacement_ruleset_with_http_info(create_replacement_ruleset_request, async_req=True)
86
+ >>> result = thread.get()
87
+
88
+ :param create_replacement_ruleset_request: JSON object containing the name for the ruleset and an array of replacement rule objects. (required)
89
+ :type create_replacement_ruleset_request: CreateReplacementRulesetRequest
90
+ :param async_req: Whether to execute the request asynchronously.
91
+ :type async_req: bool, optional
92
+ :param _preload_content: if False, the ApiResponse.data will
93
+ be set to none and raw_data will store the
94
+ HTTP response body without reading/decoding.
95
+ Default is True.
96
+ :type _preload_content: bool, optional
97
+ :param _return_http_data_only: response data instead of ApiResponse
98
+ object with status code, headers, etc
99
+ :type _return_http_data_only: bool, optional
100
+ :param _request_timeout: timeout setting for this request. If one
101
+ number provided, it will be total request
102
+ timeout. It can also be a pair (tuple) of
103
+ (connection, read) timeouts.
104
+ :param _request_auth: set to override the auth_settings for an a single
105
+ request; this effectively ignores the authentication
106
+ in the spec for a single request.
107
+ :type _request_auth: dict, optional
108
+ :type _content_type: string, optional: force content-type for the request
109
+ :return: Returns the result object.
110
+ If the method is called asynchronously,
111
+ returns the request thread.
112
+ :rtype: tuple(CreateReplacementRuleset201Response, status_code(int), headers(HTTPHeaderDict))
113
+ """
114
+
115
+ _params = locals()
116
+
117
+ _all_params = [
118
+ 'create_replacement_ruleset_request'
119
+ ]
120
+ _all_params.extend(
121
+ [
122
+ 'async_req',
123
+ '_return_http_data_only',
124
+ '_preload_content',
125
+ '_request_timeout',
126
+ '_request_auth',
127
+ '_content_type',
128
+ '_headers'
129
+ ]
130
+ )
131
+
132
+ # validate the arguments
133
+ for _key, _val in _params['kwargs'].items():
134
+ if _key not in _all_params:
135
+ raise ApiTypeError(
136
+ "Got an unexpected keyword argument '%s'"
137
+ " to method create_replacement_ruleset" % _key
138
+ )
139
+ _params[_key] = _val
140
+ del _params['kwargs']
141
+
142
+ _collection_formats = {}
143
+
144
+ # process the path parameters
145
+ _path_params = {}
146
+
147
+ # process the query parameters
148
+ _query_params = []
149
+ # process the header parameters
150
+ _header_params = dict(_params.get('_headers', {}))
151
+ # process the form parameters
152
+ _form_params = []
153
+ _files = {}
154
+ # process the body parameter
155
+ _body_params = None
156
+ if _params['create_replacement_ruleset_request'] is not None:
157
+ _body_params = _params['create_replacement_ruleset_request']
158
+
159
+ # set the HTTP header `Accept`
160
+ _header_params['Accept'] = self.api_client.select_header_accept(
161
+ ['application/json', 'text/plain']) # noqa: E501
162
+
163
+ # set the HTTP header `Content-Type`
164
+ _content_types_list = _params.get('_content_type',
165
+ self.api_client.select_header_content_type(
166
+ ['application/json']))
167
+ if _content_types_list:
168
+ _header_params['Content-Type'] = _content_types_list
169
+
170
+ # authentication setting
171
+ _auth_settings = ['bearerAuth'] # noqa: E501
172
+
173
+ _response_types_map = {
174
+ '201': "CreateReplacementRuleset201Response",
175
+ '400': "ErrorResponse",
176
+ '401': "ErrorResponse",
177
+ '402': "ErrorResponse",
178
+ '429': "ErrorResponse",
179
+ '500': "ErrorResponse",
180
+ '503': "ErrorResponse",
181
+ '504': "ErrorResponse",
182
+ }
183
+
184
+ return self.api_client.call_api(
185
+ '/replacement-rulesets', 'POST',
186
+ _path_params,
187
+ _query_params,
188
+ _header_params,
189
+ body=_body_params,
190
+ post_params=_form_params,
191
+ files=_files,
192
+ response_types_map=_response_types_map,
193
+ auth_settings=_auth_settings,
194
+ async_req=_params.get('async_req'),
195
+ _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
196
+ _preload_content=_params.get('_preload_content', True),
197
+ _request_timeout=_params.get('_request_timeout'),
198
+ collection_formats=_collection_formats,
199
+ _request_auth=_params.get('_request_auth'))