universal-mcp 0.1.12__py3-none-any.whl → 0.1.13rc2__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 (109) hide show
  1. universal_mcp/applications/__init__.py +51 -7
  2. universal_mcp/cli.py +109 -17
  3. universal_mcp/integrations/__init__.py +1 -1
  4. universal_mcp/integrations/integration.py +79 -0
  5. universal_mcp/servers/README.md +79 -0
  6. universal_mcp/servers/server.py +17 -29
  7. universal_mcp/stores/README.md +74 -0
  8. universal_mcp/stores/store.py +0 -2
  9. universal_mcp/templates/README.md.j2 +93 -0
  10. universal_mcp/templates/api_client.py.j2 +27 -0
  11. universal_mcp/tools/README.md +86 -0
  12. universal_mcp/tools/tools.py +1 -1
  13. universal_mcp/utils/agentr.py +90 -0
  14. universal_mcp/utils/api_generator.py +166 -208
  15. universal_mcp/utils/openapi.py +221 -321
  16. universal_mcp/utils/singleton.py +23 -0
  17. {universal_mcp-0.1.12.dist-info → universal_mcp-0.1.13rc2.dist-info}/METADATA +16 -41
  18. universal_mcp-0.1.13rc2.dist-info/RECORD +38 -0
  19. universal_mcp/applications/ahrefs/README.md +0 -76
  20. universal_mcp/applications/ahrefs/__init__.py +0 -0
  21. universal_mcp/applications/ahrefs/app.py +0 -2291
  22. universal_mcp/applications/cal_com_v2/README.md +0 -175
  23. universal_mcp/applications/cal_com_v2/__init__.py +0 -0
  24. universal_mcp/applications/cal_com_v2/app.py +0 -5390
  25. universal_mcp/applications/calendly/README.md +0 -78
  26. universal_mcp/applications/calendly/__init__.py +0 -0
  27. universal_mcp/applications/calendly/app.py +0 -1195
  28. universal_mcp/applications/clickup/README.md +0 -160
  29. universal_mcp/applications/clickup/__init__.py +0 -0
  30. universal_mcp/applications/clickup/app.py +0 -5009
  31. universal_mcp/applications/coda/README.md +0 -133
  32. universal_mcp/applications/coda/__init__.py +0 -0
  33. universal_mcp/applications/coda/app.py +0 -3671
  34. universal_mcp/applications/e2b/README.md +0 -37
  35. universal_mcp/applications/e2b/app.py +0 -65
  36. universal_mcp/applications/elevenlabs/README.md +0 -84
  37. universal_mcp/applications/elevenlabs/__init__.py +0 -0
  38. universal_mcp/applications/elevenlabs/app.py +0 -1402
  39. universal_mcp/applications/falai/README.md +0 -42
  40. universal_mcp/applications/falai/__init__.py +0 -0
  41. universal_mcp/applications/falai/app.py +0 -332
  42. universal_mcp/applications/figma/README.md +0 -74
  43. universal_mcp/applications/figma/__init__.py +0 -0
  44. universal_mcp/applications/figma/app.py +0 -1261
  45. universal_mcp/applications/firecrawl/README.md +0 -45
  46. universal_mcp/applications/firecrawl/app.py +0 -268
  47. universal_mcp/applications/github/README.md +0 -47
  48. universal_mcp/applications/github/app.py +0 -429
  49. universal_mcp/applications/gong/README.md +0 -88
  50. universal_mcp/applications/gong/__init__.py +0 -0
  51. universal_mcp/applications/gong/app.py +0 -2297
  52. universal_mcp/applications/google_calendar/app.py +0 -442
  53. universal_mcp/applications/google_docs/README.md +0 -40
  54. universal_mcp/applications/google_docs/app.py +0 -88
  55. universal_mcp/applications/google_drive/README.md +0 -44
  56. universal_mcp/applications/google_drive/app.py +0 -286
  57. universal_mcp/applications/google_mail/README.md +0 -47
  58. universal_mcp/applications/google_mail/app.py +0 -664
  59. universal_mcp/applications/google_sheet/README.md +0 -42
  60. universal_mcp/applications/google_sheet/app.py +0 -150
  61. universal_mcp/applications/hashnode/app.py +0 -81
  62. universal_mcp/applications/hashnode/prompt.md +0 -23
  63. universal_mcp/applications/heygen/README.md +0 -69
  64. universal_mcp/applications/heygen/__init__.py +0 -0
  65. universal_mcp/applications/heygen/app.py +0 -956
  66. universal_mcp/applications/mailchimp/README.md +0 -306
  67. universal_mcp/applications/mailchimp/__init__.py +0 -0
  68. universal_mcp/applications/mailchimp/app.py +0 -10937
  69. universal_mcp/applications/markitdown/app.py +0 -44
  70. universal_mcp/applications/notion/README.md +0 -55
  71. universal_mcp/applications/notion/__init__.py +0 -0
  72. universal_mcp/applications/notion/app.py +0 -527
  73. universal_mcp/applications/perplexity/README.md +0 -37
  74. universal_mcp/applications/perplexity/app.py +0 -65
  75. universal_mcp/applications/reddit/README.md +0 -45
  76. universal_mcp/applications/reddit/app.py +0 -379
  77. universal_mcp/applications/replicate/README.md +0 -65
  78. universal_mcp/applications/replicate/__init__.py +0 -0
  79. universal_mcp/applications/replicate/app.py +0 -980
  80. universal_mcp/applications/resend/README.md +0 -38
  81. universal_mcp/applications/resend/app.py +0 -37
  82. universal_mcp/applications/retell_ai/README.md +0 -46
  83. universal_mcp/applications/retell_ai/__init__.py +0 -0
  84. universal_mcp/applications/retell_ai/app.py +0 -333
  85. universal_mcp/applications/rocketlane/README.md +0 -42
  86. universal_mcp/applications/rocketlane/__init__.py +0 -0
  87. universal_mcp/applications/rocketlane/app.py +0 -194
  88. universal_mcp/applications/serpapi/README.md +0 -37
  89. universal_mcp/applications/serpapi/app.py +0 -73
  90. universal_mcp/applications/spotify/README.md +0 -116
  91. universal_mcp/applications/spotify/__init__.py +0 -0
  92. universal_mcp/applications/spotify/app.py +0 -2526
  93. universal_mcp/applications/supabase/README.md +0 -112
  94. universal_mcp/applications/supabase/__init__.py +0 -0
  95. universal_mcp/applications/supabase/app.py +0 -2970
  96. universal_mcp/applications/tavily/README.md +0 -38
  97. universal_mcp/applications/tavily/app.py +0 -51
  98. universal_mcp/applications/wrike/README.md +0 -71
  99. universal_mcp/applications/wrike/__init__.py +0 -0
  100. universal_mcp/applications/wrike/app.py +0 -1372
  101. universal_mcp/applications/youtube/README.md +0 -82
  102. universal_mcp/applications/youtube/__init__.py +0 -0
  103. universal_mcp/applications/youtube/app.py +0 -1428
  104. universal_mcp/applications/zenquotes/README.md +0 -37
  105. universal_mcp/applications/zenquotes/app.py +0 -31
  106. universal_mcp/integrations/agentr.py +0 -112
  107. universal_mcp-0.1.12.dist-info/RECORD +0 -119
  108. {universal_mcp-0.1.12.dist-info → universal_mcp-0.1.13rc2.dist-info}/WHEEL +0 -0
  109. {universal_mcp-0.1.12.dist-info → universal_mcp-0.1.13rc2.dist-info}/entry_points.txt +0 -0
@@ -1,1402 +0,0 @@
1
- from typing import Any
2
-
3
- from universal_mcp.applications import APIApplication
4
- from universal_mcp.integrations import Integration
5
-
6
-
7
- class ElevenlabsApp(APIApplication):
8
- def __init__(self, integration: Integration = None, **kwargs) -> None:
9
- super().__init__(name='elevenlabs', integration=integration, **kwargs)
10
- self.base_url = "https://api.elevenlabs.io"
11
-
12
- def _get_headers(self) -> dict[str, Any]:
13
- api_key = self.integration.get_credentials().get("api_key")
14
- return {
15
- "xi-api-key": f"{api_key}",
16
- "Content-Type": "application/json",
17
- "Accept": "application/json",
18
- }
19
-
20
- def get_generated_items_v1_history_get(self, page_size=None, start_after_history_item_id=None, voice_id=None) -> dict[str, Any]:
21
- """
22
- Retrieves a paginated history of generated items from the API, optionally filtered by page size, starting history item, or voice ID.
23
-
24
- Args:
25
- page_size: Optional; int. The maximum number of history items to return in one response.
26
- start_after_history_item_id: Optional; str. The ID of the history item after which to start retrieving results, used for pagination.
27
- voice_id: Optional; str. If specified, filters the history items to those generated using the given voice ID.
28
-
29
- Returns:
30
- dict[str, Any]: A dictionary representing the parsed JSON response containing the list of generated history items and associated metadata.
31
-
32
- Raises:
33
- requests.HTTPError: If the HTTP request to the API fails or an error status code is returned.
34
-
35
- Tags:
36
- get, history, list, api
37
- """
38
- url = f"{self.base_url}/v1/history"
39
- query_params = {k: v for k, v in [('page_size', page_size), ('start_after_history_item_id', start_after_history_item_id), ('voice_id', voice_id)] if v is not None}
40
- response = self._get(url, params=query_params)
41
- response.raise_for_status()
42
- return response.json()
43
-
44
- def get_history_item_by_id_v1_history__history_item_id__get(self, history_item_id) -> dict[str, Any]:
45
- """
46
- Retrieves a specific history item by its unique identifier.
47
-
48
- Args:
49
- history_item_id: str. The unique identifier of the history item to retrieve.
50
-
51
- Returns:
52
- dict. A dictionary containing the details of the requested history item.
53
-
54
- Raises:
55
- ValueError: Raised if 'history_item_id' is None.
56
- HTTPError: Raised if the HTTP request to retrieve the history item fails.
57
-
58
- Tags:
59
- get, history, item, fetch, api
60
- """
61
- if history_item_id is None:
62
- raise ValueError("Missing required parameter 'history_item_id'")
63
- url = f"{self.base_url}/v1/history/{history_item_id}"
64
- query_params = {}
65
- response = self._get(url, params=query_params)
66
- response.raise_for_status()
67
- return response.json()
68
-
69
- def delete_history_item_v1_history__history_item_id__delete(self, history_item_id) -> Any:
70
- """
71
- Deletes a specific history item by its unique identifier.
72
-
73
- Args:
74
- history_item_id: str. The unique identifier of the history item to delete.
75
-
76
- Returns:
77
- dict. The JSON response from the API after deleting the history item.
78
-
79
- Raises:
80
- ValueError: If 'history_item_id' is None.
81
- requests.HTTPError: If the HTTP request to delete the history item fails.
82
-
83
- Tags:
84
- delete, history, management, v1
85
- """
86
- if history_item_id is None:
87
- raise ValueError("Missing required parameter 'history_item_id'")
88
- url = f"{self.base_url}/v1/history/{history_item_id}"
89
- query_params = {}
90
- response = self._delete(url, params=query_params)
91
- response.raise_for_status()
92
- return response.json()
93
-
94
- def get_audio_from_history_item_v1_history__history_item_id__audio_get(self, history_item_id) -> Any:
95
- """
96
- Retrieves the audio data associated with a specific history item by its unique identifier.
97
-
98
- Args:
99
- history_item_id: str. The unique identifier of the history item whose audio data is to be retrieved.
100
-
101
- Returns:
102
- dict. The audio data for the specified history item, parsed from the JSON response.
103
-
104
- Raises:
105
- ValueError: If the 'history_item_id' parameter is None.
106
- requests.HTTPError: If the HTTP request to retrieve audio data fails (e.g., non-2xx status code).
107
-
108
- Tags:
109
- get, audio, history
110
- """
111
- if history_item_id is None:
112
- raise ValueError("Missing required parameter 'history_item_id'")
113
- url = f"{self.base_url}/v1/history/{history_item_id}/audio"
114
- query_params = {}
115
- response = self._get(url, params=query_params)
116
- response.raise_for_status()
117
- return response.json()
118
-
119
- def download_history_items_v1_history_download_post(self, history_item_ids, output_format=None) -> Any:
120
- """
121
- Downloads specified history items in the given output format via a POST request.
122
-
123
- Args:
124
- history_item_ids: List of identifiers for the history items to download. Must not be None.
125
- output_format: Optional; specifies the desired output format for the downloaded data (e.g., 'json', 'csv'). If not provided, a default format is used.
126
-
127
- Returns:
128
- A JSON-decoded response containing the downloaded history items in the requested format.
129
-
130
- Raises:
131
- ValueError: If 'history_item_ids' is None.
132
- HTTPError: If the HTTP request to the API fails or returns an error response.
133
-
134
- Tags:
135
- download, history, post, api
136
- """
137
- if history_item_ids is None:
138
- raise ValueError("Missing required parameter 'history_item_ids'")
139
- request_body = {
140
- 'history_item_ids': history_item_ids,
141
- 'output_format': output_format,
142
- }
143
- request_body = {k: v for k, v in request_body.items() if v is not None}
144
- url = f"{self.base_url}/v1/history/download"
145
- query_params = {}
146
- response = self._post(url, data=request_body, params=query_params)
147
- response.raise_for_status()
148
- return response.json()
149
-
150
- def delete_sample_v1_voices__voice_id__samples__sample_id__delete(self, voice_id, sample_id) -> Any:
151
- """
152
- Deletes a specific voice sample identified by voice_id and sample_id from the API.
153
-
154
- Args:
155
- voice_id: str. The unique identifier for the voice whose sample is to be deleted.
156
- sample_id: str. The unique identifier for the sample to be deleted.
157
-
158
- Returns:
159
- dict. The JSON response from the API after successful deletion of the sample.
160
-
161
- Raises:
162
- ValueError: Raised if either 'voice_id' or 'sample_id' is None.
163
- requests.HTTPError: Raised if the API response contains an HTTP error status.
164
-
165
- Tags:
166
- delete, voice, sample, api
167
- """
168
- if voice_id is None:
169
- raise ValueError("Missing required parameter 'voice_id'")
170
- if sample_id is None:
171
- raise ValueError("Missing required parameter 'sample_id'")
172
- url = f"{self.base_url}/v1/voices/{voice_id}/samples/{sample_id}"
173
- query_params = {}
174
- response = self._delete(url, params=query_params)
175
- response.raise_for_status()
176
- return response.json()
177
-
178
- def get_audio_from_sample_v1_voices__voice_id__samples__sample_id__audio_get(self, voice_id, sample_id) -> Any:
179
- """
180
- Retrieves audio data for a specific sample from a given voice using provided identifiers.
181
-
182
- Args:
183
- voice_id: The unique identifier of the voice whose sample audio is to be retrieved.
184
- sample_id: The unique identifier of the sample whose audio data is requested.
185
-
186
- Returns:
187
- A JSON-decoded object containing the audio data and metadata for the specified sample.
188
-
189
- Raises:
190
- ValueError: Raised if 'voice_id' or 'sample_id' is None.
191
- requests.HTTPError: Raised if the HTTP request to fetch the audio fails with a non-2xx status code.
192
-
193
- Tags:
194
- get, audio, sample, voice, api
195
- """
196
- if voice_id is None:
197
- raise ValueError("Missing required parameter 'voice_id'")
198
- if sample_id is None:
199
- raise ValueError("Missing required parameter 'sample_id'")
200
- url = f"{self.base_url}/v1/voices/{voice_id}/samples/{sample_id}/audio"
201
- query_params = {}
202
- response = self._get(url, params=query_params)
203
- response.raise_for_status()
204
- return response.json()
205
-
206
- def text_to_speech_v1_text_to_speech__voice_id__post(self, voice_id, text, optimize_streaming_latency=None, output_format=None, model_id=None, voice_settings=None, pronunciation_dictionary_locators=None, seed=None) -> Any:
207
- """
208
- Converts input text to speech using the specified voice configuration via a POST request to the text-to-speech API endpoint.
209
-
210
- Args:
211
- voice_id: str. The identifier of the voice to use for speech synthesis.
212
- text: str. The input text to be converted into speech.
213
- optimize_streaming_latency: Optional[int]. Controls streaming latency optimization; lower values may reduce initial playback delay.
214
- output_format: Optional[str]. Specifies the format of the returned audio (e.g., 'mp3', 'wav').
215
- model_id: Optional[str]. Identifier for the specific speech synthesis model to use.
216
- voice_settings: Optional[dict]. Additional settings for the selected voice, such as pitch or speed.
217
- pronunciation_dictionary_locators: Optional[list]. List of pronunciation dictionary locators to apply custom pronunciations.
218
- seed: Optional[int]. Seed value for deterministic speech synthesis output.
219
-
220
- Returns:
221
- dict. The JSON-decoded API response containing synthesized audio information or relevant metadata.
222
-
223
- Raises:
224
- ValueError: If 'voice_id' or 'text' is not provided.
225
- requests.HTTPError: If the HTTP request to the text-to-speech API fails or returns an unsuccessful status.
226
-
227
- Tags:
228
- text-to-speech, convert, api, voice, synthesis, ai, batch
229
- """
230
- if voice_id is None:
231
- raise ValueError("Missing required parameter 'voice_id'")
232
- if text is None:
233
- raise ValueError("Missing required parameter 'text'")
234
- request_body = {
235
- 'text': text,
236
- 'model_id': model_id,
237
- 'voice_settings': voice_settings,
238
- 'pronunciation_dictionary_locators': pronunciation_dictionary_locators,
239
- 'seed': seed,
240
- }
241
- request_body = {k: v for k, v in request_body.items() if v is not None}
242
- url = f"{self.base_url}/v1/text-to-speech/{voice_id}"
243
- query_params = {k: v for k, v in [('optimize_streaming_latency', optimize_streaming_latency), ('output_format', output_format)] if v is not None}
244
- response = self._post(url, data=request_body, params=query_params)
245
- response.raise_for_status()
246
- return response.json()
247
-
248
- def text_to_speech_v1_text_to_speech__voice_id__stream_post(self, voice_id, text, optimize_streaming_latency=None, output_format=None, model_id=None, voice_settings=None, pronunciation_dictionary_locators=None, seed=None) -> Any:
249
- """
250
- Streams synthesized speech audio for given text using a specified voice ID and customizable options.
251
-
252
- Args:
253
- voice_id: str. The unique identifier for the voice to synthesize speech with. Required.
254
- text: str. The input text to be converted to speech. Required.
255
- optimize_streaming_latency: Optional[int]. Optimization level for audio streaming latency. If provided, adjusts streaming performance.
256
- output_format: Optional[str]. Desired audio output format (e.g., 'mp3', 'wav').
257
- model_id: Optional[str]. Specific speech synthesis model ID to use.
258
- voice_settings: Optional[dict]. Additional settings for the selected voice (e.g., pitch, speed).
259
- pronunciation_dictionary_locators: Optional[List[str]]. List of pronunciation dictionary locators for custom pronunciations.
260
- seed: Optional[int]. Random seed for generating non-deterministic voice outputs.
261
-
262
- Returns:
263
- dict. The API's JSON response containing metadata about the speech synthesis stream and possibly streaming URLs or audio data.
264
-
265
- Raises:
266
- ValueError: Raised if 'voice_id' or 'text' is not provided.
267
- requests.HTTPError: Raised if the API request fails with an HTTP error response.
268
-
269
- Tags:
270
- text-to-speech, stream, ai, synthesize, voice, api
271
- """
272
- if voice_id is None:
273
- raise ValueError("Missing required parameter 'voice_id'")
274
- if text is None:
275
- raise ValueError("Missing required parameter 'text'")
276
- request_body = {
277
- 'text': text,
278
- 'model_id': model_id,
279
- 'voice_settings': voice_settings,
280
- 'pronunciation_dictionary_locators': pronunciation_dictionary_locators,
281
- 'seed': seed,
282
- }
283
- request_body = {k: v for k, v in request_body.items() if v is not None}
284
- url = f"{self.base_url}/v1/text-to-speech/{voice_id}/stream"
285
- query_params = {k: v for k, v in [('optimize_streaming_latency', optimize_streaming_latency), ('output_format', output_format)] if v is not None}
286
- response = self._post(url, data=request_body, params=query_params)
287
- response.raise_for_status()
288
- return response.json()
289
-
290
- def voice_generation_parameters_v1_voice_generation_generate_voice_parameters_get(self, ) -> dict[str, Any]:
291
- """
292
- Retrieves available parameter options for voice generation from the API.
293
-
294
- Args:
295
- None: This function takes no arguments
296
-
297
- Returns:
298
- A dictionary containing supported parameters and options for the voice generation endpoint.
299
-
300
- Raises:
301
- requests.HTTPError: If the HTTP request to the API fails or an error response is returned.
302
-
303
- Tags:
304
- fetch, parameters, voice-generation, api
305
- """
306
- url = f"{self.base_url}/v1/voice-generation/generate-voice/parameters"
307
- query_params = {}
308
- response = self._get(url, params=query_params)
309
- response.raise_for_status()
310
- return response.json()
311
-
312
- def generate_a_random_voice_v1_voice_generation_generate_voice_post(self, gender, accent, age, accent_strength, text) -> Any:
313
- """
314
- Generates a synthetic voice audio based on specified demographics and text input by sending a POST request to the voice generation API.
315
-
316
- Args:
317
- gender: str. The gender for the generated voice (e.g., 'male', 'female'). Required.
318
- accent: str. The accent to apply to the synthesized voice (e.g., 'british', 'american'). Required.
319
- age: str or int. The age or age group for the generated voice. Required.
320
- accent_strength: str or float. The intensity of the accent in the output voice. Required.
321
- text: str. The text to be converted into synthetic speech. Required.
322
-
323
- Returns:
324
- dict. The JSON response containing the generated voice data and any related metadata.
325
-
326
- Raises:
327
- ValueError: If any of the required parameters ('gender', 'accent', 'age', 'accent_strength', or 'text') is None.
328
- requests.HTTPError: If the API request fails with an HTTP error status.
329
-
330
- Tags:
331
- generate, voice, ai, post
332
- """
333
- if gender is None:
334
- raise ValueError("Missing required parameter 'gender'")
335
- if accent is None:
336
- raise ValueError("Missing required parameter 'accent'")
337
- if age is None:
338
- raise ValueError("Missing required parameter 'age'")
339
- if accent_strength is None:
340
- raise ValueError("Missing required parameter 'accent_strength'")
341
- if text is None:
342
- raise ValueError("Missing required parameter 'text'")
343
- request_body = {
344
- 'gender': gender,
345
- 'accent': accent,
346
- 'age': age,
347
- 'accent_strength': accent_strength,
348
- 'text': text,
349
- }
350
- request_body = {k: v for k, v in request_body.items() if v is not None}
351
- url = f"{self.base_url}/v1/voice-generation/generate-voice"
352
- query_params = {}
353
- response = self._post(url, data=request_body, params=query_params)
354
- response.raise_for_status()
355
- return response.json()
356
-
357
- def create_a_previously_generated_voice_v1_voice_generation_create_voice_post(self, voice_name, voice_description, generated_voice_id, labels=None) -> dict[str, Any]:
358
- """
359
- Creates a new voice entry using data from a previously generated voice.
360
-
361
- Args:
362
- voice_name: str. The display name for the new voice. Must not be None.
363
- voice_description: str. A textual description of the new voice. Must not be None.
364
- generated_voice_id: str. The unique identifier of the previously generated voice to use as a template. Must not be None.
365
- labels: Optional[dict]. Additional metadata or labels to associate with the voice. Defaults to None.
366
-
367
- Returns:
368
- dict. The server's JSON response containing information about the created voice.
369
-
370
- Raises:
371
- ValueError: Raised if any of the required parameters ('voice_name', 'voice_description', or 'generated_voice_id') are None.
372
- requests.HTTPError: Raised if the HTTP request to the voice-generation API fails (non-2xx response).
373
-
374
- Tags:
375
- create, voice, ai, api
376
- """
377
- if voice_name is None:
378
- raise ValueError("Missing required parameter 'voice_name'")
379
- if voice_description is None:
380
- raise ValueError("Missing required parameter 'voice_description'")
381
- if generated_voice_id is None:
382
- raise ValueError("Missing required parameter 'generated_voice_id'")
383
- request_body = {
384
- 'voice_name': voice_name,
385
- 'voice_description': voice_description,
386
- 'generated_voice_id': generated_voice_id,
387
- 'labels': labels,
388
- }
389
- request_body = {k: v for k, v in request_body.items() if v is not None}
390
- url = f"{self.base_url}/v1/voice-generation/create-voice"
391
- query_params = {}
392
- response = self._post(url, data=request_body, params=query_params)
393
- response.raise_for_status()
394
- return response.json()
395
-
396
- def get_user_subscription_info_v1_user_subscription_get(self, ) -> dict[str, Any]:
397
- """
398
- Retrieves the current user's subscription information from the API.
399
-
400
- Args:
401
- None: This function takes no arguments
402
-
403
- Returns:
404
- A dictionary containing the user's subscription details as returned by the API.
405
-
406
- Raises:
407
- requests.HTTPError: If the HTTP request to retrieve subscription information fails or returns an error status code.
408
-
409
- Tags:
410
- get, subscription, user, api
411
- """
412
- url = f"{self.base_url}/v1/user/subscription"
413
- query_params = {}
414
- response = self._get(url, params=query_params)
415
- response.raise_for_status()
416
- return response.json()
417
-
418
- def get_user_info_v1_user_get(self, ) -> dict[str, Any]:
419
- """
420
- Retrieves information about the current authenticated user from the API.
421
-
422
- Args:
423
- None: This function takes no arguments
424
-
425
- Returns:
426
- A dictionary containing user details as returned by the API.
427
-
428
- Raises:
429
- requests.HTTPError: If the HTTP request to the user information endpoint fails or returns a non-success status code.
430
-
431
- Tags:
432
- get, user, info, api, important
433
- """
434
- url = f"{self.base_url}/v1/user"
435
- query_params = {}
436
- response = self._get(url, params=query_params)
437
- response.raise_for_status()
438
- return response.json()
439
-
440
- def get_voices_v1_voices_get(self, ) -> dict[str, Any]:
441
- """
442
- Retrieves a list of available voices from the v1 API endpoint.
443
-
444
- Args:
445
- None: This function takes no arguments
446
-
447
- Returns:
448
- dict: A dictionary containing information about the available voices as returned by the API.
449
-
450
- Raises:
451
- requests.HTTPError: Raised if the API response contains an HTTP error status.
452
-
453
- Tags:
454
- get, voices, api, list
455
- """
456
- url = f"{self.base_url}/v1/voices"
457
- query_params = {}
458
- response = self._get(url, params=query_params)
459
- response.raise_for_status()
460
- return response.json()
461
-
462
- def get_default_voice_settings__v1_voices_settings_default_get(self, ) -> dict[str, Any]:
463
- """
464
- Retrieves the default voice settings from the API endpoint.
465
-
466
- Returns:
467
- A dictionary containing the default voice settings as returned by the API.
468
-
469
- Raises:
470
- requests.HTTPError: If the HTTP request returned an unsuccessful status code.
471
-
472
- Tags:
473
- get, voice-settings, api, fetch
474
- """
475
- url = f"{self.base_url}/v1/voices/settings/default"
476
- query_params = {}
477
- response = self._get(url, params=query_params)
478
- response.raise_for_status()
479
- return response.json()
480
-
481
- def get_voice_settings_v1_voices__voice_id__settings_get(self, voice_id) -> dict[str, Any]:
482
- """
483
- Retrieves the settings for a specific voice using the provided voice ID.
484
-
485
- Args:
486
- voice_id: str. The unique identifier of the voice for which to fetch settings.
487
-
488
- Returns:
489
- dict. The settings of the specified voice, parsed from the service response.
490
-
491
- Raises:
492
- ValueError: If 'voice_id' is None.
493
- requests.exceptions.HTTPError: If the HTTP request to fetch settings fails (non-2xx response).
494
-
495
- Tags:
496
- get, voice-settings, ai
497
- """
498
- if voice_id is None:
499
- raise ValueError("Missing required parameter 'voice_id'")
500
- url = f"{self.base_url}/v1/voices/{voice_id}/settings"
501
- query_params = {}
502
- response = self._get(url, params=query_params)
503
- response.raise_for_status()
504
- return response.json()
505
-
506
- def get_voice_v1_voices__voice_id__get(self, voice_id, with_settings=None) -> dict[str, Any]:
507
- """
508
- Retrieves details for a specific voice, optionally including voice settings, by making a GET request to the API.
509
-
510
- Args:
511
- voice_id: str. Unique identifier of the voice to retrieve. Must not be None.
512
- with_settings: Optional[bool]. If True, include voice settings in the response. Defaults to None, meaning settings are not included.
513
-
514
- Returns:
515
- dict[str, Any]: A dictionary containing voice details as returned by the API.
516
-
517
- Raises:
518
- ValueError: Raised if 'voice_id' is None.
519
- requests.HTTPError: Raised if the HTTP request to the API fails or returns an error response.
520
-
521
- Tags:
522
- get, voice, api, management
523
- """
524
- if voice_id is None:
525
- raise ValueError("Missing required parameter 'voice_id'")
526
- url = f"{self.base_url}/v1/voices/{voice_id}"
527
- query_params = {k: v for k, v in [('with_settings', with_settings)] if v is not None}
528
- response = self._get(url, params=query_params)
529
- response.raise_for_status()
530
- return response.json()
531
-
532
- def delete_voice_v1_voices__voice_id__delete(self, voice_id) -> Any:
533
- """
534
- Deletes a voice resource identified by the given voice ID using the v1 API endpoint.
535
-
536
- Args:
537
- voice_id: str. Unique identifier of the voice resource to be deleted.
538
-
539
- Returns:
540
- dict. Response data from the API after attempting to delete the voice resource.
541
-
542
- Raises:
543
- ValueError: Raised if the 'voice_id' parameter is None.
544
- requests.HTTPError: Raised if the HTTP request to delete the voice fails with an unsuccessful status code.
545
-
546
- Tags:
547
- delete, voice-management, api
548
- """
549
- if voice_id is None:
550
- raise ValueError("Missing required parameter 'voice_id'")
551
- url = f"{self.base_url}/v1/voices/{voice_id}"
552
- query_params = {}
553
- response = self._delete(url, params=query_params)
554
- response.raise_for_status()
555
- return response.json()
556
-
557
- def add_sharing_voice_v1_voices_add__public_user_id___voice_id__post(self, public_user_id, voice_id, new_name) -> dict[str, Any]:
558
- """
559
- Adds a shared voice for a public user by sending a POST request with a new name for the specified voice.
560
-
561
- Args:
562
- public_user_id: str. The public user identifier to whom the voice will be shared.
563
- voice_id: str. The unique identifier of the voice to add.
564
- new_name: str. The new name to assign to the shared voice.
565
-
566
- Returns:
567
- dict[str, Any]: The JSON response from the server containing details about the shared voice addition.
568
-
569
- Raises:
570
- ValueError: Raised if any of the required parameters ('public_user_id', 'voice_id', or 'new_name') are None.
571
- requests.HTTPError: Raised if the HTTP request to the server returns an unsuccessful status code.
572
-
573
- Tags:
574
- add, sharing, voice, api, post, management
575
- """
576
- if public_user_id is None:
577
- raise ValueError("Missing required parameter 'public_user_id'")
578
- if voice_id is None:
579
- raise ValueError("Missing required parameter 'voice_id'")
580
- if new_name is None:
581
- raise ValueError("Missing required parameter 'new_name'")
582
- request_body = {
583
- 'new_name': new_name,
584
- }
585
- request_body = {k: v for k, v in request_body.items() if v is not None}
586
- url = f"{self.base_url}/v1/voices/add/{public_user_id}/{voice_id}"
587
- query_params = {}
588
- response = self._post(url, data=request_body, params=query_params)
589
- response.raise_for_status()
590
- return response.json()
591
-
592
- def get_projects_v1_projects_get(self, ) -> dict[str, Any]:
593
- """
594
- Retrieves a list of projects from the API using a GET request to the '/v1/projects' endpoint.
595
-
596
- Returns:
597
- A dictionary containing the JSON-decoded response from the API, typically representing a list of projects.
598
-
599
- Raises:
600
- requests.HTTPError: If the HTTP request to the projects API endpoint fails or returns an unsuccessful status code.
601
-
602
- Tags:
603
- get, list, projects, api, management
604
- """
605
- url = f"{self.base_url}/v1/projects"
606
- query_params = {}
607
- response = self._get(url, params=query_params)
608
- response.raise_for_status()
609
- return response.json()
610
-
611
- def get_project_by_id_v1_projects__project_id__get(self, project_id) -> dict[str, Any]:
612
- """
613
- Retrieve project details by project ID using the v1 projects API.
614
-
615
- Args:
616
- project_id: str. The unique identifier of the project to retrieve.
617
-
618
- Returns:
619
- dict[str, Any]: A dictionary containing the project's details as returned by the API.
620
-
621
- Raises:
622
- ValueError: If 'project_id' is None.
623
- HTTPError: If the HTTP request to the API fails with a non-success status code.
624
-
625
- Tags:
626
- get, project, management, api
627
- """
628
- if project_id is None:
629
- raise ValueError("Missing required parameter 'project_id'")
630
- url = f"{self.base_url}/v1/projects/{project_id}"
631
- query_params = {}
632
- response = self._get(url, params=query_params)
633
- response.raise_for_status()
634
- return response.json()
635
-
636
- def delete_project_v1_projects__project_id__delete(self, project_id) -> Any:
637
- """
638
- Deletes a project by its ID using a DELETE HTTP request to the v1/projects endpoint.
639
-
640
- Args:
641
- project_id: The unique identifier of the project to be deleted. Must not be None.
642
-
643
- Returns:
644
- dict: The JSON response from the API after successful deletion of the project.
645
-
646
- Raises:
647
- ValueError: If 'project_id' is None.
648
- requests.HTTPError: If the API response contains an unsuccessful HTTP status code.
649
-
650
- Tags:
651
- delete, project, api, management
652
- """
653
- if project_id is None:
654
- raise ValueError("Missing required parameter 'project_id'")
655
- url = f"{self.base_url}/v1/projects/{project_id}"
656
- query_params = {}
657
- response = self._delete(url, params=query_params)
658
- response.raise_for_status()
659
- return response.json()
660
-
661
- def convert_project_v1_projects__project_id__convert_post(self, project_id) -> Any:
662
- """
663
- Converts the specified project by sending a POST request to the appropriate API endpoint.
664
-
665
- Args:
666
- project_id: The unique identifier of the project to convert. Must not be None.
667
-
668
- Returns:
669
- A dictionary containing the JSON response from the API after converting the project.
670
-
671
- Raises:
672
- ValueError: If 'project_id' is None.
673
- requests.HTTPError: If the API response contains an unsuccessful HTTP status code.
674
-
675
- Tags:
676
- convert, project, api, post
677
- """
678
- if project_id is None:
679
- raise ValueError("Missing required parameter 'project_id'")
680
- url = f"{self.base_url}/v1/projects/{project_id}/convert"
681
- query_params = {}
682
- response = self._post(url, data={}, params=query_params)
683
- response.raise_for_status()
684
- return response.json()
685
-
686
- def get_project_snapshots_v1_projects__project_id__snapshots_get(self, project_id) -> dict[str, Any]:
687
- """
688
- Retrieves a list of snapshots for the specified project using the v1 projects API.
689
-
690
- Args:
691
- project_id: str. Unique identifier of the project for which snapshots are to be fetched.
692
-
693
- Returns:
694
- dict[str, Any]: The JSON response containing snapshot information for the given project.
695
-
696
- Raises:
697
- ValueError: If project_id is None.
698
- requests.HTTPError: If the HTTP request to the API endpoint results in an error status code.
699
-
700
- Tags:
701
- get, list, snapshots, project-management, api
702
- """
703
- if project_id is None:
704
- raise ValueError("Missing required parameter 'project_id'")
705
- url = f"{self.base_url}/v1/projects/{project_id}/snapshots"
706
- query_params = {}
707
- response = self._get(url, params=query_params)
708
- response.raise_for_status()
709
- return response.json()
710
-
711
- def stream_project_audio_v1_projects__project_id__snapshots__project_snapshot_id__stream_post(self, project_id, project_snapshot_id, convert_to_mpeg=None) -> Any:
712
- """
713
- Streams audio data for a specific project snapshot, with optional conversion to MPEG format.
714
-
715
- Args:
716
- project_id: str. The unique identifier of the project whose audio snapshot is to be streamed.
717
- project_snapshot_id: str. The unique identifier of the project snapshot to stream audio from.
718
- convert_to_mpeg: Optional[bool]. If True, converts the audio stream to MPEG format before streaming. Defaults to None.
719
-
720
- Returns:
721
- dict. The JSON response containing the streamed audio data or relevant streaming metadata from the server.
722
-
723
- Raises:
724
- ValueError: Raised if 'project_id' or 'project_snapshot_id' is not provided.
725
- requests.HTTPError: Raised if the HTTP request to the streaming endpoint fails.
726
-
727
- Tags:
728
- stream, audio, project, snapshot, post
729
- """
730
- if project_id is None:
731
- raise ValueError("Missing required parameter 'project_id'")
732
- if project_snapshot_id is None:
733
- raise ValueError("Missing required parameter 'project_snapshot_id'")
734
- request_body = {
735
- 'convert_to_mpeg': convert_to_mpeg,
736
- }
737
- request_body = {k: v for k, v in request_body.items() if v is not None}
738
- url = f"{self.base_url}/v1/projects/{project_id}/snapshots/{project_snapshot_id}/stream"
739
- query_params = {}
740
- response = self._post(url, data=request_body, params=query_params)
741
- response.raise_for_status()
742
- return response.json()
743
-
744
- def streams_archive_with_project_audio_v1_projects__project_id__snapshots__project_snapshot_id__archive_post(self, project_id, project_snapshot_id) -> Any:
745
- """
746
- Creates an audio archive for the specified project snapshot by making a POST request to the project's archive endpoint.
747
-
748
- Args:
749
- project_id: The unique identifier of the project for which the snapshot archive is to be created.
750
- project_snapshot_id: The unique identifier of the project snapshot to archive.
751
-
752
- Returns:
753
- A dictionary containing the response data from the archive creation request.
754
-
755
- Raises:
756
- ValueError: Raised if 'project_id' or 'project_snapshot_id' is None.
757
- requests.HTTPError: Raised if the HTTP request to the archive endpoint returns an unsuccessful status code.
758
-
759
- Tags:
760
- archive, post, ai, management
761
- """
762
- if project_id is None:
763
- raise ValueError("Missing required parameter 'project_id'")
764
- if project_snapshot_id is None:
765
- raise ValueError("Missing required parameter 'project_snapshot_id'")
766
- url = f"{self.base_url}/v1/projects/{project_id}/snapshots/{project_snapshot_id}/archive"
767
- query_params = {}
768
- response = self._post(url, data={}, params=query_params)
769
- response.raise_for_status()
770
- return response.json()
771
-
772
- def get_chapters_v1_projects__project_id__chapters_get(self, project_id) -> dict[str, Any]:
773
- """
774
- Retrieves the list of chapters for a specific project by project ID.
775
-
776
- Args:
777
- project_id: The unique identifier of the project whose chapters are to be fetched.
778
-
779
- Returns:
780
- A dictionary representing the JSON response containing the project's chapters.
781
-
782
- Raises:
783
- ValueError: Raised if 'project_id' is None.
784
- requests.HTTPError: Raised if the HTTP request to the API endpoint fails.
785
-
786
- Tags:
787
- get, chapters, project, api
788
- """
789
- if project_id is None:
790
- raise ValueError("Missing required parameter 'project_id'")
791
- url = f"{self.base_url}/v1/projects/{project_id}/chapters"
792
- query_params = {}
793
- response = self._get(url, params=query_params)
794
- response.raise_for_status()
795
- return response.json()
796
-
797
- def get_chapter_by_id_v1_projects__project_id__chapters__chapter_id__get(self, project_id, chapter_id) -> dict[str, Any]:
798
- """
799
- Retrieves a specific chapter resource by its ID from a given project using the API.
800
-
801
- Args:
802
- project_id: The unique identifier of the project containing the desired chapter.
803
- chapter_id: The unique identifier of the chapter to retrieve.
804
-
805
- Returns:
806
- A dictionary containing the chapter data as returned by the API.
807
-
808
- Raises:
809
- ValueError: Raised if either 'project_id' or 'chapter_id' is None.
810
- HTTPError: Raised if the HTTP request to the API fails or returns an error status.
811
-
812
- Tags:
813
- get, chapter, project, api
814
- """
815
- if project_id is None:
816
- raise ValueError("Missing required parameter 'project_id'")
817
- if chapter_id is None:
818
- raise ValueError("Missing required parameter 'chapter_id'")
819
- url = f"{self.base_url}/v1/projects/{project_id}/chapters/{chapter_id}"
820
- query_params = {}
821
- response = self._get(url, params=query_params)
822
- response.raise_for_status()
823
- return response.json()
824
-
825
- def delete_chapter_v1_projects__project_id__chapters__chapter_id__delete(self, project_id, chapter_id) -> Any:
826
- """
827
- Deletes a specific chapter from a project by its project and chapter IDs.
828
-
829
- Args:
830
- project_id: The unique identifier of the project containing the chapter to delete.
831
- chapter_id: The unique identifier of the chapter to delete from the project.
832
-
833
- Returns:
834
- The response body as a dictionary representing the result of the deletion operation.
835
-
836
- Raises:
837
- ValueError: If either 'project_id' or 'chapter_id' is None.
838
- requests.HTTPError: If the HTTP request fails or returns an unsuccessful status code.
839
-
840
- Tags:
841
- delete, chapter, project-management, api
842
- """
843
- if project_id is None:
844
- raise ValueError("Missing required parameter 'project_id'")
845
- if chapter_id is None:
846
- raise ValueError("Missing required parameter 'chapter_id'")
847
- url = f"{self.base_url}/v1/projects/{project_id}/chapters/{chapter_id}"
848
- query_params = {}
849
- response = self._delete(url, params=query_params)
850
- response.raise_for_status()
851
- return response.json()
852
-
853
- def convert_chapter_v1_projects__project_id__chapters__chapter_id__convert_post(self, project_id, chapter_id) -> Any:
854
- """
855
- Initiates a conversion operation for a specified chapter within a project and returns the result as JSON.
856
-
857
- Args:
858
- project_id: The unique identifier of the project containing the chapter to convert.
859
- chapter_id: The unique identifier of the chapter within the project to be converted.
860
-
861
- Returns:
862
- A JSON object containing the result of the chapter conversion operation.
863
-
864
- Raises:
865
- ValueError: Raised if 'project_id' or 'chapter_id' is not provided.
866
- requests.HTTPError: Raised if the POST request to the conversion endpoint fails.
867
-
868
- Tags:
869
- convert, chapter, post, api, async-job
870
- """
871
- if project_id is None:
872
- raise ValueError("Missing required parameter 'project_id'")
873
- if chapter_id is None:
874
- raise ValueError("Missing required parameter 'chapter_id'")
875
- url = f"{self.base_url}/v1/projects/{project_id}/chapters/{chapter_id}/convert"
876
- query_params = {}
877
- response = self._post(url, data={}, params=query_params)
878
- response.raise_for_status()
879
- return response.json()
880
-
881
- def get_chapter_snapshots_v1_projects__project_id__chapters__chapter_id__snapshots_get(self, project_id, chapter_id) -> dict[str, Any]:
882
- """
883
- Retrieves the list of chapter snapshots for a specific chapter within a project.
884
-
885
- Args:
886
- project_id: The unique identifier of the project containing the chapter.
887
- chapter_id: The unique identifier of the chapter whose snapshots are to be retrieved.
888
-
889
- Returns:
890
- A dictionary containing the snapshot data for the specified chapter.
891
-
892
- Raises:
893
- ValueError: Raised if either 'project_id' or 'chapter_id' is None.
894
- HTTPError: Raised if the HTTP request to retrieve snapshots fails.
895
-
896
- Tags:
897
- get, list, snapshots, project-management, chapter
898
- """
899
- if project_id is None:
900
- raise ValueError("Missing required parameter 'project_id'")
901
- if chapter_id is None:
902
- raise ValueError("Missing required parameter 'chapter_id'")
903
- url = f"{self.base_url}/v1/projects/{project_id}/chapters/{chapter_id}/snapshots"
904
- query_params = {}
905
- response = self._get(url, params=query_params)
906
- response.raise_for_status()
907
- return response.json()
908
-
909
- def stream_chapter_audio_v1_projects__project_id__chapters__chapter_id__snapshots__chapter_snapshot_id__stream_post(self, project_id, chapter_id, chapter_snapshot_id, convert_to_mpeg=None) -> Any:
910
- """
911
- Streams the audio for a specific chapter snapshot in a project, with optional conversion to MPEG format.
912
-
913
- Args:
914
- project_id: str. Unique identifier of the project containing the chapter.
915
- chapter_id: str. Identifier of the chapter whose audio is to be streamed.
916
- chapter_snapshot_id: str. Identifier of the chapter snapshot to stream audio from.
917
- convert_to_mpeg: bool, optional. If True, converts the audio stream to MPEG format before returning.
918
-
919
- Returns:
920
- dict. JSON response containing audio stream details or metadata.
921
-
922
- Raises:
923
- ValueError: If any of the required parameters ('project_id', 'chapter_id', or 'chapter_snapshot_id') are missing.
924
- requests.HTTPError: If the HTTP request to the audio streaming endpoint fails.
925
-
926
- Tags:
927
- stream, audio, chapter, project, ai
928
- """
929
- if project_id is None:
930
- raise ValueError("Missing required parameter 'project_id'")
931
- if chapter_id is None:
932
- raise ValueError("Missing required parameter 'chapter_id'")
933
- if chapter_snapshot_id is None:
934
- raise ValueError("Missing required parameter 'chapter_snapshot_id'")
935
- request_body = {
936
- 'convert_to_mpeg': convert_to_mpeg,
937
- }
938
- request_body = {k: v for k, v in request_body.items() if v is not None}
939
- url = f"{self.base_url}/v1/projects/{project_id}/chapters/{chapter_id}/snapshots/{chapter_snapshot_id}/stream"
940
- query_params = {}
941
- response = self._post(url, data=request_body, params=query_params)
942
- response.raise_for_status()
943
- return response.json()
944
-
945
- def update_pronunciation_dictionaries_v1_projects__project_id__update_pronunciation_dictionaries_post(self, project_id, pronunciation_dictionary_locators) -> Any:
946
- """
947
- Updates the pronunciation dictionaries for a specific project by sending the provided dictionary locators to the server.
948
-
949
- Args:
950
- project_id: str. The unique identifier of the project whose pronunciation dictionaries are to be updated.
951
- pronunciation_dictionary_locators: Any. The locators or references to the pronunciation dictionaries that should be updated for the project.
952
-
953
- Returns:
954
- Any. The JSON-decoded response from the server after updating the pronunciation dictionaries.
955
-
956
- Raises:
957
- ValueError: Raised if 'project_id' or 'pronunciation_dictionary_locators' is None.
958
- requests.HTTPError: Raised if the server responds with an unsuccessful HTTP status code.
959
-
960
- Tags:
961
- update, pronunciation-dictionaries, project-management, api-call
962
- """
963
- if project_id is None:
964
- raise ValueError("Missing required parameter 'project_id'")
965
- if pronunciation_dictionary_locators is None:
966
- raise ValueError("Missing required parameter 'pronunciation_dictionary_locators'")
967
- request_body = {
968
- 'pronunciation_dictionary_locators': pronunciation_dictionary_locators,
969
- }
970
- request_body = {k: v for k, v in request_body.items() if v is not None}
971
- url = f"{self.base_url}/v1/projects/{project_id}/update-pronunciation-dictionaries"
972
- query_params = {}
973
- response = self._post(url, data=request_body, params=query_params)
974
- response.raise_for_status()
975
- return response.json()
976
-
977
- def get_dubbing_project_metadata_v1_dubbing__dubbing_id__get(self, dubbing_id) -> dict[str, Any]:
978
- """
979
- Retrieves metadata for a dubbing project by its unique identifier.
980
-
981
- Args:
982
- dubbing_id: str. The unique identifier of the dubbing project to retrieve metadata for.
983
-
984
- Returns:
985
- dict[str, Any]: A dictionary containing metadata of the specified dubbing project.
986
-
987
- Raises:
988
- ValueError: If 'dubbing_id' is None.
989
- requests.HTTPError: If the HTTP request to fetch metadata fails.
990
-
991
- Tags:
992
- get, fetch, dubbing, metadata, api
993
- """
994
- if dubbing_id is None:
995
- raise ValueError("Missing required parameter 'dubbing_id'")
996
- url = f"{self.base_url}/v1/dubbing/{dubbing_id}"
997
- query_params = {}
998
- response = self._get(url, params=query_params)
999
- response.raise_for_status()
1000
- return response.json()
1001
-
1002
- def delete_dubbing_project_v1_dubbing__dubbing_id__delete(self, dubbing_id) -> Any:
1003
- """
1004
- Deletes a dubbing project identified by its ID via the v1 API endpoint.
1005
-
1006
- Args:
1007
- dubbing_id: The unique identifier of the dubbing project to delete.
1008
-
1009
- Returns:
1010
- A dictionary parsed from the JSON response indicating the result of the deletion operation.
1011
-
1012
- Raises:
1013
- ValueError: If 'dubbing_id' is None.
1014
- requests.HTTPError: If the HTTP request to delete the dubbing project fails (non-success status code).
1015
-
1016
- Tags:
1017
- delete, dubbing, api, management
1018
- """
1019
- if dubbing_id is None:
1020
- raise ValueError("Missing required parameter 'dubbing_id'")
1021
- url = f"{self.base_url}/v1/dubbing/{dubbing_id}"
1022
- query_params = {}
1023
- response = self._delete(url, params=query_params)
1024
- response.raise_for_status()
1025
- return response.json()
1026
-
1027
- def get_dubbed_file_v1_dubbing__dubbing_id__audio__language_code__get(self, dubbing_id, language_code) -> Any:
1028
- """
1029
- Retrieves the dubbed audio file for a given dubbing ID and language code from the API.
1030
-
1031
- Args:
1032
- dubbing_id: The unique identifier of the dubbing resource to fetch. Must not be None.
1033
- language_code: The language code (e.g., 'en', 'es') of the audio file to retrieve. Must not be None.
1034
-
1035
- Returns:
1036
- dict: The JSON response containing the dubbed audio file metadata and/or download information.
1037
-
1038
- Raises:
1039
- ValueError: Raised if either 'dubbing_id' or 'language_code' is None.
1040
- HTTPError: Raised if the HTTP request to the API fails with an unsuccessful status code.
1041
-
1042
- Tags:
1043
- get, audio, dubbing, api
1044
- """
1045
- if dubbing_id is None:
1046
- raise ValueError("Missing required parameter 'dubbing_id'")
1047
- if language_code is None:
1048
- raise ValueError("Missing required parameter 'language_code'")
1049
- url = f"{self.base_url}/v1/dubbing/{dubbing_id}/audio/{language_code}"
1050
- query_params = {}
1051
- response = self._get(url, params=query_params)
1052
- response.raise_for_status()
1053
- return response.json()
1054
-
1055
- def get_transcript_for_dub_v1_dubbing__dubbing_id__transcript__language_code__get(self, dubbing_id, language_code) -> Any:
1056
- """
1057
- Retrieves the transcript for a specific dubbing in the requested language.
1058
-
1059
- Args:
1060
- dubbing_id: The unique identifier of the dubbing for which to fetch the transcript.
1061
- language_code: The language code (e.g., 'en', 'es') for the desired transcript.
1062
-
1063
- Returns:
1064
- The transcript data as parsed from the API response, typically a dictionary or list depending on the API.
1065
-
1066
- Raises:
1067
- ValueError: If 'dubbing_id' or 'language_code' is not provided.
1068
- requests.HTTPError: If the HTTP request to fetch the transcript fails.
1069
-
1070
- Tags:
1071
- get, transcript, dubbing, api
1072
- """
1073
- if dubbing_id is None:
1074
- raise ValueError("Missing required parameter 'dubbing_id'")
1075
- if language_code is None:
1076
- raise ValueError("Missing required parameter 'language_code'")
1077
- url = f"{self.base_url}/v1/dubbing/{dubbing_id}/transcript/{language_code}"
1078
- query_params = {}
1079
- response = self._get(url, params=query_params)
1080
- response.raise_for_status()
1081
- return response.json()
1082
-
1083
- def get_sso_provider_admin_admin__admin_url_prefix__sso_provider_get(self, admin_url_prefix, workspace_id) -> dict[str, Any]:
1084
- """
1085
- Retrieves SSO provider information for a specific admin URL prefix and workspace.
1086
-
1087
- Args:
1088
- admin_url_prefix: str. The URL prefix identifying the admin scope for the SSO provider.
1089
- workspace_id: str. The ID of the workspace for which to retrieve SSO provider information.
1090
-
1091
- Returns:
1092
- dict. A dictionary containing the SSO provider information for the specified workspace and admin URL prefix.
1093
-
1094
- Raises:
1095
- ValueError: Raised if either 'admin_url_prefix' or 'workspace_id' is None.
1096
- requests.HTTPError: Raised if the HTTP request to retrieve SSO provider information fails.
1097
-
1098
- Tags:
1099
- get, sso-provider, admin, management
1100
- """
1101
- if admin_url_prefix is None:
1102
- raise ValueError("Missing required parameter 'admin_url_prefix'")
1103
- if workspace_id is None:
1104
- raise ValueError("Missing required parameter 'workspace_id'")
1105
- url = f"{self.base_url}/admin/{admin_url_prefix}/sso-provider"
1106
- query_params = {k: v for k, v in [('workspace_id', workspace_id)] if v is not None}
1107
- response = self._get(url, params=query_params)
1108
- response.raise_for_status()
1109
- return response.json()
1110
-
1111
- def get_models_v1_models_get(self, ) -> list[Any]:
1112
- """
1113
- Retrieves a list of available models from the v1 API endpoint.
1114
-
1115
- Args:
1116
- None: This function takes no arguments
1117
-
1118
- Returns:
1119
- A list containing model information retrieved from the API.
1120
-
1121
- Raises:
1122
- requests.HTTPError: If the HTTP request to the models endpoint returns an unsuccessful status code.
1123
-
1124
- Tags:
1125
- get, models, ai, api, list
1126
- """
1127
- url = f"{self.base_url}/v1/models"
1128
- query_params = {}
1129
- response = self._get(url, params=query_params)
1130
- response.raise_for_status()
1131
- return response.json()
1132
-
1133
- def get_voices_v1_shared_voices_get(self, page_size=None, category=None, gender=None, age=None, accent=None, language=None, search=None, use_cases=None, descriptives=None, featured=None, reader_app_enabled=None, owner_id=None, sort=None, page=None) -> dict[str, Any]:
1134
- """
1135
- Retrieves a list of shared voice resources, filtered and paginated according to the specified criteria.
1136
-
1137
- Args:
1138
- page_size: Optional; The number of voice results to return per page.
1139
- category: Optional; Filter voices by category (e.g., audiobook, narration, commercial).
1140
- gender: Optional; Filter voices by gender (e.g., male, female, neutral).
1141
- age: Optional; Filter voices by age group (e.g., child, adult, senior).
1142
- accent: Optional; Filter voices by accent or dialect.
1143
- language: Optional; Filter voices by language code or name.
1144
- search: Optional; Search query string to match against voice names or descriptions.
1145
- use_cases: Optional; Filter voices by specific use cases.
1146
- descriptives: Optional; Filter voices by descriptive attributes (e.g., warm, energetic).
1147
- featured: Optional; Filter to only featured voices if True.
1148
- reader_app_enabled: Optional; Filter voices available in the reader app.
1149
- owner_id: Optional; Filter voices by the owner's identifier.
1150
- sort: Optional; Sort order for returned voices (e.g., by relevance or name).
1151
- page: Optional; The page number for paginated results.
1152
-
1153
- Returns:
1154
- A dictionary containing metadata and a list of shared voice resources matching the provided filters.
1155
-
1156
- Raises:
1157
- requests.HTTPError: If the HTTP request to fetch shared voices fails or returns a non-success status code.
1158
-
1159
- Tags:
1160
- get, list, voices, filter, pagination, batch, ai
1161
- """
1162
- url = f"{self.base_url}/v1/shared-voices"
1163
- query_params = {k: v for k, v in [('page_size', page_size), ('category', category), ('gender', gender), ('age', age), ('accent', accent), ('language', language), ('search', search), ('use_cases', use_cases), ('descriptives', descriptives), ('featured', featured), ('reader_app_enabled', reader_app_enabled), ('owner_id', owner_id), ('sort', sort), ('page', page)] if v is not None}
1164
- response = self._get(url, params=query_params)
1165
- response.raise_for_status()
1166
- return response.json()
1167
-
1168
- def add_rules_to_the_pronunciation_dictionary_v1_pronunciation_dictionaries__pronunciation_dictionary_id__add_rules_post(self, pronunciation_dictionary_id, rules) -> dict[str, Any]:
1169
- """
1170
- Adds new pronunciation rules to a specified pronunciation dictionary by making a POST request to the backend service.
1171
-
1172
- Args:
1173
- pronunciation_dictionary_id: The unique identifier of the pronunciation dictionary to which the rules will be added.
1174
- rules: A list or collection of pronunciation rules to be added to the dictionary.
1175
-
1176
- Returns:
1177
- A dictionary containing the server's response data after attempting to add the specified rules.
1178
-
1179
- Raises:
1180
- ValueError: Raised if 'pronunciation_dictionary_id' or 'rules' is None.
1181
- requests.HTTPError: Raised if the POST request to the backend service fails due to a bad HTTP response.
1182
-
1183
- Tags:
1184
- add, rules, pronunciation-dictionary, post, api, management
1185
- """
1186
- if pronunciation_dictionary_id is None:
1187
- raise ValueError("Missing required parameter 'pronunciation_dictionary_id'")
1188
- if rules is None:
1189
- raise ValueError("Missing required parameter 'rules'")
1190
- request_body = {
1191
- 'rules': rules,
1192
- }
1193
- request_body = {k: v for k, v in request_body.items() if v is not None}
1194
- url = f"{self.base_url}/v1/pronunciation-dictionaries/{pronunciation_dictionary_id}/add-rules"
1195
- query_params = {}
1196
- response = self._post(url, data=request_body, params=query_params)
1197
- response.raise_for_status()
1198
- return response.json()
1199
-
1200
- def remove_rules_from_the_pronunciation_dictionary_v1_pronunciation_dictionaries__pronunciation_dictionary_id__remove_rules_post(self, pronunciation_dictionary_id, rule_strings) -> dict[str, Any]:
1201
- """
1202
- Removes specified pronunciation rules from a pronunciation dictionary via a POST request to the API.
1203
-
1204
- Args:
1205
- pronunciation_dictionary_id: str. The unique identifier of the pronunciation dictionary from which to remove rules.
1206
- rule_strings: list[str]. A list of pronunciation rule strings to be removed from the dictionary.
1207
-
1208
- Returns:
1209
- dict[str, Any]: A dictionary containing the API response data after removing the rules.
1210
-
1211
- Raises:
1212
- ValueError: Raised when 'pronunciation_dictionary_id' or 'rule_strings' is None.
1213
- requests.HTTPError: Raised if the API request fails or returns a non-success status code.
1214
-
1215
- Tags:
1216
- remove, pronunciation, dictionary, rules, api, post, management
1217
- """
1218
- if pronunciation_dictionary_id is None:
1219
- raise ValueError("Missing required parameter 'pronunciation_dictionary_id'")
1220
- if rule_strings is None:
1221
- raise ValueError("Missing required parameter 'rule_strings'")
1222
- request_body = {
1223
- 'rule_strings': rule_strings,
1224
- }
1225
- request_body = {k: v for k, v in request_body.items() if v is not None}
1226
- url = f"{self.base_url}/v1/pronunciation-dictionaries/{pronunciation_dictionary_id}/remove-rules"
1227
- query_params = {}
1228
- response = self._post(url, data=request_body, params=query_params)
1229
- response.raise_for_status()
1230
- return response.json()
1231
-
1232
- def get_pls_file_with_a_pronunciation_dictionary_version_rules_v1_pronunciation_dictionaries__dictionary_id___version_id__download_get(self, dictionary_id, version_id) -> Any:
1233
- """
1234
- Downloads a pronunciation lexicon (PLS) file for a specific pronunciation dictionary version.
1235
-
1236
- Args:
1237
- dictionary_id: The unique identifier of the pronunciation dictionary to download.
1238
- version_id: The specific version identifier of the pronunciation dictionary.
1239
-
1240
- Returns:
1241
- A dictionary containing the JSON response data of the downloaded PLS file.
1242
-
1243
- Raises:
1244
- ValueError: Raised if 'dictionary_id' or 'version_id' is None.
1245
- HTTPError: Raised if the HTTP request for the PLS file results in a failed status code.
1246
-
1247
- Tags:
1248
- download, pronunciation-dictionary, get, ai
1249
- """
1250
- if dictionary_id is None:
1251
- raise ValueError("Missing required parameter 'dictionary_id'")
1252
- if version_id is None:
1253
- raise ValueError("Missing required parameter 'version_id'")
1254
- url = f"{self.base_url}/v1/pronunciation-dictionaries/{dictionary_id}/{version_id}/download"
1255
- query_params = {}
1256
- response = self._get(url, params=query_params)
1257
- response.raise_for_status()
1258
- return response.json()
1259
-
1260
- def get_metadata_for_a_pronunciation_dictionary_v1_pronunciation_dictionaries__pronunciation_dictionary_id___get(self, pronunciation_dictionary_id) -> dict[str, Any]:
1261
- """
1262
- Retrieves metadata for a specific pronunciation dictionary by its ID.
1263
-
1264
- Args:
1265
- pronunciation_dictionary_id: The unique identifier of the pronunciation dictionary to retrieve metadata for.
1266
-
1267
- Returns:
1268
- A dictionary containing the metadata of the specified pronunciation dictionary.
1269
-
1270
- Raises:
1271
- ValueError: If 'pronunciation_dictionary_id' is None.
1272
- requests.HTTPError: If the HTTP request to retrieve the metadata fails with a non-success status.
1273
-
1274
- Tags:
1275
- get, pronunciation-dictionary, metadata, api
1276
- """
1277
- if pronunciation_dictionary_id is None:
1278
- raise ValueError("Missing required parameter 'pronunciation_dictionary_id'")
1279
- url = f"{self.base_url}/v1/pronunciation-dictionaries/{pronunciation_dictionary_id}/"
1280
- query_params = {}
1281
- response = self._get(url, params=query_params)
1282
- response.raise_for_status()
1283
- return response.json()
1284
-
1285
- def get_pronunciation_dictionaries_v1_pronunciation_dictionaries__get(self, cursor=None, page_size=None) -> dict[str, Any]:
1286
- """
1287
- Retrieve a paginated list of pronunciation dictionaries from the v1 API endpoint.
1288
-
1289
- Args:
1290
- cursor: Optional; a string used for pagination, indicating the position to continue retrieving results from.
1291
- page_size: Optional; an integer specifying the maximum number of pronunciation dictionaries to return in one page.
1292
-
1293
- Returns:
1294
- A dictionary containing the response data from the pronunciation dictionaries API, typically including results and pagination information.
1295
-
1296
- Raises:
1297
- requests.HTTPError: Raised if the HTTP request to the API fails or returns an error response status code.
1298
-
1299
- Tags:
1300
- get, list, pronunciation-dictionaries, api, pagination
1301
- """
1302
- url = f"{self.base_url}/v1/pronunciation-dictionaries/"
1303
- query_params = {k: v for k, v in [('cursor', cursor), ('page_size', page_size)] if v is not None}
1304
- response = self._get(url, params=query_params)
1305
- response.raise_for_status()
1306
- return response.json()
1307
-
1308
- def get_a_profile_page_profile__handle__get(self, handle) -> dict[str, Any]:
1309
- """
1310
- Retrieves a user's profile data as a dictionary using their unique handle.
1311
-
1312
- Args:
1313
- handle: str. The unique identifier for the user profile to retrieve.
1314
-
1315
- Returns:
1316
- dict[str, Any]: A dictionary containing the user's profile data returned by the API.
1317
-
1318
- Raises:
1319
- ValueError: If 'handle' is None.
1320
- requests.exceptions.HTTPError: If the HTTP request returned an unsuccessful status code.
1321
-
1322
- Tags:
1323
- get, profile, api, user-data
1324
- """
1325
- if handle is None:
1326
- raise ValueError("Missing required parameter 'handle'")
1327
- url = f"{self.base_url}/profile/{handle}"
1328
- query_params = {}
1329
- response = self._get(url, params=query_params)
1330
- response.raise_for_status()
1331
- return response.json()
1332
-
1333
- def redirect_to_mintlify_docs_get(self, ) -> Any:
1334
- """
1335
- Fetches the Mintlify documentation by sending a GET request and returns the parsed JSON response.
1336
-
1337
- Returns:
1338
- dict: Parsed JSON content from the Mintlify documentation endpoint.
1339
-
1340
- Raises:
1341
- requests.HTTPError: If the HTTP request to the Mintlify documentation endpoint fails (i.e., a non-success status code is returned).
1342
-
1343
- Tags:
1344
- get, docs, mintlify, api
1345
- """
1346
- url = f"{self.base_url}/docs"
1347
- query_params = {}
1348
- response = self._get(url, params=query_params)
1349
- response.raise_for_status()
1350
- return response.json()
1351
-
1352
- def list_tools(self):
1353
- return [
1354
- self.get_generated_items_v1_history_get,
1355
- self.get_history_item_by_id_v1_history__history_item_id__get,
1356
- self.delete_history_item_v1_history__history_item_id__delete,
1357
- self.get_audio_from_history_item_v1_history__history_item_id__audio_get,
1358
- self.download_history_items_v1_history_download_post,
1359
- self.delete_sample_v1_voices__voice_id__samples__sample_id__delete,
1360
- self.get_audio_from_sample_v1_voices__voice_id__samples__sample_id__audio_get,
1361
- self.text_to_speech_v1_text_to_speech__voice_id__post,
1362
- self.text_to_speech_v1_text_to_speech__voice_id__stream_post,
1363
- self.voice_generation_parameters_v1_voice_generation_generate_voice_parameters_get,
1364
- self.generate_a_random_voice_v1_voice_generation_generate_voice_post,
1365
- self.create_a_previously_generated_voice_v1_voice_generation_create_voice_post,
1366
- self.get_user_subscription_info_v1_user_subscription_get,
1367
- self.get_user_info_v1_user_get,
1368
- self.get_voices_v1_voices_get,
1369
- self.get_default_voice_settings__v1_voices_settings_default_get,
1370
- self.get_voice_settings_v1_voices__voice_id__settings_get,
1371
- self.get_voice_v1_voices__voice_id__get,
1372
- self.delete_voice_v1_voices__voice_id__delete,
1373
- self.add_sharing_voice_v1_voices_add__public_user_id___voice_id__post,
1374
- self.get_projects_v1_projects_get,
1375
- self.get_project_by_id_v1_projects__project_id__get,
1376
- self.delete_project_v1_projects__project_id__delete,
1377
- self.convert_project_v1_projects__project_id__convert_post,
1378
- self.get_project_snapshots_v1_projects__project_id__snapshots_get,
1379
- self.stream_project_audio_v1_projects__project_id__snapshots__project_snapshot_id__stream_post,
1380
- self.streams_archive_with_project_audio_v1_projects__project_id__snapshots__project_snapshot_id__archive_post,
1381
- self.get_chapters_v1_projects__project_id__chapters_get,
1382
- self.get_chapter_by_id_v1_projects__project_id__chapters__chapter_id__get,
1383
- self.delete_chapter_v1_projects__project_id__chapters__chapter_id__delete,
1384
- self.convert_chapter_v1_projects__project_id__chapters__chapter_id__convert_post,
1385
- self.get_chapter_snapshots_v1_projects__project_id__chapters__chapter_id__snapshots_get,
1386
- self.stream_chapter_audio_v1_projects__project_id__chapters__chapter_id__snapshots__chapter_snapshot_id__stream_post,
1387
- self.update_pronunciation_dictionaries_v1_projects__project_id__update_pronunciation_dictionaries_post,
1388
- self.get_dubbing_project_metadata_v1_dubbing__dubbing_id__get,
1389
- self.delete_dubbing_project_v1_dubbing__dubbing_id__delete,
1390
- self.get_dubbed_file_v1_dubbing__dubbing_id__audio__language_code__get,
1391
- self.get_transcript_for_dub_v1_dubbing__dubbing_id__transcript__language_code__get,
1392
- self.get_sso_provider_admin_admin__admin_url_prefix__sso_provider_get,
1393
- self.get_models_v1_models_get,
1394
- self.get_voices_v1_shared_voices_get,
1395
- self.add_rules_to_the_pronunciation_dictionary_v1_pronunciation_dictionaries__pronunciation_dictionary_id__add_rules_post,
1396
- self.remove_rules_from_the_pronunciation_dictionary_v1_pronunciation_dictionaries__pronunciation_dictionary_id__remove_rules_post,
1397
- self.get_pls_file_with_a_pronunciation_dictionary_version_rules_v1_pronunciation_dictionaries__dictionary_id___version_id__download_get,
1398
- self.get_metadata_for_a_pronunciation_dictionary_v1_pronunciation_dictionaries__pronunciation_dictionary_id___get,
1399
- self.get_pronunciation_dictionaries_v1_pronunciation_dictionaries__get,
1400
- self.get_a_profile_page_profile__handle__get,
1401
- self.redirect_to_mintlify_docs_get
1402
- ]