introvoyz045 commited on
Commit
9410704
·
verified ·
1 Parent(s): 9bb0027

Migrated from GitHub

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. data/.fern/metadata.json +60 -0
  2. data/.fern/replay.lock +0 -0
  3. data/.fernignore +29 -0
  4. data/AGENTS.md +7 -0
  5. data/LICENSE +21 -0
  6. data/README.md +431 -0
  7. data/poetry.lock +970 -0
  8. data/pyproject.toml +97 -0
  9. data/reference.md +0 -0
  10. data/requirements.txt +7 -0
  11. data/src/elevenlabs/__init__.py +0 -0
  12. data/src/elevenlabs/assets/__init__.py +4 -0
  13. data/src/elevenlabs/assets/client.py +367 -0
  14. data/src/elevenlabs/assets/raw_client.py +498 -0
  15. data/src/elevenlabs/audio_effects/__init__.py +4 -0
  16. data/src/elevenlabs/audio_effects/client.py +104 -0
  17. data/src/elevenlabs/audio_effects/raw_client.py +126 -0
  18. data/src/elevenlabs/audio_isolation/__init__.py +37 -0
  19. data/src/elevenlabs/audio_isolation/client.py +348 -0
  20. data/src/elevenlabs/audio_isolation/raw_client.py +580 -0
  21. data/src/elevenlabs/audio_isolation/types/__init__.py +38 -0
  22. data/src/elevenlabs/audio_isolation/types/audio_isolation_request_file_format.py +5 -0
  23. data/src/elevenlabs/audio_isolation/types/audio_isolation_stream_request_file_format.py +5 -0
  24. data/src/elevenlabs/audio_native/__init__.py +34 -0
  25. data/src/elevenlabs/audio_native/client.py +555 -0
  26. data/src/elevenlabs/audio_native/raw_client.py +712 -0
  27. data/src/elevenlabs/audio_native/types/__init__.py +36 -0
  28. data/src/elevenlabs/audio_native/types/audio_native_create_request_apply_text_normalization.py +7 -0
  29. data/src/elevenlabs/base_client.py +774 -0
  30. data/src/elevenlabs/client.py +175 -0
  31. data/src/elevenlabs/conversational_ai/__init__.py +253 -0
  32. data/src/elevenlabs/conversational_ai/agents/__init__.py +84 -0
  33. data/src/elevenlabs/conversational_ai/agents/branches/__init__.py +4 -0
  34. data/src/elevenlabs/conversational_ai/agents/branches/client.py +1052 -0
  35. data/src/elevenlabs/conversational_ai/agents/branches/raw_client.py +1294 -0
  36. data/src/elevenlabs/conversational_ai/agents/client.py +1510 -0
  37. data/src/elevenlabs/conversational_ai/agents/deployments/__init__.py +4 -0
  38. data/src/elevenlabs/conversational_ai/agents/deployments/client.py +269 -0
  39. data/src/elevenlabs/conversational_ai/agents/deployments/raw_client.py +309 -0
  40. data/src/elevenlabs/conversational_ai/agents/drafts/__init__.py +4 -0
  41. data/src/elevenlabs/conversational_ai/agents/drafts/client.py +467 -0
  42. data/src/elevenlabs/conversational_ai/agents/drafts/raw_client.py +351 -0
  43. data/src/elevenlabs/conversational_ai/agents/hold_audio/__init__.py +4 -0
  44. data/src/elevenlabs/conversational_ai/agents/hold_audio/client.py +201 -0
  45. data/src/elevenlabs/conversational_ai/agents/hold_audio/raw_client.py +264 -0
  46. data/src/elevenlabs/conversational_ai/agents/knowledge_base/__init__.py +4 -0
  47. data/src/elevenlabs/conversational_ai/agents/knowledge_base/client.py +112 -0
  48. data/src/elevenlabs/conversational_ai/agents/knowledge_base/raw_client.py +131 -0
  49. data/src/elevenlabs/conversational_ai/agents/link/__init__.py +4 -0
  50. data/src/elevenlabs/conversational_ai/agents/link/client.py +114 -0
data/.fern/metadata.json ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cliVersion": "5.146.2",
3
+ "generatorName": "fernapi/fern-python-sdk",
4
+ "generatorVersion": "4.64.1",
5
+ "generatorConfig": {
6
+ "timeout_in_seconds": 240,
7
+ "default_bytes_stream_chunk_size": 1024,
8
+ "inline_request_params": false,
9
+ "follow_redirects_by_default": true,
10
+ "recursion_limit": 10000,
11
+ "pydantic_config": {
12
+ "skip_validation": true
13
+ },
14
+ "client": {
15
+ "class_name": "BaseElevenLabs",
16
+ "filename": "base_client.py",
17
+ "exported_class_name": "ElevenLabs",
18
+ "exported_filename": "client.py"
19
+ },
20
+ "extra_dependencies": {
21
+ "requests": ">=2.20",
22
+ "websockets": ">=13.0",
23
+ "pyaudio": {
24
+ "version": ">=0.2.14",
25
+ "optional": true
26
+ }
27
+ },
28
+ "extra_dev_dependencies": {
29
+ "types-pyaudio": "^0.2.16.20240516"
30
+ },
31
+ "extras": {
32
+ "pyaudio": [
33
+ "pyaudio"
34
+ ]
35
+ },
36
+ "additional_init_exports": [
37
+ {
38
+ "from": "play",
39
+ "imports": [
40
+ "play",
41
+ "save",
42
+ "stream"
43
+ ]
44
+ },
45
+ {
46
+ "from": "realtime",
47
+ "imports": [
48
+ "RealtimeEvents",
49
+ "RealtimeAudioOptions",
50
+ "RealtimeUrlOptions",
51
+ "AudioFormat",
52
+ "CommitStrategy",
53
+ "RealtimeConnection"
54
+ ]
55
+ }
56
+ ]
57
+ },
58
+ "originGitCommit": "54b8c672ac5673b901df1e2603f9a98de8eb15fd",
59
+ "sdkVersion": "2.74.0"
60
+ }
data/.fern/replay.lock ADDED
The diff for this file is too large to render. See raw diff
 
data/.fernignore ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Specify files that shouldn't be modified by Fern
2
+
3
+ # Ignore manually created SDK wrappers
4
+ src/elevenlabs/client.py
5
+ src/elevenlabs/conversational_ai/conversation.py
6
+ src/elevenlabs/conversational_ai/default_audio_interface.py
7
+ src/elevenlabs/realtime_tts.py
8
+ src/elevenlabs/play.py
9
+ src/elevenlabs/webhooks_custom.py
10
+ src/elevenlabs/music_custom.py
11
+ src/elevenlabs/speech_to_text_custom.py
12
+ src/elevenlabs/url_utils.py
13
+ src/elevenlabs/realtime/
14
+ src/elevenlabs/speech_engine/
15
+ src/elevenlabs/speech_engine_custom.py
16
+ src/elevenlabs/flows_custom.py
17
+
18
+ # Ignore CI files
19
+ .github/
20
+
21
+ README.md
22
+ AGENTS.md
23
+ assets/
24
+
25
+ # Ignore custom tests
26
+ tests/
27
+ .fern/replay.lock
28
+ .fern/replay.yml
29
+ .gitattributes
data/AGENTS.md ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ # Agent Instructions
2
+
3
+ ## Fern-generated code
4
+
5
+ Most of the source code in this repository is auto-generated by [Fern](https://buildwithfern.com/). Only files listed in `.fernignore` are hand-maintained and safe to edit. **Do not modify files outside of `.fernignore`** — they will be overwritten on the next regeneration. Always check `.fernignore` before editing any file.
6
+
7
+ When fixing build issues caused by Fern regeneration, always fix the hand-maintained wrapper files to adapt to the new generated code — never patch the generated files directly.
data/LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Elevenlabs.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,431 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ElevenLabs Python Library
2
+
3
+ ![LOGO](https://github.com/elevenlabs/elevenlabs-python/assets/12028621/21267d89-5e82-4e7e-9c81-caf30b237683)
4
+
5
+ [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-SDK%20generated%20by%20Fern-brightgreen)](https://buildwithfern.com/?utm_source=fern-elevenlabs/elevenlabs-python/readme)
6
+ [![Discord](https://badgen.net/badge/black/ElevenLabs/icon?icon=discord&label)](https://discord.gg/elevenlabs)
7
+ [![Twitter](https://badgen.net/badge/black/elevenlabsio/icon?icon=twitter&label)](https://twitter.com/elevenlabsio)
8
+ [![PyPI - Python Version](https://img.shields.io/pypi/v/elevenlabs?style=flat&colorA=black&colorB=black)](https://pypi.org/project/elevenlabs/)
9
+ [![Downloads](https://static.pepy.tech/personalized-badge/elevenlabs?period=total&units=international_system&left_color=black&right_color=black&left_text=Downloads)](https://pepy.tech/project/elevenlabs)
10
+
11
+ The official Python SDK for [ElevenLabs](https://elevenlabs.io/). ElevenLabs brings the most compelling, rich and lifelike voices to creators and developers in just a few lines of code.
12
+
13
+ ## 📖 API & Docs
14
+
15
+ Check out the [HTTP API documentation](https://elevenlabs.io/docs/api-reference).
16
+
17
+ ## Install
18
+
19
+ ```bash
20
+ pip install elevenlabs
21
+ ```
22
+
23
+ ## Usage
24
+
25
+ ### Main Models
26
+
27
+ 1. **Eleven v3** (`eleven_v3`)
28
+ - Dramatic delivery and performances
29
+ - 70+ languages supported
30
+ - Supported for natural multi-speaker dialogue
31
+
32
+ 2. **Eleven Multilingual v2** (`eleven_multilingual_v2`)
33
+
34
+ - Excels in stability, language diversity, and accent accuracy
35
+ - Supports 29 languages
36
+ - Recommended for most use cases
37
+
38
+ 3. **Eleven Flash v2.5** (`eleven_flash_v2_5`)
39
+
40
+ - Ultra-low latency
41
+ - Supports 32 languages
42
+ - Faster model, 50% lower price per character
43
+
44
+ 4. **Eleven Turbo v2.5** (`eleven_turbo_v2_5`)
45
+
46
+ - Good balance of quality and latency
47
+ - Ideal for developer use cases where speed is crucial
48
+ - Supports 32 languages
49
+
50
+ For more detailed information about these models and others, visit the [ElevenLabs Models documentation](https://elevenlabs.io/docs/models).
51
+
52
+ ```py
53
+ from dotenv import load_dotenv
54
+ from elevenlabs.client import ElevenLabs
55
+ from elevenlabs.play import play
56
+
57
+ load_dotenv()
58
+
59
+ elevenlabs = ElevenLabs()
60
+
61
+ audio = elevenlabs.text_to_speech.convert(
62
+ text="The first move is what sets everything in motion.",
63
+ voice_id="JBFqnCBsd6RMkjVDRZzb",
64
+ model_id="eleven_v3",
65
+ output_format="mp3_44100_128",
66
+ )
67
+
68
+ play(audio)
69
+ ```
70
+
71
+ <details> <summary> Play </summary>
72
+
73
+ 🎧 **Try it out!** Want to hear our voices in action? Visit the [ElevenLabs Voice Lab](https://elevenlabs.io/voice-lab) to experiment with different voices, languages, and settings.
74
+
75
+ </details>
76
+
77
+ ## Voices
78
+
79
+ List all your available voices with `search()`.
80
+
81
+ ```py
82
+ from elevenlabs.client import ElevenLabs
83
+
84
+ elevenlabs = ElevenLabs(
85
+ api_key="YOUR_API_KEY",
86
+ )
87
+
88
+ response = elevenlabs.voices.search()
89
+ print(response.voices)
90
+ ```
91
+
92
+ For information about the structure of the voices output, please refer to the [official ElevenLabs API documentation for Get Voices](https://elevenlabs.io/docs/api-reference/get-voices).
93
+
94
+ Build a voice object with custom settings to personalize the voice style, or call
95
+ `elevenlabs.voices.settings.get("your-voice-id")` to get the default settings for the voice.
96
+
97
+ </details>
98
+
99
+ ## Clone Voice
100
+
101
+ Clone your voice in an instant. Note that voice cloning requires an API key, see below.
102
+
103
+ ```py
104
+ from elevenlabs.client import ElevenLabs
105
+ from elevenlabs.play import play
106
+
107
+ elevenlabs = ElevenLabs(
108
+ api_key="YOUR_API_KEY",
109
+ )
110
+
111
+ voice = elevenlabs.voices.ivc.create(
112
+ name="Alex",
113
+ description="An old American male voice with a slight hoarseness in his throat. Perfect for news", # Optional
114
+ files=["./sample_0.mp3", "./sample_1.mp3", "./sample_2.mp3"],
115
+ )
116
+ ```
117
+
118
+ ## Streaming
119
+
120
+ Stream audio in real-time, as it's being generated.
121
+
122
+ ```py
123
+ from elevenlabs import stream
124
+ from elevenlabs.client import ElevenLabs
125
+
126
+ elevenlabs = ElevenLabs(
127
+ api_key="YOUR_API_KEY",
128
+ )
129
+
130
+ audio_stream = elevenlabs.text_to_speech.stream(
131
+ text="This is a test",
132
+ voice_id="JBFqnCBsd6RMkjVDRZzb",
133
+ model_id="eleven_multilingual_v2"
134
+ )
135
+
136
+ # option 1: play the streamed audio locally
137
+ stream(audio_stream)
138
+
139
+ # option 2: process the audio bytes manually
140
+ for chunk in audio_stream:
141
+ if isinstance(chunk, bytes):
142
+ print(chunk)
143
+
144
+ ```
145
+
146
+ ## Async Client
147
+
148
+ Use `AsyncElevenLabs` if you want to make API calls asynchronously.
149
+
150
+ ```python
151
+ import asyncio
152
+
153
+ from elevenlabs.client import AsyncElevenLabs
154
+
155
+ elevenlabs = AsyncElevenLabs(
156
+ api_key="MY_API_KEY"
157
+ )
158
+
159
+ async def print_models() -> None:
160
+ models = await elevenlabs.models.list()
161
+ print(models)
162
+
163
+ asyncio.run(print_models())
164
+ ```
165
+
166
+ ## ElevenAgents
167
+
168
+ Build interactive AI agents with real-time audio capabilities using ElevenAgents.
169
+
170
+ ### Basic Usage
171
+
172
+ ```python
173
+ from elevenlabs.client import ElevenLabs
174
+ from elevenlabs.conversational_ai.conversation import Conversation, ClientTools
175
+ from elevenlabs.conversational_ai.default_audio_interface import DefaultAudioInterface
176
+
177
+ elevenlabs = ElevenLabs(
178
+ api_key="YOUR_API_KEY",
179
+ )
180
+
181
+ # Create audio interface for real-time audio input/output
182
+ audio_interface = DefaultAudioInterface()
183
+
184
+ # Create conversation
185
+ conversation = Conversation(
186
+ client=elevenlabs,
187
+ agent_id="your-agent-id",
188
+ requires_auth=True,
189
+ audio_interface=audio_interface,
190
+ )
191
+
192
+ # Start the conversation
193
+ conversation.start_session()
194
+
195
+ # The conversation runs in background until you call:
196
+ conversation.end_session()
197
+ ```
198
+
199
+ ### Custom Event Loop Support
200
+
201
+ For advanced use cases involving context propagation, resource reuse, or specific event loop management, `ClientTools` supports custom asyncio event loops:
202
+
203
+ ```python
204
+ import asyncio
205
+ from elevenlabs.conversational_ai.conversation import ClientTools
206
+
207
+ elevenlabs = ElevenLabs(
208
+ api_key="YOUR_API_KEY",
209
+ )
210
+
211
+ async def main():
212
+ # Get the current event loop
213
+ custom_loop = asyncio.get_running_loop()
214
+
215
+ # Create ClientTools with custom loop to prevent "different event loop" errors
216
+ client_tools = ClientTools(loop=custom_loop)
217
+
218
+ # Register your tools
219
+ async def get_weather(params):
220
+ location = params.get("location", "Unknown")
221
+ # Your async logic here
222
+ return f"Weather in {location}: Sunny, 72°F"
223
+
224
+ client_tools.register("get_weather", get_weather, is_async=True)
225
+
226
+ # Use with conversation
227
+ conversation = Conversation(
228
+ client=elevenlabs,
229
+ agent_id="your-agent-id",
230
+ requires_auth=True,
231
+ audio_interface=audio_interface,
232
+ client_tools=client_tools
233
+ )
234
+
235
+ asyncio.run(main())
236
+ ```
237
+
238
+ **Benefits of Custom Event Loop:**
239
+ - **Context Propagation**: Maintain request-scoped state across async operations
240
+ - **Resource Reuse**: Share existing async resources like HTTP sessions or database pools
241
+ - **Loop Management**: Prevent "Task got Future attached to a different event loop" errors
242
+ - **Performance**: Better control over async task scheduling and execution
243
+
244
+ **Important:** When using a custom loop, you're responsible for its lifecycle
245
+ Don't close the loop while ClientTools are still using it.
246
+
247
+ ### Tool Registration
248
+
249
+ Register custom tools that the AI agent can call during conversations:
250
+
251
+ ```python
252
+ client_tools = ClientTools()
253
+
254
+ # Sync tool
255
+ def calculate_sum(params):
256
+ numbers = params.get("numbers", [])
257
+ return sum(numbers)
258
+
259
+ # Async tool
260
+ async def fetch_data(params):
261
+ url = params.get("url")
262
+ # Your async HTTP request logic
263
+ return {"data": "fetched"}
264
+
265
+ client_tools.register("calculate_sum", calculate_sum, is_async=False)
266
+ client_tools.register("fetch_data", fetch_data, is_async=True)
267
+ ```
268
+
269
+ ## Speech Engine
270
+
271
+ Speech Engine lets you build server-side voice agents that receive real-time transcripts from the ElevenLabs API and stream LLM responses back for text-to-speech synthesis. Your server acts as a WebSocket endpoint — ElevenLabs connects to it, sends user transcripts, and your code decides how to respond.
272
+
273
+ Speech Engine is async-only and available on `AsyncElevenLabs`.
274
+
275
+ ### Quick Start
276
+
277
+ ```python
278
+ import asyncio
279
+ from openai import AsyncOpenAI
280
+ from elevenlabs import AsyncElevenLabs
281
+
282
+ openai_client = AsyncOpenAI()
283
+ elevenlabs = AsyncElevenLabs()
284
+
285
+ async def main():
286
+ engine = await elevenlabs.speech_engine.get("seng_123")
287
+
288
+ async def on_transcript(transcript, session):
289
+ stream = await openai_client.responses.create(
290
+ model="gpt-4o",
291
+ input=[
292
+ {"role": "assistant" if m.role == "agent" else m.role, "content": m.content}
293
+ for m in transcript
294
+ ],
295
+ stream=True,
296
+ )
297
+ await session.send_response(stream)
298
+
299
+ async def on_init(conversation_id, session):
300
+ print(f"Session started: {conversation_id}")
301
+
302
+ async def on_close(session):
303
+ print(f"Session ended: {session.conversation_id}")
304
+
305
+ async def on_error(err, session):
306
+ print(f"Error: {err}")
307
+
308
+ await engine.serve(
309
+ port=3001,
310
+ debug=True,
311
+ on_init=on_init,
312
+ on_transcript=on_transcript,
313
+ on_close=on_close,
314
+ on_error=on_error,
315
+ )
316
+
317
+ asyncio.run(main())
318
+ ```
319
+
320
+ ### How It Works
321
+
322
+ When `engine.serve()` starts, it opens a WebSocket server on the specified port. For each incoming connection from the ElevenLabs API:
323
+
324
+ 1. An `init` message arrives with a `conversation_id`
325
+ 2. As the user speaks, `user_transcript` messages arrive with the full conversation history
326
+ 3. Your `on_transcript` handler generates a response (using any LLM) and calls `session.send_response()`
327
+ 4. If the user interrupts (speaks again mid-response), the previous handler is automatically cancelled
328
+
329
+ ### Sending Responses
330
+
331
+ `send_response()` accepts strings or async iterators. LLM stream formats from OpenAI, Anthropic, and Google Gemini are auto-detected:
332
+
333
+ ```python
334
+ # Plain string
335
+ await session.send_response("Hello world")
336
+
337
+ # OpenAI stream (auto-parsed)
338
+ stream = await openai_client.responses.create(model="gpt-4o", ..., stream=True)
339
+ await session.send_response(stream)
340
+
341
+ # Anthropic stream (auto-parsed)
342
+ stream = anthropic_client.messages.stream(model="claude-sonnet-4-20250514", ...)
343
+ await session.send_response(stream)
344
+
345
+ # Any async iterator of strings
346
+ async def my_generator():
347
+ yield "Hello "
348
+ yield "world"
349
+ await session.send_response(my_generator())
350
+ ```
351
+
352
+ ### Interruption Handling
353
+
354
+ When a new transcript arrives while a previous response is still streaming, the previous handler's `asyncio.Task` is cancelled automatically. Any `await` in your handler (including LLM SDK calls) will raise `asyncio.CancelledError`, which cleanly aborts the in-flight request. No manual signal handling needed.
355
+
356
+ ### Custom Server Integration (FastAPI, Starlette)
357
+
358
+ For integrating with an existing web server, use `create_session()` instead of `serve()`:
359
+
360
+ ```python
361
+ from fastapi import FastAPI, WebSocket
362
+
363
+ app = FastAPI()
364
+ engine = ... # SpeechEngineResource from await client.speech_engine.get(...)
365
+
366
+ @app.websocket("/api/speech-engine/ws")
367
+ async def speech_engine_ws(ws: WebSocket):
368
+ await ws.accept()
369
+ session = engine.create_session(ws, debug=True)
370
+ session.on("user_transcript", handle_transcript)
371
+ await session.run()
372
+ ```
373
+
374
+ When using `session.on()` directly, handlers receive just the event data (no `session` argument, since you already have the reference):
375
+
376
+ | Event | Handler signature |
377
+ |---|---|
378
+ | `"init"` | `async (conversation_id: str) -> None` |
379
+ | `"user_transcript"` | `async (transcript: list[ConversationMessage]) -> None` |
380
+ | `"close"` | `async () -> None` |
381
+ | `"disconnected"` | `async () -> None` |
382
+ | `"error"` | `async (error: Exception) -> None` |
383
+
384
+ ### Standalone Server
385
+
386
+ For full control over the server lifecycle, use `SpeechEngineServer` directly:
387
+
388
+ ```python
389
+ from elevenlabs.speech_engine import SpeechEngineServer
390
+
391
+ server = SpeechEngineServer(
392
+ port=3001,
393
+ debug=True,
394
+ on_transcript=handle_transcript,
395
+ )
396
+
397
+ # In one task:
398
+ await server.serve()
399
+
400
+ # In another task (e.g. signal handler):
401
+ await server.stop()
402
+ ```
403
+
404
+ ### Authentication
405
+
406
+ Both `engine.serve()` and `SpeechEngineServer` automatically verify the `X-Elevenlabs-Speech-Engine-Authorization` header on every incoming connection, rejecting any requests that were not signed by ElevenLabs. The API key is read from the `AsyncElevenLabs` client (or `api_key=` on `SpeechEngineServer`), falling back to the `ELEVENLABS_API_KEY` environment variable.
407
+
408
+ #### Disabling authentication
409
+
410
+ If your server sits behind an infrastructure layer that already restricts incoming traffic to ElevenLabs (typically an IP allowlist scoped to [ElevenLabs' egress ranges](https://elevenlabs.io/docs/overview/capabilities/speech-engine#ip-allowlisting)), you can skip JWT verification by passing `disable_auth=True`:
411
+
412
+ ```python
413
+ # Via engine.serve() — no api_key required when disable_auth is True
414
+ await engine.serve(port=3001, disable_auth=True, on_transcript=on_transcript)
415
+
416
+ # Or directly on SpeechEngineServer
417
+ server = SpeechEngineServer(port=3001, disable_auth=True, on_transcript=on_transcript)
418
+ await server.serve()
419
+ ```
420
+
421
+ When auth is disabled the server accepts any client that can reach it and emits a `UserWarning` on startup. **Only use this if you have an IP allowlist or equivalent network-level restriction in front of the server** — without one, anyone on the internet can open a session and consume your compute and downstream LLM quota.
422
+
423
+ ## Languages Supported
424
+
425
+ Explore [all models & languages](https://elevenlabs.io/docs/models).
426
+
427
+ ## Contributing
428
+
429
+ While we value open-source contributions to this SDK, this library is generated programmatically. Additions made directly to this library would have to be moved over to our generation code, otherwise they would be overwritten upon the next generated release. Feel free to open a PR as a proof of concept, but know that we will not be able to merge it as-is. We suggest opening an issue first to discuss with us!
430
+
431
+ On the other hand, contributions to the README are always very welcome!
data/poetry.lock ADDED
@@ -0,0 +1,970 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file is automatically @generated by Poetry 1.8.5 and should not be changed by hand.
2
+
3
+ [[package]]
4
+ name = "annotated-types"
5
+ version = "0.7.0"
6
+ description = "Reusable constraint types to use with typing.Annotated"
7
+ optional = false
8
+ python-versions = ">=3.8"
9
+ files = [
10
+ {file = "annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53"},
11
+ {file = "annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"},
12
+ ]
13
+
14
+ [package.dependencies]
15
+ typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.9\""}
16
+
17
+ [[package]]
18
+ name = "anyio"
19
+ version = "4.5.2"
20
+ description = "High level compatibility layer for multiple asynchronous event loop implementations"
21
+ optional = false
22
+ python-versions = ">=3.8"
23
+ files = [
24
+ {file = "anyio-4.5.2-py3-none-any.whl", hash = "sha256:c011ee36bc1e8ba40e5a81cb9df91925c218fe9b778554e0b56a21e1b5d4716f"},
25
+ {file = "anyio-4.5.2.tar.gz", hash = "sha256:23009af4ed04ce05991845451e11ef02fc7c5ed29179ac9a420e5ad0ac7ddc5b"},
26
+ ]
27
+
28
+ [package.dependencies]
29
+ exceptiongroup = {version = ">=1.0.2", markers = "python_version < \"3.11\""}
30
+ idna = ">=2.8"
31
+ sniffio = ">=1.1"
32
+ typing-extensions = {version = ">=4.1", markers = "python_version < \"3.11\""}
33
+
34
+ [package.extras]
35
+ doc = ["Sphinx (>=7.4,<8.0)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphinx-rtd-theme"]
36
+ test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "truststore (>=0.9.1)", "uvloop (>=0.21.0b1)"]
37
+ trio = ["trio (>=0.26.1)"]
38
+
39
+ [[package]]
40
+ name = "certifi"
41
+ version = "2026.10.19"
42
+ description = "Python package for providing Mozilla's CA Bundle."
43
+ optional = false
44
+ python-versions = ">=3.7"
45
+ files = [
46
+ {file = "certifi-2026.10.19-py3-none-any.whl", hash = "sha256:42d35340cc5b9ba78e818ddbff0c5b1c2b779de448a340fd1b989f5fa8670e1b"},
47
+ {file = "certifi-2026.10.19.tar.gz", hash = "sha256:035c1e85572b141bf1c3a3eff0e33a8eb74917522f2559075ff8d2fea780a1ae"},
48
+ ]
49
+
50
+ [[package]]
51
+ name = "charset-normalizer"
52
+ version = "3.5.2"
53
+ description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet."
54
+ optional = false
55
+ python-versions = ">=3.7"
56
+ files = [
57
+ {file = "charset_normalizer-3.5.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:195c26fb65950f8fce54e26349852b7bdd7c5f120aeefbcc440b8a20faaed4a3"},
58
+ {file = "charset_normalizer-3.5.2-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9373ad13ef0d2c0fb761e04e55bfdee5a08b52cef2c882c8fbe9935b1517152e"},
59
+ {file = "charset_normalizer-3.5.2-cp310-cp310-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:ddf19c062bea7a0cc80f519243d2c01dd091be0cf952a0750d4ad576709559f5"},
60
+ {file = "charset_normalizer-3.5.2-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:3d14b50de6bf4d0edf857a9386836846f982b8f524e188e2e68b96d702bcf4aa"},
61
+ {file = "charset_normalizer-3.5.2-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:28a15fdad492a99b6eccfaaed66ef3f74050680545ea61ec8b2f4c538f1f1320"},
62
+ {file = "charset_normalizer-3.5.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8a893cc101149f80a653f82062ebc95b34525a2614382e1da5458fe7c6997249"},
63
+ {file = "charset_normalizer-3.5.2-cp310-cp310-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:619799369eeef6366ed3e8755a5670f4f2f0fb6b30a0fd7264dc0fdc2357058e"},
64
+ {file = "charset_normalizer-3.5.2-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:447441e76ec720b15e64418d32e092297340387053047c7c694f579efb0ee1d9"},
65
+ {file = "charset_normalizer-3.5.2-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:62588a277bfb59def052abd940703fa35107152bf479781a878617d60faf8fb5"},
66
+ {file = "charset_normalizer-3.5.2-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:44bd4fbb29dfbeba60e7d2bd000c59e4b21ddb3cc53912b14048d37092706d7c"},
67
+ {file = "charset_normalizer-3.5.2-cp310-cp310-musllinux_1_2_riscv64.whl", hash = "sha256:30fcd120b732aa79317f08dee04d7de0847822e4cf7ee0e9f445bb958832252c"},
68
+ {file = "charset_normalizer-3.5.2-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:50e3adfb96fc189eb27b1cf62d3b598b89b4bb0420d93a3d3e42e137409011be"},
69
+ {file = "charset_normalizer-3.5.2-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:b736353c0a625bbd5fcec108576e2385db3496f4f771f785ff32e108d3c3bc45"},
70
+ {file = "charset_normalizer-3.5.2-cp310-cp310-win32.whl", hash = "sha256:f5833ad231be5eb6553de524a70f48d71b2c8563101750531e0b80184e175cd4"},
71
+ {file = "charset_normalizer-3.5.2-cp310-cp310-win_amd64.whl", hash = "sha256:1461ac396c4fdb983a675f20aa555624f0ee18ac83d832b9244ffff3d8055275"},
72
+ {file = "charset_normalizer-3.5.2-cp310-cp310-win_arm64.whl", hash = "sha256:c6708715abcf3c73b99508253e961a9967f02fe536532834149574eda6de0d1c"},
73
+ {file = "charset_normalizer-3.5.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:3d21b8b13c7592db2ac5e544a6d83187b995257472b0c9e8351b6d507ae37ed6"},
74
+ {file = "charset_normalizer-3.5.2-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d760fe2a4d7c3b226cb9026d6a842868d52a7901bd98420e1baf14e80da85cf5"},
75
+ {file = "charset_normalizer-3.5.2-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c9790464842f85f437dbbb54417eda1e0e6bfc52dd8d22d6fd1c994b73b2dc74"},
76
+ {file = "charset_normalizer-3.5.2-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:4685902cf26edf013ed7a3da0f426ebba7a00ebb9541386d835afbf002c11cab"},
77
+ {file = "charset_normalizer-3.5.2-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:4495c5002a7b28557e7e222e77e0b661183e432b7d6d2e788101e3f240e05b8c"},
78
+ {file = "charset_normalizer-3.5.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:211d5a3eb6af8f513b8d4ca19a8c1b7accab1b5f0d3175f9826b03c1a920dc1f"},
79
+ {file = "charset_normalizer-3.5.2-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:ef4fcbf3327382cd4c9f540babd61248208af7b93eec4de397b4d5f58a09e288"},
80
+ {file = "charset_normalizer-3.5.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:bd16aabe4a02a297c23417aa17ac6299dbd8c49f673bcd645b4929b11f5a4400"},
81
+ {file = "charset_normalizer-3.5.2-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:fb9e68df06293761f9fe66ade60a9bc6d0f5e42b8acf2939a9158af86ab0e5bd"},
82
+ {file = "charset_normalizer-3.5.2-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:59f63901b0031c3136cf64704dcb21de0bbae62ce2c9529bc39d27665463de37"},
83
+ {file = "charset_normalizer-3.5.2-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:304d5463e65a35d7bb0850550e0780395395f6fcf452f04db7d5ca7cecc425ac"},
84
+ {file = "charset_normalizer-3.5.2-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:9cf9b1a857e25c4baceeb3624e92a56df3668f398c4acba74e174d81fb4d1d3a"},
85
+ {file = "charset_normalizer-3.5.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:114e4d0c92d618409ed82a99e22b5c5e768fe995f2973f78265f4524f49d4640"},
86
+ {file = "charset_normalizer-3.5.2-cp311-cp311-win32.whl", hash = "sha256:2625388c6c754520c37abaf3b41eb34d1cc4a373f457898f08606c8e362b891d"},
87
+ {file = "charset_normalizer-3.5.2-cp311-cp311-win_amd64.whl", hash = "sha256:87e50a3e7cb90af586b6c5faf23e302a970415ac73bd7bd90a515a04b427ef96"},
88
+ {file = "charset_normalizer-3.5.2-cp311-cp311-win_arm64.whl", hash = "sha256:254eb48b9fa5ee9898a3c445825a1f340fe53712a098904b39b0bddba8ea3cb1"},
89
+ {file = "charset_normalizer-3.5.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:ed2a239c0ea213acc1908150a3037257083c7c083128f1a4cec2ec4b97dca491"},
90
+ {file = "charset_normalizer-3.5.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b91363207bd9dc966a691e959bb47f64b30f7ac4b072be9968b366982f7db77c"},
91
+ {file = "charset_normalizer-3.5.2-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:38a873987f3be698494da8b2e3085e29da02da7b633dce73e79c699a113d7bf0"},
92
+ {file = "charset_normalizer-3.5.2-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:355ad8011081dec5412240c087a9a0c9d4d5039f3ed11a3f13e18c2b29b56c51"},
93
+ {file = "charset_normalizer-3.5.2-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:ee21e28f0430bd6dc9086c6e525d5e818a44a5ad19720c8a0ef766792f3eb5e5"},
94
+ {file = "charset_normalizer-3.5.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3d31298449090ab8d47b7b1b2a555ff73cac7ed438a08b7ac160980c7ebed649"},
95
+ {file = "charset_normalizer-3.5.2-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:5cde776b7cc66e4f6c99612cea4aa7269aa65863f7a15841b2c264f103822f4e"},
96
+ {file = "charset_normalizer-3.5.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:ae4f5fea5b8b8ccff88238cc8569303e5ee95efae67fa62922a311397a71f346"},
97
+ {file = "charset_normalizer-3.5.2-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:f7d486c83842422badd511868fd8a9a20e9407ace71564b6af47ce7e60a336c1"},
98
+ {file = "charset_normalizer-3.5.2-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:11a4d68a6ecda3292cb1e50239e111543ba5d709bb62a6b4ea1afcfa729d8875"},
99
+ {file = "charset_normalizer-3.5.2-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:d6734d2ef8a50fbf8445c139477da401f50d62a0606bf00e20ec6d87773fefb1"},
100
+ {file = "charset_normalizer-3.5.2-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:a815775b6c38d4e0ff7bcffbeba67feded90202bb6a226b8dd35f1c855217413"},
101
+ {file = "charset_normalizer-3.5.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:23851fb4e1b85ed3f6c2a27b777cdfe2e19fb5b38429a8faf38c7542b7665869"},
102
+ {file = "charset_normalizer-3.5.2-cp312-cp312-win32.whl", hash = "sha256:db19d07e2e0129e974a0e65d0064fc222a446cd5122c2fd4184d2af9fc734a9e"},
103
+ {file = "charset_normalizer-3.5.2-cp312-cp312-win_amd64.whl", hash = "sha256:780fbe7cab297b81dad9fb8dc5eb003c0468ffb0d9e5f65068c53a34661a96bc"},
104
+ {file = "charset_normalizer-3.5.2-cp312-cp312-win_arm64.whl", hash = "sha256:e2af3aad578aa6bd1384bcf4750fc285e5a9de53f40b7d41e5a0bf748edeb2b3"},
105
+ {file = "charset_normalizer-3.5.2-cp313-cp313-android_24_arm64_v8a.whl", hash = "sha256:ed905975ab14056a2e5eb1c376cb2e1ebc5396baf84163939c518556fccde9f5"},
106
+ {file = "charset_normalizer-3.5.2-cp313-cp313-android_24_x86_64.whl", hash = "sha256:a66c3bc5ab1f0ff2164fc9965ddd611ff0802173f4b9d24554c563f6ab7e1d6e"},
107
+ {file = "charset_normalizer-3.5.2-cp313-cp313-ios_13_0_arm64_iphoneos.whl", hash = "sha256:d2374b62878abb00cd8309b32af6c0b715cd02dec0ca74ef12e5069bdc64144a"},
108
+ {file = "charset_normalizer-3.5.2-cp313-cp313-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:d376bbd28b3a8999db1a103b3b388aee6f1ddeb3e51bc2172993efdcd86e064d"},
109
+ {file = "charset_normalizer-3.5.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:6045373d5a89a5ec71afde535db987ca28e76dfa276c2d4c818265b375d4b055"},
110
+ {file = "charset_normalizer-3.5.2-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:849df64e889b2e17230d58410a03dba311a65b163508fd33679b2b737d4b7858"},
111
+ {file = "charset_normalizer-3.5.2-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:15c44f7edfd477b06f517a5cc317fc1707edb9de2c865f43d4b6513907473234"},
112
+ {file = "charset_normalizer-3.5.2-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:a89012d6d5476ee112d20d998570ed58df2260a852afb1758809cd6900411d21"},
113
+ {file = "charset_normalizer-3.5.2-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:0c951d5e6dd9c2ff60609476752bee49da4206adde960ebc247766937f72e718"},
114
+ {file = "charset_normalizer-3.5.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7218e8f32b0956cfcd048fd42d9d5779809745ca1d86113ca56f66e7ae1549c4"},
115
+ {file = "charset_normalizer-3.5.2-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:a19a731138fc27d5682277d3b9df22855cea1239bce7fcec5f78f42ef2d1f3c3"},
116
+ {file = "charset_normalizer-3.5.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:62603db9a7caa0802eaa28c1c46fecd7b3a263a774069c24c3c28c302448721c"},
117
+ {file = "charset_normalizer-3.5.2-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:b6856554c4f44d79fc2307d5768854310a8f0096e501c75637542c82292b0429"},
118
+ {file = "charset_normalizer-3.5.2-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:1bc0baf5ef96b6ede57d47f4b8fe4d9d84019c3bfcbeb20a41edc6a6ee341f1f"},
119
+ {file = "charset_normalizer-3.5.2-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:56bc200a365efb37383b7852e4cc5898d3b2da5987289b543956cf8cad71018a"},
120
+ {file = "charset_normalizer-3.5.2-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:2c9ad19a6cfcd5ea5c0d41161d22f9df1dcc277e9bef2751391334546a314c00"},
121
+ {file = "charset_normalizer-3.5.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:e243bd13217235fc7290c621941c3f5cc8b66e4872495be821d7436ba2fb838d"},
122
+ {file = "charset_normalizer-3.5.2-cp313-cp313-pyemscripten_2025_0_wasm32.whl", hash = "sha256:a090bb2c68df85450502e3e20d665e3a5af9c65a84d6508ed477badd49166fd3"},
123
+ {file = "charset_normalizer-3.5.2-cp313-cp313-win32.whl", hash = "sha256:2b7b3bbfb4fe8ef40600792d762fbaa9057559f9d3fad209525b7a22b99e91fd"},
124
+ {file = "charset_normalizer-3.5.2-cp313-cp313-win_amd64.whl", hash = "sha256:78456a747de8dc58360ffa581f30a002baf5aa28cb262536545e91f113ed7639"},
125
+ {file = "charset_normalizer-3.5.2-cp313-cp313-win_arm64.whl", hash = "sha256:11912e4bb14baae7c5d8791aa55ba0a3a03ec6729073307b0f57270abaa713d3"},
126
+ {file = "charset_normalizer-3.5.2-cp314-cp314-android_24_arm64_v8a.whl", hash = "sha256:1afb975bd5d68d5ce9f6b6d44fdf2f7e34b895a35e95708a7a91b20a3b51d187"},
127
+ {file = "charset_normalizer-3.5.2-cp314-cp314-android_24_x86_64.whl", hash = "sha256:bbbfc8e28816f19d7c0f1816664980c0a9875d01b27cdf8eedddb639d9e108ad"},
128
+ {file = "charset_normalizer-3.5.2-cp314-cp314-ios_13_0_arm64_iphoneos.whl", hash = "sha256:7967d08cf06dee78443b874f98c98036f624f3a4e73e11f9f64f5be4d25393cf"},
129
+ {file = "charset_normalizer-3.5.2-cp314-cp314-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:4c2b5031f63e331e3839b40aed2dd6f191e9c07edbde303e7876846ea1946995"},
130
+ {file = "charset_normalizer-3.5.2-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:fcff63213e8e6e47770541a4607175404f47cbb3ebea7b6058cc82d524a0e424"},
131
+ {file = "charset_normalizer-3.5.2-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8d86d6fc60743dc916eb79e2eb1ec4818e21e427731543af40a3021851174a13"},
132
+ {file = "charset_normalizer-3.5.2-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:7a881931aa470808df94a8c380eed2bbbc76cd9dc622310f99665658c821eb6d"},
133
+ {file = "charset_normalizer-3.5.2-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:8024d00c3faf3fc0c16e07a69f4405e8eac7cc0ab15f65fe6cf43827c4cf72b4"},
134
+ {file = "charset_normalizer-3.5.2-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:4d48f2d08b9de5864e2c8744d4461b862fb149a18274abc8b698c45975573438"},
135
+ {file = "charset_normalizer-3.5.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:34276fd796040bf0993ab33a369aa572e6979c7aab225a88893667ad8eac8f7a"},
136
+ {file = "charset_normalizer-3.5.2-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0521c5665880b33d603717defa76c094048900010897909952397feb3039da56"},
137
+ {file = "charset_normalizer-3.5.2-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:eff0ac9dbe711a4aee69bf04a83896aa9b85f19641264053a9f6d48573abb7dd"},
138
+ {file = "charset_normalizer-3.5.2-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:1503bccbeb36d5527790c3930327704c39af22de3112f1b1666a9f3ce15ee204"},
139
+ {file = "charset_normalizer-3.5.2-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:52aa6992700996af31f375de0c6bacd402b0097fe40b53c426b9f51a90ebabc7"},
140
+ {file = "charset_normalizer-3.5.2-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:e09a3942ecbdee5cce73ea9d42da82b81b72ac1bf031ce069b93b5adf4eac8cd"},
141
+ {file = "charset_normalizer-3.5.2-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:c7c9ab723cde841fefb34efbad91e87f00a674b1fe1cd0784fde742bf2c154dc"},
142
+ {file = "charset_normalizer-3.5.2-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:ddc7dacc8ece3a182e7f15cb862d1fd616b46d076cb1ae9dd232b2c38b655874"},
143
+ {file = "charset_normalizer-3.5.2-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:ee43c17b173d46a3212baa6ead3ae258eeabdae48c263a01ccf0218c366dd655"},
144
+ {file = "charset_normalizer-3.5.2-cp314-cp314-win32.whl", hash = "sha256:4f87960d57feabfb618e4e0af6e7371645fa26a277860739d6e5d6e0012c92f0"},
145
+ {file = "charset_normalizer-3.5.2-cp314-cp314-win_amd64.whl", hash = "sha256:e4e81e09c1578b8df602e3db08b0b3ea0a6947ad612f52bf8dc5ea8d47691f0c"},
146
+ {file = "charset_normalizer-3.5.2-cp314-cp314-win_arm64.whl", hash = "sha256:80d02b6f04e92601a081dd97b23d3128033098bff5d35d392ddcc0476ea11253"},
147
+ {file = "charset_normalizer-3.5.2-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:dca9ab98072a5a54ebacebdc45f53e645336b320c667410b061be1ca588ae709"},
148
+ {file = "charset_normalizer-3.5.2-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f0aa869112ef88429ae17820d99c3dd9504c9e9c671d3c246f3d7442cb051084"},
149
+ {file = "charset_normalizer-3.5.2-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c0afc6800ba57ccc350374c5bd6150419915d95ce93cdbab2d783d75eaf30ecb"},
150
+ {file = "charset_normalizer-3.5.2-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:7dcd882da75ef9adf94903b1e3b9419e8aa8fb4c7396822b834b9ef7fb96954f"},
151
+ {file = "charset_normalizer-3.5.2-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:2e06a3a98f916dd41d27f3105e02e7a40181c98c94b9158733d03a6f80506c09"},
152
+ {file = "charset_normalizer-3.5.2-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6bd128f206a7752ae1f2ab6c61bf8a24ba28913a10df8b14c2637b973ff97a80"},
153
+ {file = "charset_normalizer-3.5.2-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:c8f3d67aeaf55f017982b73683f0e7342ba2f6635a78f69ce89ebb26aa411e5c"},
154
+ {file = "charset_normalizer-3.5.2-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:fe9753dfee015c570d73df76f899f18444d41388bffcde097deba51c4fadbb9f"},
155
+ {file = "charset_normalizer-3.5.2-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:92888bb3187c5ba50500b00b3b310c9f2c651709d28036077680cb5255450a03"},
156
+ {file = "charset_normalizer-3.5.2-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:d008d90a7f2471519aef0c90dfbe73b3e6e4d5e66ac48e19154c17e89e98b604"},
157
+ {file = "charset_normalizer-3.5.2-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:31f3930700408d211f13378ccbe1c40845d8da54bd0681fac3a9b5aae81c7aa8"},
158
+ {file = "charset_normalizer-3.5.2-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:2a925889534b3748302dae5dead07cc13480de1dac3aea80a941b729b471ef93"},
159
+ {file = "charset_normalizer-3.5.2-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:f5ec61164adcec446f8969a3358ec3f9b26bbda3b9213e5586d219afa8df2915"},
160
+ {file = "charset_normalizer-3.5.2-cp314-cp314t-win32.whl", hash = "sha256:598a11a2c7ebaa5334bf698bf29568c9c390abac6a154d8170fedecd1cea38c5"},
161
+ {file = "charset_normalizer-3.5.2-cp314-cp314t-win_amd64.whl", hash = "sha256:7fdde2c9fd9e3eca40631e024664cf2584272cc8f96308cbe5fdfc930f51d8bc"},
162
+ {file = "charset_normalizer-3.5.2-cp314-cp314t-win_arm64.whl", hash = "sha256:d1befeed746d247c81127bb14de9dc3d30edb6e5976d34f83f86ed262b1d9105"},
163
+ {file = "charset_normalizer-3.5.2-cp315-cp315-macosx_10_15_universal2.whl", hash = "sha256:87475fabc8d9996fd9c27debb395e642e8c838d78a00b6e932227a0e06b81e26"},
164
+ {file = "charset_normalizer-3.5.2-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9409a8bf35cf78353942504b24a57de3d75b708997a1e4bd8db71ac8633ce364"},
165
+ {file = "charset_normalizer-3.5.2-cp315-cp315-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:498dc3188ca05a68231ac3fdbfc7f57eb67e1343c30e0fea17f8218c1599b253"},
166
+ {file = "charset_normalizer-3.5.2-cp315-cp315-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:e242bb1c5e76e97dfa9e7f209a71e93a01d7f19ffdd5cfbb2e2d55b4f08f8ab0"},
167
+ {file = "charset_normalizer-3.5.2-cp315-cp315-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:def79fa35ef0cef8d2accec024f4fdc7ead3012ff02f5215c783f39f03ef8cfc"},
168
+ {file = "charset_normalizer-3.5.2-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3df041de8887954562c9b261cba85ca0e9ded74048daf125f45edcfaa4832229"},
169
+ {file = "charset_normalizer-3.5.2-cp315-cp315-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:04851f73ae72b8413dddadb16a49dfee95263553741fd42d546f7d66907e6be5"},
170
+ {file = "charset_normalizer-3.5.2-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:183b88127acdb4fabe59d951ab424faf1af7b63cdbb5f776186c1ea2ffcaed98"},
171
+ {file = "charset_normalizer-3.5.2-cp315-cp315-musllinux_1_2_armv7l.whl", hash = "sha256:16fa0eccf81304b79c5cd87f9271c3b85dd9dd99245e4422ae9c0dd45e0f99d3"},
172
+ {file = "charset_normalizer-3.5.2-cp315-cp315-musllinux_1_2_ppc64le.whl", hash = "sha256:7441d755b7ab94f8d4eb3e43ec05482d760842fd263d003a99102d742cd835e2"},
173
+ {file = "charset_normalizer-3.5.2-cp315-cp315-musllinux_1_2_riscv64.whl", hash = "sha256:ca403d7e4798f525fdfc78e258820419cbbd0f0ecbab9de7840e3c017cf6b8cf"},
174
+ {file = "charset_normalizer-3.5.2-cp315-cp315-musllinux_1_2_s390x.whl", hash = "sha256:df29a0a7107f7011e77f4eebdddec4c7331e24d787a0b21a46d63bdf7445da95"},
175
+ {file = "charset_normalizer-3.5.2-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:f3c96f633825733f735c5a9cf21d21a257d8e1edf0b1cee0a064b9c424ca0f7d"},
176
+ {file = "charset_normalizer-3.5.2-cp315-cp315-win32.whl", hash = "sha256:281cb91036248400f4cc957495cccd44c275c2e0c5854f7e45ac5cf7dc193847"},
177
+ {file = "charset_normalizer-3.5.2-cp315-cp315-win_amd64.whl", hash = "sha256:89b53f3cda69831909888e0494f4fa0bcd3537e3e138dabeb620bd6ad946bae8"},
178
+ {file = "charset_normalizer-3.5.2-cp315-cp315-win_arm64.whl", hash = "sha256:6be488a102b8cf28d0391d8c4ba7748938ae28b78ad901f8585520fca33ead1a"},
179
+ {file = "charset_normalizer-3.5.2-cp315-cp315t-macosx_10_15_universal2.whl", hash = "sha256:915563965d418f986e7e145accc592eae9e1a1be3566ff98a05d7a9ec42a76e1"},
180
+ {file = "charset_normalizer-3.5.2-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:65cd72beeeca9d3aaea1201e5923859f308f952f9c71de93f06063c79f0f7a3b"},
181
+ {file = "charset_normalizer-3.5.2-cp315-cp315t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:b7fd005a73d9e657273b7a10dc71a9e03c8fb9ee6999798d6918ce095b81ac7f"},
182
+ {file = "charset_normalizer-3.5.2-cp315-cp315t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:e54da4baf05720032d527874d40b65fa4d7e5c6c6a43d0c3adbeffcaf275a2b3"},
183
+ {file = "charset_normalizer-3.5.2-cp315-cp315t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:124fbf1a8ff966d87ae05bb8bd45a71f966055ed8bba320d0c7cf450bc5f4d0e"},
184
+ {file = "charset_normalizer-3.5.2-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:28b4f0d66fb834ff90f28209ac7bce77868c45d8c93e26f906709d9b7c2e1af9"},
185
+ {file = "charset_normalizer-3.5.2-cp315-cp315t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:58ca3755ee7ff7f59b57789ec9833c9de9ea275405cdd240eda1f193112e398a"},
186
+ {file = "charset_normalizer-3.5.2-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:443eae2bf318abeaf6f15d785138f71fd6de770e99a92158b8b814265e079115"},
187
+ {file = "charset_normalizer-3.5.2-cp315-cp315t-musllinux_1_2_armv7l.whl", hash = "sha256:58f361dcbab699cf8f42db3f47c8e7fd1036f138c23a5d08de9fde5f425a730c"},
188
+ {file = "charset_normalizer-3.5.2-cp315-cp315t-musllinux_1_2_ppc64le.whl", hash = "sha256:1b4cbc7c3491ccb4aa17fcd8165649d01cf39f76de1696da8631b5f71b85401d"},
189
+ {file = "charset_normalizer-3.5.2-cp315-cp315t-musllinux_1_2_riscv64.whl", hash = "sha256:ba0b1d2620edf869789c3879223f52bf2afc5d31b3cb47cc57b3a12c05e2aa9d"},
190
+ {file = "charset_normalizer-3.5.2-cp315-cp315t-musllinux_1_2_s390x.whl", hash = "sha256:5e2b6b57e9733d39f0c9fd3185efa6b8e29652c4cd8fe94180272cf6ed9a78c4"},
191
+ {file = "charset_normalizer-3.5.2-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:51cf45226a9b588d0d2b4880c62d686934b63ab0bd79ca23ab0e9762eb27441b"},
192
+ {file = "charset_normalizer-3.5.2-cp315-cp315t-win32.whl", hash = "sha256:5fb29fb8cd1a46c27a1bf9613ad5ec2599310d46b4025d9556404a6b6a292800"},
193
+ {file = "charset_normalizer-3.5.2-cp315-cp315t-win_amd64.whl", hash = "sha256:a192e2c40070d92c3ccf777e3a5c4ff515573cd2bb7ed0c537fdadbbec5bbf21"},
194
+ {file = "charset_normalizer-3.5.2-cp315-cp315t-win_arm64.whl", hash = "sha256:749e97e1b32313717a565abbe321bc2190bc8b35f1a67e4cdbc7c56c8d8ffe58"},
195
+ {file = "charset_normalizer-3.5.2-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:4275811936e2f06feff5e598fb42a1b7ae852da8e39605211892b56b81a34efd"},
196
+ {file = "charset_normalizer-3.5.2-cp37-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:1c50fe28bbc2ced33386f298650d91218076c05420e6cbd790b913adc41659e7"},
197
+ {file = "charset_normalizer-3.5.2-cp37-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d19fbd981a488e22cd04883659ca6b08f50b5974f9fd7c95655ef6a043e5893f"},
198
+ {file = "charset_normalizer-3.5.2-cp37-abi3-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:0fed1d06615f022ee3b13caf5e8b180cfea32bb2c5aded8a9d44277afc040f93"},
199
+ {file = "charset_normalizer-3.5.2-cp37-abi3-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:838dcc90063569a0448120554591a1d6c4a4ffe11babf048908793154ab86ade"},
200
+ {file = "charset_normalizer-3.5.2-cp37-abi3-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:2ce45c6627b22c47e390bc91a41c3d13032192e699fa0bea96e9671b373d69b0"},
201
+ {file = "charset_normalizer-3.5.2-cp37-abi3-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0774bf9bf620249fee3e0b8b9fd3065de213be30f3aa94ce2494b3b638949e26"},
202
+ {file = "charset_normalizer-3.5.2-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:1db38f4c5496827c1a501846d64d14c3b80c7e6714e406cd7dc36a9899fa1011"},
203
+ {file = "charset_normalizer-3.5.2-cp37-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:304d8e4d493af723536393eee0c689eb7813f4a474c8b479dee63f1fdd98f621"},
204
+ {file = "charset_normalizer-3.5.2-cp37-abi3-musllinux_1_2_ppc64le.whl", hash = "sha256:9b7f416ff0978e2f2249330527f0ad6fa02f4932e6199692d3b52da2048c19e4"},
205
+ {file = "charset_normalizer-3.5.2-cp37-abi3-musllinux_1_2_riscv64.whl", hash = "sha256:01077390b03f7988f11d700a2194e69b119741a86b1a638b1db88891e3eced8e"},
206
+ {file = "charset_normalizer-3.5.2-cp37-abi3-musllinux_1_2_s390x.whl", hash = "sha256:7e841fb9010836c992c9f12fcbd43a831de93a5f726fc1ccd8ca1d0268c5014c"},
207
+ {file = "charset_normalizer-3.5.2-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:9cae88599c7219005d879f98e5ed53341e9a122af585e1091200358a3003d2a0"},
208
+ {file = "charset_normalizer-3.5.2-cp37-abi3-win32.whl", hash = "sha256:01b0c0d2262a9e28e8484a278c7e1b5d650e3ac8cf2683d2967e25899f208bdf"},
209
+ {file = "charset_normalizer-3.5.2-cp37-abi3-win_amd64.whl", hash = "sha256:9f56f72050826f63dcee7a7f55b0a77168cb3bfc553fd405e7f8f9ece75a4036"},
210
+ {file = "charset_normalizer-3.5.2-cp37-abi3-win_arm64.whl", hash = "sha256:40ab6bffa02ae10a0581e6c198be7d2d8ca5c2a0c64e4ed3465d766df457573e"},
211
+ {file = "charset_normalizer-3.5.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:75a3ceed0724d625d64b86ca20aba182e4df462e04c2414fc941c0f523f06aac"},
212
+ {file = "charset_normalizer-3.5.2-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0891b9d3903c5571c03771ca669a4b0ec5618ca722a5c957d3d29cd4e5062848"},
213
+ {file = "charset_normalizer-3.5.2-cp39-cp39-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:fc14a032f813bf5fe624d991960ea83e9715adc27e4c1830a2361eb1d02ac341"},
214
+ {file = "charset_normalizer-3.5.2-cp39-cp39-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:8b2bfab86aa71ae13aa41a6a26aab338e0db2b8bc75434b05aea89e011ff35a4"},
215
+ {file = "charset_normalizer-3.5.2-cp39-cp39-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:9bde855991b7e362c146535e3136a50bfaffc0487d38b33ca7e5edefc6e23849"},
216
+ {file = "charset_normalizer-3.5.2-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:55ea99acb17b9325618de155a0cd6a2e8f5d10be008113e1d433bbb58db543b2"},
217
+ {file = "charset_normalizer-3.5.2-cp39-cp39-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:68eb192d85ab8e5f6ec69c2bc6ac0179fbf04a5ac1569d12fbef74883fe102d0"},
218
+ {file = "charset_normalizer-3.5.2-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:d913de495d90407cd859d263bee2e5d1a4ed3eb6573c04e70d9ec619a7cbed7f"},
219
+ {file = "charset_normalizer-3.5.2-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:3ddacd27458c45bdacd6bd6db644bfb730efbf9e830310186e3045c9c5be8fb2"},
220
+ {file = "charset_normalizer-3.5.2-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:588461c2e8384d309bd63e5826019b6977bc66d629b99ac8737bb795d7b2cb5a"},
221
+ {file = "charset_normalizer-3.5.2-cp39-cp39-musllinux_1_2_riscv64.whl", hash = "sha256:e80e6c2f55656b4824d72065abb4ddd6a525c74bd78a0aab5d9fc2cf4fb5af50"},
222
+ {file = "charset_normalizer-3.5.2-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:d4a7319f304a774bed22115bc891618e45f85065ab44ea6acd07d274e750519a"},
223
+ {file = "charset_normalizer-3.5.2-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:fd1fbe0f116b6e55da77aca2c6ddcddcfac2186cbf78bdebf40fc156efca389d"},
224
+ {file = "charset_normalizer-3.5.2-cp39-cp39-win32.whl", hash = "sha256:93223adc95033dd47133a46ccfc316a0139176fd79085762e27202ec56018f03"},
225
+ {file = "charset_normalizer-3.5.2-cp39-cp39-win_amd64.whl", hash = "sha256:15bb4005af6320d259dc7593ca84a38d7fe06a421dbcf7b910ae23979101e787"},
226
+ {file = "charset_normalizer-3.5.2-cp39-cp39-win_arm64.whl", hash = "sha256:2cc961b171b3f3440f410489ab3573e86aea8736134ebbb40ea1338b7f0831bc"},
227
+ {file = "charset_normalizer-3.5.2-py3-none-any.whl", hash = "sha256:b6b751274acb69d77b3323d6b7dbaa3c7fdfc1eb829b7eb61d262f32e1af9685"},
228
+ {file = "charset_normalizer-3.5.2.tar.gz", hash = "sha256:39de2a259fc954455c57274dc94c79d5842774e1247a016aff30bc0efed0f4ef"},
229
+ ]
230
+
231
+ [[package]]
232
+ name = "colorama"
233
+ version = "0.4.6"
234
+ description = "Cross-platform colored terminal text."
235
+ optional = false
236
+ python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7"
237
+ files = [
238
+ {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"},
239
+ {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"},
240
+ ]
241
+
242
+ [[package]]
243
+ name = "exceptiongroup"
244
+ version = "1.3.1"
245
+ description = "Backport of PEP 654 (exception groups)"
246
+ optional = false
247
+ python-versions = ">=3.7"
248
+ files = [
249
+ {file = "exceptiongroup-1.3.1-py3-none-any.whl", hash = "sha256:a7a39a3bd276781e98394987d3a5701d0c4edffb633bb7a5144577f82c773598"},
250
+ {file = "exceptiongroup-1.3.1.tar.gz", hash = "sha256:8b412432c6055b0b7d14c310000ae93352ed6754f70fa8f7c34141f91c4e3219"},
251
+ ]
252
+
253
+ [package.dependencies]
254
+ typing-extensions = {version = ">=4.6.0", markers = "python_version < \"3.13\""}
255
+
256
+ [package.extras]
257
+ test = ["pytest (>=6)"]
258
+
259
+ [[package]]
260
+ name = "execnet"
261
+ version = "2.1.2"
262
+ description = "execnet: rapid multi-Python deployment"
263
+ optional = false
264
+ python-versions = ">=3.8"
265
+ files = [
266
+ {file = "execnet-2.1.2-py3-none-any.whl", hash = "sha256:67fba928dd5a544b783f6056f449e5e3931a5c378b128bc18501f7ea79e296ec"},
267
+ {file = "execnet-2.1.2.tar.gz", hash = "sha256:63d83bfdd9a23e35b9c6a3261412324f964c2ec8dcd8d3c6916ee9373e0befcd"},
268
+ ]
269
+
270
+ [package.extras]
271
+ testing = ["hatch", "pre-commit", "pytest", "tox"]
272
+
273
+ [[package]]
274
+ name = "h11"
275
+ version = "0.16.0"
276
+ description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1"
277
+ optional = false
278
+ python-versions = ">=3.8"
279
+ files = [
280
+ {file = "h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86"},
281
+ {file = "h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1"},
282
+ ]
283
+
284
+ [[package]]
285
+ name = "httpcore"
286
+ version = "1.0.9"
287
+ description = "A minimal low-level HTTP client."
288
+ optional = false
289
+ python-versions = ">=3.8"
290
+ files = [
291
+ {file = "httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55"},
292
+ {file = "httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8"},
293
+ ]
294
+
295
+ [package.dependencies]
296
+ certifi = "*"
297
+ h11 = ">=0.16"
298
+
299
+ [package.extras]
300
+ asyncio = ["anyio (>=4.0,<5.0)"]
301
+ http2 = ["h2 (>=3,<5)"]
302
+ socks = ["socksio (==1.*)"]
303
+ trio = ["trio (>=0.22.0,<1.0)"]
304
+
305
+ [[package]]
306
+ name = "httpx"
307
+ version = "0.28.1"
308
+ description = "The next generation HTTP client."
309
+ optional = false
310
+ python-versions = ">=3.8"
311
+ files = [
312
+ {file = "httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad"},
313
+ {file = "httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc"},
314
+ ]
315
+
316
+ [package.dependencies]
317
+ anyio = "*"
318
+ certifi = "*"
319
+ httpcore = "==1.*"
320
+ idna = "*"
321
+
322
+ [package.extras]
323
+ brotli = ["brotli", "brotlicffi"]
324
+ cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"]
325
+ http2 = ["h2 (>=3,<5)"]
326
+ socks = ["socksio (==1.*)"]
327
+ zstd = ["zstandard (>=0.18.0)"]
328
+
329
+ [[package]]
330
+ name = "idna"
331
+ version = "3.15"
332
+ description = "Internationalized Domain Names in Applications (IDNA)"
333
+ optional = false
334
+ python-versions = ">=3.8"
335
+ files = [
336
+ {file = "idna-3.15-py3-none-any.whl", hash = "sha256:048adeaf8c2d788c40fee287673ccaa74c24ffd8dcf09ffa555a2fbb59f10ac8"},
337
+ {file = "idna-3.15.tar.gz", hash = "sha256:ca962446ea538f7092a95e057da437618e886f4d349216d2b1e294abfdb65fdc"},
338
+ ]
339
+
340
+ [package.extras]
341
+ all = ["mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.6.2)"]
342
+
343
+ [[package]]
344
+ name = "iniconfig"
345
+ version = "2.1.0"
346
+ description = "brain-dead simple config-ini parsing"
347
+ optional = false
348
+ python-versions = ">=3.8"
349
+ files = [
350
+ {file = "iniconfig-2.1.0-py3-none-any.whl", hash = "sha256:9deba5723312380e77435581c6bf4935c94cbfab9b1ed33ef8d238ea168eb760"},
351
+ {file = "iniconfig-2.1.0.tar.gz", hash = "sha256:3abbd2e30b36733fee78f9c7f7308f2d0050e88f0087fd25c2645f63c773e1c7"},
352
+ ]
353
+
354
+ [[package]]
355
+ name = "mypy"
356
+ version = "1.13.0"
357
+ description = "Optional static typing for Python"
358
+ optional = false
359
+ python-versions = ">=3.8"
360
+ files = [
361
+ {file = "mypy-1.13.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6607e0f1dd1fb7f0aca14d936d13fd19eba5e17e1cd2a14f808fa5f8f6d8f60a"},
362
+ {file = "mypy-1.13.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8a21be69bd26fa81b1f80a61ee7ab05b076c674d9b18fb56239d72e21d9f4c80"},
363
+ {file = "mypy-1.13.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7b2353a44d2179846a096e25691d54d59904559f4232519d420d64da6828a3a7"},
364
+ {file = "mypy-1.13.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0730d1c6a2739d4511dc4253f8274cdd140c55c32dfb0a4cf8b7a43f40abfa6f"},
365
+ {file = "mypy-1.13.0-cp310-cp310-win_amd64.whl", hash = "sha256:c5fc54dbb712ff5e5a0fca797e6e0aa25726c7e72c6a5850cfd2adbc1eb0a372"},
366
+ {file = "mypy-1.13.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:581665e6f3a8a9078f28d5502f4c334c0c8d802ef55ea0e7276a6e409bc0d82d"},
367
+ {file = "mypy-1.13.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3ddb5b9bf82e05cc9a627e84707b528e5c7caaa1c55c69e175abb15a761cec2d"},
368
+ {file = "mypy-1.13.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:20c7ee0bc0d5a9595c46f38beb04201f2620065a93755704e141fcac9f59db2b"},
369
+ {file = "mypy-1.13.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3790ded76f0b34bc9c8ba4def8f919dd6a46db0f5a6610fb994fe8efdd447f73"},
370
+ {file = "mypy-1.13.0-cp311-cp311-win_amd64.whl", hash = "sha256:51f869f4b6b538229c1d1bcc1dd7d119817206e2bc54e8e374b3dfa202defcca"},
371
+ {file = "mypy-1.13.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:5c7051a3461ae84dfb5dd15eff5094640c61c5f22257c8b766794e6dd85e72d5"},
372
+ {file = "mypy-1.13.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:39bb21c69a5d6342f4ce526e4584bc5c197fd20a60d14a8624d8743fffb9472e"},
373
+ {file = "mypy-1.13.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:164f28cb9d6367439031f4c81e84d3ccaa1e19232d9d05d37cb0bd880d3f93c2"},
374
+ {file = "mypy-1.13.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a4c1bfcdbce96ff5d96fc9b08e3831acb30dc44ab02671eca5953eadad07d6d0"},
375
+ {file = "mypy-1.13.0-cp312-cp312-win_amd64.whl", hash = "sha256:a0affb3a79a256b4183ba09811e3577c5163ed06685e4d4b46429a271ba174d2"},
376
+ {file = "mypy-1.13.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:a7b44178c9760ce1a43f544e595d35ed61ac2c3de306599fa59b38a6048e1aa7"},
377
+ {file = "mypy-1.13.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:5d5092efb8516d08440e36626f0153b5006d4088c1d663d88bf79625af3d1d62"},
378
+ {file = "mypy-1.13.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:de2904956dac40ced10931ac967ae63c5089bd498542194b436eb097a9f77bc8"},
379
+ {file = "mypy-1.13.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:7bfd8836970d33c2105562650656b6846149374dc8ed77d98424b40b09340ba7"},
380
+ {file = "mypy-1.13.0-cp313-cp313-win_amd64.whl", hash = "sha256:9f73dba9ec77acb86457a8fc04b5239822df0c14a082564737833d2963677dbc"},
381
+ {file = "mypy-1.13.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:100fac22ce82925f676a734af0db922ecfea991e1d7ec0ceb1e115ebe501301a"},
382
+ {file = "mypy-1.13.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:7bcb0bb7f42a978bb323a7c88f1081d1b5dee77ca86f4100735a6f541299d8fb"},
383
+ {file = "mypy-1.13.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bde31fc887c213e223bbfc34328070996061b0833b0a4cfec53745ed61f3519b"},
384
+ {file = "mypy-1.13.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:07de989f89786f62b937851295ed62e51774722e5444a27cecca993fc3f9cd74"},
385
+ {file = "mypy-1.13.0-cp38-cp38-win_amd64.whl", hash = "sha256:4bde84334fbe19bad704b3f5b78c4abd35ff1026f8ba72b29de70dda0916beb6"},
386
+ {file = "mypy-1.13.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:0246bcb1b5de7f08f2826451abd947bf656945209b140d16ed317f65a17dc7dc"},
387
+ {file = "mypy-1.13.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:7f5b7deae912cf8b77e990b9280f170381fdfbddf61b4ef80927edd813163732"},
388
+ {file = "mypy-1.13.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7029881ec6ffb8bc233a4fa364736789582c738217b133f1b55967115288a2bc"},
389
+ {file = "mypy-1.13.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:3e38b980e5681f28f033f3be86b099a247b13c491f14bb8b1e1e134d23bb599d"},
390
+ {file = "mypy-1.13.0-cp39-cp39-win_amd64.whl", hash = "sha256:a6789be98a2017c912ae6ccb77ea553bbaf13d27605d2ca20a76dfbced631b24"},
391
+ {file = "mypy-1.13.0-py3-none-any.whl", hash = "sha256:9c250883f9fd81d212e0952c92dbfcc96fc237f4b7c92f56ac81fd48460b3e5a"},
392
+ {file = "mypy-1.13.0.tar.gz", hash = "sha256:0291a61b6fbf3e6673e3405cfcc0e7650bebc7939659fdca2702958038bd835e"},
393
+ ]
394
+
395
+ [package.dependencies]
396
+ mypy-extensions = ">=1.0.0"
397
+ tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""}
398
+ typing-extensions = ">=4.6.0"
399
+
400
+ [package.extras]
401
+ dmypy = ["psutil (>=4.0)"]
402
+ faster-cache = ["orjson"]
403
+ install-types = ["pip"]
404
+ mypyc = ["setuptools (>=50)"]
405
+ reports = ["lxml"]
406
+
407
+ [[package]]
408
+ name = "mypy-extensions"
409
+ version = "1.1.0"
410
+ description = "Type system extensions for programs checked with the mypy type checker."
411
+ optional = false
412
+ python-versions = ">=3.8"
413
+ files = [
414
+ {file = "mypy_extensions-1.1.0-py3-none-any.whl", hash = "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505"},
415
+ {file = "mypy_extensions-1.1.0.tar.gz", hash = "sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558"},
416
+ ]
417
+
418
+ [[package]]
419
+ name = "packaging"
420
+ version = "26.2"
421
+ description = "Core utilities for Python packages"
422
+ optional = false
423
+ python-versions = ">=3.8"
424
+ files = [
425
+ {file = "packaging-26.2-py3-none-any.whl", hash = "sha256:5fc45236b9446107ff2415ce77c807cee2862cb6fac22b8a73826d0693b0980e"},
426
+ {file = "packaging-26.2.tar.gz", hash = "sha256:ff452ff5a3e828ce110190feff1178bb1f2ea2281fa2075aadb987c2fb221661"},
427
+ ]
428
+
429
+ [[package]]
430
+ name = "pluggy"
431
+ version = "1.5.0"
432
+ description = "plugin and hook calling mechanisms for python"
433
+ optional = false
434
+ python-versions = ">=3.8"
435
+ files = [
436
+ {file = "pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669"},
437
+ {file = "pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1"},
438
+ ]
439
+
440
+ [package.extras]
441
+ dev = ["pre-commit", "tox"]
442
+ testing = ["pytest", "pytest-benchmark"]
443
+
444
+ [[package]]
445
+ name = "pyaudio"
446
+ version = "0.2.14"
447
+ description = "Cross-platform audio I/O with PortAudio"
448
+ optional = true
449
+ python-versions = "*"
450
+ files = [
451
+ {file = "PyAudio-0.2.14-cp310-cp310-win32.whl", hash = "sha256:126065b5e82a1c03ba16e7c0404d8f54e17368836e7d2d92427358ad44fefe61"},
452
+ {file = "PyAudio-0.2.14-cp310-cp310-win_amd64.whl", hash = "sha256:2a166fc88d435a2779810dd2678354adc33499e9d4d7f937f28b20cc55893e83"},
453
+ {file = "PyAudio-0.2.14-cp311-cp311-win32.whl", hash = "sha256:506b32a595f8693811682ab4b127602d404df7dfc453b499c91a80d0f7bad289"},
454
+ {file = "PyAudio-0.2.14-cp311-cp311-win_amd64.whl", hash = "sha256:bbeb01d36a2f472ae5ee5e1451cacc42112986abe622f735bb870a5db77cf903"},
455
+ {file = "PyAudio-0.2.14-cp312-cp312-win32.whl", hash = "sha256:5fce4bcdd2e0e8c063d835dbe2860dac46437506af509353c7f8114d4bacbd5b"},
456
+ {file = "PyAudio-0.2.14-cp312-cp312-win_amd64.whl", hash = "sha256:12f2f1ba04e06ff95d80700a78967897a489c05e093e3bffa05a84ed9c0a7fa3"},
457
+ {file = "PyAudio-0.2.14-cp313-cp313-win32.whl", hash = "sha256:95328285b4dab57ea8c52a4a996cb52be6d629353315be5bfda403d15932a497"},
458
+ {file = "PyAudio-0.2.14-cp313-cp313-win_amd64.whl", hash = "sha256:692d8c1446f52ed2662120bcd9ddcb5aa2b71f38bda31e58b19fb4672fffba69"},
459
+ {file = "PyAudio-0.2.14-cp38-cp38-win32.whl", hash = "sha256:858caf35b05c26d8fc62f1efa2e8f53d5fa1a01164842bd622f70ddc41f55000"},
460
+ {file = "PyAudio-0.2.14-cp38-cp38-win_amd64.whl", hash = "sha256:2dac0d6d675fe7e181ba88f2de88d321059b69abd52e3f4934a8878e03a7a074"},
461
+ {file = "PyAudio-0.2.14-cp39-cp39-win32.whl", hash = "sha256:f745109634a7c19fa4d6b8b7d6967c3123d988c9ade0cd35d4295ee1acdb53e9"},
462
+ {file = "PyAudio-0.2.14-cp39-cp39-win_amd64.whl", hash = "sha256:009f357ee5aa6bc8eb19d69921cd30e98c42cddd34210615d592a71d09c4bd57"},
463
+ {file = "PyAudio-0.2.14.tar.gz", hash = "sha256:78dfff3879b4994d1f4fc6485646a57755c6ee3c19647a491f790a0895bd2f87"},
464
+ ]
465
+
466
+ [package.extras]
467
+ test = ["numpy"]
468
+
469
+ [[package]]
470
+ name = "pydantic"
471
+ version = "2.10.6"
472
+ description = "Data validation using Python type hints"
473
+ optional = false
474
+ python-versions = ">=3.8"
475
+ files = [
476
+ {file = "pydantic-2.10.6-py3-none-any.whl", hash = "sha256:427d664bf0b8a2b34ff5dd0f5a18df00591adcee7198fbd71981054cef37b584"},
477
+ {file = "pydantic-2.10.6.tar.gz", hash = "sha256:ca5daa827cce33de7a42be142548b0096bf05a7e7b365aebfa5f8eeec7128236"},
478
+ ]
479
+
480
+ [package.dependencies]
481
+ annotated-types = ">=0.6.0"
482
+ pydantic-core = "2.27.2"
483
+ typing-extensions = ">=4.12.2"
484
+
485
+ [package.extras]
486
+ email = ["email-validator (>=2.0.0)"]
487
+ timezone = ["tzdata"]
488
+
489
+ [[package]]
490
+ name = "pydantic-core"
491
+ version = "2.27.2"
492
+ description = "Core functionality for Pydantic validation and serialization"
493
+ optional = false
494
+ python-versions = ">=3.8"
495
+ files = [
496
+ {file = "pydantic_core-2.27.2-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:2d367ca20b2f14095a8f4fa1210f5a7b78b8a20009ecced6b12818f455b1e9fa"},
497
+ {file = "pydantic_core-2.27.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:491a2b73db93fab69731eaee494f320faa4e093dbed776be1a829c2eb222c34c"},
498
+ {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7969e133a6f183be60e9f6f56bfae753585680f3b7307a8e555a948d443cc05a"},
499
+ {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:3de9961f2a346257caf0aa508a4da705467f53778e9ef6fe744c038119737ef5"},
500
+ {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e2bb4d3e5873c37bb3dd58714d4cd0b0e6238cebc4177ac8fe878f8b3aa8e74c"},
501
+ {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:280d219beebb0752699480fe8f1dc61ab6615c2046d76b7ab7ee38858de0a4e7"},
502
+ {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:47956ae78b6422cbd46f772f1746799cbb862de838fd8d1fbd34a82e05b0983a"},
503
+ {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:14d4a5c49d2f009d62a2a7140d3064f686d17a5d1a268bc641954ba181880236"},
504
+ {file = "pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:337b443af21d488716f8d0b6164de833e788aa6bd7e3a39c005febc1284f4962"},
505
+ {file = "pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:03d0f86ea3184a12f41a2d23f7ccb79cdb5a18e06993f8a45baa8dfec746f0e9"},
506
+ {file = "pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:7041c36f5680c6e0f08d922aed302e98b3745d97fe1589db0a3eebf6624523af"},
507
+ {file = "pydantic_core-2.27.2-cp310-cp310-win32.whl", hash = "sha256:50a68f3e3819077be2c98110c1f9dcb3817e93f267ba80a2c05bb4f8799e2ff4"},
508
+ {file = "pydantic_core-2.27.2-cp310-cp310-win_amd64.whl", hash = "sha256:e0fd26b16394ead34a424eecf8a31a1f5137094cabe84a1bcb10fa6ba39d3d31"},
509
+ {file = "pydantic_core-2.27.2-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:8e10c99ef58cfdf2a66fc15d66b16c4a04f62bca39db589ae8cba08bc55331bc"},
510
+ {file = "pydantic_core-2.27.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:26f32e0adf166a84d0cb63be85c562ca8a6fa8de28e5f0d92250c6b7e9e2aff7"},
511
+ {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8c19d1ea0673cd13cc2f872f6c9ab42acc4e4f492a7ca9d3795ce2b112dd7e15"},
512
+ {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5e68c4446fe0810e959cdff46ab0a41ce2f2c86d227d96dc3847af0ba7def306"},
513
+ {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d9640b0059ff4f14d1f37321b94061c6db164fbe49b334b31643e0528d100d99"},
514
+ {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:40d02e7d45c9f8af700f3452f329ead92da4c5f4317ca9b896de7ce7199ea459"},
515
+ {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1c1fd185014191700554795c99b347d64f2bb637966c4cfc16998a0ca700d048"},
516
+ {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d81d2068e1c1228a565af076598f9e7451712700b673de8f502f0334f281387d"},
517
+ {file = "pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:1a4207639fb02ec2dbb76227d7c751a20b1a6b4bc52850568e52260cae64ca3b"},
518
+ {file = "pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:3de3ce3c9ddc8bbd88f6e0e304dea0e66d843ec9de1b0042b0911c1663ffd474"},
519
+ {file = "pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:30c5f68ded0c36466acede341551106821043e9afaad516adfb6e8fa80a4e6a6"},
520
+ {file = "pydantic_core-2.27.2-cp311-cp311-win32.whl", hash = "sha256:c70c26d2c99f78b125a3459f8afe1aed4d9687c24fd677c6a4436bc042e50d6c"},
521
+ {file = "pydantic_core-2.27.2-cp311-cp311-win_amd64.whl", hash = "sha256:08e125dbdc505fa69ca7d9c499639ab6407cfa909214d500897d02afb816e7cc"},
522
+ {file = "pydantic_core-2.27.2-cp311-cp311-win_arm64.whl", hash = "sha256:26f0d68d4b235a2bae0c3fc585c585b4ecc51382db0e3ba402a22cbc440915e4"},
523
+ {file = "pydantic_core-2.27.2-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:9e0c8cfefa0ef83b4da9588448b6d8d2a2bf1a53c3f1ae5fca39eb3061e2f0b0"},
524
+ {file = "pydantic_core-2.27.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:83097677b8e3bd7eaa6775720ec8e0405f1575015a463285a92bfdfe254529ef"},
525
+ {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:172fce187655fece0c90d90a678424b013f8fbb0ca8b036ac266749c09438cb7"},
526
+ {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:519f29f5213271eeeeb3093f662ba2fd512b91c5f188f3bb7b27bc5973816934"},
527
+ {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:05e3a55d124407fffba0dd6b0c0cd056d10e983ceb4e5dbd10dda135c31071d6"},
528
+ {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9c3ed807c7b91de05e63930188f19e921d1fe90de6b4f5cd43ee7fcc3525cb8c"},
529
+ {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6fb4aadc0b9a0c063206846d603b92030eb6f03069151a625667f982887153e2"},
530
+ {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:28ccb213807e037460326424ceb8b5245acb88f32f3d2777427476e1b32c48c4"},
531
+ {file = "pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:de3cd1899e2c279b140adde9357c4495ed9d47131b4a4eaff9052f23398076b3"},
532
+ {file = "pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:220f892729375e2d736b97d0e51466252ad84c51857d4d15f5e9692f9ef12be4"},
533
+ {file = "pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a0fcd29cd6b4e74fe8ddd2c90330fd8edf2e30cb52acda47f06dd615ae72da57"},
534
+ {file = "pydantic_core-2.27.2-cp312-cp312-win32.whl", hash = "sha256:1e2cb691ed9834cd6a8be61228471d0a503731abfb42f82458ff27be7b2186fc"},
535
+ {file = "pydantic_core-2.27.2-cp312-cp312-win_amd64.whl", hash = "sha256:cc3f1a99a4f4f9dd1de4fe0312c114e740b5ddead65bb4102884b384c15d8bc9"},
536
+ {file = "pydantic_core-2.27.2-cp312-cp312-win_arm64.whl", hash = "sha256:3911ac9284cd8a1792d3cb26a2da18f3ca26c6908cc434a18f730dc0db7bfa3b"},
537
+ {file = "pydantic_core-2.27.2-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:7d14bd329640e63852364c306f4d23eb744e0f8193148d4044dd3dacdaacbd8b"},
538
+ {file = "pydantic_core-2.27.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:82f91663004eb8ed30ff478d77c4d1179b3563df6cdb15c0817cd1cdaf34d154"},
539
+ {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:71b24c7d61131bb83df10cc7e687433609963a944ccf45190cfc21e0887b08c9"},
540
+ {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:fa8e459d4954f608fa26116118bb67f56b93b209c39b008277ace29937453dc9"},
541
+ {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ce8918cbebc8da707ba805b7fd0b382816858728ae7fe19a942080c24e5b7cd1"},
542
+ {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:eda3f5c2a021bbc5d976107bb302e0131351c2ba54343f8a496dc8783d3d3a6a"},
543
+ {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bd8086fa684c4775c27f03f062cbb9eaa6e17f064307e86b21b9e0abc9c0f02e"},
544
+ {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8d9b3388db186ba0c099a6d20f0604a44eabdeef1777ddd94786cdae158729e4"},
545
+ {file = "pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:7a66efda2387de898c8f38c0cf7f14fca0b51a8ef0b24bfea5849f1b3c95af27"},
546
+ {file = "pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:18a101c168e4e092ab40dbc2503bdc0f62010e95d292b27827871dc85450d7ee"},
547
+ {file = "pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:ba5dd002f88b78a4215ed2f8ddbdf85e8513382820ba15ad5ad8955ce0ca19a1"},
548
+ {file = "pydantic_core-2.27.2-cp313-cp313-win32.whl", hash = "sha256:1ebaf1d0481914d004a573394f4be3a7616334be70261007e47c2a6fe7e50130"},
549
+ {file = "pydantic_core-2.27.2-cp313-cp313-win_amd64.whl", hash = "sha256:953101387ecf2f5652883208769a79e48db18c6df442568a0b5ccd8c2723abee"},
550
+ {file = "pydantic_core-2.27.2-cp313-cp313-win_arm64.whl", hash = "sha256:ac4dbfd1691affb8f48c2c13241a2e3b60ff23247cbcf981759c768b6633cf8b"},
551
+ {file = "pydantic_core-2.27.2-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:d3e8d504bdd3f10835468f29008d72fc8359d95c9c415ce6e767203db6127506"},
552
+ {file = "pydantic_core-2.27.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:521eb9b7f036c9b6187f0b47318ab0d7ca14bd87f776240b90b21c1f4f149320"},
553
+ {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:85210c4d99a0114f5a9481b44560d7d1e35e32cc5634c656bc48e590b669b145"},
554
+ {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d716e2e30c6f140d7560ef1538953a5cd1a87264c737643d481f2779fc247fe1"},
555
+ {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f66d89ba397d92f840f8654756196d93804278457b5fbede59598a1f9f90b228"},
556
+ {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:669e193c1c576a58f132e3158f9dfa9662969edb1a250c54d8fa52590045f046"},
557
+ {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9fdbe7629b996647b99c01b37f11170a57ae675375b14b8c13b8518b8320ced5"},
558
+ {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d262606bf386a5ba0b0af3b97f37c83d7011439e3dc1a9298f21efb292e42f1a"},
559
+ {file = "pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:cabb9bcb7e0d97f74df8646f34fc76fbf793b7f6dc2438517d7a9e50eee4f14d"},
560
+ {file = "pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_armv7l.whl", hash = "sha256:d2d63f1215638d28221f664596b1ccb3944f6e25dd18cd3b86b0a4c408d5ebb9"},
561
+ {file = "pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:bca101c00bff0adb45a833f8451b9105d9df18accb8743b08107d7ada14bd7da"},
562
+ {file = "pydantic_core-2.27.2-cp38-cp38-win32.whl", hash = "sha256:f6f8e111843bbb0dee4cb6594cdc73e79b3329b526037ec242a3e49012495b3b"},
563
+ {file = "pydantic_core-2.27.2-cp38-cp38-win_amd64.whl", hash = "sha256:fd1aea04935a508f62e0d0ef1f5ae968774a32afc306fb8545e06f5ff5cdf3ad"},
564
+ {file = "pydantic_core-2.27.2-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:c10eb4f1659290b523af58fa7cffb452a61ad6ae5613404519aee4bfbf1df993"},
565
+ {file = "pydantic_core-2.27.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ef592d4bad47296fb11f96cd7dc898b92e795032b4894dfb4076cfccd43a9308"},
566
+ {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c61709a844acc6bf0b7dce7daae75195a10aac96a596ea1b776996414791ede4"},
567
+ {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:42c5f762659e47fdb7b16956c71598292f60a03aa92f8b6351504359dbdba6cf"},
568
+ {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4c9775e339e42e79ec99c441d9730fccf07414af63eac2f0e48e08fd38a64d76"},
569
+ {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:57762139821c31847cfb2df63c12f725788bd9f04bc2fb392790959b8f70f118"},
570
+ {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0d1e85068e818c73e048fe28cfc769040bb1f475524f4745a5dc621f75ac7630"},
571
+ {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:097830ed52fd9e427942ff3b9bc17fab52913b2f50f2880dc4a5611446606a54"},
572
+ {file = "pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:044a50963a614ecfae59bb1eaf7ea7efc4bc62f49ed594e18fa1e5d953c40e9f"},
573
+ {file = "pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_armv7l.whl", hash = "sha256:4e0b4220ba5b40d727c7f879eac379b822eee5d8fff418e9d3381ee45b3b0362"},
574
+ {file = "pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5e4f4bb20d75e9325cc9696c6802657b58bc1dbbe3022f32cc2b2b632c3fbb96"},
575
+ {file = "pydantic_core-2.27.2-cp39-cp39-win32.whl", hash = "sha256:cca63613e90d001b9f2f9a9ceb276c308bfa2a43fafb75c8031c4f66039e8c6e"},
576
+ {file = "pydantic_core-2.27.2-cp39-cp39-win_amd64.whl", hash = "sha256:77d1bca19b0f7021b3a982e6f903dcd5b2b06076def36a652e3907f596e29f67"},
577
+ {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:2bf14caea37e91198329b828eae1618c068dfb8ef17bb33287a7ad4b61ac314e"},
578
+ {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:b0cb791f5b45307caae8810c2023a184c74605ec3bcbb67d13846c28ff731ff8"},
579
+ {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:688d3fd9fcb71f41c4c015c023d12a79d1c4c0732ec9eb35d96e3388a120dcf3"},
580
+ {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3d591580c34f4d731592f0e9fe40f9cc1b430d297eecc70b962e93c5c668f15f"},
581
+ {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:82f986faf4e644ffc189a7f1aafc86e46ef70372bb153e7001e8afccc6e54133"},
582
+ {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:bec317a27290e2537f922639cafd54990551725fc844249e64c523301d0822fc"},
583
+ {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:0296abcb83a797db256b773f45773da397da75a08f5fcaef41f2044adec05f50"},
584
+ {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:0d75070718e369e452075a6017fbf187f788e17ed67a3abd47fa934d001863d9"},
585
+ {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:7e17b560be3c98a8e3aa66ce828bdebb9e9ac6ad5466fba92eb74c4c95cb1151"},
586
+ {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:c33939a82924da9ed65dab5a65d427205a73181d8098e79b6b426bdf8ad4e656"},
587
+ {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:00bad2484fa6bda1e216e7345a798bd37c68fb2d97558edd584942aa41b7d278"},
588
+ {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c817e2b40aba42bac6f457498dacabc568c3b7a986fc9ba7c8d9d260b71485fb"},
589
+ {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:251136cdad0cb722e93732cb45ca5299fb56e1344a833640bf93b2803f8d1bfd"},
590
+ {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d2088237af596f0a524d3afc39ab3b036e8adb054ee57cbb1dcf8e09da5b29cc"},
591
+ {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:d4041c0b966a84b4ae7a09832eb691a35aec90910cd2dbe7a208de59be77965b"},
592
+ {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:8083d4e875ebe0b864ffef72a4304827015cff328a1be6e22cc850753bfb122b"},
593
+ {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f141ee28a0ad2123b6611b6ceff018039df17f32ada8b534e6aa039545a3efb2"},
594
+ {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:7d0c8399fcc1848491f00e0314bd59fb34a9c008761bcb422a057670c3f65e35"},
595
+ {file = "pydantic_core-2.27.2.tar.gz", hash = "sha256:eb026e5a4c1fee05726072337ff51d1efb6f59090b7da90d30ea58625b1ffb39"},
596
+ ]
597
+
598
+ [package.dependencies]
599
+ typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0"
600
+
601
+ [[package]]
602
+ name = "pytest"
603
+ version = "7.4.4"
604
+ description = "pytest: simple powerful testing with Python"
605
+ optional = false
606
+ python-versions = ">=3.7"
607
+ files = [
608
+ {file = "pytest-7.4.4-py3-none-any.whl", hash = "sha256:b090cdf5ed60bf4c45261be03239c2c1c22df034fbffe691abe93cd80cea01d8"},
609
+ {file = "pytest-7.4.4.tar.gz", hash = "sha256:2cf0005922c6ace4a3e2ec8b4080eb0d9753fdc93107415332f50ce9e7994280"},
610
+ ]
611
+
612
+ [package.dependencies]
613
+ colorama = {version = "*", markers = "sys_platform == \"win32\""}
614
+ exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""}
615
+ iniconfig = "*"
616
+ packaging = "*"
617
+ pluggy = ">=0.12,<2.0"
618
+ tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""}
619
+
620
+ [package.extras]
621
+ testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"]
622
+
623
+ [[package]]
624
+ name = "pytest-asyncio"
625
+ version = "0.23.8"
626
+ description = "Pytest support for asyncio"
627
+ optional = false
628
+ python-versions = ">=3.8"
629
+ files = [
630
+ {file = "pytest_asyncio-0.23.8-py3-none-any.whl", hash = "sha256:50265d892689a5faefb84df80819d1ecef566eb3549cf915dfb33569359d1ce2"},
631
+ {file = "pytest_asyncio-0.23.8.tar.gz", hash = "sha256:759b10b33a6dc61cce40a8bd5205e302978bbbcc00e279a8b61d9a6a3c82e4d3"},
632
+ ]
633
+
634
+ [package.dependencies]
635
+ pytest = ">=7.0.0,<9"
636
+
637
+ [package.extras]
638
+ docs = ["sphinx (>=5.3)", "sphinx-rtd-theme (>=1.0)"]
639
+ testing = ["coverage (>=6.2)", "hypothesis (>=5.7.1)"]
640
+
641
+ [[package]]
642
+ name = "pytest-xdist"
643
+ version = "3.6.1"
644
+ description = "pytest xdist plugin for distributed testing, most importantly across multiple CPUs"
645
+ optional = false
646
+ python-versions = ">=3.8"
647
+ files = [
648
+ {file = "pytest_xdist-3.6.1-py3-none-any.whl", hash = "sha256:9ed4adfb68a016610848639bb7e02c9352d5d9f03d04809919e2dafc3be4cca7"},
649
+ {file = "pytest_xdist-3.6.1.tar.gz", hash = "sha256:ead156a4db231eec769737f57668ef58a2084a34b2e55c4a8fa20d861107300d"},
650
+ ]
651
+
652
+ [package.dependencies]
653
+ execnet = ">=2.1"
654
+ pytest = ">=7.0.0"
655
+
656
+ [package.extras]
657
+ psutil = ["psutil (>=3.0)"]
658
+ setproctitle = ["setproctitle"]
659
+ testing = ["filelock"]
660
+
661
+ [[package]]
662
+ name = "python-dateutil"
663
+ version = "2.9.0.post0"
664
+ description = "Extensions to the standard Python datetime module"
665
+ optional = false
666
+ python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7"
667
+ files = [
668
+ {file = "python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3"},
669
+ {file = "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"},
670
+ ]
671
+
672
+ [package.dependencies]
673
+ six = ">=1.5"
674
+
675
+ [[package]]
676
+ name = "requests"
677
+ version = "2.32.4"
678
+ description = "Python HTTP for Humans."
679
+ optional = false
680
+ python-versions = ">=3.8"
681
+ files = [
682
+ {file = "requests-2.32.4-py3-none-any.whl", hash = "sha256:27babd3cda2a6d50b30443204ee89830707d396671944c998b5975b031ac2b2c"},
683
+ {file = "requests-2.32.4.tar.gz", hash = "sha256:27d0316682c8a29834d3264820024b62a36942083d52caf2f14c0591336d3422"},
684
+ ]
685
+
686
+ [package.dependencies]
687
+ certifi = ">=2017.4.17"
688
+ charset_normalizer = ">=2,<4"
689
+ idna = ">=2.5,<4"
690
+ urllib3 = ">=1.21.1,<3"
691
+
692
+ [package.extras]
693
+ socks = ["PySocks (>=1.5.6,!=1.5.7)"]
694
+ use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"]
695
+
696
+ [[package]]
697
+ name = "ruff"
698
+ version = "0.11.5"
699
+ description = "An extremely fast Python linter and code formatter, written in Rust."
700
+ optional = false
701
+ python-versions = ">=3.7"
702
+ files = [
703
+ {file = "ruff-0.11.5-py3-none-linux_armv6l.whl", hash = "sha256:2561294e108eb648e50f210671cc56aee590fb6167b594144401532138c66c7b"},
704
+ {file = "ruff-0.11.5-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:ac12884b9e005c12d0bd121f56ccf8033e1614f736f766c118ad60780882a077"},
705
+ {file = "ruff-0.11.5-py3-none-macosx_11_0_arm64.whl", hash = "sha256:4bfd80a6ec559a5eeb96c33f832418bf0fb96752de0539905cf7b0cc1d31d779"},
706
+ {file = "ruff-0.11.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0947c0a1afa75dcb5db4b34b070ec2bccee869d40e6cc8ab25aca11a7d527794"},
707
+ {file = "ruff-0.11.5-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ad871ff74b5ec9caa66cb725b85d4ef89b53f8170f47c3406e32ef040400b038"},
708
+ {file = "ruff-0.11.5-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e6cf918390cfe46d240732d4d72fa6e18e528ca1f60e318a10835cf2fa3dc19f"},
709
+ {file = "ruff-0.11.5-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:56145ee1478582f61c08f21076dc59153310d606ad663acc00ea3ab5b2125f82"},
710
+ {file = "ruff-0.11.5-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e5f66f8f1e8c9fc594cbd66fbc5f246a8d91f916cb9667e80208663ec3728304"},
711
+ {file = "ruff-0.11.5-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:80b4df4d335a80315ab9afc81ed1cff62be112bd165e162b5eed8ac55bfc8470"},
712
+ {file = "ruff-0.11.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3068befab73620b8a0cc2431bd46b3cd619bc17d6f7695a3e1bb166b652c382a"},
713
+ {file = "ruff-0.11.5-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:f5da2e710a9641828e09aa98b92c9ebbc60518fdf3921241326ca3e8f8e55b8b"},
714
+ {file = "ruff-0.11.5-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:ef39f19cb8ec98cbc762344921e216f3857a06c47412030374fffd413fb8fd3a"},
715
+ {file = "ruff-0.11.5-py3-none-musllinux_1_2_i686.whl", hash = "sha256:b2a7cedf47244f431fd11aa5a7e2806dda2e0c365873bda7834e8f7d785ae159"},
716
+ {file = "ruff-0.11.5-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:81be52e7519f3d1a0beadcf8e974715b2dfc808ae8ec729ecfc79bddf8dbb783"},
717
+ {file = "ruff-0.11.5-py3-none-win32.whl", hash = "sha256:e268da7b40f56e3eca571508a7e567e794f9bfcc0f412c4b607931d3af9c4afe"},
718
+ {file = "ruff-0.11.5-py3-none-win_amd64.whl", hash = "sha256:6c6dc38af3cfe2863213ea25b6dc616d679205732dc0fb673356c2d69608f800"},
719
+ {file = "ruff-0.11.5-py3-none-win_arm64.whl", hash = "sha256:67e241b4314f4eacf14a601d586026a962f4002a475aa702c69980a38087aa4e"},
720
+ {file = "ruff-0.11.5.tar.gz", hash = "sha256:cae2e2439cb88853e421901ec040a758960b576126dab520fa08e9de431d1bef"},
721
+ ]
722
+
723
+ [[package]]
724
+ name = "six"
725
+ version = "1.17.0"
726
+ description = "Python 2 and 3 compatibility utilities"
727
+ optional = false
728
+ python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7"
729
+ files = [
730
+ {file = "six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274"},
731
+ {file = "six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81"},
732
+ ]
733
+
734
+ [[package]]
735
+ name = "sniffio"
736
+ version = "1.3.1"
737
+ description = "Sniff out which async library your code is running under"
738
+ optional = false
739
+ python-versions = ">=3.7"
740
+ files = [
741
+ {file = "sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2"},
742
+ {file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"},
743
+ ]
744
+
745
+ [[package]]
746
+ name = "tomli"
747
+ version = "2.5.0"
748
+ description = "A lil' TOML parser"
749
+ optional = false
750
+ python-versions = ">=3.8"
751
+ files = [
752
+ {file = "tomli-2.5.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c4dc1c1781f2f716de763d1e9a7b34c6a894e167e291c7c5d16c72f7a9538545"},
753
+ {file = "tomli-2.5.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:eff8babca5a7999bc137acbc7482a8b7e17ffca5075ab41f5d770ab408c7bfef"},
754
+ {file = "tomli-2.5.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:86665cee9c4835b7a7f1e8ec2c719b5258d4dc782887aded5a8ae7352a96843b"},
755
+ {file = "tomli-2.5.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d7e369fd63331746182360977b1892bfc215476a30d61612d732425311639f56"},
756
+ {file = "tomli-2.5.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:7ad1ea345759240d6463efa0ed1c704402752e49aa21476620738d74d72d8aa1"},
757
+ {file = "tomli-2.5.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:96243987194634bd411066ce40c952e108f86af04db533ecd8ac3ff2a85b1885"},
758
+ {file = "tomli-2.5.0-cp311-cp311-win32.whl", hash = "sha256:610b27d99f28ec5f191c7064a48f3ddb179a1fe6ca73d571483ae859f57b605e"},
759
+ {file = "tomli-2.5.0-cp311-cp311-win_amd64.whl", hash = "sha256:c804ae44fe7b4bab5da295e4f980a1ff04670bca9d23fe0a4e887e08ebd741a8"},
760
+ {file = "tomli-2.5.0-cp311-cp311-win_arm64.whl", hash = "sha256:cfac177ebd6236003846ea339981f71457cb6eb748f23381eb257e45092e3980"},
761
+ {file = "tomli-2.5.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:1f4a40d03fb9f63424f0979855bdeaf44dd7696b8d59501822c10ed30ba532df"},
762
+ {file = "tomli-2.5.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:9ebf8d19b17bd0daeb7b7dec81a946a439b753942fd0210d6e96c532249eea6b"},
763
+ {file = "tomli-2.5.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:bf0b5e8e0f68ebb494356e577c06c139161efd8d3b9050f93b39b7c26cc54ff0"},
764
+ {file = "tomli-2.5.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6cf74416bdc94ae458b14e37286c1073081850ac8459a00d0c5efef5d44294c6"},
765
+ {file = "tomli-2.5.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:61ea1ebe1e55a34ea8199cc8dbff398d35027b82271c8ac4802fd3a1fd5b1bcc"},
766
+ {file = "tomli-2.5.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:ed53f7e89bb04f6d9e8e7799112360b0c4d5cbff067de0814c98c37c39b920f7"},
767
+ {file = "tomli-2.5.0-cp312-cp312-win32.whl", hash = "sha256:e7ad033e27a516a233bea839cdb77b80146facb3b4f40bf02cd0cac165cdd5c2"},
768
+ {file = "tomli-2.5.0-cp312-cp312-win_amd64.whl", hash = "sha256:bd05de8c1698f8413dd7d869492693a0bf2211543b787ac78cd5e7536af1a6d7"},
769
+ {file = "tomli-2.5.0-cp312-cp312-win_arm64.whl", hash = "sha256:069435bd5480429b98c5e5afb02ab21c219b6f0064680671c6dc0d46817346ea"},
770
+ {file = "tomli-2.5.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:943276cf269e0071948d9ff697159c1735e623c1151d88abb09b74659ef0cbea"},
771
+ {file = "tomli-2.5.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:463b16086865b97facd8d0b3fb4cb7c544e3f58d2a69dc3113d6db9653fdb043"},
772
+ {file = "tomli-2.5.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1245a6638fc4bb0a60af38a7d45413db34a13842027c77597c712c998c62fdf0"},
773
+ {file = "tomli-2.5.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5d8bac3d603c97e6854424e5b2b5b741bdbde387e09f162fb0446812b4a8362b"},
774
+ {file = "tomli-2.5.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:21e4cae4114aba25aa0d4f85cdf486d290fb35c0954d7bba536248da64d43066"},
775
+ {file = "tomli-2.5.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:bbaefc84548d754be821bba7c4141c4787dda182f9e77f2f87b71213529efa7b"},
776
+ {file = "tomli-2.5.0-cp313-cp313-win32.whl", hash = "sha256:abdbf6313b8d9efe157edeb7ab6eae4de064b1300ad31abf73755154b30abe68"},
777
+ {file = "tomli-2.5.0-cp313-cp313-win_amd64.whl", hash = "sha256:fd4dc129784e0c5335bd4e61dfcc4487499a013419e655cf2da1d091b7e0efdc"},
778
+ {file = "tomli-2.5.0-cp313-cp313-win_arm64.whl", hash = "sha256:69491c143d2fe063046e0301e62a810bed338fa4d1ce0fd870c27dc1e09b0d84"},
779
+ {file = "tomli-2.5.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:d3182ee2d887e507bd67319a0a61105d1dd33facc111329559a233b772c1a105"},
780
+ {file = "tomli-2.5.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:521345fd1f19d45b8df87657aaa38b6f2ca3800059fadf428e7ebf479a383646"},
781
+ {file = "tomli-2.5.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6e95c7614e705bfe2b04b27aa124adec59752d15813df37e2156747cab3a006b"},
782
+ {file = "tomli-2.5.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7ac2027d37c3afbdf4bdd377f2676f6f1d2122a5be1f1137b49dced590b37e75"},
783
+ {file = "tomli-2.5.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:c414be4ed9d3cac80c42e348fa5a956117d1a48227f48026e31f59cb4a7671eb"},
784
+ {file = "tomli-2.5.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:9b03d7dc168353b4132965bde20feceabaa470e570c6f59660dfae59b1f9eeb3"},
785
+ {file = "tomli-2.5.0-cp314-cp314-win32.whl", hash = "sha256:6f041843c4d3a37245c0c056fd955b186bf8b1fb85690cbe40b81230891dc34b"},
786
+ {file = "tomli-2.5.0-cp314-cp314-win_amd64.whl", hash = "sha256:f4b653094e18f9031102d3a1da5c729c8f222d85225b18037dac621695e46e1a"},
787
+ {file = "tomli-2.5.0-cp314-cp314-win_arm64.whl", hash = "sha256:3f89d10c1ff6a38d992c27fc8a4816af71a909e08a40ec66934240b1e74347c3"},
788
+ {file = "tomli-2.5.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:e9e15b4a6c7dd6b85b5fbab29488a73f1f70de516942308daa266bf0e0aeb0d4"},
789
+ {file = "tomli-2.5.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:e12bbcd32897272fb05929110362ae9ff4c1b9bb26bd9e971e71dcd3275b4c3d"},
790
+ {file = "tomli-2.5.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:20aa36de8f2cf87237143bc1fa1aae8d6612c09118f4da21c6a684db5dd1f6f9"},
791
+ {file = "tomli-2.5.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:22185fad8a1e622f064e78008018a0dd3323550dcb479cb7a1d296888d74024f"},
792
+ {file = "tomli-2.5.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:984012f71908165449a951de2050d52f276bfe3aa5d5f570f63ddad814370374"},
793
+ {file = "tomli-2.5.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:f79203b3965b4000e91808aaa7c040206093f2b8bf86f455982f2274c9ccf442"},
794
+ {file = "tomli-2.5.0-cp314-cp314t-win32.whl", hash = "sha256:91294a9fb94a75542f6e46e4a2ae709bd8d9b51134098cae5cf3bea5478b6d03"},
795
+ {file = "tomli-2.5.0-cp314-cp314t-win_amd64.whl", hash = "sha256:f15e3e0b835a6d68b10c86bf80a3149780498d6911c93c3ffd1861d19f9200f1"},
796
+ {file = "tomli-2.5.0-cp314-cp314t-win_arm64.whl", hash = "sha256:6664b7ae7af7294256c53960a6103077f4914cec8ff98479c352f622c6f6b2f0"},
797
+ {file = "tomli-2.5.0-cp315-cp315-macosx_10_15_x86_64.whl", hash = "sha256:a525685c2f97da40762b8695eb7aa0af4c8344ca1905c73e4e29cb04d34607dc"},
798
+ {file = "tomli-2.5.0-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:9dbb18c1cfb2f6517942fc9314437f66aa06d94436ffb1f06102ef3572f35276"},
799
+ {file = "tomli-2.5.0-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:752e8b1aa6a4367ef8bf6a1a1e005540f7ed055ba36d7193796812ca5404eb52"},
800
+ {file = "tomli-2.5.0-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c47300f9bf791808f77d82747691c4bb09cb14bdf3060cca99b42cdc4361d5a7"},
801
+ {file = "tomli-2.5.0-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:19b0dd8749f4ea2f112c5fcfb3c5248390c899d7e2e173f1d91abee1fa0ff391"},
802
+ {file = "tomli-2.5.0-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:57b1c3b01fab802e2899bc3d168dca320e14165e2fd9fd584760fb4ca5826859"},
803
+ {file = "tomli-2.5.0-cp315-cp315-win32.whl", hash = "sha256:667e521b37a6c5ccaa044202c235b530f90177ffe2cd4a64ecc213c7dd535feb"},
804
+ {file = "tomli-2.5.0-cp315-cp315-win_amd64.whl", hash = "sha256:d747252933c8a65ef6bd8da0fbb7ce28a90eb6119d8cd00772cd528aa07b68d5"},
805
+ {file = "tomli-2.5.0-cp315-cp315-win_arm64.whl", hash = "sha256:75dbcde8751b0a960aa3de173aa5e894d590755c6d7758b7e774c06f1dc3cbdd"},
806
+ {file = "tomli-2.5.0-cp315-cp315t-macosx_10_15_x86_64.whl", hash = "sha256:2419c2a189551987b59d80e63ec355671283336f41c6b9b89462df679c7d0c57"},
807
+ {file = "tomli-2.5.0-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:0dc598040da8d42cf20f0be588ed7004f46db12a0ac6c32e03a59dccedaaadcd"},
808
+ {file = "tomli-2.5.0-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:49096930c8d886c9bbdab62d2d0d17ce823ddeea522309a190b36245d5b49e01"},
809
+ {file = "tomli-2.5.0-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b8ade5023067f99fe72b88accd30d0ea05a158e9e32a11f124e731ea9695313f"},
810
+ {file = "tomli-2.5.0-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:b69564772b5c8f22ea5f498dff08cfa825045b4d4c4400529000bdf818aa3b2a"},
811
+ {file = "tomli-2.5.0-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:8ff3a2ca028c7eee0c777f9a092038d0a594a9fa04e215f929a22c329e2cb142"},
812
+ {file = "tomli-2.5.0-cp315-cp315t-win32.whl", hash = "sha256:62fc1bc8eb03e3a9cadfca713d65614ed8e09d974a283295ffe3a831976b4dc5"},
813
+ {file = "tomli-2.5.0-cp315-cp315t-win_amd64.whl", hash = "sha256:f3fcbc57b1791fa6cbe5d8434179d51de12be1a4811469529f47f6e7487a2571"},
814
+ {file = "tomli-2.5.0-cp315-cp315t-win_arm64.whl", hash = "sha256:d2ba24db8a9376921b5e87b4762b9adb0f3f1deaea68f2b8b0bb2c11efb9c3e7"},
815
+ {file = "tomli-2.5.0-py3-none-any.whl", hash = "sha256:32a7b79ac57a2e83670ce329ccf675798bc5a2094783a63676866b70503f2e2b"},
816
+ {file = "tomli-2.5.0.tar.gz", hash = "sha256:264507556cd8b8c8e7c6ee037cdf443a463f03f4c958e57195e3d369711b8ff6"},
817
+ ]
818
+
819
+ [[package]]
820
+ name = "types-pyaudio"
821
+ version = "0.2.16.20240516"
822
+ description = "Typing stubs for pyaudio"
823
+ optional = false
824
+ python-versions = ">=3.8"
825
+ files = [
826
+ {file = "types-pyaudio-0.2.16.20240516.tar.gz", hash = "sha256:f1c419ccc78b00d26c6c1ae4fcb17f7e4f08af2c2b9b73b12fcbc4a4ffa3a2c7"},
827
+ {file = "types_pyaudio-0.2.16.20240516-py3-none-any.whl", hash = "sha256:40063f13ae15a422cbd4a2a783653eb3e1091bdd23fc7ab8ca3abc21ad0d13f8"},
828
+ ]
829
+
830
+ [[package]]
831
+ name = "types-python-dateutil"
832
+ version = "2.9.0.20241206"
833
+ description = "Typing stubs for python-dateutil"
834
+ optional = false
835
+ python-versions = ">=3.8"
836
+ files = [
837
+ {file = "types_python_dateutil-2.9.0.20241206-py3-none-any.whl", hash = "sha256:e248a4bc70a486d3e3ec84d0dc30eec3a5f979d6e7ee4123ae043eedbb987f53"},
838
+ {file = "types_python_dateutil-2.9.0.20241206.tar.gz", hash = "sha256:18f493414c26ffba692a72369fea7a154c502646301ebfe3d56a04b3767284cb"},
839
+ ]
840
+
841
+ [[package]]
842
+ name = "typing-extensions"
843
+ version = "4.13.2"
844
+ description = "Backported and Experimental Type Hints for Python 3.8+"
845
+ optional = false
846
+ python-versions = ">=3.8"
847
+ files = [
848
+ {file = "typing_extensions-4.13.2-py3-none-any.whl", hash = "sha256:a439e7c04b49fec3e5d3e2beaa21755cadbbdc391694e28ccdd36ca4a1408f8c"},
849
+ {file = "typing_extensions-4.13.2.tar.gz", hash = "sha256:e6c81219bd689f51865d9e372991c540bda33a0379d5573cddb9a3a23f7caaef"},
850
+ ]
851
+
852
+ [[package]]
853
+ name = "urllib3"
854
+ version = "2.2.3"
855
+ description = "HTTP library with thread-safe connection pooling, file post, and more."
856
+ optional = false
857
+ python-versions = ">=3.8"
858
+ files = [
859
+ {file = "urllib3-2.2.3-py3-none-any.whl", hash = "sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac"},
860
+ {file = "urllib3-2.2.3.tar.gz", hash = "sha256:e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9"},
861
+ ]
862
+
863
+ [package.extras]
864
+ brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)"]
865
+ h2 = ["h2 (>=4,<5)"]
866
+ socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"]
867
+ zstd = ["zstandard (>=0.18.0)"]
868
+
869
+ [[package]]
870
+ name = "websockets"
871
+ version = "13.1"
872
+ description = "An implementation of the WebSocket Protocol (RFC 6455 & 7692)"
873
+ optional = false
874
+ python-versions = ">=3.8"
875
+ files = [
876
+ {file = "websockets-13.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:f48c749857f8fb598fb890a75f540e3221d0976ed0bf879cf3c7eef34151acee"},
877
+ {file = "websockets-13.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c7e72ce6bda6fb9409cc1e8164dd41d7c91466fb599eb047cfda72fe758a34a7"},
878
+ {file = "websockets-13.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:f779498eeec470295a2b1a5d97aa1bc9814ecd25e1eb637bd9d1c73a327387f6"},
879
+ {file = "websockets-13.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4676df3fe46956fbb0437d8800cd5f2b6d41143b6e7e842e60554398432cf29b"},
880
+ {file = "websockets-13.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a7affedeb43a70351bb811dadf49493c9cfd1ed94c9c70095fd177e9cc1541fa"},
881
+ {file = "websockets-13.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1971e62d2caa443e57588e1d82d15f663b29ff9dfe7446d9964a4b6f12c1e700"},
882
+ {file = "websockets-13.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:5f2e75431f8dc4a47f31565a6e1355fb4f2ecaa99d6b89737527ea917066e26c"},
883
+ {file = "websockets-13.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:58cf7e75dbf7e566088b07e36ea2e3e2bd5676e22216e4cad108d4df4a7402a0"},
884
+ {file = "websockets-13.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:c90d6dec6be2c7d03378a574de87af9b1efea77d0c52a8301dd831ece938452f"},
885
+ {file = "websockets-13.1-cp310-cp310-win32.whl", hash = "sha256:730f42125ccb14602f455155084f978bd9e8e57e89b569b4d7f0f0c17a448ffe"},
886
+ {file = "websockets-13.1-cp310-cp310-win_amd64.whl", hash = "sha256:5993260f483d05a9737073be197371940c01b257cc45ae3f1d5d7adb371b266a"},
887
+ {file = "websockets-13.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:61fc0dfcda609cda0fc9fe7977694c0c59cf9d749fbb17f4e9483929e3c48a19"},
888
+ {file = "websockets-13.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:ceec59f59d092c5007e815def4ebb80c2de330e9588e101cf8bd94c143ec78a5"},
889
+ {file = "websockets-13.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:c1dca61c6db1166c48b95198c0b7d9c990b30c756fc2923cc66f68d17dc558fd"},
890
+ {file = "websockets-13.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:308e20f22c2c77f3f39caca508e765f8725020b84aa963474e18c59accbf4c02"},
891
+ {file = "websockets-13.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:62d516c325e6540e8a57b94abefc3459d7dab8ce52ac75c96cad5549e187e3a7"},
892
+ {file = "websockets-13.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:87c6e35319b46b99e168eb98472d6c7d8634ee37750d7693656dc766395df096"},
893
+ {file = "websockets-13.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:5f9fee94ebafbc3117c30be1844ed01a3b177bb6e39088bc6b2fa1dc15572084"},
894
+ {file = "websockets-13.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:7c1e90228c2f5cdde263253fa5db63e6653f1c00e7ec64108065a0b9713fa1b3"},
895
+ {file = "websockets-13.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:6548f29b0e401eea2b967b2fdc1c7c7b5ebb3eeb470ed23a54cd45ef078a0db9"},
896
+ {file = "websockets-13.1-cp311-cp311-win32.whl", hash = "sha256:c11d4d16e133f6df8916cc5b7e3e96ee4c44c936717d684a94f48f82edb7c92f"},
897
+ {file = "websockets-13.1-cp311-cp311-win_amd64.whl", hash = "sha256:d04f13a1d75cb2b8382bdc16ae6fa58c97337253826dfe136195b7f89f661557"},
898
+ {file = "websockets-13.1-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:9d75baf00138f80b48f1eac72ad1535aac0b6461265a0bcad391fc5aba875cfc"},
899
+ {file = "websockets-13.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:9b6f347deb3dcfbfde1c20baa21c2ac0751afaa73e64e5b693bb2b848efeaa49"},
900
+ {file = "websockets-13.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:de58647e3f9c42f13f90ac7e5f58900c80a39019848c5547bc691693098ae1bd"},
901
+ {file = "websockets-13.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a1b54689e38d1279a51d11e3467dd2f3a50f5f2e879012ce8f2d6943f00e83f0"},
902
+ {file = "websockets-13.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cf1781ef73c073e6b0f90af841aaf98501f975d306bbf6221683dd594ccc52b6"},
903
+ {file = "websockets-13.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8d23b88b9388ed85c6faf0e74d8dec4f4d3baf3ecf20a65a47b836d56260d4b9"},
904
+ {file = "websockets-13.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:3c78383585f47ccb0fcf186dcb8a43f5438bd7d8f47d69e0b56f71bf431a0a68"},
905
+ {file = "websockets-13.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:d6d300f8ec35c24025ceb9b9019ae9040c1ab2f01cddc2bcc0b518af31c75c14"},
906
+ {file = "websockets-13.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:a9dcaf8b0cc72a392760bb8755922c03e17a5a54e08cca58e8b74f6902b433cf"},
907
+ {file = "websockets-13.1-cp312-cp312-win32.whl", hash = "sha256:2f85cf4f2a1ba8f602298a853cec8526c2ca42a9a4b947ec236eaedb8f2dc80c"},
908
+ {file = "websockets-13.1-cp312-cp312-win_amd64.whl", hash = "sha256:38377f8b0cdeee97c552d20cf1865695fcd56aba155ad1b4ca8779a5b6ef4ac3"},
909
+ {file = "websockets-13.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:a9ab1e71d3d2e54a0aa646ab6d4eebfaa5f416fe78dfe4da2839525dc5d765c6"},
910
+ {file = "websockets-13.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:b9d7439d7fab4dce00570bb906875734df13d9faa4b48e261c440a5fec6d9708"},
911
+ {file = "websockets-13.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:327b74e915cf13c5931334c61e1a41040e365d380f812513a255aa804b183418"},
912
+ {file = "websockets-13.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:325b1ccdbf5e5725fdcb1b0e9ad4d2545056479d0eee392c291c1bf76206435a"},
913
+ {file = "websockets-13.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:346bee67a65f189e0e33f520f253d5147ab76ae42493804319b5716e46dddf0f"},
914
+ {file = "websockets-13.1-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:91a0fa841646320ec0d3accdff5b757b06e2e5c86ba32af2e0815c96c7a603c5"},
915
+ {file = "websockets-13.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:18503d2c5f3943e93819238bf20df71982d193f73dcecd26c94514f417f6b135"},
916
+ {file = "websockets-13.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:a9cd1af7e18e5221d2878378fbc287a14cd527fdd5939ed56a18df8a31136bb2"},
917
+ {file = "websockets-13.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:70c5be9f416aa72aab7a2a76c90ae0a4fe2755c1816c153c1a2bcc3333ce4ce6"},
918
+ {file = "websockets-13.1-cp313-cp313-win32.whl", hash = "sha256:624459daabeb310d3815b276c1adef475b3e6804abaf2d9d2c061c319f7f187d"},
919
+ {file = "websockets-13.1-cp313-cp313-win_amd64.whl", hash = "sha256:c518e84bb59c2baae725accd355c8dc517b4a3ed8db88b4bc93c78dae2974bf2"},
920
+ {file = "websockets-13.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:c7934fd0e920e70468e676fe7f1b7261c1efa0d6c037c6722278ca0228ad9d0d"},
921
+ {file = "websockets-13.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:149e622dc48c10ccc3d2760e5f36753db9cacf3ad7bc7bbbfd7d9c819e286f23"},
922
+ {file = "websockets-13.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:a569eb1b05d72f9bce2ebd28a1ce2054311b66677fcd46cf36204ad23acead8c"},
923
+ {file = "websockets-13.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:95df24ca1e1bd93bbca51d94dd049a984609687cb2fb08a7f2c56ac84e9816ea"},
924
+ {file = "websockets-13.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d8dbb1bf0c0a4ae8b40bdc9be7f644e2f3fb4e8a9aca7145bfa510d4a374eeb7"},
925
+ {file = "websockets-13.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:035233b7531fb92a76beefcbf479504db8c72eb3bff41da55aecce3a0f729e54"},
926
+ {file = "websockets-13.1-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:e4450fc83a3df53dec45922b576e91e94f5578d06436871dce3a6be38e40f5db"},
927
+ {file = "websockets-13.1-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:463e1c6ec853202dd3657f156123d6b4dad0c546ea2e2e38be2b3f7c5b8e7295"},
928
+ {file = "websockets-13.1-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:6d6855bbe70119872c05107e38fbc7f96b1d8cb047d95c2c50869a46c65a8e96"},
929
+ {file = "websockets-13.1-cp38-cp38-win32.whl", hash = "sha256:204e5107f43095012b00f1451374693267adbb832d29966a01ecc4ce1db26faf"},
930
+ {file = "websockets-13.1-cp38-cp38-win_amd64.whl", hash = "sha256:485307243237328c022bc908b90e4457d0daa8b5cf4b3723fd3c4a8012fce4c6"},
931
+ {file = "websockets-13.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:9b37c184f8b976f0c0a231a5f3d6efe10807d41ccbe4488df8c74174805eea7d"},
932
+ {file = "websockets-13.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:163e7277e1a0bd9fb3c8842a71661ad19c6aa7bb3d6678dc7f89b17fbcc4aeb7"},
933
+ {file = "websockets-13.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4b889dbd1342820cc210ba44307cf75ae5f2f96226c0038094455a96e64fb07a"},
934
+ {file = "websockets-13.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:586a356928692c1fed0eca68b4d1c2cbbd1ca2acf2ac7e7ebd3b9052582deefa"},
935
+ {file = "websockets-13.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7bd6abf1e070a6b72bfeb71049d6ad286852e285f146682bf30d0296f5fbadfa"},
936
+ {file = "websockets-13.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6d2aad13a200e5934f5a6767492fb07151e1de1d6079c003ab31e1823733ae79"},
937
+ {file = "websockets-13.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:df01aea34b6e9e33572c35cd16bae5a47785e7d5c8cb2b54b2acdb9678315a17"},
938
+ {file = "websockets-13.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:e54affdeb21026329fb0744ad187cf812f7d3c2aa702a5edb562b325191fcab6"},
939
+ {file = "websockets-13.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:9ef8aa8bdbac47f4968a5d66462a2a0935d044bf35c0e5a8af152d58516dbeb5"},
940
+ {file = "websockets-13.1-cp39-cp39-win32.whl", hash = "sha256:deeb929efe52bed518f6eb2ddc00cc496366a14c726005726ad62c2dd9017a3c"},
941
+ {file = "websockets-13.1-cp39-cp39-win_amd64.whl", hash = "sha256:7c65ffa900e7cc958cd088b9a9157a8141c991f8c53d11087e6fb7277a03f81d"},
942
+ {file = "websockets-13.1-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:5dd6da9bec02735931fccec99d97c29f47cc61f644264eb995ad6c0c27667238"},
943
+ {file = "websockets-13.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:2510c09d8e8df777177ee3d40cd35450dc169a81e747455cc4197e63f7e7bfe5"},
944
+ {file = "websockets-13.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f1c3cf67185543730888b20682fb186fc8d0fa6f07ccc3ef4390831ab4b388d9"},
945
+ {file = "websockets-13.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bcc03c8b72267e97b49149e4863d57c2d77f13fae12066622dc78fe322490fe6"},
946
+ {file = "websockets-13.1-pp310-pypy310_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:004280a140f220c812e65f36944a9ca92d766b6cc4560be652a0a3883a79ed8a"},
947
+ {file = "websockets-13.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:e2620453c075abeb0daa949a292e19f56de518988e079c36478bacf9546ced23"},
948
+ {file = "websockets-13.1-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:9156c45750b37337f7b0b00e6248991a047be4aa44554c9886fe6bdd605aab3b"},
949
+ {file = "websockets-13.1-pp38-pypy38_pp73-macosx_11_0_arm64.whl", hash = "sha256:80c421e07973a89fbdd93e6f2003c17d20b69010458d3a8e37fb47874bd67d51"},
950
+ {file = "websockets-13.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:82d0ba76371769d6a4e56f7e83bb8e81846d17a6190971e38b5de108bde9b0d7"},
951
+ {file = "websockets-13.1-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e9875a0143f07d74dc5e1ded1c4581f0d9f7ab86c78994e2ed9e95050073c94d"},
952
+ {file = "websockets-13.1-pp38-pypy38_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a11e38ad8922c7961447f35c7b17bffa15de4d17c70abd07bfbe12d6faa3e027"},
953
+ {file = "websockets-13.1-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:4059f790b6ae8768471cddb65d3c4fe4792b0ab48e154c9f0a04cefaabcd5978"},
954
+ {file = "websockets-13.1-pp39-pypy39_pp73-macosx_10_15_x86_64.whl", hash = "sha256:25c35bf84bf7c7369d247f0b8cfa157f989862c49104c5cf85cb5436a641d93e"},
955
+ {file = "websockets-13.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:83f91d8a9bb404b8c2c41a707ac7f7f75b9442a0a876df295de27251a856ad09"},
956
+ {file = "websockets-13.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7a43cfdcddd07f4ca2b1afb459824dd3c6d53a51410636a2c7fc97b9a8cf4842"},
957
+ {file = "websockets-13.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:48a2ef1381632a2f0cb4efeff34efa97901c9fbc118e01951ad7cfc10601a9bb"},
958
+ {file = "websockets-13.1-pp39-pypy39_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:459bf774c754c35dbb487360b12c5727adab887f1622b8aed5755880a21c4a20"},
959
+ {file = "websockets-13.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:95858ca14a9f6fa8413d29e0a585b31b278388aa775b8a81fa24830123874678"},
960
+ {file = "websockets-13.1-py3-none-any.whl", hash = "sha256:a9a396a6ad26130cdae92ae10c36af09d9bfe6cafe69670fd3b6da9b07b4044f"},
961
+ {file = "websockets-13.1.tar.gz", hash = "sha256:a3b3366087c1bc0a2795111edcadddb8b3b59509d5db5d7ea3fdd69f954a8878"},
962
+ ]
963
+
964
+ [extras]
965
+ pyaudio = ["pyaudio"]
966
+
967
+ [metadata]
968
+ lock-version = "2.0"
969
+ python-versions = "^3.8"
970
+ content-hash = "88b375777d2a14ecbfbce27674ed77a8264c175d514119b668caaf4f911ba2c7"
data/pyproject.toml ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [project]
2
+ name = "elevenlabs"
3
+ dynamic = ["version"]
4
+
5
+ [tool.poetry]
6
+ name = "elevenlabs"
7
+ version = "2.74.1"
8
+ description = ""
9
+ readme = "README.md"
10
+ authors = []
11
+ keywords = []
12
+ license = "MIT"
13
+ classifiers = [
14
+ "Intended Audience :: Developers",
15
+ "Programming Language :: Python",
16
+ "Programming Language :: Python :: 3",
17
+ "Programming Language :: Python :: 3.8",
18
+ "Programming Language :: Python :: 3.9",
19
+ "Programming Language :: Python :: 3.10",
20
+ "Programming Language :: Python :: 3.11",
21
+ "Programming Language :: Python :: 3.12",
22
+ "Programming Language :: Python :: 3.13",
23
+ "Programming Language :: Python :: 3.14",
24
+ "Programming Language :: Python :: 3.15",
25
+ "Operating System :: OS Independent",
26
+ "Operating System :: POSIX",
27
+ "Operating System :: MacOS",
28
+ "Operating System :: POSIX :: Linux",
29
+ "Operating System :: Microsoft :: Windows",
30
+ "Topic :: Software Development :: Libraries :: Python Modules",
31
+ "Typing :: Typed",
32
+ "License :: OSI Approved :: MIT License"
33
+ ]
34
+ packages = [
35
+ { include = "elevenlabs", from = "src"}
36
+ ]
37
+
38
+ [tool.poetry.urls]
39
+ Repository = 'https://github.com/elevenlabs/elevenlabs-python'
40
+
41
+ [tool.poetry.dependencies]
42
+ python = "^3.8"
43
+ httpx = ">=0.21.2"
44
+ pyaudio = { version = ">=0.2.14", optional = true}
45
+ pydantic = ">= 1.9.2"
46
+ pydantic-core = ">=2.18.2"
47
+ requests = ">=2.20"
48
+ typing_extensions = ">= 4.0.0"
49
+ websockets = ">=13.0"
50
+
51
+ [tool.poetry.group.dev.dependencies]
52
+ mypy = "==1.13.0"
53
+ pytest = "^7.4.0"
54
+ pytest-asyncio = "^0.23.5"
55
+ pytest-xdist = "^3.6.1"
56
+ python-dateutil = "^2.9.0"
57
+ types-python-dateutil = "^2.9.0.20240316"
58
+ ruff = "==0.11.5"
59
+ types-pyaudio = "^0.2.16.20240516"
60
+
61
+ [tool.pytest.ini_options]
62
+ testpaths = [ "tests" ]
63
+ asyncio_mode = "auto"
64
+
65
+ [tool.mypy]
66
+ plugins = ["pydantic.mypy"]
67
+
68
+ [tool.ruff]
69
+ line-length = 120
70
+
71
+ [tool.ruff.lint]
72
+ select = [
73
+ "E", # pycodestyle errors
74
+ "F", # pyflakes
75
+ "I", # isort
76
+ ]
77
+ ignore = [
78
+ "E402", # Module level import not at top of file
79
+ "E501", # Line too long
80
+ "E711", # Comparison to `None` should be `cond is not None`
81
+ "E712", # Avoid equality comparisons to `True`; use `if ...:` checks
82
+ "E721", # Use `is` and `is not` for type comparisons, or `isinstance()` for insinstance checks
83
+ "E722", # Do not use bare `except`
84
+ "E731", # Do not assign a `lambda` expression, use a `def`
85
+ "F821", # Undefined name
86
+ "F841" # Local variable ... is assigned to but never used
87
+ ]
88
+
89
+ [tool.ruff.lint.isort]
90
+ section-order = ["future", "standard-library", "third-party", "first-party"]
91
+
92
+ [build-system]
93
+ requires = ["poetry-core"]
94
+ build-backend = "poetry.core.masonry.api"
95
+
96
+ [tool.poetry.extras]
97
+ pyaudio=["pyaudio"]
data/reference.md ADDED
The diff for this file is too large to render. See raw diff
 
data/requirements.txt ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ httpx>=0.21.2
2
+ pyaudio>=0.2.14
3
+ pydantic>= 1.9.2
4
+ pydantic-core>=2.18.2
5
+ requests>=2.20
6
+ typing_extensions>= 4.0.0
7
+ websockets>=13.0
data/src/elevenlabs/__init__.py ADDED
The diff for this file is too large to render. See raw diff
 
data/src/elevenlabs/assets/__init__.py ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
data/src/elevenlabs/assets/client.py ADDED
@@ -0,0 +1,367 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from .. import core
6
+ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
7
+ from ..core.request_options import RequestOptions
8
+ from ..types.asset_list_response import AssetListResponse
9
+ from ..types.asset_response import AssetResponse
10
+ from .raw_client import AsyncRawAssetsClient, RawAssetsClient
11
+
12
+ # this is used as the default value for optional parameters
13
+ OMIT = typing.cast(typing.Any, ...)
14
+
15
+
16
+ class AssetsClient:
17
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
18
+ self._raw_client = RawAssetsClient(client_wrapper=client_wrapper)
19
+
20
+ @property
21
+ def with_raw_response(self) -> RawAssetsClient:
22
+ """
23
+ Retrieves a raw implementation of this client that returns raw responses.
24
+
25
+ Returns
26
+ -------
27
+ RawAssetsClient
28
+ """
29
+ return self._raw_client
30
+
31
+ def list(
32
+ self,
33
+ *,
34
+ page_size: typing.Optional[int] = None,
35
+ cursor: typing.Optional[str] = None,
36
+ search: typing.Optional[str] = None,
37
+ request_options: typing.Optional[RequestOptions] = None,
38
+ ) -> AssetListResponse:
39
+ """
40
+ List assets in the workspace, most recently created first.
41
+
42
+ Parameters
43
+ ----------
44
+ page_size : typing.Optional[int]
45
+ Number of assets to return.
46
+
47
+ cursor : typing.Optional[str]
48
+ Token from a previous response's `next_cursor`. Omit to fetch the first page.
49
+
50
+ search : typing.Optional[str]
51
+ Optional free-text search filter over asset names.
52
+
53
+ request_options : typing.Optional[RequestOptions]
54
+ Request-specific configuration.
55
+
56
+ Returns
57
+ -------
58
+ AssetListResponse
59
+ Successful Response
60
+
61
+ Examples
62
+ --------
63
+ from elevenlabs import ElevenLabs
64
+
65
+ client = ElevenLabs(
66
+ api_key="YOUR_API_KEY",
67
+ )
68
+ client.assets.list(
69
+ page_size=1,
70
+ cursor="cursor",
71
+ search="search",
72
+ )
73
+ """
74
+ _response = self._raw_client.list(
75
+ page_size=page_size, cursor=cursor, search=search, request_options=request_options
76
+ )
77
+ return _response.data
78
+
79
+ def create(
80
+ self, *, asset: core.File, name: str, request_options: typing.Optional[RequestOptions] = None
81
+ ) -> AssetResponse:
82
+ """
83
+ Upload a new asset.
84
+
85
+ Parameters
86
+ ----------
87
+ asset : core.File
88
+ See core.File for more documentation
89
+
90
+ name : str
91
+ Display name for the asset.
92
+
93
+ request_options : typing.Optional[RequestOptions]
94
+ Request-specific configuration.
95
+
96
+ Returns
97
+ -------
98
+ AssetResponse
99
+ Successful Response
100
+
101
+ Examples
102
+ --------
103
+ from elevenlabs import ElevenLabs
104
+
105
+ client = ElevenLabs(
106
+ api_key="YOUR_API_KEY",
107
+ )
108
+ client.assets.create(
109
+ name="name",
110
+ )
111
+ """
112
+ _response = self._raw_client.create(asset=asset, name=name, request_options=request_options)
113
+ return _response.data
114
+
115
+ def get(self, asset_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> AssetResponse:
116
+ """
117
+ Retrieve a single asset by ID.
118
+
119
+ Parameters
120
+ ----------
121
+ asset_id : str
122
+ ID of the asset.
123
+
124
+ request_options : typing.Optional[RequestOptions]
125
+ Request-specific configuration.
126
+
127
+ Returns
128
+ -------
129
+ AssetResponse
130
+ Successful Response
131
+
132
+ Examples
133
+ --------
134
+ from elevenlabs import ElevenLabs
135
+
136
+ client = ElevenLabs(
137
+ api_key="YOUR_API_KEY",
138
+ )
139
+ client.assets.get(
140
+ asset_id="5xM2KqOnZyce22SPZ9d4",
141
+ )
142
+ """
143
+ _response = self._raw_client.get(asset_id, request_options=request_options)
144
+ return _response.data
145
+
146
+ def delete(self, asset_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
147
+ """
148
+ Delete an asset by ID.
149
+
150
+ Parameters
151
+ ----------
152
+ asset_id : str
153
+ ID of the asset.
154
+
155
+ request_options : typing.Optional[RequestOptions]
156
+ Request-specific configuration.
157
+
158
+ Returns
159
+ -------
160
+ None
161
+
162
+ Examples
163
+ --------
164
+ from elevenlabs import ElevenLabs
165
+
166
+ client = ElevenLabs(
167
+ api_key="YOUR_API_KEY",
168
+ )
169
+ client.assets.delete(
170
+ asset_id="5xM2KqOnZyce22SPZ9d4",
171
+ )
172
+ """
173
+ _response = self._raw_client.delete(asset_id, request_options=request_options)
174
+ return _response.data
175
+
176
+
177
+ class AsyncAssetsClient:
178
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
179
+ self._raw_client = AsyncRawAssetsClient(client_wrapper=client_wrapper)
180
+
181
+ @property
182
+ def with_raw_response(self) -> AsyncRawAssetsClient:
183
+ """
184
+ Retrieves a raw implementation of this client that returns raw responses.
185
+
186
+ Returns
187
+ -------
188
+ AsyncRawAssetsClient
189
+ """
190
+ return self._raw_client
191
+
192
+ async def list(
193
+ self,
194
+ *,
195
+ page_size: typing.Optional[int] = None,
196
+ cursor: typing.Optional[str] = None,
197
+ search: typing.Optional[str] = None,
198
+ request_options: typing.Optional[RequestOptions] = None,
199
+ ) -> AssetListResponse:
200
+ """
201
+ List assets in the workspace, most recently created first.
202
+
203
+ Parameters
204
+ ----------
205
+ page_size : typing.Optional[int]
206
+ Number of assets to return.
207
+
208
+ cursor : typing.Optional[str]
209
+ Token from a previous response's `next_cursor`. Omit to fetch the first page.
210
+
211
+ search : typing.Optional[str]
212
+ Optional free-text search filter over asset names.
213
+
214
+ request_options : typing.Optional[RequestOptions]
215
+ Request-specific configuration.
216
+
217
+ Returns
218
+ -------
219
+ AssetListResponse
220
+ Successful Response
221
+
222
+ Examples
223
+ --------
224
+ import asyncio
225
+
226
+ from elevenlabs import AsyncElevenLabs
227
+
228
+ client = AsyncElevenLabs(
229
+ api_key="YOUR_API_KEY",
230
+ )
231
+
232
+
233
+ async def main() -> None:
234
+ await client.assets.list(
235
+ page_size=1,
236
+ cursor="cursor",
237
+ search="search",
238
+ )
239
+
240
+
241
+ asyncio.run(main())
242
+ """
243
+ _response = await self._raw_client.list(
244
+ page_size=page_size, cursor=cursor, search=search, request_options=request_options
245
+ )
246
+ return _response.data
247
+
248
+ async def create(
249
+ self, *, asset: core.File, name: str, request_options: typing.Optional[RequestOptions] = None
250
+ ) -> AssetResponse:
251
+ """
252
+ Upload a new asset.
253
+
254
+ Parameters
255
+ ----------
256
+ asset : core.File
257
+ See core.File for more documentation
258
+
259
+ name : str
260
+ Display name for the asset.
261
+
262
+ request_options : typing.Optional[RequestOptions]
263
+ Request-specific configuration.
264
+
265
+ Returns
266
+ -------
267
+ AssetResponse
268
+ Successful Response
269
+
270
+ Examples
271
+ --------
272
+ import asyncio
273
+
274
+ from elevenlabs import AsyncElevenLabs
275
+
276
+ client = AsyncElevenLabs(
277
+ api_key="YOUR_API_KEY",
278
+ )
279
+
280
+
281
+ async def main() -> None:
282
+ await client.assets.create(
283
+ name="name",
284
+ )
285
+
286
+
287
+ asyncio.run(main())
288
+ """
289
+ _response = await self._raw_client.create(asset=asset, name=name, request_options=request_options)
290
+ return _response.data
291
+
292
+ async def get(self, asset_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> AssetResponse:
293
+ """
294
+ Retrieve a single asset by ID.
295
+
296
+ Parameters
297
+ ----------
298
+ asset_id : str
299
+ ID of the asset.
300
+
301
+ request_options : typing.Optional[RequestOptions]
302
+ Request-specific configuration.
303
+
304
+ Returns
305
+ -------
306
+ AssetResponse
307
+ Successful Response
308
+
309
+ Examples
310
+ --------
311
+ import asyncio
312
+
313
+ from elevenlabs import AsyncElevenLabs
314
+
315
+ client = AsyncElevenLabs(
316
+ api_key="YOUR_API_KEY",
317
+ )
318
+
319
+
320
+ async def main() -> None:
321
+ await client.assets.get(
322
+ asset_id="5xM2KqOnZyce22SPZ9d4",
323
+ )
324
+
325
+
326
+ asyncio.run(main())
327
+ """
328
+ _response = await self._raw_client.get(asset_id, request_options=request_options)
329
+ return _response.data
330
+
331
+ async def delete(self, asset_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
332
+ """
333
+ Delete an asset by ID.
334
+
335
+ Parameters
336
+ ----------
337
+ asset_id : str
338
+ ID of the asset.
339
+
340
+ request_options : typing.Optional[RequestOptions]
341
+ Request-specific configuration.
342
+
343
+ Returns
344
+ -------
345
+ None
346
+
347
+ Examples
348
+ --------
349
+ import asyncio
350
+
351
+ from elevenlabs import AsyncElevenLabs
352
+
353
+ client = AsyncElevenLabs(
354
+ api_key="YOUR_API_KEY",
355
+ )
356
+
357
+
358
+ async def main() -> None:
359
+ await client.assets.delete(
360
+ asset_id="5xM2KqOnZyce22SPZ9d4",
361
+ )
362
+
363
+
364
+ asyncio.run(main())
365
+ """
366
+ _response = await self._raw_client.delete(asset_id, request_options=request_options)
367
+ return _response.data
data/src/elevenlabs/assets/raw_client.py ADDED
@@ -0,0 +1,498 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ from json.decoder import JSONDecodeError
5
+
6
+ from .. import core
7
+ from ..core.api_error import ApiError
8
+ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
9
+ from ..core.http_response import AsyncHttpResponse, HttpResponse
10
+ from ..core.jsonable_encoder import jsonable_encoder
11
+ from ..core.parse_error import ParsingError
12
+ from ..core.request_options import RequestOptions
13
+ from ..core.unchecked_base_model import construct_type
14
+ from ..errors.unprocessable_entity_error import UnprocessableEntityError
15
+ from ..types.asset_list_response import AssetListResponse
16
+ from ..types.asset_response import AssetResponse
17
+ from pydantic import ValidationError
18
+
19
+ # this is used as the default value for optional parameters
20
+ OMIT = typing.cast(typing.Any, ...)
21
+
22
+
23
+ class RawAssetsClient:
24
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
25
+ self._client_wrapper = client_wrapper
26
+
27
+ def list(
28
+ self,
29
+ *,
30
+ page_size: typing.Optional[int] = None,
31
+ cursor: typing.Optional[str] = None,
32
+ search: typing.Optional[str] = None,
33
+ request_options: typing.Optional[RequestOptions] = None,
34
+ ) -> HttpResponse[AssetListResponse]:
35
+ """
36
+ List assets in the workspace, most recently created first.
37
+
38
+ Parameters
39
+ ----------
40
+ page_size : typing.Optional[int]
41
+ Number of assets to return.
42
+
43
+ cursor : typing.Optional[str]
44
+ Token from a previous response's `next_cursor`. Omit to fetch the first page.
45
+
46
+ search : typing.Optional[str]
47
+ Optional free-text search filter over asset names.
48
+
49
+ request_options : typing.Optional[RequestOptions]
50
+ Request-specific configuration.
51
+
52
+ Returns
53
+ -------
54
+ HttpResponse[AssetListResponse]
55
+ Successful Response
56
+ """
57
+ _response = self._client_wrapper.httpx_client.request(
58
+ "v1/assets",
59
+ method="GET",
60
+ params={
61
+ "page_size": page_size,
62
+ "cursor": cursor,
63
+ "search": search,
64
+ },
65
+ request_options=request_options,
66
+ )
67
+ try:
68
+ if 200 <= _response.status_code < 300:
69
+ _data = typing.cast(
70
+ AssetListResponse,
71
+ construct_type(
72
+ type_=AssetListResponse, # type: ignore
73
+ object_=_response.json(),
74
+ ),
75
+ )
76
+ return HttpResponse(response=_response, data=_data)
77
+ if _response.status_code == 422:
78
+ raise UnprocessableEntityError(
79
+ headers=dict(_response.headers),
80
+ body=typing.cast(
81
+ typing.Any,
82
+ construct_type(
83
+ type_=typing.Any, # type: ignore
84
+ object_=_response.json(),
85
+ ),
86
+ ),
87
+ )
88
+ _response_json = _response.json()
89
+ except JSONDecodeError:
90
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
91
+ except ValidationError as e:
92
+ raise ParsingError(
93
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
94
+ )
95
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
96
+
97
+ def create(
98
+ self, *, asset: core.File, name: str, request_options: typing.Optional[RequestOptions] = None
99
+ ) -> HttpResponse[AssetResponse]:
100
+ """
101
+ Upload a new asset.
102
+
103
+ Parameters
104
+ ----------
105
+ asset : core.File
106
+ See core.File for more documentation
107
+
108
+ name : str
109
+ Display name for the asset.
110
+
111
+ request_options : typing.Optional[RequestOptions]
112
+ Request-specific configuration.
113
+
114
+ Returns
115
+ -------
116
+ HttpResponse[AssetResponse]
117
+ Successful Response
118
+ """
119
+ _response = self._client_wrapper.httpx_client.request(
120
+ "v1/assets",
121
+ method="POST",
122
+ data={
123
+ "name": name,
124
+ },
125
+ files={
126
+ "asset": asset,
127
+ },
128
+ request_options=request_options,
129
+ omit=OMIT,
130
+ force_multipart=True,
131
+ )
132
+ try:
133
+ if 200 <= _response.status_code < 300:
134
+ _data = typing.cast(
135
+ AssetResponse,
136
+ construct_type(
137
+ type_=AssetResponse, # type: ignore
138
+ object_=_response.json(),
139
+ ),
140
+ )
141
+ return HttpResponse(response=_response, data=_data)
142
+ if _response.status_code == 422:
143
+ raise UnprocessableEntityError(
144
+ headers=dict(_response.headers),
145
+ body=typing.cast(
146
+ typing.Any,
147
+ construct_type(
148
+ type_=typing.Any, # type: ignore
149
+ object_=_response.json(),
150
+ ),
151
+ ),
152
+ )
153
+ _response_json = _response.json()
154
+ except JSONDecodeError:
155
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
156
+ except ValidationError as e:
157
+ raise ParsingError(
158
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
159
+ )
160
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
161
+
162
+ def get(
163
+ self, asset_id: str, *, request_options: typing.Optional[RequestOptions] = None
164
+ ) -> HttpResponse[AssetResponse]:
165
+ """
166
+ Retrieve a single asset by ID.
167
+
168
+ Parameters
169
+ ----------
170
+ asset_id : str
171
+ ID of the asset.
172
+
173
+ request_options : typing.Optional[RequestOptions]
174
+ Request-specific configuration.
175
+
176
+ Returns
177
+ -------
178
+ HttpResponse[AssetResponse]
179
+ Successful Response
180
+ """
181
+ _response = self._client_wrapper.httpx_client.request(
182
+ f"v1/assets/{jsonable_encoder(asset_id)}",
183
+ method="GET",
184
+ request_options=request_options,
185
+ )
186
+ try:
187
+ if 200 <= _response.status_code < 300:
188
+ _data = typing.cast(
189
+ AssetResponse,
190
+ construct_type(
191
+ type_=AssetResponse, # type: ignore
192
+ object_=_response.json(),
193
+ ),
194
+ )
195
+ return HttpResponse(response=_response, data=_data)
196
+ if _response.status_code == 422:
197
+ raise UnprocessableEntityError(
198
+ headers=dict(_response.headers),
199
+ body=typing.cast(
200
+ typing.Any,
201
+ construct_type(
202
+ type_=typing.Any, # type: ignore
203
+ object_=_response.json(),
204
+ ),
205
+ ),
206
+ )
207
+ _response_json = _response.json()
208
+ except JSONDecodeError:
209
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
210
+ except ValidationError as e:
211
+ raise ParsingError(
212
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
213
+ )
214
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
215
+
216
+ def delete(self, asset_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[None]:
217
+ """
218
+ Delete an asset by ID.
219
+
220
+ Parameters
221
+ ----------
222
+ asset_id : str
223
+ ID of the asset.
224
+
225
+ request_options : typing.Optional[RequestOptions]
226
+ Request-specific configuration.
227
+
228
+ Returns
229
+ -------
230
+ HttpResponse[None]
231
+ """
232
+ _response = self._client_wrapper.httpx_client.request(
233
+ f"v1/assets/{jsonable_encoder(asset_id)}",
234
+ method="DELETE",
235
+ request_options=request_options,
236
+ )
237
+ try:
238
+ if 200 <= _response.status_code < 300:
239
+ return HttpResponse(response=_response, data=None)
240
+ if _response.status_code == 422:
241
+ raise UnprocessableEntityError(
242
+ headers=dict(_response.headers),
243
+ body=typing.cast(
244
+ typing.Any,
245
+ construct_type(
246
+ type_=typing.Any, # type: ignore
247
+ object_=_response.json(),
248
+ ),
249
+ ),
250
+ )
251
+ _response_json = _response.json()
252
+ except JSONDecodeError:
253
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
254
+ except ValidationError as e:
255
+ raise ParsingError(
256
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
257
+ )
258
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
259
+
260
+
261
+ class AsyncRawAssetsClient:
262
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
263
+ self._client_wrapper = client_wrapper
264
+
265
+ async def list(
266
+ self,
267
+ *,
268
+ page_size: typing.Optional[int] = None,
269
+ cursor: typing.Optional[str] = None,
270
+ search: typing.Optional[str] = None,
271
+ request_options: typing.Optional[RequestOptions] = None,
272
+ ) -> AsyncHttpResponse[AssetListResponse]:
273
+ """
274
+ List assets in the workspace, most recently created first.
275
+
276
+ Parameters
277
+ ----------
278
+ page_size : typing.Optional[int]
279
+ Number of assets to return.
280
+
281
+ cursor : typing.Optional[str]
282
+ Token from a previous response's `next_cursor`. Omit to fetch the first page.
283
+
284
+ search : typing.Optional[str]
285
+ Optional free-text search filter over asset names.
286
+
287
+ request_options : typing.Optional[RequestOptions]
288
+ Request-specific configuration.
289
+
290
+ Returns
291
+ -------
292
+ AsyncHttpResponse[AssetListResponse]
293
+ Successful Response
294
+ """
295
+ _response = await self._client_wrapper.httpx_client.request(
296
+ "v1/assets",
297
+ method="GET",
298
+ params={
299
+ "page_size": page_size,
300
+ "cursor": cursor,
301
+ "search": search,
302
+ },
303
+ request_options=request_options,
304
+ )
305
+ try:
306
+ if 200 <= _response.status_code < 300:
307
+ _data = typing.cast(
308
+ AssetListResponse,
309
+ construct_type(
310
+ type_=AssetListResponse, # type: ignore
311
+ object_=_response.json(),
312
+ ),
313
+ )
314
+ return AsyncHttpResponse(response=_response, data=_data)
315
+ if _response.status_code == 422:
316
+ raise UnprocessableEntityError(
317
+ headers=dict(_response.headers),
318
+ body=typing.cast(
319
+ typing.Any,
320
+ construct_type(
321
+ type_=typing.Any, # type: ignore
322
+ object_=_response.json(),
323
+ ),
324
+ ),
325
+ )
326
+ _response_json = _response.json()
327
+ except JSONDecodeError:
328
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
329
+ except ValidationError as e:
330
+ raise ParsingError(
331
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
332
+ )
333
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
334
+
335
+ async def create(
336
+ self, *, asset: core.File, name: str, request_options: typing.Optional[RequestOptions] = None
337
+ ) -> AsyncHttpResponse[AssetResponse]:
338
+ """
339
+ Upload a new asset.
340
+
341
+ Parameters
342
+ ----------
343
+ asset : core.File
344
+ See core.File for more documentation
345
+
346
+ name : str
347
+ Display name for the asset.
348
+
349
+ request_options : typing.Optional[RequestOptions]
350
+ Request-specific configuration.
351
+
352
+ Returns
353
+ -------
354
+ AsyncHttpResponse[AssetResponse]
355
+ Successful Response
356
+ """
357
+ _response = await self._client_wrapper.httpx_client.request(
358
+ "v1/assets",
359
+ method="POST",
360
+ data={
361
+ "name": name,
362
+ },
363
+ files={
364
+ "asset": asset,
365
+ },
366
+ request_options=request_options,
367
+ omit=OMIT,
368
+ force_multipart=True,
369
+ )
370
+ try:
371
+ if 200 <= _response.status_code < 300:
372
+ _data = typing.cast(
373
+ AssetResponse,
374
+ construct_type(
375
+ type_=AssetResponse, # type: ignore
376
+ object_=_response.json(),
377
+ ),
378
+ )
379
+ return AsyncHttpResponse(response=_response, data=_data)
380
+ if _response.status_code == 422:
381
+ raise UnprocessableEntityError(
382
+ headers=dict(_response.headers),
383
+ body=typing.cast(
384
+ typing.Any,
385
+ construct_type(
386
+ type_=typing.Any, # type: ignore
387
+ object_=_response.json(),
388
+ ),
389
+ ),
390
+ )
391
+ _response_json = _response.json()
392
+ except JSONDecodeError:
393
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
394
+ except ValidationError as e:
395
+ raise ParsingError(
396
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
397
+ )
398
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
399
+
400
+ async def get(
401
+ self, asset_id: str, *, request_options: typing.Optional[RequestOptions] = None
402
+ ) -> AsyncHttpResponse[AssetResponse]:
403
+ """
404
+ Retrieve a single asset by ID.
405
+
406
+ Parameters
407
+ ----------
408
+ asset_id : str
409
+ ID of the asset.
410
+
411
+ request_options : typing.Optional[RequestOptions]
412
+ Request-specific configuration.
413
+
414
+ Returns
415
+ -------
416
+ AsyncHttpResponse[AssetResponse]
417
+ Successful Response
418
+ """
419
+ _response = await self._client_wrapper.httpx_client.request(
420
+ f"v1/assets/{jsonable_encoder(asset_id)}",
421
+ method="GET",
422
+ request_options=request_options,
423
+ )
424
+ try:
425
+ if 200 <= _response.status_code < 300:
426
+ _data = typing.cast(
427
+ AssetResponse,
428
+ construct_type(
429
+ type_=AssetResponse, # type: ignore
430
+ object_=_response.json(),
431
+ ),
432
+ )
433
+ return AsyncHttpResponse(response=_response, data=_data)
434
+ if _response.status_code == 422:
435
+ raise UnprocessableEntityError(
436
+ headers=dict(_response.headers),
437
+ body=typing.cast(
438
+ typing.Any,
439
+ construct_type(
440
+ type_=typing.Any, # type: ignore
441
+ object_=_response.json(),
442
+ ),
443
+ ),
444
+ )
445
+ _response_json = _response.json()
446
+ except JSONDecodeError:
447
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
448
+ except ValidationError as e:
449
+ raise ParsingError(
450
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
451
+ )
452
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
453
+
454
+ async def delete(
455
+ self, asset_id: str, *, request_options: typing.Optional[RequestOptions] = None
456
+ ) -> AsyncHttpResponse[None]:
457
+ """
458
+ Delete an asset by ID.
459
+
460
+ Parameters
461
+ ----------
462
+ asset_id : str
463
+ ID of the asset.
464
+
465
+ request_options : typing.Optional[RequestOptions]
466
+ Request-specific configuration.
467
+
468
+ Returns
469
+ -------
470
+ AsyncHttpResponse[None]
471
+ """
472
+ _response = await self._client_wrapper.httpx_client.request(
473
+ f"v1/assets/{jsonable_encoder(asset_id)}",
474
+ method="DELETE",
475
+ request_options=request_options,
476
+ )
477
+ try:
478
+ if 200 <= _response.status_code < 300:
479
+ return AsyncHttpResponse(response=_response, data=None)
480
+ if _response.status_code == 422:
481
+ raise UnprocessableEntityError(
482
+ headers=dict(_response.headers),
483
+ body=typing.cast(
484
+ typing.Any,
485
+ construct_type(
486
+ type_=typing.Any, # type: ignore
487
+ object_=_response.json(),
488
+ ),
489
+ ),
490
+ )
491
+ _response_json = _response.json()
492
+ except JSONDecodeError:
493
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
494
+ except ValidationError as e:
495
+ raise ParsingError(
496
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
497
+ )
498
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
data/src/elevenlabs/audio_effects/__init__.py ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
data/src/elevenlabs/audio_effects/client.py ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
6
+ from ..core.request_options import RequestOptions
7
+ from ..types.audio_effects_catalog_response_model import AudioEffectsCatalogResponseModel
8
+ from .raw_client import AsyncRawAudioEffectsClient, RawAudioEffectsClient
9
+
10
+
11
+ class AudioEffectsClient:
12
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
13
+ self._raw_client = RawAudioEffectsClient(client_wrapper=client_wrapper)
14
+
15
+ @property
16
+ def with_raw_response(self) -> RawAudioEffectsClient:
17
+ """
18
+ Retrieves a raw implementation of this client that returns raw responses.
19
+
20
+ Returns
21
+ -------
22
+ RawAudioEffectsClient
23
+ """
24
+ return self._raw_client
25
+
26
+ def get_catalog(
27
+ self, *, request_options: typing.Optional[RequestOptions] = None
28
+ ) -> AudioEffectsCatalogResponseModel:
29
+ """
30
+ Lists the filter presets, reverb environments, and background noises that `audio_effects` can reference in Text to Speech, Text to Dialogue, and agent configurations.
31
+
32
+ Parameters
33
+ ----------
34
+ request_options : typing.Optional[RequestOptions]
35
+ Request-specific configuration.
36
+
37
+ Returns
38
+ -------
39
+ AudioEffectsCatalogResponseModel
40
+ Successful Response
41
+
42
+ Examples
43
+ --------
44
+ from elevenlabs import ElevenLabs
45
+
46
+ client = ElevenLabs(
47
+ api_key="YOUR_API_KEY",
48
+ )
49
+ client.audio_effects.get_catalog()
50
+ """
51
+ _response = self._raw_client.get_catalog(request_options=request_options)
52
+ return _response.data
53
+
54
+
55
+ class AsyncAudioEffectsClient:
56
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
57
+ self._raw_client = AsyncRawAudioEffectsClient(client_wrapper=client_wrapper)
58
+
59
+ @property
60
+ def with_raw_response(self) -> AsyncRawAudioEffectsClient:
61
+ """
62
+ Retrieves a raw implementation of this client that returns raw responses.
63
+
64
+ Returns
65
+ -------
66
+ AsyncRawAudioEffectsClient
67
+ """
68
+ return self._raw_client
69
+
70
+ async def get_catalog(
71
+ self, *, request_options: typing.Optional[RequestOptions] = None
72
+ ) -> AudioEffectsCatalogResponseModel:
73
+ """
74
+ Lists the filter presets, reverb environments, and background noises that `audio_effects` can reference in Text to Speech, Text to Dialogue, and agent configurations.
75
+
76
+ Parameters
77
+ ----------
78
+ request_options : typing.Optional[RequestOptions]
79
+ Request-specific configuration.
80
+
81
+ Returns
82
+ -------
83
+ AudioEffectsCatalogResponseModel
84
+ Successful Response
85
+
86
+ Examples
87
+ --------
88
+ import asyncio
89
+
90
+ from elevenlabs import AsyncElevenLabs
91
+
92
+ client = AsyncElevenLabs(
93
+ api_key="YOUR_API_KEY",
94
+ )
95
+
96
+
97
+ async def main() -> None:
98
+ await client.audio_effects.get_catalog()
99
+
100
+
101
+ asyncio.run(main())
102
+ """
103
+ _response = await self._raw_client.get_catalog(request_options=request_options)
104
+ return _response.data
data/src/elevenlabs/audio_effects/raw_client.py ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ from json.decoder import JSONDecodeError
5
+
6
+ from ..core.api_error import ApiError
7
+ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
8
+ from ..core.http_response import AsyncHttpResponse, HttpResponse
9
+ from ..core.parse_error import ParsingError
10
+ from ..core.request_options import RequestOptions
11
+ from ..core.unchecked_base_model import construct_type
12
+ from ..errors.unprocessable_entity_error import UnprocessableEntityError
13
+ from ..types.audio_effects_catalog_response_model import AudioEffectsCatalogResponseModel
14
+ from pydantic import ValidationError
15
+
16
+
17
+ class RawAudioEffectsClient:
18
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
19
+ self._client_wrapper = client_wrapper
20
+
21
+ def get_catalog(
22
+ self, *, request_options: typing.Optional[RequestOptions] = None
23
+ ) -> HttpResponse[AudioEffectsCatalogResponseModel]:
24
+ """
25
+ Lists the filter presets, reverb environments, and background noises that `audio_effects` can reference in Text to Speech, Text to Dialogue, and agent configurations.
26
+
27
+ Parameters
28
+ ----------
29
+ request_options : typing.Optional[RequestOptions]
30
+ Request-specific configuration.
31
+
32
+ Returns
33
+ -------
34
+ HttpResponse[AudioEffectsCatalogResponseModel]
35
+ Successful Response
36
+ """
37
+ _response = self._client_wrapper.httpx_client.request(
38
+ "v1/audio-effects/catalog",
39
+ method="GET",
40
+ request_options=request_options,
41
+ )
42
+ try:
43
+ if 200 <= _response.status_code < 300:
44
+ _data = typing.cast(
45
+ AudioEffectsCatalogResponseModel,
46
+ construct_type(
47
+ type_=AudioEffectsCatalogResponseModel, # type: ignore
48
+ object_=_response.json(),
49
+ ),
50
+ )
51
+ return HttpResponse(response=_response, data=_data)
52
+ if _response.status_code == 422:
53
+ raise UnprocessableEntityError(
54
+ headers=dict(_response.headers),
55
+ body=typing.cast(
56
+ typing.Any,
57
+ construct_type(
58
+ type_=typing.Any, # type: ignore
59
+ object_=_response.json(),
60
+ ),
61
+ ),
62
+ )
63
+ _response_json = _response.json()
64
+ except JSONDecodeError:
65
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
66
+ except ValidationError as e:
67
+ raise ParsingError(
68
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
69
+ )
70
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
71
+
72
+
73
+ class AsyncRawAudioEffectsClient:
74
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
75
+ self._client_wrapper = client_wrapper
76
+
77
+ async def get_catalog(
78
+ self, *, request_options: typing.Optional[RequestOptions] = None
79
+ ) -> AsyncHttpResponse[AudioEffectsCatalogResponseModel]:
80
+ """
81
+ Lists the filter presets, reverb environments, and background noises that `audio_effects` can reference in Text to Speech, Text to Dialogue, and agent configurations.
82
+
83
+ Parameters
84
+ ----------
85
+ request_options : typing.Optional[RequestOptions]
86
+ Request-specific configuration.
87
+
88
+ Returns
89
+ -------
90
+ AsyncHttpResponse[AudioEffectsCatalogResponseModel]
91
+ Successful Response
92
+ """
93
+ _response = await self._client_wrapper.httpx_client.request(
94
+ "v1/audio-effects/catalog",
95
+ method="GET",
96
+ request_options=request_options,
97
+ )
98
+ try:
99
+ if 200 <= _response.status_code < 300:
100
+ _data = typing.cast(
101
+ AudioEffectsCatalogResponseModel,
102
+ construct_type(
103
+ type_=AudioEffectsCatalogResponseModel, # type: ignore
104
+ object_=_response.json(),
105
+ ),
106
+ )
107
+ return AsyncHttpResponse(response=_response, data=_data)
108
+ if _response.status_code == 422:
109
+ raise UnprocessableEntityError(
110
+ headers=dict(_response.headers),
111
+ body=typing.cast(
112
+ typing.Any,
113
+ construct_type(
114
+ type_=typing.Any, # type: ignore
115
+ object_=_response.json(),
116
+ ),
117
+ ),
118
+ )
119
+ _response_json = _response.json()
120
+ except JSONDecodeError:
121
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
122
+ except ValidationError as e:
123
+ raise ParsingError(
124
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
125
+ )
126
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
data/src/elevenlabs/audio_isolation/__init__.py ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
5
+ import typing
6
+ from importlib import import_module
7
+
8
+ if typing.TYPE_CHECKING:
9
+ from .types import AudioIsolationRequestFileFormat, AudioIsolationStreamRequestFileFormat
10
+ _dynamic_imports: typing.Dict[str, str] = {
11
+ "AudioIsolationRequestFileFormat": ".types",
12
+ "AudioIsolationStreamRequestFileFormat": ".types",
13
+ }
14
+
15
+
16
+ def __getattr__(attr_name: str) -> typing.Any:
17
+ module_name = _dynamic_imports.get(attr_name)
18
+ if module_name is None:
19
+ raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
20
+ try:
21
+ module = import_module(module_name, __package__)
22
+ if module_name == f".{attr_name}":
23
+ return module
24
+ else:
25
+ return getattr(module, attr_name)
26
+ except ImportError as e:
27
+ raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
28
+ except AttributeError as e:
29
+ raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
30
+
31
+
32
+ def __dir__():
33
+ lazy_attrs = list(_dynamic_imports.keys())
34
+ return sorted(lazy_attrs)
35
+
36
+
37
+ __all__ = ["AudioIsolationRequestFileFormat", "AudioIsolationStreamRequestFileFormat"]
data/src/elevenlabs/audio_isolation/client.py ADDED
@@ -0,0 +1,348 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from .. import core
6
+ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
7
+ from ..core.request_options import RequestOptions
8
+ from ..types.get_audio_isolation_history_response_model import GetAudioIsolationHistoryResponseModel
9
+ from .raw_client import AsyncRawAudioIsolationClient, RawAudioIsolationClient
10
+ from .types.audio_isolation_request_file_format import AudioIsolationRequestFileFormat
11
+ from .types.audio_isolation_stream_request_file_format import AudioIsolationStreamRequestFileFormat
12
+
13
+ # this is used as the default value for optional parameters
14
+ OMIT = typing.cast(typing.Any, ...)
15
+
16
+
17
+ class AudioIsolationClient:
18
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
19
+ self._raw_client = RawAudioIsolationClient(client_wrapper=client_wrapper)
20
+
21
+ @property
22
+ def with_raw_response(self) -> RawAudioIsolationClient:
23
+ """
24
+ Retrieves a raw implementation of this client that returns raw responses.
25
+
26
+ Returns
27
+ -------
28
+ RawAudioIsolationClient
29
+ """
30
+ return self._raw_client
31
+
32
+ def convert(
33
+ self,
34
+ *,
35
+ audio: core.File,
36
+ file_format: typing.Optional[AudioIsolationRequestFileFormat] = OMIT,
37
+ preview_b_64: typing.Optional[str] = OMIT,
38
+ request_options: typing.Optional[RequestOptions] = None,
39
+ ) -> typing.Iterator[bytes]:
40
+ """
41
+ Removes background noise from audio.
42
+
43
+ Parameters
44
+ ----------
45
+ audio : core.File
46
+ See core.File for more documentation
47
+
48
+ file_format : typing.Optional[AudioIsolationRequestFileFormat]
49
+ The format of input audio. Options are 'pcm_s16le_16' or 'other' For `pcm_s16le_16`, the input audio must be 16-bit PCM at a 16kHz sample rate, single channel (mono), and little-endian byte order. Latency will be lower than with passing an encoded waveform.
50
+
51
+ preview_b_64 : typing.Optional[str]
52
+ Optional preview image base64 for tracking this generation.
53
+
54
+ request_options : typing.Optional[RequestOptions]
55
+ Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
56
+
57
+ Returns
58
+ -------
59
+ typing.Iterator[bytes]
60
+ Successful Response
61
+ """
62
+ with self._raw_client.convert(
63
+ audio=audio, file_format=file_format, preview_b_64=preview_b_64, request_options=request_options
64
+ ) as r:
65
+ yield from r.data
66
+
67
+ def list(
68
+ self,
69
+ *,
70
+ page_size: typing.Optional[int] = None,
71
+ page: typing.Optional[int] = None,
72
+ search: typing.Optional[str] = None,
73
+ request_options: typing.Optional[RequestOptions] = None,
74
+ ) -> GetAudioIsolationHistoryResponseModel:
75
+ """
76
+ Returns a list of all your audio isolation generations.
77
+
78
+ Parameters
79
+ ----------
80
+ page_size : typing.Optional[int]
81
+ How many history items to return at maximum. Defaults to 100.
82
+
83
+ page : typing.Optional[int]
84
+ Page number for search pagination (1-based). Only used when search is provided.
85
+
86
+ search : typing.Optional[str]
87
+ Optional search term used for filtering audio isolation history (title/text).
88
+
89
+ request_options : typing.Optional[RequestOptions]
90
+ Request-specific configuration.
91
+
92
+ Returns
93
+ -------
94
+ GetAudioIsolationHistoryResponseModel
95
+ Successful Response
96
+
97
+ Examples
98
+ --------
99
+ from elevenlabs import ElevenLabs
100
+
101
+ client = ElevenLabs(
102
+ api_key="YOUR_API_KEY",
103
+ )
104
+ client.audio_isolation.list(
105
+ page_size=1,
106
+ page=1,
107
+ search="search",
108
+ )
109
+ """
110
+ _response = self._raw_client.list(
111
+ page_size=page_size, page=page, search=search, request_options=request_options
112
+ )
113
+ return _response.data
114
+
115
+ def delete(self, history_item_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
116
+ """
117
+ Deletes a specific audio isolation history item and the associated media files.
118
+
119
+ Parameters
120
+ ----------
121
+ history_item_id : str
122
+ Identifier of the audio isolation history item.
123
+
124
+ request_options : typing.Optional[RequestOptions]
125
+ Request-specific configuration.
126
+
127
+ Returns
128
+ -------
129
+ None
130
+
131
+ Examples
132
+ --------
133
+ from elevenlabs import ElevenLabs
134
+
135
+ client = ElevenLabs(
136
+ api_key="YOUR_API_KEY",
137
+ )
138
+ client.audio_isolation.delete(
139
+ history_item_id="history_item_id",
140
+ )
141
+ """
142
+ _response = self._raw_client.delete(history_item_id, request_options=request_options)
143
+ return _response.data
144
+
145
+ def stream(
146
+ self,
147
+ *,
148
+ audio: core.File,
149
+ file_format: typing.Optional[AudioIsolationStreamRequestFileFormat] = OMIT,
150
+ request_options: typing.Optional[RequestOptions] = None,
151
+ ) -> typing.Iterator[bytes]:
152
+ """
153
+ Removes background noise from audio.
154
+
155
+ Parameters
156
+ ----------
157
+ audio : core.File
158
+ See core.File for more documentation
159
+
160
+ file_format : typing.Optional[AudioIsolationStreamRequestFileFormat]
161
+ The format of input audio. Options are 'pcm_s16le_16' or 'other' For `pcm_s16le_16`, the input audio must be 16-bit PCM at a 16kHz sample rate, single channel (mono), and little-endian byte order. Latency will be lower than with passing an encoded waveform.
162
+
163
+ request_options : typing.Optional[RequestOptions]
164
+ Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
165
+
166
+ Returns
167
+ -------
168
+ typing.Iterator[bytes]
169
+ Successful Response
170
+ """
171
+ with self._raw_client.stream(audio=audio, file_format=file_format, request_options=request_options) as r:
172
+ yield from r.data
173
+
174
+
175
+ class AsyncAudioIsolationClient:
176
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
177
+ self._raw_client = AsyncRawAudioIsolationClient(client_wrapper=client_wrapper)
178
+
179
+ @property
180
+ def with_raw_response(self) -> AsyncRawAudioIsolationClient:
181
+ """
182
+ Retrieves a raw implementation of this client that returns raw responses.
183
+
184
+ Returns
185
+ -------
186
+ AsyncRawAudioIsolationClient
187
+ """
188
+ return self._raw_client
189
+
190
+ async def convert(
191
+ self,
192
+ *,
193
+ audio: core.File,
194
+ file_format: typing.Optional[AudioIsolationRequestFileFormat] = OMIT,
195
+ preview_b_64: typing.Optional[str] = OMIT,
196
+ request_options: typing.Optional[RequestOptions] = None,
197
+ ) -> typing.AsyncIterator[bytes]:
198
+ """
199
+ Removes background noise from audio.
200
+
201
+ Parameters
202
+ ----------
203
+ audio : core.File
204
+ See core.File for more documentation
205
+
206
+ file_format : typing.Optional[AudioIsolationRequestFileFormat]
207
+ The format of input audio. Options are 'pcm_s16le_16' or 'other' For `pcm_s16le_16`, the input audio must be 16-bit PCM at a 16kHz sample rate, single channel (mono), and little-endian byte order. Latency will be lower than with passing an encoded waveform.
208
+
209
+ preview_b_64 : typing.Optional[str]
210
+ Optional preview image base64 for tracking this generation.
211
+
212
+ request_options : typing.Optional[RequestOptions]
213
+ Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
214
+
215
+ Returns
216
+ -------
217
+ typing.AsyncIterator[bytes]
218
+ Successful Response
219
+ """
220
+ async with self._raw_client.convert(
221
+ audio=audio, file_format=file_format, preview_b_64=preview_b_64, request_options=request_options
222
+ ) as r:
223
+ async for _chunk in r.data:
224
+ yield _chunk
225
+
226
+ async def list(
227
+ self,
228
+ *,
229
+ page_size: typing.Optional[int] = None,
230
+ page: typing.Optional[int] = None,
231
+ search: typing.Optional[str] = None,
232
+ request_options: typing.Optional[RequestOptions] = None,
233
+ ) -> GetAudioIsolationHistoryResponseModel:
234
+ """
235
+ Returns a list of all your audio isolation generations.
236
+
237
+ Parameters
238
+ ----------
239
+ page_size : typing.Optional[int]
240
+ How many history items to return at maximum. Defaults to 100.
241
+
242
+ page : typing.Optional[int]
243
+ Page number for search pagination (1-based). Only used when search is provided.
244
+
245
+ search : typing.Optional[str]
246
+ Optional search term used for filtering audio isolation history (title/text).
247
+
248
+ request_options : typing.Optional[RequestOptions]
249
+ Request-specific configuration.
250
+
251
+ Returns
252
+ -------
253
+ GetAudioIsolationHistoryResponseModel
254
+ Successful Response
255
+
256
+ Examples
257
+ --------
258
+ import asyncio
259
+
260
+ from elevenlabs import AsyncElevenLabs
261
+
262
+ client = AsyncElevenLabs(
263
+ api_key="YOUR_API_KEY",
264
+ )
265
+
266
+
267
+ async def main() -> None:
268
+ await client.audio_isolation.list(
269
+ page_size=1,
270
+ page=1,
271
+ search="search",
272
+ )
273
+
274
+
275
+ asyncio.run(main())
276
+ """
277
+ _response = await self._raw_client.list(
278
+ page_size=page_size, page=page, search=search, request_options=request_options
279
+ )
280
+ return _response.data
281
+
282
+ async def delete(self, history_item_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
283
+ """
284
+ Deletes a specific audio isolation history item and the associated media files.
285
+
286
+ Parameters
287
+ ----------
288
+ history_item_id : str
289
+ Identifier of the audio isolation history item.
290
+
291
+ request_options : typing.Optional[RequestOptions]
292
+ Request-specific configuration.
293
+
294
+ Returns
295
+ -------
296
+ None
297
+
298
+ Examples
299
+ --------
300
+ import asyncio
301
+
302
+ from elevenlabs import AsyncElevenLabs
303
+
304
+ client = AsyncElevenLabs(
305
+ api_key="YOUR_API_KEY",
306
+ )
307
+
308
+
309
+ async def main() -> None:
310
+ await client.audio_isolation.delete(
311
+ history_item_id="history_item_id",
312
+ )
313
+
314
+
315
+ asyncio.run(main())
316
+ """
317
+ _response = await self._raw_client.delete(history_item_id, request_options=request_options)
318
+ return _response.data
319
+
320
+ async def stream(
321
+ self,
322
+ *,
323
+ audio: core.File,
324
+ file_format: typing.Optional[AudioIsolationStreamRequestFileFormat] = OMIT,
325
+ request_options: typing.Optional[RequestOptions] = None,
326
+ ) -> typing.AsyncIterator[bytes]:
327
+ """
328
+ Removes background noise from audio.
329
+
330
+ Parameters
331
+ ----------
332
+ audio : core.File
333
+ See core.File for more documentation
334
+
335
+ file_format : typing.Optional[AudioIsolationStreamRequestFileFormat]
336
+ The format of input audio. Options are 'pcm_s16le_16' or 'other' For `pcm_s16le_16`, the input audio must be 16-bit PCM at a 16kHz sample rate, single channel (mono), and little-endian byte order. Latency will be lower than with passing an encoded waveform.
337
+
338
+ request_options : typing.Optional[RequestOptions]
339
+ Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
340
+
341
+ Returns
342
+ -------
343
+ typing.AsyncIterator[bytes]
344
+ Successful Response
345
+ """
346
+ async with self._raw_client.stream(audio=audio, file_format=file_format, request_options=request_options) as r:
347
+ async for _chunk in r.data:
348
+ yield _chunk
data/src/elevenlabs/audio_isolation/raw_client.py ADDED
@@ -0,0 +1,580 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import contextlib
4
+ import typing
5
+ from json.decoder import JSONDecodeError
6
+
7
+ from .. import core
8
+ from ..core.api_error import ApiError
9
+ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
10
+ from ..core.http_response import AsyncHttpResponse, HttpResponse
11
+ from ..core.jsonable_encoder import jsonable_encoder
12
+ from ..core.parse_error import ParsingError
13
+ from ..core.request_options import RequestOptions
14
+ from ..core.unchecked_base_model import construct_type
15
+ from ..errors.unprocessable_entity_error import UnprocessableEntityError
16
+ from ..types.get_audio_isolation_history_response_model import GetAudioIsolationHistoryResponseModel
17
+ from .types.audio_isolation_request_file_format import AudioIsolationRequestFileFormat
18
+ from .types.audio_isolation_stream_request_file_format import AudioIsolationStreamRequestFileFormat
19
+ from pydantic import ValidationError
20
+
21
+ # this is used as the default value for optional parameters
22
+ OMIT = typing.cast(typing.Any, ...)
23
+
24
+
25
+ class RawAudioIsolationClient:
26
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
27
+ self._client_wrapper = client_wrapper
28
+
29
+ @contextlib.contextmanager
30
+ def convert(
31
+ self,
32
+ *,
33
+ audio: core.File,
34
+ file_format: typing.Optional[AudioIsolationRequestFileFormat] = OMIT,
35
+ preview_b_64: typing.Optional[str] = OMIT,
36
+ request_options: typing.Optional[RequestOptions] = None,
37
+ ) -> typing.Iterator[HttpResponse[typing.Iterator[bytes]]]:
38
+ """
39
+ Removes background noise from audio.
40
+
41
+ Parameters
42
+ ----------
43
+ audio : core.File
44
+ See core.File for more documentation
45
+
46
+ file_format : typing.Optional[AudioIsolationRequestFileFormat]
47
+ The format of input audio. Options are 'pcm_s16le_16' or 'other' For `pcm_s16le_16`, the input audio must be 16-bit PCM at a 16kHz sample rate, single channel (mono), and little-endian byte order. Latency will be lower than with passing an encoded waveform.
48
+
49
+ preview_b_64 : typing.Optional[str]
50
+ Optional preview image base64 for tracking this generation.
51
+
52
+ request_options : typing.Optional[RequestOptions]
53
+ Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
54
+
55
+ Returns
56
+ -------
57
+ typing.Iterator[HttpResponse[typing.Iterator[bytes]]]
58
+ Successful Response
59
+ """
60
+ with self._client_wrapper.httpx_client.stream(
61
+ "v1/audio-isolation",
62
+ method="POST",
63
+ data={
64
+ "file_format": file_format,
65
+ "preview_b64": preview_b_64,
66
+ },
67
+ files={
68
+ "audio": audio,
69
+ },
70
+ request_options=request_options,
71
+ omit=OMIT,
72
+ force_multipart=True,
73
+ ) as _response:
74
+
75
+ def _stream() -> HttpResponse[typing.Iterator[bytes]]:
76
+ try:
77
+ if 200 <= _response.status_code < 300:
78
+ _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024
79
+ return HttpResponse(
80
+ response=_response, data=(_chunk for _chunk in _response.iter_bytes(chunk_size=_chunk_size))
81
+ )
82
+ _response.read()
83
+ if _response.status_code == 422:
84
+ raise UnprocessableEntityError(
85
+ headers=dict(_response.headers),
86
+ body=typing.cast(
87
+ typing.Any,
88
+ construct_type(
89
+ type_=typing.Any, # type: ignore
90
+ object_=_response.json(),
91
+ ),
92
+ ),
93
+ )
94
+ _response_json = _response.json()
95
+ except JSONDecodeError:
96
+ raise ApiError(
97
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
98
+ )
99
+ except ValidationError as e:
100
+ raise ParsingError(
101
+ status_code=_response.status_code,
102
+ headers=dict(_response.headers),
103
+ body=_response.json(),
104
+ cause=e,
105
+ )
106
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
107
+
108
+ yield _stream()
109
+
110
+ def list(
111
+ self,
112
+ *,
113
+ page_size: typing.Optional[int] = None,
114
+ page: typing.Optional[int] = None,
115
+ search: typing.Optional[str] = None,
116
+ request_options: typing.Optional[RequestOptions] = None,
117
+ ) -> HttpResponse[GetAudioIsolationHistoryResponseModel]:
118
+ """
119
+ Returns a list of all your audio isolation generations.
120
+
121
+ Parameters
122
+ ----------
123
+ page_size : typing.Optional[int]
124
+ How many history items to return at maximum. Defaults to 100.
125
+
126
+ page : typing.Optional[int]
127
+ Page number for search pagination (1-based). Only used when search is provided.
128
+
129
+ search : typing.Optional[str]
130
+ Optional search term used for filtering audio isolation history (title/text).
131
+
132
+ request_options : typing.Optional[RequestOptions]
133
+ Request-specific configuration.
134
+
135
+ Returns
136
+ -------
137
+ HttpResponse[GetAudioIsolationHistoryResponseModel]
138
+ Successful Response
139
+ """
140
+ _response = self._client_wrapper.httpx_client.request(
141
+ "v1/audio-isolation/history",
142
+ method="GET",
143
+ params={
144
+ "page_size": page_size,
145
+ "page": page,
146
+ "search": search,
147
+ },
148
+ request_options=request_options,
149
+ )
150
+ try:
151
+ if 200 <= _response.status_code < 300:
152
+ _data = typing.cast(
153
+ GetAudioIsolationHistoryResponseModel,
154
+ construct_type(
155
+ type_=GetAudioIsolationHistoryResponseModel, # type: ignore
156
+ object_=_response.json(),
157
+ ),
158
+ )
159
+ return HttpResponse(response=_response, data=_data)
160
+ if _response.status_code == 422:
161
+ raise UnprocessableEntityError(
162
+ headers=dict(_response.headers),
163
+ body=typing.cast(
164
+ typing.Any,
165
+ construct_type(
166
+ type_=typing.Any, # type: ignore
167
+ object_=_response.json(),
168
+ ),
169
+ ),
170
+ )
171
+ _response_json = _response.json()
172
+ except JSONDecodeError:
173
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
174
+ except ValidationError as e:
175
+ raise ParsingError(
176
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
177
+ )
178
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
179
+
180
+ def delete(
181
+ self, history_item_id: str, *, request_options: typing.Optional[RequestOptions] = None
182
+ ) -> HttpResponse[None]:
183
+ """
184
+ Deletes a specific audio isolation history item and the associated media files.
185
+
186
+ Parameters
187
+ ----------
188
+ history_item_id : str
189
+ Identifier of the audio isolation history item.
190
+
191
+ request_options : typing.Optional[RequestOptions]
192
+ Request-specific configuration.
193
+
194
+ Returns
195
+ -------
196
+ HttpResponse[None]
197
+ """
198
+ _response = self._client_wrapper.httpx_client.request(
199
+ f"v1/audio-isolation/history/{jsonable_encoder(history_item_id)}",
200
+ method="DELETE",
201
+ request_options=request_options,
202
+ )
203
+ try:
204
+ if 200 <= _response.status_code < 300:
205
+ return HttpResponse(response=_response, data=None)
206
+ if _response.status_code == 422:
207
+ raise UnprocessableEntityError(
208
+ headers=dict(_response.headers),
209
+ body=typing.cast(
210
+ typing.Any,
211
+ construct_type(
212
+ type_=typing.Any, # type: ignore
213
+ object_=_response.json(),
214
+ ),
215
+ ),
216
+ )
217
+ _response_json = _response.json()
218
+ except JSONDecodeError:
219
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
220
+ except ValidationError as e:
221
+ raise ParsingError(
222
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
223
+ )
224
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
225
+
226
+ @contextlib.contextmanager
227
+ def stream(
228
+ self,
229
+ *,
230
+ audio: core.File,
231
+ file_format: typing.Optional[AudioIsolationStreamRequestFileFormat] = OMIT,
232
+ request_options: typing.Optional[RequestOptions] = None,
233
+ ) -> typing.Iterator[HttpResponse[typing.Iterator[bytes]]]:
234
+ """
235
+ Removes background noise from audio.
236
+
237
+ Parameters
238
+ ----------
239
+ audio : core.File
240
+ See core.File for more documentation
241
+
242
+ file_format : typing.Optional[AudioIsolationStreamRequestFileFormat]
243
+ The format of input audio. Options are 'pcm_s16le_16' or 'other' For `pcm_s16le_16`, the input audio must be 16-bit PCM at a 16kHz sample rate, single channel (mono), and little-endian byte order. Latency will be lower than with passing an encoded waveform.
244
+
245
+ request_options : typing.Optional[RequestOptions]
246
+ Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
247
+
248
+ Returns
249
+ -------
250
+ typing.Iterator[HttpResponse[typing.Iterator[bytes]]]
251
+ Successful Response
252
+ """
253
+ with self._client_wrapper.httpx_client.stream(
254
+ "v1/audio-isolation/stream",
255
+ method="POST",
256
+ data={
257
+ "file_format": file_format,
258
+ },
259
+ files={
260
+ "audio": audio,
261
+ },
262
+ request_options=request_options,
263
+ omit=OMIT,
264
+ force_multipart=True,
265
+ ) as _response:
266
+
267
+ def _stream() -> HttpResponse[typing.Iterator[bytes]]:
268
+ try:
269
+ if 200 <= _response.status_code < 300:
270
+ _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024
271
+ return HttpResponse(
272
+ response=_response, data=(_chunk for _chunk in _response.iter_bytes(chunk_size=_chunk_size))
273
+ )
274
+ _response.read()
275
+ if _response.status_code == 422:
276
+ raise UnprocessableEntityError(
277
+ headers=dict(_response.headers),
278
+ body=typing.cast(
279
+ typing.Any,
280
+ construct_type(
281
+ type_=typing.Any, # type: ignore
282
+ object_=_response.json(),
283
+ ),
284
+ ),
285
+ )
286
+ _response_json = _response.json()
287
+ except JSONDecodeError:
288
+ raise ApiError(
289
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
290
+ )
291
+ except ValidationError as e:
292
+ raise ParsingError(
293
+ status_code=_response.status_code,
294
+ headers=dict(_response.headers),
295
+ body=_response.json(),
296
+ cause=e,
297
+ )
298
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
299
+
300
+ yield _stream()
301
+
302
+
303
+ class AsyncRawAudioIsolationClient:
304
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
305
+ self._client_wrapper = client_wrapper
306
+
307
+ @contextlib.asynccontextmanager
308
+ async def convert(
309
+ self,
310
+ *,
311
+ audio: core.File,
312
+ file_format: typing.Optional[AudioIsolationRequestFileFormat] = OMIT,
313
+ preview_b_64: typing.Optional[str] = OMIT,
314
+ request_options: typing.Optional[RequestOptions] = None,
315
+ ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]:
316
+ """
317
+ Removes background noise from audio.
318
+
319
+ Parameters
320
+ ----------
321
+ audio : core.File
322
+ See core.File for more documentation
323
+
324
+ file_format : typing.Optional[AudioIsolationRequestFileFormat]
325
+ The format of input audio. Options are 'pcm_s16le_16' or 'other' For `pcm_s16le_16`, the input audio must be 16-bit PCM at a 16kHz sample rate, single channel (mono), and little-endian byte order. Latency will be lower than with passing an encoded waveform.
326
+
327
+ preview_b_64 : typing.Optional[str]
328
+ Optional preview image base64 for tracking this generation.
329
+
330
+ request_options : typing.Optional[RequestOptions]
331
+ Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
332
+
333
+ Returns
334
+ -------
335
+ typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]
336
+ Successful Response
337
+ """
338
+ async with self._client_wrapper.httpx_client.stream(
339
+ "v1/audio-isolation",
340
+ method="POST",
341
+ data={
342
+ "file_format": file_format,
343
+ "preview_b64": preview_b_64,
344
+ },
345
+ files={
346
+ "audio": audio,
347
+ },
348
+ request_options=request_options,
349
+ omit=OMIT,
350
+ force_multipart=True,
351
+ ) as _response:
352
+
353
+ async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]:
354
+ try:
355
+ if 200 <= _response.status_code < 300:
356
+ _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024
357
+ return AsyncHttpResponse(
358
+ response=_response,
359
+ data=(_chunk async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size)),
360
+ )
361
+ await _response.aread()
362
+ if _response.status_code == 422:
363
+ raise UnprocessableEntityError(
364
+ headers=dict(_response.headers),
365
+ body=typing.cast(
366
+ typing.Any,
367
+ construct_type(
368
+ type_=typing.Any, # type: ignore
369
+ object_=_response.json(),
370
+ ),
371
+ ),
372
+ )
373
+ _response_json = _response.json()
374
+ except JSONDecodeError:
375
+ raise ApiError(
376
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
377
+ )
378
+ except ValidationError as e:
379
+ raise ParsingError(
380
+ status_code=_response.status_code,
381
+ headers=dict(_response.headers),
382
+ body=_response.json(),
383
+ cause=e,
384
+ )
385
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
386
+
387
+ yield await _stream()
388
+
389
+ async def list(
390
+ self,
391
+ *,
392
+ page_size: typing.Optional[int] = None,
393
+ page: typing.Optional[int] = None,
394
+ search: typing.Optional[str] = None,
395
+ request_options: typing.Optional[RequestOptions] = None,
396
+ ) -> AsyncHttpResponse[GetAudioIsolationHistoryResponseModel]:
397
+ """
398
+ Returns a list of all your audio isolation generations.
399
+
400
+ Parameters
401
+ ----------
402
+ page_size : typing.Optional[int]
403
+ How many history items to return at maximum. Defaults to 100.
404
+
405
+ page : typing.Optional[int]
406
+ Page number for search pagination (1-based). Only used when search is provided.
407
+
408
+ search : typing.Optional[str]
409
+ Optional search term used for filtering audio isolation history (title/text).
410
+
411
+ request_options : typing.Optional[RequestOptions]
412
+ Request-specific configuration.
413
+
414
+ Returns
415
+ -------
416
+ AsyncHttpResponse[GetAudioIsolationHistoryResponseModel]
417
+ Successful Response
418
+ """
419
+ _response = await self._client_wrapper.httpx_client.request(
420
+ "v1/audio-isolation/history",
421
+ method="GET",
422
+ params={
423
+ "page_size": page_size,
424
+ "page": page,
425
+ "search": search,
426
+ },
427
+ request_options=request_options,
428
+ )
429
+ try:
430
+ if 200 <= _response.status_code < 300:
431
+ _data = typing.cast(
432
+ GetAudioIsolationHistoryResponseModel,
433
+ construct_type(
434
+ type_=GetAudioIsolationHistoryResponseModel, # type: ignore
435
+ object_=_response.json(),
436
+ ),
437
+ )
438
+ return AsyncHttpResponse(response=_response, data=_data)
439
+ if _response.status_code == 422:
440
+ raise UnprocessableEntityError(
441
+ headers=dict(_response.headers),
442
+ body=typing.cast(
443
+ typing.Any,
444
+ construct_type(
445
+ type_=typing.Any, # type: ignore
446
+ object_=_response.json(),
447
+ ),
448
+ ),
449
+ )
450
+ _response_json = _response.json()
451
+ except JSONDecodeError:
452
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
453
+ except ValidationError as e:
454
+ raise ParsingError(
455
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
456
+ )
457
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
458
+
459
+ async def delete(
460
+ self, history_item_id: str, *, request_options: typing.Optional[RequestOptions] = None
461
+ ) -> AsyncHttpResponse[None]:
462
+ """
463
+ Deletes a specific audio isolation history item and the associated media files.
464
+
465
+ Parameters
466
+ ----------
467
+ history_item_id : str
468
+ Identifier of the audio isolation history item.
469
+
470
+ request_options : typing.Optional[RequestOptions]
471
+ Request-specific configuration.
472
+
473
+ Returns
474
+ -------
475
+ AsyncHttpResponse[None]
476
+ """
477
+ _response = await self._client_wrapper.httpx_client.request(
478
+ f"v1/audio-isolation/history/{jsonable_encoder(history_item_id)}",
479
+ method="DELETE",
480
+ request_options=request_options,
481
+ )
482
+ try:
483
+ if 200 <= _response.status_code < 300:
484
+ return AsyncHttpResponse(response=_response, data=None)
485
+ if _response.status_code == 422:
486
+ raise UnprocessableEntityError(
487
+ headers=dict(_response.headers),
488
+ body=typing.cast(
489
+ typing.Any,
490
+ construct_type(
491
+ type_=typing.Any, # type: ignore
492
+ object_=_response.json(),
493
+ ),
494
+ ),
495
+ )
496
+ _response_json = _response.json()
497
+ except JSONDecodeError:
498
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
499
+ except ValidationError as e:
500
+ raise ParsingError(
501
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
502
+ )
503
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
504
+
505
+ @contextlib.asynccontextmanager
506
+ async def stream(
507
+ self,
508
+ *,
509
+ audio: core.File,
510
+ file_format: typing.Optional[AudioIsolationStreamRequestFileFormat] = OMIT,
511
+ request_options: typing.Optional[RequestOptions] = None,
512
+ ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]:
513
+ """
514
+ Removes background noise from audio.
515
+
516
+ Parameters
517
+ ----------
518
+ audio : core.File
519
+ See core.File for more documentation
520
+
521
+ file_format : typing.Optional[AudioIsolationStreamRequestFileFormat]
522
+ The format of input audio. Options are 'pcm_s16le_16' or 'other' For `pcm_s16le_16`, the input audio must be 16-bit PCM at a 16kHz sample rate, single channel (mono), and little-endian byte order. Latency will be lower than with passing an encoded waveform.
523
+
524
+ request_options : typing.Optional[RequestOptions]
525
+ Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
526
+
527
+ Returns
528
+ -------
529
+ typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]
530
+ Successful Response
531
+ """
532
+ async with self._client_wrapper.httpx_client.stream(
533
+ "v1/audio-isolation/stream",
534
+ method="POST",
535
+ data={
536
+ "file_format": file_format,
537
+ },
538
+ files={
539
+ "audio": audio,
540
+ },
541
+ request_options=request_options,
542
+ omit=OMIT,
543
+ force_multipart=True,
544
+ ) as _response:
545
+
546
+ async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]:
547
+ try:
548
+ if 200 <= _response.status_code < 300:
549
+ _chunk_size = request_options.get("chunk_size", 1024) if request_options is not None else 1024
550
+ return AsyncHttpResponse(
551
+ response=_response,
552
+ data=(_chunk async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size)),
553
+ )
554
+ await _response.aread()
555
+ if _response.status_code == 422:
556
+ raise UnprocessableEntityError(
557
+ headers=dict(_response.headers),
558
+ body=typing.cast(
559
+ typing.Any,
560
+ construct_type(
561
+ type_=typing.Any, # type: ignore
562
+ object_=_response.json(),
563
+ ),
564
+ ),
565
+ )
566
+ _response_json = _response.json()
567
+ except JSONDecodeError:
568
+ raise ApiError(
569
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.text
570
+ )
571
+ except ValidationError as e:
572
+ raise ParsingError(
573
+ status_code=_response.status_code,
574
+ headers=dict(_response.headers),
575
+ body=_response.json(),
576
+ cause=e,
577
+ )
578
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
579
+
580
+ yield await _stream()
data/src/elevenlabs/audio_isolation/types/__init__.py ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
5
+ import typing
6
+ from importlib import import_module
7
+
8
+ if typing.TYPE_CHECKING:
9
+ from .audio_isolation_request_file_format import AudioIsolationRequestFileFormat
10
+ from .audio_isolation_stream_request_file_format import AudioIsolationStreamRequestFileFormat
11
+ _dynamic_imports: typing.Dict[str, str] = {
12
+ "AudioIsolationRequestFileFormat": ".audio_isolation_request_file_format",
13
+ "AudioIsolationStreamRequestFileFormat": ".audio_isolation_stream_request_file_format",
14
+ }
15
+
16
+
17
+ def __getattr__(attr_name: str) -> typing.Any:
18
+ module_name = _dynamic_imports.get(attr_name)
19
+ if module_name is None:
20
+ raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
21
+ try:
22
+ module = import_module(module_name, __package__)
23
+ if module_name == f".{attr_name}":
24
+ return module
25
+ else:
26
+ return getattr(module, attr_name)
27
+ except ImportError as e:
28
+ raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
29
+ except AttributeError as e:
30
+ raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
31
+
32
+
33
+ def __dir__():
34
+ lazy_attrs = list(_dynamic_imports.keys())
35
+ return sorted(lazy_attrs)
36
+
37
+
38
+ __all__ = ["AudioIsolationRequestFileFormat", "AudioIsolationStreamRequestFileFormat"]
data/src/elevenlabs/audio_isolation/types/audio_isolation_request_file_format.py ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ AudioIsolationRequestFileFormat = typing.Union[typing.Literal["pcm_s16le_16", "other"], typing.Any]
data/src/elevenlabs/audio_isolation/types/audio_isolation_stream_request_file_format.py ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ AudioIsolationStreamRequestFileFormat = typing.Union[typing.Literal["pcm_s16le_16", "other"], typing.Any]
data/src/elevenlabs/audio_native/__init__.py ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
5
+ import typing
6
+ from importlib import import_module
7
+
8
+ if typing.TYPE_CHECKING:
9
+ from .types import AudioNativeCreateRequestApplyTextNormalization
10
+ _dynamic_imports: typing.Dict[str, str] = {"AudioNativeCreateRequestApplyTextNormalization": ".types"}
11
+
12
+
13
+ def __getattr__(attr_name: str) -> typing.Any:
14
+ module_name = _dynamic_imports.get(attr_name)
15
+ if module_name is None:
16
+ raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
17
+ try:
18
+ module = import_module(module_name, __package__)
19
+ if module_name == f".{attr_name}":
20
+ return module
21
+ else:
22
+ return getattr(module, attr_name)
23
+ except ImportError as e:
24
+ raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
25
+ except AttributeError as e:
26
+ raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
27
+
28
+
29
+ def __dir__():
30
+ lazy_attrs = list(_dynamic_imports.keys())
31
+ return sorted(lazy_attrs)
32
+
33
+
34
+ __all__ = ["AudioNativeCreateRequestApplyTextNormalization"]
data/src/elevenlabs/audio_native/client.py ADDED
@@ -0,0 +1,555 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from .. import core
6
+ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
7
+ from ..core.request_options import RequestOptions
8
+ from ..types.audio_native_create_project_response_model import AudioNativeCreateProjectResponseModel
9
+ from ..types.audio_native_edit_content_response_model import AudioNativeEditContentResponseModel
10
+ from ..types.get_audio_native_project_settings_response_model import GetAudioNativeProjectSettingsResponseModel
11
+ from .raw_client import AsyncRawAudioNativeClient, RawAudioNativeClient
12
+ from .types.audio_native_create_request_apply_text_normalization import AudioNativeCreateRequestApplyTextNormalization
13
+
14
+ # this is used as the default value for optional parameters
15
+ OMIT = typing.cast(typing.Any, ...)
16
+
17
+
18
+ class AudioNativeClient:
19
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
20
+ self._raw_client = RawAudioNativeClient(client_wrapper=client_wrapper)
21
+
22
+ @property
23
+ def with_raw_response(self) -> RawAudioNativeClient:
24
+ """
25
+ Retrieves a raw implementation of this client that returns raw responses.
26
+
27
+ Returns
28
+ -------
29
+ RawAudioNativeClient
30
+ """
31
+ return self._raw_client
32
+
33
+ def create(
34
+ self,
35
+ *,
36
+ name: str,
37
+ image: typing.Optional[str] = OMIT,
38
+ author: typing.Optional[str] = OMIT,
39
+ title: typing.Optional[str] = OMIT,
40
+ small: typing.Optional[bool] = OMIT,
41
+ text_color: typing.Optional[str] = OMIT,
42
+ background_color: typing.Optional[str] = OMIT,
43
+ sessionization: typing.Optional[int] = OMIT,
44
+ voice_id: typing.Optional[str] = OMIT,
45
+ model_id: typing.Optional[str] = OMIT,
46
+ file: typing.Optional[core.File] = OMIT,
47
+ auto_convert: typing.Optional[bool] = OMIT,
48
+ apply_text_normalization: typing.Optional[AudioNativeCreateRequestApplyTextNormalization] = OMIT,
49
+ pronunciation_dictionary_locators: typing.Optional[typing.List[str]] = OMIT,
50
+ request_options: typing.Optional[RequestOptions] = None,
51
+ ) -> AudioNativeCreateProjectResponseModel:
52
+ """
53
+ Creates Audio Native enabled project, optionally starts conversion and returns project ID and embeddable HTML snippet.
54
+
55
+ Parameters
56
+ ----------
57
+ name : str
58
+ Project name.
59
+
60
+ image : typing.Optional[str]
61
+ (Deprecated) Image URL used in the player. If not provided, default image set in the Player settings is used.
62
+
63
+ author : typing.Optional[str]
64
+ Author used in the player and inserted at the start of the uploaded article. If not provided, the default author set in the Player settings is used.
65
+
66
+ title : typing.Optional[str]
67
+ Title used in the player and inserted at the top of the uploaded article. If not provided, the default title set in the Player settings is used.
68
+
69
+ small : typing.Optional[bool]
70
+ (Deprecated) Whether to use small player or not. If not provided, default value set in the Player settings is used.
71
+
72
+ text_color : typing.Optional[str]
73
+ Text color used in the player. If not provided, default text color set in the Player settings is used.
74
+
75
+ background_color : typing.Optional[str]
76
+ Background color used in the player. If not provided, default background color set in the Player settings is used.
77
+
78
+ sessionization : typing.Optional[int]
79
+ (Deprecated) Specifies for how many minutes to persist the session across page reloads. If not provided, default sessionization set in the Player settings is used.
80
+
81
+ voice_id : typing.Optional[str]
82
+ Voice ID used to voice the content. If not provided, default voice ID set in the Player settings is used.
83
+
84
+ model_id : typing.Optional[str]
85
+ TTS Model ID used in the player. If not provided, default model ID set in the Player settings is used.
86
+
87
+ file : typing.Optional[core.File]
88
+ See core.File for more documentation
89
+
90
+ auto_convert : typing.Optional[bool]
91
+ Whether to auto convert the project to audio or not.
92
+
93
+ apply_text_normalization : typing.Optional[AudioNativeCreateRequestApplyTextNormalization]
94
+
95
+ This parameter controls text normalization with four modes: 'auto', 'on', 'apply_english' and 'off'.
96
+ When set to 'auto', the system will automatically decide whether to apply text normalization
97
+ (e.g., spelling out numbers). With 'on', text normalization will always be applied, while
98
+ with 'off', it will be skipped. 'apply_english' is the same as 'on' but will assume that text is in English.
99
+
100
+
101
+ pronunciation_dictionary_locators : typing.Optional[typing.List[str]]
102
+ A list of pronunciation dictionary locators (pronunciation_dictionary_id, version_id) encoded as a list of JSON strings for pronunciation dictionaries to be applied to the text. A list of json encoded strings is required as adding projects may occur through formData as opposed to jsonBody. To specify multiple dictionaries use multiple --form lines in your curl, such as --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"Vmd4Zor6fplcA7WrINey\\",\\"version_id\\":\\"hRPaxjlTdR7wFMhV4w0b\\"}"' --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"JzWtcGQMJ6bnlWwyMo7e\\",\\"version_id\\":\\"lbmwxiLu4q6txYxgdZqn\\"}"'.
103
+
104
+ request_options : typing.Optional[RequestOptions]
105
+ Request-specific configuration.
106
+
107
+ Returns
108
+ -------
109
+ AudioNativeCreateProjectResponseModel
110
+ Successful Response
111
+
112
+ Examples
113
+ --------
114
+ from elevenlabs import ElevenLabs
115
+
116
+ client = ElevenLabs(
117
+ api_key="YOUR_API_KEY",
118
+ )
119
+ client.audio_native.create(
120
+ name="name",
121
+ )
122
+ """
123
+ _response = self._raw_client.create(
124
+ name=name,
125
+ image=image,
126
+ author=author,
127
+ title=title,
128
+ small=small,
129
+ text_color=text_color,
130
+ background_color=background_color,
131
+ sessionization=sessionization,
132
+ voice_id=voice_id,
133
+ model_id=model_id,
134
+ file=file,
135
+ auto_convert=auto_convert,
136
+ apply_text_normalization=apply_text_normalization,
137
+ pronunciation_dictionary_locators=pronunciation_dictionary_locators,
138
+ request_options=request_options,
139
+ )
140
+ return _response.data
141
+
142
+ def get_settings(
143
+ self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None
144
+ ) -> GetAudioNativeProjectSettingsResponseModel:
145
+ """
146
+ Get player settings for the specific project.
147
+
148
+ Parameters
149
+ ----------
150
+ project_id : str
151
+ The ID of the Studio project.
152
+
153
+ request_options : typing.Optional[RequestOptions]
154
+ Request-specific configuration.
155
+
156
+ Returns
157
+ -------
158
+ GetAudioNativeProjectSettingsResponseModel
159
+ Successful Response
160
+
161
+ Examples
162
+ --------
163
+ from elevenlabs import ElevenLabs
164
+
165
+ client = ElevenLabs(
166
+ api_key="YOUR_API_KEY",
167
+ )
168
+ client.audio_native.get_settings(
169
+ project_id="21m00Tcm4TlvDq8ikWAM",
170
+ )
171
+ """
172
+ _response = self._raw_client.get_settings(project_id, request_options=request_options)
173
+ return _response.data
174
+
175
+ def update(
176
+ self,
177
+ project_id: str,
178
+ *,
179
+ file: typing.Optional[core.File] = OMIT,
180
+ auto_convert: typing.Optional[bool] = OMIT,
181
+ auto_publish: typing.Optional[bool] = OMIT,
182
+ request_options: typing.Optional[RequestOptions] = None,
183
+ ) -> AudioNativeEditContentResponseModel:
184
+ """
185
+ Updates content for the specific AudioNative Project.
186
+
187
+ Parameters
188
+ ----------
189
+ project_id : str
190
+ The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects.
191
+
192
+ file : typing.Optional[core.File]
193
+ See core.File for more documentation
194
+
195
+ auto_convert : typing.Optional[bool]
196
+ Whether to auto convert the project to audio or not.
197
+
198
+ auto_publish : typing.Optional[bool]
199
+ Whether to auto publish the new project snapshot after it's converted.
200
+
201
+ request_options : typing.Optional[RequestOptions]
202
+ Request-specific configuration.
203
+
204
+ Returns
205
+ -------
206
+ AudioNativeEditContentResponseModel
207
+ Successful Response
208
+
209
+ Examples
210
+ --------
211
+ from elevenlabs import ElevenLabs
212
+
213
+ client = ElevenLabs(
214
+ api_key="YOUR_API_KEY",
215
+ )
216
+ client.audio_native.update(
217
+ project_id="21m00Tcm4TlvDq8ikWAM",
218
+ )
219
+ """
220
+ _response = self._raw_client.update(
221
+ project_id, file=file, auto_convert=auto_convert, auto_publish=auto_publish, request_options=request_options
222
+ )
223
+ return _response.data
224
+
225
+ def update_content_from_url(
226
+ self,
227
+ *,
228
+ url: str,
229
+ author: typing.Optional[str] = OMIT,
230
+ title: typing.Optional[str] = OMIT,
231
+ request_options: typing.Optional[RequestOptions] = None,
232
+ ) -> AudioNativeEditContentResponseModel:
233
+ """
234
+ Finds an AudioNative project matching the provided URL, extracts content from the URL, updates the project content, and queues it for conversion and auto-publishing.
235
+
236
+ Parameters
237
+ ----------
238
+ url : str
239
+ URL of the page to extract content from.
240
+
241
+ author : typing.Optional[str]
242
+ Author used in the player and inserted at the start of the uploaded article. If not provided, the default author set in the Player settings is used.
243
+
244
+ title : typing.Optional[str]
245
+ Title used in the player and inserted at the top of the uploaded article. If not provided, the default title set in the Player settings is used.
246
+
247
+ request_options : typing.Optional[RequestOptions]
248
+ Request-specific configuration.
249
+
250
+ Returns
251
+ -------
252
+ AudioNativeEditContentResponseModel
253
+ Successful Response
254
+
255
+ Examples
256
+ --------
257
+ from elevenlabs import ElevenLabs
258
+
259
+ client = ElevenLabs(
260
+ api_key="YOUR_API_KEY",
261
+ )
262
+ client.audio_native.update_content_from_url(
263
+ url="https://elevenlabs.io/blog/the_first_ai_that_can_laugh/",
264
+ )
265
+ """
266
+ _response = self._raw_client.update_content_from_url(
267
+ url=url, author=author, title=title, request_options=request_options
268
+ )
269
+ return _response.data
270
+
271
+
272
+ class AsyncAudioNativeClient:
273
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
274
+ self._raw_client = AsyncRawAudioNativeClient(client_wrapper=client_wrapper)
275
+
276
+ @property
277
+ def with_raw_response(self) -> AsyncRawAudioNativeClient:
278
+ """
279
+ Retrieves a raw implementation of this client that returns raw responses.
280
+
281
+ Returns
282
+ -------
283
+ AsyncRawAudioNativeClient
284
+ """
285
+ return self._raw_client
286
+
287
+ async def create(
288
+ self,
289
+ *,
290
+ name: str,
291
+ image: typing.Optional[str] = OMIT,
292
+ author: typing.Optional[str] = OMIT,
293
+ title: typing.Optional[str] = OMIT,
294
+ small: typing.Optional[bool] = OMIT,
295
+ text_color: typing.Optional[str] = OMIT,
296
+ background_color: typing.Optional[str] = OMIT,
297
+ sessionization: typing.Optional[int] = OMIT,
298
+ voice_id: typing.Optional[str] = OMIT,
299
+ model_id: typing.Optional[str] = OMIT,
300
+ file: typing.Optional[core.File] = OMIT,
301
+ auto_convert: typing.Optional[bool] = OMIT,
302
+ apply_text_normalization: typing.Optional[AudioNativeCreateRequestApplyTextNormalization] = OMIT,
303
+ pronunciation_dictionary_locators: typing.Optional[typing.List[str]] = OMIT,
304
+ request_options: typing.Optional[RequestOptions] = None,
305
+ ) -> AudioNativeCreateProjectResponseModel:
306
+ """
307
+ Creates Audio Native enabled project, optionally starts conversion and returns project ID and embeddable HTML snippet.
308
+
309
+ Parameters
310
+ ----------
311
+ name : str
312
+ Project name.
313
+
314
+ image : typing.Optional[str]
315
+ (Deprecated) Image URL used in the player. If not provided, default image set in the Player settings is used.
316
+
317
+ author : typing.Optional[str]
318
+ Author used in the player and inserted at the start of the uploaded article. If not provided, the default author set in the Player settings is used.
319
+
320
+ title : typing.Optional[str]
321
+ Title used in the player and inserted at the top of the uploaded article. If not provided, the default title set in the Player settings is used.
322
+
323
+ small : typing.Optional[bool]
324
+ (Deprecated) Whether to use small player or not. If not provided, default value set in the Player settings is used.
325
+
326
+ text_color : typing.Optional[str]
327
+ Text color used in the player. If not provided, default text color set in the Player settings is used.
328
+
329
+ background_color : typing.Optional[str]
330
+ Background color used in the player. If not provided, default background color set in the Player settings is used.
331
+
332
+ sessionization : typing.Optional[int]
333
+ (Deprecated) Specifies for how many minutes to persist the session across page reloads. If not provided, default sessionization set in the Player settings is used.
334
+
335
+ voice_id : typing.Optional[str]
336
+ Voice ID used to voice the content. If not provided, default voice ID set in the Player settings is used.
337
+
338
+ model_id : typing.Optional[str]
339
+ TTS Model ID used in the player. If not provided, default model ID set in the Player settings is used.
340
+
341
+ file : typing.Optional[core.File]
342
+ See core.File for more documentation
343
+
344
+ auto_convert : typing.Optional[bool]
345
+ Whether to auto convert the project to audio or not.
346
+
347
+ apply_text_normalization : typing.Optional[AudioNativeCreateRequestApplyTextNormalization]
348
+
349
+ This parameter controls text normalization with four modes: 'auto', 'on', 'apply_english' and 'off'.
350
+ When set to 'auto', the system will automatically decide whether to apply text normalization
351
+ (e.g., spelling out numbers). With 'on', text normalization will always be applied, while
352
+ with 'off', it will be skipped. 'apply_english' is the same as 'on' but will assume that text is in English.
353
+
354
+
355
+ pronunciation_dictionary_locators : typing.Optional[typing.List[str]]
356
+ A list of pronunciation dictionary locators (pronunciation_dictionary_id, version_id) encoded as a list of JSON strings for pronunciation dictionaries to be applied to the text. A list of json encoded strings is required as adding projects may occur through formData as opposed to jsonBody. To specify multiple dictionaries use multiple --form lines in your curl, such as --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"Vmd4Zor6fplcA7WrINey\\",\\"version_id\\":\\"hRPaxjlTdR7wFMhV4w0b\\"}"' --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"JzWtcGQMJ6bnlWwyMo7e\\",\\"version_id\\":\\"lbmwxiLu4q6txYxgdZqn\\"}"'.
357
+
358
+ request_options : typing.Optional[RequestOptions]
359
+ Request-specific configuration.
360
+
361
+ Returns
362
+ -------
363
+ AudioNativeCreateProjectResponseModel
364
+ Successful Response
365
+
366
+ Examples
367
+ --------
368
+ import asyncio
369
+
370
+ from elevenlabs import AsyncElevenLabs
371
+
372
+ client = AsyncElevenLabs(
373
+ api_key="YOUR_API_KEY",
374
+ )
375
+
376
+
377
+ async def main() -> None:
378
+ await client.audio_native.create(
379
+ name="name",
380
+ )
381
+
382
+
383
+ asyncio.run(main())
384
+ """
385
+ _response = await self._raw_client.create(
386
+ name=name,
387
+ image=image,
388
+ author=author,
389
+ title=title,
390
+ small=small,
391
+ text_color=text_color,
392
+ background_color=background_color,
393
+ sessionization=sessionization,
394
+ voice_id=voice_id,
395
+ model_id=model_id,
396
+ file=file,
397
+ auto_convert=auto_convert,
398
+ apply_text_normalization=apply_text_normalization,
399
+ pronunciation_dictionary_locators=pronunciation_dictionary_locators,
400
+ request_options=request_options,
401
+ )
402
+ return _response.data
403
+
404
+ async def get_settings(
405
+ self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None
406
+ ) -> GetAudioNativeProjectSettingsResponseModel:
407
+ """
408
+ Get player settings for the specific project.
409
+
410
+ Parameters
411
+ ----------
412
+ project_id : str
413
+ The ID of the Studio project.
414
+
415
+ request_options : typing.Optional[RequestOptions]
416
+ Request-specific configuration.
417
+
418
+ Returns
419
+ -------
420
+ GetAudioNativeProjectSettingsResponseModel
421
+ Successful Response
422
+
423
+ Examples
424
+ --------
425
+ import asyncio
426
+
427
+ from elevenlabs import AsyncElevenLabs
428
+
429
+ client = AsyncElevenLabs(
430
+ api_key="YOUR_API_KEY",
431
+ )
432
+
433
+
434
+ async def main() -> None:
435
+ await client.audio_native.get_settings(
436
+ project_id="21m00Tcm4TlvDq8ikWAM",
437
+ )
438
+
439
+
440
+ asyncio.run(main())
441
+ """
442
+ _response = await self._raw_client.get_settings(project_id, request_options=request_options)
443
+ return _response.data
444
+
445
+ async def update(
446
+ self,
447
+ project_id: str,
448
+ *,
449
+ file: typing.Optional[core.File] = OMIT,
450
+ auto_convert: typing.Optional[bool] = OMIT,
451
+ auto_publish: typing.Optional[bool] = OMIT,
452
+ request_options: typing.Optional[RequestOptions] = None,
453
+ ) -> AudioNativeEditContentResponseModel:
454
+ """
455
+ Updates content for the specific AudioNative Project.
456
+
457
+ Parameters
458
+ ----------
459
+ project_id : str
460
+ The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects.
461
+
462
+ file : typing.Optional[core.File]
463
+ See core.File for more documentation
464
+
465
+ auto_convert : typing.Optional[bool]
466
+ Whether to auto convert the project to audio or not.
467
+
468
+ auto_publish : typing.Optional[bool]
469
+ Whether to auto publish the new project snapshot after it's converted.
470
+
471
+ request_options : typing.Optional[RequestOptions]
472
+ Request-specific configuration.
473
+
474
+ Returns
475
+ -------
476
+ AudioNativeEditContentResponseModel
477
+ Successful Response
478
+
479
+ Examples
480
+ --------
481
+ import asyncio
482
+
483
+ from elevenlabs import AsyncElevenLabs
484
+
485
+ client = AsyncElevenLabs(
486
+ api_key="YOUR_API_KEY",
487
+ )
488
+
489
+
490
+ async def main() -> None:
491
+ await client.audio_native.update(
492
+ project_id="21m00Tcm4TlvDq8ikWAM",
493
+ )
494
+
495
+
496
+ asyncio.run(main())
497
+ """
498
+ _response = await self._raw_client.update(
499
+ project_id, file=file, auto_convert=auto_convert, auto_publish=auto_publish, request_options=request_options
500
+ )
501
+ return _response.data
502
+
503
+ async def update_content_from_url(
504
+ self,
505
+ *,
506
+ url: str,
507
+ author: typing.Optional[str] = OMIT,
508
+ title: typing.Optional[str] = OMIT,
509
+ request_options: typing.Optional[RequestOptions] = None,
510
+ ) -> AudioNativeEditContentResponseModel:
511
+ """
512
+ Finds an AudioNative project matching the provided URL, extracts content from the URL, updates the project content, and queues it for conversion and auto-publishing.
513
+
514
+ Parameters
515
+ ----------
516
+ url : str
517
+ URL of the page to extract content from.
518
+
519
+ author : typing.Optional[str]
520
+ Author used in the player and inserted at the start of the uploaded article. If not provided, the default author set in the Player settings is used.
521
+
522
+ title : typing.Optional[str]
523
+ Title used in the player and inserted at the top of the uploaded article. If not provided, the default title set in the Player settings is used.
524
+
525
+ request_options : typing.Optional[RequestOptions]
526
+ Request-specific configuration.
527
+
528
+ Returns
529
+ -------
530
+ AudioNativeEditContentResponseModel
531
+ Successful Response
532
+
533
+ Examples
534
+ --------
535
+ import asyncio
536
+
537
+ from elevenlabs import AsyncElevenLabs
538
+
539
+ client = AsyncElevenLabs(
540
+ api_key="YOUR_API_KEY",
541
+ )
542
+
543
+
544
+ async def main() -> None:
545
+ await client.audio_native.update_content_from_url(
546
+ url="https://elevenlabs.io/blog/the_first_ai_that_can_laugh/",
547
+ )
548
+
549
+
550
+ asyncio.run(main())
551
+ """
552
+ _response = await self._raw_client.update_content_from_url(
553
+ url=url, author=author, title=title, request_options=request_options
554
+ )
555
+ return _response.data
data/src/elevenlabs/audio_native/raw_client.py ADDED
@@ -0,0 +1,712 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ from json.decoder import JSONDecodeError
5
+
6
+ from .. import core
7
+ from ..core.api_error import ApiError
8
+ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
9
+ from ..core.http_response import AsyncHttpResponse, HttpResponse
10
+ from ..core.jsonable_encoder import jsonable_encoder
11
+ from ..core.parse_error import ParsingError
12
+ from ..core.request_options import RequestOptions
13
+ from ..core.unchecked_base_model import construct_type
14
+ from ..errors.unprocessable_entity_error import UnprocessableEntityError
15
+ from ..types.audio_native_create_project_response_model import AudioNativeCreateProjectResponseModel
16
+ from ..types.audio_native_edit_content_response_model import AudioNativeEditContentResponseModel
17
+ from ..types.get_audio_native_project_settings_response_model import GetAudioNativeProjectSettingsResponseModel
18
+ from .types.audio_native_create_request_apply_text_normalization import AudioNativeCreateRequestApplyTextNormalization
19
+ from pydantic import ValidationError
20
+
21
+ # this is used as the default value for optional parameters
22
+ OMIT = typing.cast(typing.Any, ...)
23
+
24
+
25
+ class RawAudioNativeClient:
26
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
27
+ self._client_wrapper = client_wrapper
28
+
29
+ def create(
30
+ self,
31
+ *,
32
+ name: str,
33
+ image: typing.Optional[str] = OMIT,
34
+ author: typing.Optional[str] = OMIT,
35
+ title: typing.Optional[str] = OMIT,
36
+ small: typing.Optional[bool] = OMIT,
37
+ text_color: typing.Optional[str] = OMIT,
38
+ background_color: typing.Optional[str] = OMIT,
39
+ sessionization: typing.Optional[int] = OMIT,
40
+ voice_id: typing.Optional[str] = OMIT,
41
+ model_id: typing.Optional[str] = OMIT,
42
+ file: typing.Optional[core.File] = OMIT,
43
+ auto_convert: typing.Optional[bool] = OMIT,
44
+ apply_text_normalization: typing.Optional[AudioNativeCreateRequestApplyTextNormalization] = OMIT,
45
+ pronunciation_dictionary_locators: typing.Optional[typing.List[str]] = OMIT,
46
+ request_options: typing.Optional[RequestOptions] = None,
47
+ ) -> HttpResponse[AudioNativeCreateProjectResponseModel]:
48
+ """
49
+ Creates Audio Native enabled project, optionally starts conversion and returns project ID and embeddable HTML snippet.
50
+
51
+ Parameters
52
+ ----------
53
+ name : str
54
+ Project name.
55
+
56
+ image : typing.Optional[str]
57
+ (Deprecated) Image URL used in the player. If not provided, default image set in the Player settings is used.
58
+
59
+ author : typing.Optional[str]
60
+ Author used in the player and inserted at the start of the uploaded article. If not provided, the default author set in the Player settings is used.
61
+
62
+ title : typing.Optional[str]
63
+ Title used in the player and inserted at the top of the uploaded article. If not provided, the default title set in the Player settings is used.
64
+
65
+ small : typing.Optional[bool]
66
+ (Deprecated) Whether to use small player or not. If not provided, default value set in the Player settings is used.
67
+
68
+ text_color : typing.Optional[str]
69
+ Text color used in the player. If not provided, default text color set in the Player settings is used.
70
+
71
+ background_color : typing.Optional[str]
72
+ Background color used in the player. If not provided, default background color set in the Player settings is used.
73
+
74
+ sessionization : typing.Optional[int]
75
+ (Deprecated) Specifies for how many minutes to persist the session across page reloads. If not provided, default sessionization set in the Player settings is used.
76
+
77
+ voice_id : typing.Optional[str]
78
+ Voice ID used to voice the content. If not provided, default voice ID set in the Player settings is used.
79
+
80
+ model_id : typing.Optional[str]
81
+ TTS Model ID used in the player. If not provided, default model ID set in the Player settings is used.
82
+
83
+ file : typing.Optional[core.File]
84
+ See core.File for more documentation
85
+
86
+ auto_convert : typing.Optional[bool]
87
+ Whether to auto convert the project to audio or not.
88
+
89
+ apply_text_normalization : typing.Optional[AudioNativeCreateRequestApplyTextNormalization]
90
+
91
+ This parameter controls text normalization with four modes: 'auto', 'on', 'apply_english' and 'off'.
92
+ When set to 'auto', the system will automatically decide whether to apply text normalization
93
+ (e.g., spelling out numbers). With 'on', text normalization will always be applied, while
94
+ with 'off', it will be skipped. 'apply_english' is the same as 'on' but will assume that text is in English.
95
+
96
+
97
+ pronunciation_dictionary_locators : typing.Optional[typing.List[str]]
98
+ A list of pronunciation dictionary locators (pronunciation_dictionary_id, version_id) encoded as a list of JSON strings for pronunciation dictionaries to be applied to the text. A list of json encoded strings is required as adding projects may occur through formData as opposed to jsonBody. To specify multiple dictionaries use multiple --form lines in your curl, such as --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"Vmd4Zor6fplcA7WrINey\\",\\"version_id\\":\\"hRPaxjlTdR7wFMhV4w0b\\"}"' --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"JzWtcGQMJ6bnlWwyMo7e\\",\\"version_id\\":\\"lbmwxiLu4q6txYxgdZqn\\"}"'.
99
+
100
+ request_options : typing.Optional[RequestOptions]
101
+ Request-specific configuration.
102
+
103
+ Returns
104
+ -------
105
+ HttpResponse[AudioNativeCreateProjectResponseModel]
106
+ Successful Response
107
+ """
108
+ _response = self._client_wrapper.httpx_client.request(
109
+ "v1/audio-native",
110
+ method="POST",
111
+ data={
112
+ "name": name,
113
+ "image": image,
114
+ "author": author,
115
+ "title": title,
116
+ "small": small,
117
+ "text_color": text_color,
118
+ "background_color": background_color,
119
+ "sessionization": sessionization,
120
+ "voice_id": voice_id,
121
+ "model_id": model_id,
122
+ "auto_convert": auto_convert,
123
+ "apply_text_normalization": apply_text_normalization,
124
+ "pronunciation_dictionary_locators": pronunciation_dictionary_locators,
125
+ },
126
+ files={
127
+ **({"file": file} if file is not None else {}),
128
+ },
129
+ request_options=request_options,
130
+ omit=OMIT,
131
+ force_multipart=True,
132
+ )
133
+ try:
134
+ if 200 <= _response.status_code < 300:
135
+ _data = typing.cast(
136
+ AudioNativeCreateProjectResponseModel,
137
+ construct_type(
138
+ type_=AudioNativeCreateProjectResponseModel, # type: ignore
139
+ object_=_response.json(),
140
+ ),
141
+ )
142
+ return HttpResponse(response=_response, data=_data)
143
+ if _response.status_code == 422:
144
+ raise UnprocessableEntityError(
145
+ headers=dict(_response.headers),
146
+ body=typing.cast(
147
+ typing.Any,
148
+ construct_type(
149
+ type_=typing.Any, # type: ignore
150
+ object_=_response.json(),
151
+ ),
152
+ ),
153
+ )
154
+ _response_json = _response.json()
155
+ except JSONDecodeError:
156
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
157
+ except ValidationError as e:
158
+ raise ParsingError(
159
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
160
+ )
161
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
162
+
163
+ def get_settings(
164
+ self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None
165
+ ) -> HttpResponse[GetAudioNativeProjectSettingsResponseModel]:
166
+ """
167
+ Get player settings for the specific project.
168
+
169
+ Parameters
170
+ ----------
171
+ project_id : str
172
+ The ID of the Studio project.
173
+
174
+ request_options : typing.Optional[RequestOptions]
175
+ Request-specific configuration.
176
+
177
+ Returns
178
+ -------
179
+ HttpResponse[GetAudioNativeProjectSettingsResponseModel]
180
+ Successful Response
181
+ """
182
+ _response = self._client_wrapper.httpx_client.request(
183
+ f"v1/audio-native/{jsonable_encoder(project_id)}/settings",
184
+ method="GET",
185
+ request_options=request_options,
186
+ )
187
+ try:
188
+ if 200 <= _response.status_code < 300:
189
+ _data = typing.cast(
190
+ GetAudioNativeProjectSettingsResponseModel,
191
+ construct_type(
192
+ type_=GetAudioNativeProjectSettingsResponseModel, # type: ignore
193
+ object_=_response.json(),
194
+ ),
195
+ )
196
+ return HttpResponse(response=_response, data=_data)
197
+ if _response.status_code == 422:
198
+ raise UnprocessableEntityError(
199
+ headers=dict(_response.headers),
200
+ body=typing.cast(
201
+ typing.Any,
202
+ construct_type(
203
+ type_=typing.Any, # type: ignore
204
+ object_=_response.json(),
205
+ ),
206
+ ),
207
+ )
208
+ _response_json = _response.json()
209
+ except JSONDecodeError:
210
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
211
+ except ValidationError as e:
212
+ raise ParsingError(
213
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
214
+ )
215
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
216
+
217
+ def update(
218
+ self,
219
+ project_id: str,
220
+ *,
221
+ file: typing.Optional[core.File] = OMIT,
222
+ auto_convert: typing.Optional[bool] = OMIT,
223
+ auto_publish: typing.Optional[bool] = OMIT,
224
+ request_options: typing.Optional[RequestOptions] = None,
225
+ ) -> HttpResponse[AudioNativeEditContentResponseModel]:
226
+ """
227
+ Updates content for the specific AudioNative Project.
228
+
229
+ Parameters
230
+ ----------
231
+ project_id : str
232
+ The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects.
233
+
234
+ file : typing.Optional[core.File]
235
+ See core.File for more documentation
236
+
237
+ auto_convert : typing.Optional[bool]
238
+ Whether to auto convert the project to audio or not.
239
+
240
+ auto_publish : typing.Optional[bool]
241
+ Whether to auto publish the new project snapshot after it's converted.
242
+
243
+ request_options : typing.Optional[RequestOptions]
244
+ Request-specific configuration.
245
+
246
+ Returns
247
+ -------
248
+ HttpResponse[AudioNativeEditContentResponseModel]
249
+ Successful Response
250
+ """
251
+ _response = self._client_wrapper.httpx_client.request(
252
+ f"v1/audio-native/{jsonable_encoder(project_id)}/content",
253
+ method="POST",
254
+ data={
255
+ "auto_convert": auto_convert,
256
+ "auto_publish": auto_publish,
257
+ },
258
+ files={
259
+ **({"file": file} if file is not None else {}),
260
+ },
261
+ request_options=request_options,
262
+ omit=OMIT,
263
+ force_multipart=True,
264
+ )
265
+ try:
266
+ if 200 <= _response.status_code < 300:
267
+ _data = typing.cast(
268
+ AudioNativeEditContentResponseModel,
269
+ construct_type(
270
+ type_=AudioNativeEditContentResponseModel, # type: ignore
271
+ object_=_response.json(),
272
+ ),
273
+ )
274
+ return HttpResponse(response=_response, data=_data)
275
+ if _response.status_code == 422:
276
+ raise UnprocessableEntityError(
277
+ headers=dict(_response.headers),
278
+ body=typing.cast(
279
+ typing.Any,
280
+ construct_type(
281
+ type_=typing.Any, # type: ignore
282
+ object_=_response.json(),
283
+ ),
284
+ ),
285
+ )
286
+ _response_json = _response.json()
287
+ except JSONDecodeError:
288
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
289
+ except ValidationError as e:
290
+ raise ParsingError(
291
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
292
+ )
293
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
294
+
295
+ def update_content_from_url(
296
+ self,
297
+ *,
298
+ url: str,
299
+ author: typing.Optional[str] = OMIT,
300
+ title: typing.Optional[str] = OMIT,
301
+ request_options: typing.Optional[RequestOptions] = None,
302
+ ) -> HttpResponse[AudioNativeEditContentResponseModel]:
303
+ """
304
+ Finds an AudioNative project matching the provided URL, extracts content from the URL, updates the project content, and queues it for conversion and auto-publishing.
305
+
306
+ Parameters
307
+ ----------
308
+ url : str
309
+ URL of the page to extract content from.
310
+
311
+ author : typing.Optional[str]
312
+ Author used in the player and inserted at the start of the uploaded article. If not provided, the default author set in the Player settings is used.
313
+
314
+ title : typing.Optional[str]
315
+ Title used in the player and inserted at the top of the uploaded article. If not provided, the default title set in the Player settings is used.
316
+
317
+ request_options : typing.Optional[RequestOptions]
318
+ Request-specific configuration.
319
+
320
+ Returns
321
+ -------
322
+ HttpResponse[AudioNativeEditContentResponseModel]
323
+ Successful Response
324
+ """
325
+ _response = self._client_wrapper.httpx_client.request(
326
+ "v1/audio-native/content",
327
+ method="POST",
328
+ json={
329
+ "url": url,
330
+ "author": author,
331
+ "title": title,
332
+ },
333
+ headers={
334
+ "content-type": "application/json",
335
+ },
336
+ request_options=request_options,
337
+ omit=OMIT,
338
+ )
339
+ try:
340
+ if 200 <= _response.status_code < 300:
341
+ _data = typing.cast(
342
+ AudioNativeEditContentResponseModel,
343
+ construct_type(
344
+ type_=AudioNativeEditContentResponseModel, # type: ignore
345
+ object_=_response.json(),
346
+ ),
347
+ )
348
+ return HttpResponse(response=_response, data=_data)
349
+ if _response.status_code == 422:
350
+ raise UnprocessableEntityError(
351
+ headers=dict(_response.headers),
352
+ body=typing.cast(
353
+ typing.Any,
354
+ construct_type(
355
+ type_=typing.Any, # type: ignore
356
+ object_=_response.json(),
357
+ ),
358
+ ),
359
+ )
360
+ _response_json = _response.json()
361
+ except JSONDecodeError:
362
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
363
+ except ValidationError as e:
364
+ raise ParsingError(
365
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
366
+ )
367
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
368
+
369
+
370
+ class AsyncRawAudioNativeClient:
371
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
372
+ self._client_wrapper = client_wrapper
373
+
374
+ async def create(
375
+ self,
376
+ *,
377
+ name: str,
378
+ image: typing.Optional[str] = OMIT,
379
+ author: typing.Optional[str] = OMIT,
380
+ title: typing.Optional[str] = OMIT,
381
+ small: typing.Optional[bool] = OMIT,
382
+ text_color: typing.Optional[str] = OMIT,
383
+ background_color: typing.Optional[str] = OMIT,
384
+ sessionization: typing.Optional[int] = OMIT,
385
+ voice_id: typing.Optional[str] = OMIT,
386
+ model_id: typing.Optional[str] = OMIT,
387
+ file: typing.Optional[core.File] = OMIT,
388
+ auto_convert: typing.Optional[bool] = OMIT,
389
+ apply_text_normalization: typing.Optional[AudioNativeCreateRequestApplyTextNormalization] = OMIT,
390
+ pronunciation_dictionary_locators: typing.Optional[typing.List[str]] = OMIT,
391
+ request_options: typing.Optional[RequestOptions] = None,
392
+ ) -> AsyncHttpResponse[AudioNativeCreateProjectResponseModel]:
393
+ """
394
+ Creates Audio Native enabled project, optionally starts conversion and returns project ID and embeddable HTML snippet.
395
+
396
+ Parameters
397
+ ----------
398
+ name : str
399
+ Project name.
400
+
401
+ image : typing.Optional[str]
402
+ (Deprecated) Image URL used in the player. If not provided, default image set in the Player settings is used.
403
+
404
+ author : typing.Optional[str]
405
+ Author used in the player and inserted at the start of the uploaded article. If not provided, the default author set in the Player settings is used.
406
+
407
+ title : typing.Optional[str]
408
+ Title used in the player and inserted at the top of the uploaded article. If not provided, the default title set in the Player settings is used.
409
+
410
+ small : typing.Optional[bool]
411
+ (Deprecated) Whether to use small player or not. If not provided, default value set in the Player settings is used.
412
+
413
+ text_color : typing.Optional[str]
414
+ Text color used in the player. If not provided, default text color set in the Player settings is used.
415
+
416
+ background_color : typing.Optional[str]
417
+ Background color used in the player. If not provided, default background color set in the Player settings is used.
418
+
419
+ sessionization : typing.Optional[int]
420
+ (Deprecated) Specifies for how many minutes to persist the session across page reloads. If not provided, default sessionization set in the Player settings is used.
421
+
422
+ voice_id : typing.Optional[str]
423
+ Voice ID used to voice the content. If not provided, default voice ID set in the Player settings is used.
424
+
425
+ model_id : typing.Optional[str]
426
+ TTS Model ID used in the player. If not provided, default model ID set in the Player settings is used.
427
+
428
+ file : typing.Optional[core.File]
429
+ See core.File for more documentation
430
+
431
+ auto_convert : typing.Optional[bool]
432
+ Whether to auto convert the project to audio or not.
433
+
434
+ apply_text_normalization : typing.Optional[AudioNativeCreateRequestApplyTextNormalization]
435
+
436
+ This parameter controls text normalization with four modes: 'auto', 'on', 'apply_english' and 'off'.
437
+ When set to 'auto', the system will automatically decide whether to apply text normalization
438
+ (e.g., spelling out numbers). With 'on', text normalization will always be applied, while
439
+ with 'off', it will be skipped. 'apply_english' is the same as 'on' but will assume that text is in English.
440
+
441
+
442
+ pronunciation_dictionary_locators : typing.Optional[typing.List[str]]
443
+ A list of pronunciation dictionary locators (pronunciation_dictionary_id, version_id) encoded as a list of JSON strings for pronunciation dictionaries to be applied to the text. A list of json encoded strings is required as adding projects may occur through formData as opposed to jsonBody. To specify multiple dictionaries use multiple --form lines in your curl, such as --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"Vmd4Zor6fplcA7WrINey\\",\\"version_id\\":\\"hRPaxjlTdR7wFMhV4w0b\\"}"' --form 'pronunciation_dictionary_locators="{\\"pronunciation_dictionary_id\\":\\"JzWtcGQMJ6bnlWwyMo7e\\",\\"version_id\\":\\"lbmwxiLu4q6txYxgdZqn\\"}"'.
444
+
445
+ request_options : typing.Optional[RequestOptions]
446
+ Request-specific configuration.
447
+
448
+ Returns
449
+ -------
450
+ AsyncHttpResponse[AudioNativeCreateProjectResponseModel]
451
+ Successful Response
452
+ """
453
+ _response = await self._client_wrapper.httpx_client.request(
454
+ "v1/audio-native",
455
+ method="POST",
456
+ data={
457
+ "name": name,
458
+ "image": image,
459
+ "author": author,
460
+ "title": title,
461
+ "small": small,
462
+ "text_color": text_color,
463
+ "background_color": background_color,
464
+ "sessionization": sessionization,
465
+ "voice_id": voice_id,
466
+ "model_id": model_id,
467
+ "auto_convert": auto_convert,
468
+ "apply_text_normalization": apply_text_normalization,
469
+ "pronunciation_dictionary_locators": pronunciation_dictionary_locators,
470
+ },
471
+ files={
472
+ **({"file": file} if file is not None else {}),
473
+ },
474
+ request_options=request_options,
475
+ omit=OMIT,
476
+ force_multipart=True,
477
+ )
478
+ try:
479
+ if 200 <= _response.status_code < 300:
480
+ _data = typing.cast(
481
+ AudioNativeCreateProjectResponseModel,
482
+ construct_type(
483
+ type_=AudioNativeCreateProjectResponseModel, # type: ignore
484
+ object_=_response.json(),
485
+ ),
486
+ )
487
+ return AsyncHttpResponse(response=_response, data=_data)
488
+ if _response.status_code == 422:
489
+ raise UnprocessableEntityError(
490
+ headers=dict(_response.headers),
491
+ body=typing.cast(
492
+ typing.Any,
493
+ construct_type(
494
+ type_=typing.Any, # type: ignore
495
+ object_=_response.json(),
496
+ ),
497
+ ),
498
+ )
499
+ _response_json = _response.json()
500
+ except JSONDecodeError:
501
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
502
+ except ValidationError as e:
503
+ raise ParsingError(
504
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
505
+ )
506
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
507
+
508
+ async def get_settings(
509
+ self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None
510
+ ) -> AsyncHttpResponse[GetAudioNativeProjectSettingsResponseModel]:
511
+ """
512
+ Get player settings for the specific project.
513
+
514
+ Parameters
515
+ ----------
516
+ project_id : str
517
+ The ID of the Studio project.
518
+
519
+ request_options : typing.Optional[RequestOptions]
520
+ Request-specific configuration.
521
+
522
+ Returns
523
+ -------
524
+ AsyncHttpResponse[GetAudioNativeProjectSettingsResponseModel]
525
+ Successful Response
526
+ """
527
+ _response = await self._client_wrapper.httpx_client.request(
528
+ f"v1/audio-native/{jsonable_encoder(project_id)}/settings",
529
+ method="GET",
530
+ request_options=request_options,
531
+ )
532
+ try:
533
+ if 200 <= _response.status_code < 300:
534
+ _data = typing.cast(
535
+ GetAudioNativeProjectSettingsResponseModel,
536
+ construct_type(
537
+ type_=GetAudioNativeProjectSettingsResponseModel, # type: ignore
538
+ object_=_response.json(),
539
+ ),
540
+ )
541
+ return AsyncHttpResponse(response=_response, data=_data)
542
+ if _response.status_code == 422:
543
+ raise UnprocessableEntityError(
544
+ headers=dict(_response.headers),
545
+ body=typing.cast(
546
+ typing.Any,
547
+ construct_type(
548
+ type_=typing.Any, # type: ignore
549
+ object_=_response.json(),
550
+ ),
551
+ ),
552
+ )
553
+ _response_json = _response.json()
554
+ except JSONDecodeError:
555
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
556
+ except ValidationError as e:
557
+ raise ParsingError(
558
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
559
+ )
560
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
561
+
562
+ async def update(
563
+ self,
564
+ project_id: str,
565
+ *,
566
+ file: typing.Optional[core.File] = OMIT,
567
+ auto_convert: typing.Optional[bool] = OMIT,
568
+ auto_publish: typing.Optional[bool] = OMIT,
569
+ request_options: typing.Optional[RequestOptions] = None,
570
+ ) -> AsyncHttpResponse[AudioNativeEditContentResponseModel]:
571
+ """
572
+ Updates content for the specific AudioNative Project.
573
+
574
+ Parameters
575
+ ----------
576
+ project_id : str
577
+ The ID of the project to be used. You can use the [List projects](/docs/api-reference/studio/get-projects) endpoint to list all the available projects.
578
+
579
+ file : typing.Optional[core.File]
580
+ See core.File for more documentation
581
+
582
+ auto_convert : typing.Optional[bool]
583
+ Whether to auto convert the project to audio or not.
584
+
585
+ auto_publish : typing.Optional[bool]
586
+ Whether to auto publish the new project snapshot after it's converted.
587
+
588
+ request_options : typing.Optional[RequestOptions]
589
+ Request-specific configuration.
590
+
591
+ Returns
592
+ -------
593
+ AsyncHttpResponse[AudioNativeEditContentResponseModel]
594
+ Successful Response
595
+ """
596
+ _response = await self._client_wrapper.httpx_client.request(
597
+ f"v1/audio-native/{jsonable_encoder(project_id)}/content",
598
+ method="POST",
599
+ data={
600
+ "auto_convert": auto_convert,
601
+ "auto_publish": auto_publish,
602
+ },
603
+ files={
604
+ **({"file": file} if file is not None else {}),
605
+ },
606
+ request_options=request_options,
607
+ omit=OMIT,
608
+ force_multipart=True,
609
+ )
610
+ try:
611
+ if 200 <= _response.status_code < 300:
612
+ _data = typing.cast(
613
+ AudioNativeEditContentResponseModel,
614
+ construct_type(
615
+ type_=AudioNativeEditContentResponseModel, # type: ignore
616
+ object_=_response.json(),
617
+ ),
618
+ )
619
+ return AsyncHttpResponse(response=_response, data=_data)
620
+ if _response.status_code == 422:
621
+ raise UnprocessableEntityError(
622
+ headers=dict(_response.headers),
623
+ body=typing.cast(
624
+ typing.Any,
625
+ construct_type(
626
+ type_=typing.Any, # type: ignore
627
+ object_=_response.json(),
628
+ ),
629
+ ),
630
+ )
631
+ _response_json = _response.json()
632
+ except JSONDecodeError:
633
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
634
+ except ValidationError as e:
635
+ raise ParsingError(
636
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
637
+ )
638
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
639
+
640
+ async def update_content_from_url(
641
+ self,
642
+ *,
643
+ url: str,
644
+ author: typing.Optional[str] = OMIT,
645
+ title: typing.Optional[str] = OMIT,
646
+ request_options: typing.Optional[RequestOptions] = None,
647
+ ) -> AsyncHttpResponse[AudioNativeEditContentResponseModel]:
648
+ """
649
+ Finds an AudioNative project matching the provided URL, extracts content from the URL, updates the project content, and queues it for conversion and auto-publishing.
650
+
651
+ Parameters
652
+ ----------
653
+ url : str
654
+ URL of the page to extract content from.
655
+
656
+ author : typing.Optional[str]
657
+ Author used in the player and inserted at the start of the uploaded article. If not provided, the default author set in the Player settings is used.
658
+
659
+ title : typing.Optional[str]
660
+ Title used in the player and inserted at the top of the uploaded article. If not provided, the default title set in the Player settings is used.
661
+
662
+ request_options : typing.Optional[RequestOptions]
663
+ Request-specific configuration.
664
+
665
+ Returns
666
+ -------
667
+ AsyncHttpResponse[AudioNativeEditContentResponseModel]
668
+ Successful Response
669
+ """
670
+ _response = await self._client_wrapper.httpx_client.request(
671
+ "v1/audio-native/content",
672
+ method="POST",
673
+ json={
674
+ "url": url,
675
+ "author": author,
676
+ "title": title,
677
+ },
678
+ headers={
679
+ "content-type": "application/json",
680
+ },
681
+ request_options=request_options,
682
+ omit=OMIT,
683
+ )
684
+ try:
685
+ if 200 <= _response.status_code < 300:
686
+ _data = typing.cast(
687
+ AudioNativeEditContentResponseModel,
688
+ construct_type(
689
+ type_=AudioNativeEditContentResponseModel, # type: ignore
690
+ object_=_response.json(),
691
+ ),
692
+ )
693
+ return AsyncHttpResponse(response=_response, data=_data)
694
+ if _response.status_code == 422:
695
+ raise UnprocessableEntityError(
696
+ headers=dict(_response.headers),
697
+ body=typing.cast(
698
+ typing.Any,
699
+ construct_type(
700
+ type_=typing.Any, # type: ignore
701
+ object_=_response.json(),
702
+ ),
703
+ ),
704
+ )
705
+ _response_json = _response.json()
706
+ except JSONDecodeError:
707
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
708
+ except ValidationError as e:
709
+ raise ParsingError(
710
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
711
+ )
712
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
data/src/elevenlabs/audio_native/types/__init__.py ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
5
+ import typing
6
+ from importlib import import_module
7
+
8
+ if typing.TYPE_CHECKING:
9
+ from .audio_native_create_request_apply_text_normalization import AudioNativeCreateRequestApplyTextNormalization
10
+ _dynamic_imports: typing.Dict[str, str] = {
11
+ "AudioNativeCreateRequestApplyTextNormalization": ".audio_native_create_request_apply_text_normalization"
12
+ }
13
+
14
+
15
+ def __getattr__(attr_name: str) -> typing.Any:
16
+ module_name = _dynamic_imports.get(attr_name)
17
+ if module_name is None:
18
+ raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
19
+ try:
20
+ module = import_module(module_name, __package__)
21
+ if module_name == f".{attr_name}":
22
+ return module
23
+ else:
24
+ return getattr(module, attr_name)
25
+ except ImportError as e:
26
+ raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
27
+ except AttributeError as e:
28
+ raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
29
+
30
+
31
+ def __dir__():
32
+ lazy_attrs = list(_dynamic_imports.keys())
33
+ return sorted(lazy_attrs)
34
+
35
+
36
+ __all__ = ["AudioNativeCreateRequestApplyTextNormalization"]
data/src/elevenlabs/audio_native/types/audio_native_create_request_apply_text_normalization.py ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ AudioNativeCreateRequestApplyTextNormalization = typing.Union[
6
+ typing.Literal["auto", "on", "off", "apply_english"], typing.Any
7
+ ]
data/src/elevenlabs/base_client.py ADDED
@@ -0,0 +1,774 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from __future__ import annotations
4
+
5
+ import os
6
+ import typing
7
+
8
+ import httpx
9
+ from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
10
+ from .core.logging import LogConfig, Logger
11
+ from .environment import ElevenLabsEnvironment
12
+
13
+ if typing.TYPE_CHECKING:
14
+ from .assets.client import AssetsClient, AsyncAssetsClient
15
+ from .audio_effects.client import AsyncAudioEffectsClient, AudioEffectsClient
16
+ from .audio_isolation.client import AsyncAudioIsolationClient, AudioIsolationClient
17
+ from .audio_native.client import AsyncAudioNativeClient, AudioNativeClient
18
+ from .conversational_ai.client import AsyncConversationalAiClient, ConversationalAiClient
19
+ from .dubbing.client import AsyncDubbingClient, DubbingClient
20
+ from .environment_variables.client import AsyncEnvironmentVariablesClient, EnvironmentVariablesClient
21
+ from .environments.client import AsyncEnvironmentsClient, EnvironmentsClient
22
+ from .flows.client import AsyncFlowsClient, FlowsClient
23
+ from .forced_alignment.client import AsyncForcedAlignmentClient, ForcedAlignmentClient
24
+ from .history.client import AsyncHistoryClient, HistoryClient
25
+ from .models.client import AsyncModelsClient, ModelsClient
26
+ from .music.client import AsyncMusicClient, MusicClient
27
+ from .productions.client import AsyncProductionsClient, ProductionsClient
28
+ from .pronunciation_dictionaries.client import AsyncPronunciationDictionariesClient, PronunciationDictionariesClient
29
+ from .samples.client import AsyncSamplesClient, SamplesClient
30
+ from .service_accounts.client import AsyncServiceAccountsClient, ServiceAccountsClient
31
+ from .speech_engine.client import AsyncSpeechEngineClient, SpeechEngineClient
32
+ from .speech_to_speech.client import AsyncSpeechToSpeechClient, SpeechToSpeechClient
33
+ from .speech_to_text.client import AsyncSpeechToTextClient, SpeechToTextClient
34
+ from .studio.client import AsyncStudioClient, StudioClient
35
+ from .text_to_dialogue.client import AsyncTextToDialogueClient, TextToDialogueClient
36
+ from .text_to_sound_effects.client import AsyncTextToSoundEffectsClient, TextToSoundEffectsClient
37
+ from .text_to_speech.client import AsyncTextToSpeechClient, TextToSpeechClient
38
+ from .text_to_voice.client import AsyncTextToVoiceClient, TextToVoiceClient
39
+ from .tokens.client import AsyncTokensClient, TokensClient
40
+ from .usage.client import AsyncUsageClient, UsageClient
41
+ from .user.client import AsyncUserClient, UserClient
42
+ from .voices.client import AsyncVoicesClient, VoicesClient
43
+ from .webhooks.client import AsyncWebhooksClient, WebhooksClient
44
+ from .workspace.client import AsyncWorkspaceClient, WorkspaceClient
45
+ from .workspaces.client import AsyncWorkspacesClient, WorkspacesClient
46
+
47
+
48
+ class BaseElevenLabs:
49
+ """
50
+ Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions.
51
+
52
+ Parameters
53
+ ----------
54
+ base_url : typing.Optional[str]
55
+ The base url to use for requests from the client.
56
+
57
+ environment : ElevenLabsEnvironment
58
+ The environment to use for requests from the client. from .environment import ElevenLabsEnvironment
59
+
60
+
61
+
62
+ Defaults to ElevenLabsEnvironment.PRODUCTION
63
+
64
+
65
+
66
+ api_key : typing.Optional[str]
67
+ headers : typing.Optional[typing.Dict[str, str]]
68
+ Additional headers to send with every request.
69
+
70
+ timeout : typing.Optional[float]
71
+ The timeout to be used, in seconds, for requests. By default the timeout is 240 seconds, unless a custom httpx client is used, in which case this default is not enforced.
72
+
73
+ follow_redirects : typing.Optional[bool]
74
+ Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in.
75
+
76
+ httpx_client : typing.Optional[httpx.Client]
77
+ The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.
78
+
79
+ logging : typing.Optional[typing.Union[LogConfig, Logger]]
80
+ Configure logging for the SDK. Accepts a LogConfig dict with 'level' (debug/info/warn/error), 'logger' (custom logger implementation), and 'silent' (boolean, defaults to True) fields. You can also pass a pre-configured Logger instance.
81
+
82
+ Examples
83
+ --------
84
+ from elevenlabs import ElevenLabs
85
+
86
+ client = ElevenLabs(
87
+ api_key="YOUR_API_KEY",
88
+ )
89
+ """
90
+
91
+ def __init__(
92
+ self,
93
+ *,
94
+ base_url: typing.Optional[str] = None,
95
+ environment: ElevenLabsEnvironment = ElevenLabsEnvironment.PRODUCTION,
96
+ api_key: typing.Optional[str] = os.getenv("ELEVENLABS_API_KEY"),
97
+ headers: typing.Optional[typing.Dict[str, str]] = None,
98
+ timeout: typing.Optional[float] = None,
99
+ follow_redirects: typing.Optional[bool] = True,
100
+ httpx_client: typing.Optional[httpx.Client] = None,
101
+ logging: typing.Optional[typing.Union[LogConfig, Logger]] = None,
102
+ ):
103
+ _defaulted_timeout = (
104
+ timeout if timeout is not None else 240 if httpx_client is None else httpx_client.timeout.read
105
+ )
106
+ self._client_wrapper = SyncClientWrapper(
107
+ base_url=_get_base_url(base_url=base_url, environment=environment),
108
+ api_key=api_key,
109
+ headers=headers,
110
+ httpx_client=httpx_client
111
+ if httpx_client is not None
112
+ else httpx.Client(timeout=_defaulted_timeout, follow_redirects=follow_redirects)
113
+ if follow_redirects is not None
114
+ else httpx.Client(timeout=_defaulted_timeout),
115
+ timeout=_defaulted_timeout,
116
+ logging=logging,
117
+ )
118
+ self._history: typing.Optional[HistoryClient] = None
119
+ self._text_to_sound_effects: typing.Optional[TextToSoundEffectsClient] = None
120
+ self._audio_isolation: typing.Optional[AudioIsolationClient] = None
121
+ self._audio_effects: typing.Optional[AudioEffectsClient] = None
122
+ self._samples: typing.Optional[SamplesClient] = None
123
+ self._text_to_speech: typing.Optional[TextToSpeechClient] = None
124
+ self._text_to_dialogue: typing.Optional[TextToDialogueClient] = None
125
+ self._speech_to_speech: typing.Optional[SpeechToSpeechClient] = None
126
+ self._text_to_voice: typing.Optional[TextToVoiceClient] = None
127
+ self._user: typing.Optional[UserClient] = None
128
+ self._voices: typing.Optional[VoicesClient] = None
129
+ self._studio: typing.Optional[StudioClient] = None
130
+ self._dubbing: typing.Optional[DubbingClient] = None
131
+ self._models: typing.Optional[ModelsClient] = None
132
+ self._audio_native: typing.Optional[AudioNativeClient] = None
133
+ self._usage: typing.Optional[UsageClient] = None
134
+ self._pronunciation_dictionaries: typing.Optional[PronunciationDictionariesClient] = None
135
+ self._workspace: typing.Optional[WorkspaceClient] = None
136
+ self._service_accounts: typing.Optional[ServiceAccountsClient] = None
137
+ self._webhooks: typing.Optional[WebhooksClient] = None
138
+ self._music: typing.Optional[MusicClient] = None
139
+ self._speech_to_text: typing.Optional[SpeechToTextClient] = None
140
+ self._forced_alignment: typing.Optional[ForcedAlignmentClient] = None
141
+ self._conversational_ai: typing.Optional[ConversationalAiClient] = None
142
+ self._speech_engine: typing.Optional[SpeechEngineClient] = None
143
+ self._environment_variables: typing.Optional[EnvironmentVariablesClient] = None
144
+ self._environments: typing.Optional[EnvironmentsClient] = None
145
+ self._assets: typing.Optional[AssetsClient] = None
146
+ self._flows: typing.Optional[FlowsClient] = None
147
+ self._productions: typing.Optional[ProductionsClient] = None
148
+ self._tokens: typing.Optional[TokensClient] = None
149
+ self._workspaces: typing.Optional[WorkspacesClient] = None
150
+
151
+ @property
152
+ def history(self):
153
+ if self._history is None:
154
+ from .history.client import HistoryClient # noqa: E402
155
+
156
+ self._history = HistoryClient(client_wrapper=self._client_wrapper)
157
+ return self._history
158
+
159
+ @property
160
+ def text_to_sound_effects(self):
161
+ if self._text_to_sound_effects is None:
162
+ from .text_to_sound_effects.client import TextToSoundEffectsClient # noqa: E402
163
+
164
+ self._text_to_sound_effects = TextToSoundEffectsClient(client_wrapper=self._client_wrapper)
165
+ return self._text_to_sound_effects
166
+
167
+ @property
168
+ def audio_isolation(self):
169
+ if self._audio_isolation is None:
170
+ from .audio_isolation.client import AudioIsolationClient # noqa: E402
171
+
172
+ self._audio_isolation = AudioIsolationClient(client_wrapper=self._client_wrapper)
173
+ return self._audio_isolation
174
+
175
+ @property
176
+ def audio_effects(self):
177
+ if self._audio_effects is None:
178
+ from .audio_effects.client import AudioEffectsClient # noqa: E402
179
+
180
+ self._audio_effects = AudioEffectsClient(client_wrapper=self._client_wrapper)
181
+ return self._audio_effects
182
+
183
+ @property
184
+ def samples(self):
185
+ if self._samples is None:
186
+ from .samples.client import SamplesClient # noqa: E402
187
+
188
+ self._samples = SamplesClient(client_wrapper=self._client_wrapper)
189
+ return self._samples
190
+
191
+ @property
192
+ def text_to_speech(self):
193
+ if self._text_to_speech is None:
194
+ from .text_to_speech.client import TextToSpeechClient # noqa: E402
195
+
196
+ self._text_to_speech = TextToSpeechClient(client_wrapper=self._client_wrapper)
197
+ return self._text_to_speech
198
+
199
+ @property
200
+ def text_to_dialogue(self):
201
+ if self._text_to_dialogue is None:
202
+ from .text_to_dialogue.client import TextToDialogueClient # noqa: E402
203
+
204
+ self._text_to_dialogue = TextToDialogueClient(client_wrapper=self._client_wrapper)
205
+ return self._text_to_dialogue
206
+
207
+ @property
208
+ def speech_to_speech(self):
209
+ if self._speech_to_speech is None:
210
+ from .speech_to_speech.client import SpeechToSpeechClient # noqa: E402
211
+
212
+ self._speech_to_speech = SpeechToSpeechClient(client_wrapper=self._client_wrapper)
213
+ return self._speech_to_speech
214
+
215
+ @property
216
+ def text_to_voice(self):
217
+ if self._text_to_voice is None:
218
+ from .text_to_voice.client import TextToVoiceClient # noqa: E402
219
+
220
+ self._text_to_voice = TextToVoiceClient(client_wrapper=self._client_wrapper)
221
+ return self._text_to_voice
222
+
223
+ @property
224
+ def user(self):
225
+ if self._user is None:
226
+ from .user.client import UserClient # noqa: E402
227
+
228
+ self._user = UserClient(client_wrapper=self._client_wrapper)
229
+ return self._user
230
+
231
+ @property
232
+ def voices(self):
233
+ if self._voices is None:
234
+ from .voices.client import VoicesClient # noqa: E402
235
+
236
+ self._voices = VoicesClient(client_wrapper=self._client_wrapper)
237
+ return self._voices
238
+
239
+ @property
240
+ def studio(self):
241
+ if self._studio is None:
242
+ from .studio.client import StudioClient # noqa: E402
243
+
244
+ self._studio = StudioClient(client_wrapper=self._client_wrapper)
245
+ return self._studio
246
+
247
+ @property
248
+ def dubbing(self):
249
+ if self._dubbing is None:
250
+ from .dubbing.client import DubbingClient # noqa: E402
251
+
252
+ self._dubbing = DubbingClient(client_wrapper=self._client_wrapper)
253
+ return self._dubbing
254
+
255
+ @property
256
+ def models(self):
257
+ if self._models is None:
258
+ from .models.client import ModelsClient # noqa: E402
259
+
260
+ self._models = ModelsClient(client_wrapper=self._client_wrapper)
261
+ return self._models
262
+
263
+ @property
264
+ def audio_native(self):
265
+ if self._audio_native is None:
266
+ from .audio_native.client import AudioNativeClient # noqa: E402
267
+
268
+ self._audio_native = AudioNativeClient(client_wrapper=self._client_wrapper)
269
+ return self._audio_native
270
+
271
+ @property
272
+ def usage(self):
273
+ if self._usage is None:
274
+ from .usage.client import UsageClient # noqa: E402
275
+
276
+ self._usage = UsageClient(client_wrapper=self._client_wrapper)
277
+ return self._usage
278
+
279
+ @property
280
+ def pronunciation_dictionaries(self):
281
+ if self._pronunciation_dictionaries is None:
282
+ from .pronunciation_dictionaries.client import PronunciationDictionariesClient # noqa: E402
283
+
284
+ self._pronunciation_dictionaries = PronunciationDictionariesClient(client_wrapper=self._client_wrapper)
285
+ return self._pronunciation_dictionaries
286
+
287
+ @property
288
+ def workspace(self):
289
+ if self._workspace is None:
290
+ from .workspace.client import WorkspaceClient # noqa: E402
291
+
292
+ self._workspace = WorkspaceClient(client_wrapper=self._client_wrapper)
293
+ return self._workspace
294
+
295
+ @property
296
+ def service_accounts(self):
297
+ if self._service_accounts is None:
298
+ from .service_accounts.client import ServiceAccountsClient # noqa: E402
299
+
300
+ self._service_accounts = ServiceAccountsClient(client_wrapper=self._client_wrapper)
301
+ return self._service_accounts
302
+
303
+ @property
304
+ def webhooks(self):
305
+ if self._webhooks is None:
306
+ from .webhooks.client import WebhooksClient # noqa: E402
307
+
308
+ self._webhooks = WebhooksClient(client_wrapper=self._client_wrapper)
309
+ return self._webhooks
310
+
311
+ @property
312
+ def music(self):
313
+ if self._music is None:
314
+ from .music.client import MusicClient # noqa: E402
315
+
316
+ self._music = MusicClient(client_wrapper=self._client_wrapper)
317
+ return self._music
318
+
319
+ @property
320
+ def speech_to_text(self):
321
+ if self._speech_to_text is None:
322
+ from .speech_to_text.client import SpeechToTextClient # noqa: E402
323
+
324
+ self._speech_to_text = SpeechToTextClient(client_wrapper=self._client_wrapper)
325
+ return self._speech_to_text
326
+
327
+ @property
328
+ def forced_alignment(self):
329
+ if self._forced_alignment is None:
330
+ from .forced_alignment.client import ForcedAlignmentClient # noqa: E402
331
+
332
+ self._forced_alignment = ForcedAlignmentClient(client_wrapper=self._client_wrapper)
333
+ return self._forced_alignment
334
+
335
+ @property
336
+ def conversational_ai(self):
337
+ if self._conversational_ai is None:
338
+ from .conversational_ai.client import ConversationalAiClient # noqa: E402
339
+
340
+ self._conversational_ai = ConversationalAiClient(client_wrapper=self._client_wrapper)
341
+ return self._conversational_ai
342
+
343
+ @property
344
+ def speech_engine(self):
345
+ if self._speech_engine is None:
346
+ from .speech_engine.client import SpeechEngineClient # noqa: E402
347
+
348
+ self._speech_engine = SpeechEngineClient(client_wrapper=self._client_wrapper)
349
+ return self._speech_engine
350
+
351
+ @property
352
+ def environment_variables(self):
353
+ if self._environment_variables is None:
354
+ from .environment_variables.client import EnvironmentVariablesClient # noqa: E402
355
+
356
+ self._environment_variables = EnvironmentVariablesClient(client_wrapper=self._client_wrapper)
357
+ return self._environment_variables
358
+
359
+ @property
360
+ def environments(self):
361
+ if self._environments is None:
362
+ from .environments.client import EnvironmentsClient # noqa: E402
363
+
364
+ self._environments = EnvironmentsClient(client_wrapper=self._client_wrapper)
365
+ return self._environments
366
+
367
+ @property
368
+ def assets(self):
369
+ if self._assets is None:
370
+ from .assets.client import AssetsClient # noqa: E402
371
+
372
+ self._assets = AssetsClient(client_wrapper=self._client_wrapper)
373
+ return self._assets
374
+
375
+ @property
376
+ def flows(self):
377
+ if self._flows is None:
378
+ from .flows.client import FlowsClient # noqa: E402
379
+
380
+ self._flows = FlowsClient(client_wrapper=self._client_wrapper)
381
+ return self._flows
382
+
383
+ @property
384
+ def productions(self):
385
+ if self._productions is None:
386
+ from .productions.client import ProductionsClient # noqa: E402
387
+
388
+ self._productions = ProductionsClient(client_wrapper=self._client_wrapper)
389
+ return self._productions
390
+
391
+ @property
392
+ def tokens(self):
393
+ if self._tokens is None:
394
+ from .tokens.client import TokensClient # noqa: E402
395
+
396
+ self._tokens = TokensClient(client_wrapper=self._client_wrapper)
397
+ return self._tokens
398
+
399
+ @property
400
+ def workspaces(self):
401
+ if self._workspaces is None:
402
+ from .workspaces.client import WorkspacesClient # noqa: E402
403
+
404
+ self._workspaces = WorkspacesClient(client_wrapper=self._client_wrapper)
405
+ return self._workspaces
406
+
407
+
408
+ class AsyncBaseElevenLabs:
409
+ """
410
+ Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions.
411
+
412
+ Parameters
413
+ ----------
414
+ base_url : typing.Optional[str]
415
+ The base url to use for requests from the client.
416
+
417
+ environment : ElevenLabsEnvironment
418
+ The environment to use for requests from the client. from .environment import ElevenLabsEnvironment
419
+
420
+
421
+
422
+ Defaults to ElevenLabsEnvironment.PRODUCTION
423
+
424
+
425
+
426
+ api_key : typing.Optional[str]
427
+ headers : typing.Optional[typing.Dict[str, str]]
428
+ Additional headers to send with every request.
429
+
430
+ timeout : typing.Optional[float]
431
+ The timeout to be used, in seconds, for requests. By default the timeout is 240 seconds, unless a custom httpx client is used, in which case this default is not enforced.
432
+
433
+ follow_redirects : typing.Optional[bool]
434
+ Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in.
435
+
436
+ httpx_client : typing.Optional[httpx.AsyncClient]
437
+ The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.
438
+
439
+ logging : typing.Optional[typing.Union[LogConfig, Logger]]
440
+ Configure logging for the SDK. Accepts a LogConfig dict with 'level' (debug/info/warn/error), 'logger' (custom logger implementation), and 'silent' (boolean, defaults to True) fields. You can also pass a pre-configured Logger instance.
441
+
442
+ Examples
443
+ --------
444
+ from elevenlabs import AsyncElevenLabs
445
+
446
+ client = AsyncElevenLabs(
447
+ api_key="YOUR_API_KEY",
448
+ )
449
+ """
450
+
451
+ def __init__(
452
+ self,
453
+ *,
454
+ base_url: typing.Optional[str] = None,
455
+ environment: ElevenLabsEnvironment = ElevenLabsEnvironment.PRODUCTION,
456
+ api_key: typing.Optional[str] = os.getenv("ELEVENLABS_API_KEY"),
457
+ headers: typing.Optional[typing.Dict[str, str]] = None,
458
+ timeout: typing.Optional[float] = None,
459
+ follow_redirects: typing.Optional[bool] = True,
460
+ httpx_client: typing.Optional[httpx.AsyncClient] = None,
461
+ logging: typing.Optional[typing.Union[LogConfig, Logger]] = None,
462
+ ):
463
+ _defaulted_timeout = (
464
+ timeout if timeout is not None else 240 if httpx_client is None else httpx_client.timeout.read
465
+ )
466
+ self._client_wrapper = AsyncClientWrapper(
467
+ base_url=_get_base_url(base_url=base_url, environment=environment),
468
+ api_key=api_key,
469
+ headers=headers,
470
+ httpx_client=httpx_client
471
+ if httpx_client is not None
472
+ else httpx.AsyncClient(timeout=_defaulted_timeout, follow_redirects=follow_redirects)
473
+ if follow_redirects is not None
474
+ else httpx.AsyncClient(timeout=_defaulted_timeout),
475
+ timeout=_defaulted_timeout,
476
+ logging=logging,
477
+ )
478
+ self._history: typing.Optional[AsyncHistoryClient] = None
479
+ self._text_to_sound_effects: typing.Optional[AsyncTextToSoundEffectsClient] = None
480
+ self._audio_isolation: typing.Optional[AsyncAudioIsolationClient] = None
481
+ self._audio_effects: typing.Optional[AsyncAudioEffectsClient] = None
482
+ self._samples: typing.Optional[AsyncSamplesClient] = None
483
+ self._text_to_speech: typing.Optional[AsyncTextToSpeechClient] = None
484
+ self._text_to_dialogue: typing.Optional[AsyncTextToDialogueClient] = None
485
+ self._speech_to_speech: typing.Optional[AsyncSpeechToSpeechClient] = None
486
+ self._text_to_voice: typing.Optional[AsyncTextToVoiceClient] = None
487
+ self._user: typing.Optional[AsyncUserClient] = None
488
+ self._voices: typing.Optional[AsyncVoicesClient] = None
489
+ self._studio: typing.Optional[AsyncStudioClient] = None
490
+ self._dubbing: typing.Optional[AsyncDubbingClient] = None
491
+ self._models: typing.Optional[AsyncModelsClient] = None
492
+ self._audio_native: typing.Optional[AsyncAudioNativeClient] = None
493
+ self._usage: typing.Optional[AsyncUsageClient] = None
494
+ self._pronunciation_dictionaries: typing.Optional[AsyncPronunciationDictionariesClient] = None
495
+ self._workspace: typing.Optional[AsyncWorkspaceClient] = None
496
+ self._service_accounts: typing.Optional[AsyncServiceAccountsClient] = None
497
+ self._webhooks: typing.Optional[AsyncWebhooksClient] = None
498
+ self._music: typing.Optional[AsyncMusicClient] = None
499
+ self._speech_to_text: typing.Optional[AsyncSpeechToTextClient] = None
500
+ self._forced_alignment: typing.Optional[AsyncForcedAlignmentClient] = None
501
+ self._conversational_ai: typing.Optional[AsyncConversationalAiClient] = None
502
+ self._speech_engine: typing.Optional[AsyncSpeechEngineClient] = None
503
+ self._environment_variables: typing.Optional[AsyncEnvironmentVariablesClient] = None
504
+ self._environments: typing.Optional[AsyncEnvironmentsClient] = None
505
+ self._assets: typing.Optional[AsyncAssetsClient] = None
506
+ self._flows: typing.Optional[AsyncFlowsClient] = None
507
+ self._productions: typing.Optional[AsyncProductionsClient] = None
508
+ self._tokens: typing.Optional[AsyncTokensClient] = None
509
+ self._workspaces: typing.Optional[AsyncWorkspacesClient] = None
510
+
511
+ @property
512
+ def history(self):
513
+ if self._history is None:
514
+ from .history.client import AsyncHistoryClient # noqa: E402
515
+
516
+ self._history = AsyncHistoryClient(client_wrapper=self._client_wrapper)
517
+ return self._history
518
+
519
+ @property
520
+ def text_to_sound_effects(self):
521
+ if self._text_to_sound_effects is None:
522
+ from .text_to_sound_effects.client import AsyncTextToSoundEffectsClient # noqa: E402
523
+
524
+ self._text_to_sound_effects = AsyncTextToSoundEffectsClient(client_wrapper=self._client_wrapper)
525
+ return self._text_to_sound_effects
526
+
527
+ @property
528
+ def audio_isolation(self):
529
+ if self._audio_isolation is None:
530
+ from .audio_isolation.client import AsyncAudioIsolationClient # noqa: E402
531
+
532
+ self._audio_isolation = AsyncAudioIsolationClient(client_wrapper=self._client_wrapper)
533
+ return self._audio_isolation
534
+
535
+ @property
536
+ def audio_effects(self):
537
+ if self._audio_effects is None:
538
+ from .audio_effects.client import AsyncAudioEffectsClient # noqa: E402
539
+
540
+ self._audio_effects = AsyncAudioEffectsClient(client_wrapper=self._client_wrapper)
541
+ return self._audio_effects
542
+
543
+ @property
544
+ def samples(self):
545
+ if self._samples is None:
546
+ from .samples.client import AsyncSamplesClient # noqa: E402
547
+
548
+ self._samples = AsyncSamplesClient(client_wrapper=self._client_wrapper)
549
+ return self._samples
550
+
551
+ @property
552
+ def text_to_speech(self):
553
+ if self._text_to_speech is None:
554
+ from .text_to_speech.client import AsyncTextToSpeechClient # noqa: E402
555
+
556
+ self._text_to_speech = AsyncTextToSpeechClient(client_wrapper=self._client_wrapper)
557
+ return self._text_to_speech
558
+
559
+ @property
560
+ def text_to_dialogue(self):
561
+ if self._text_to_dialogue is None:
562
+ from .text_to_dialogue.client import AsyncTextToDialogueClient # noqa: E402
563
+
564
+ self._text_to_dialogue = AsyncTextToDialogueClient(client_wrapper=self._client_wrapper)
565
+ return self._text_to_dialogue
566
+
567
+ @property
568
+ def speech_to_speech(self):
569
+ if self._speech_to_speech is None:
570
+ from .speech_to_speech.client import AsyncSpeechToSpeechClient # noqa: E402
571
+
572
+ self._speech_to_speech = AsyncSpeechToSpeechClient(client_wrapper=self._client_wrapper)
573
+ return self._speech_to_speech
574
+
575
+ @property
576
+ def text_to_voice(self):
577
+ if self._text_to_voice is None:
578
+ from .text_to_voice.client import AsyncTextToVoiceClient # noqa: E402
579
+
580
+ self._text_to_voice = AsyncTextToVoiceClient(client_wrapper=self._client_wrapper)
581
+ return self._text_to_voice
582
+
583
+ @property
584
+ def user(self):
585
+ if self._user is None:
586
+ from .user.client import AsyncUserClient # noqa: E402
587
+
588
+ self._user = AsyncUserClient(client_wrapper=self._client_wrapper)
589
+ return self._user
590
+
591
+ @property
592
+ def voices(self):
593
+ if self._voices is None:
594
+ from .voices.client import AsyncVoicesClient # noqa: E402
595
+
596
+ self._voices = AsyncVoicesClient(client_wrapper=self._client_wrapper)
597
+ return self._voices
598
+
599
+ @property
600
+ def studio(self):
601
+ if self._studio is None:
602
+ from .studio.client import AsyncStudioClient # noqa: E402
603
+
604
+ self._studio = AsyncStudioClient(client_wrapper=self._client_wrapper)
605
+ return self._studio
606
+
607
+ @property
608
+ def dubbing(self):
609
+ if self._dubbing is None:
610
+ from .dubbing.client import AsyncDubbingClient # noqa: E402
611
+
612
+ self._dubbing = AsyncDubbingClient(client_wrapper=self._client_wrapper)
613
+ return self._dubbing
614
+
615
+ @property
616
+ def models(self):
617
+ if self._models is None:
618
+ from .models.client import AsyncModelsClient # noqa: E402
619
+
620
+ self._models = AsyncModelsClient(client_wrapper=self._client_wrapper)
621
+ return self._models
622
+
623
+ @property
624
+ def audio_native(self):
625
+ if self._audio_native is None:
626
+ from .audio_native.client import AsyncAudioNativeClient # noqa: E402
627
+
628
+ self._audio_native = AsyncAudioNativeClient(client_wrapper=self._client_wrapper)
629
+ return self._audio_native
630
+
631
+ @property
632
+ def usage(self):
633
+ if self._usage is None:
634
+ from .usage.client import AsyncUsageClient # noqa: E402
635
+
636
+ self._usage = AsyncUsageClient(client_wrapper=self._client_wrapper)
637
+ return self._usage
638
+
639
+ @property
640
+ def pronunciation_dictionaries(self):
641
+ if self._pronunciation_dictionaries is None:
642
+ from .pronunciation_dictionaries.client import AsyncPronunciationDictionariesClient # noqa: E402
643
+
644
+ self._pronunciation_dictionaries = AsyncPronunciationDictionariesClient(client_wrapper=self._client_wrapper)
645
+ return self._pronunciation_dictionaries
646
+
647
+ @property
648
+ def workspace(self):
649
+ if self._workspace is None:
650
+ from .workspace.client import AsyncWorkspaceClient # noqa: E402
651
+
652
+ self._workspace = AsyncWorkspaceClient(client_wrapper=self._client_wrapper)
653
+ return self._workspace
654
+
655
+ @property
656
+ def service_accounts(self):
657
+ if self._service_accounts is None:
658
+ from .service_accounts.client import AsyncServiceAccountsClient # noqa: E402
659
+
660
+ self._service_accounts = AsyncServiceAccountsClient(client_wrapper=self._client_wrapper)
661
+ return self._service_accounts
662
+
663
+ @property
664
+ def webhooks(self):
665
+ if self._webhooks is None:
666
+ from .webhooks.client import AsyncWebhooksClient # noqa: E402
667
+
668
+ self._webhooks = AsyncWebhooksClient(client_wrapper=self._client_wrapper)
669
+ return self._webhooks
670
+
671
+ @property
672
+ def music(self):
673
+ if self._music is None:
674
+ from .music.client import AsyncMusicClient # noqa: E402
675
+
676
+ self._music = AsyncMusicClient(client_wrapper=self._client_wrapper)
677
+ return self._music
678
+
679
+ @property
680
+ def speech_to_text(self):
681
+ if self._speech_to_text is None:
682
+ from .speech_to_text.client import AsyncSpeechToTextClient # noqa: E402
683
+
684
+ self._speech_to_text = AsyncSpeechToTextClient(client_wrapper=self._client_wrapper)
685
+ return self._speech_to_text
686
+
687
+ @property
688
+ def forced_alignment(self):
689
+ if self._forced_alignment is None:
690
+ from .forced_alignment.client import AsyncForcedAlignmentClient # noqa: E402
691
+
692
+ self._forced_alignment = AsyncForcedAlignmentClient(client_wrapper=self._client_wrapper)
693
+ return self._forced_alignment
694
+
695
+ @property
696
+ def conversational_ai(self):
697
+ if self._conversational_ai is None:
698
+ from .conversational_ai.client import AsyncConversationalAiClient # noqa: E402
699
+
700
+ self._conversational_ai = AsyncConversationalAiClient(client_wrapper=self._client_wrapper)
701
+ return self._conversational_ai
702
+
703
+ @property
704
+ def speech_engine(self):
705
+ if self._speech_engine is None:
706
+ from .speech_engine.client import AsyncSpeechEngineClient # noqa: E402
707
+
708
+ self._speech_engine = AsyncSpeechEngineClient(client_wrapper=self._client_wrapper)
709
+ return self._speech_engine
710
+
711
+ @property
712
+ def environment_variables(self):
713
+ if self._environment_variables is None:
714
+ from .environment_variables.client import AsyncEnvironmentVariablesClient # noqa: E402
715
+
716
+ self._environment_variables = AsyncEnvironmentVariablesClient(client_wrapper=self._client_wrapper)
717
+ return self._environment_variables
718
+
719
+ @property
720
+ def environments(self):
721
+ if self._environments is None:
722
+ from .environments.client import AsyncEnvironmentsClient # noqa: E402
723
+
724
+ self._environments = AsyncEnvironmentsClient(client_wrapper=self._client_wrapper)
725
+ return self._environments
726
+
727
+ @property
728
+ def assets(self):
729
+ if self._assets is None:
730
+ from .assets.client import AsyncAssetsClient # noqa: E402
731
+
732
+ self._assets = AsyncAssetsClient(client_wrapper=self._client_wrapper)
733
+ return self._assets
734
+
735
+ @property
736
+ def flows(self):
737
+ if self._flows is None:
738
+ from .flows.client import AsyncFlowsClient # noqa: E402
739
+
740
+ self._flows = AsyncFlowsClient(client_wrapper=self._client_wrapper)
741
+ return self._flows
742
+
743
+ @property
744
+ def productions(self):
745
+ if self._productions is None:
746
+ from .productions.client import AsyncProductionsClient # noqa: E402
747
+
748
+ self._productions = AsyncProductionsClient(client_wrapper=self._client_wrapper)
749
+ return self._productions
750
+
751
+ @property
752
+ def tokens(self):
753
+ if self._tokens is None:
754
+ from .tokens.client import AsyncTokensClient # noqa: E402
755
+
756
+ self._tokens = AsyncTokensClient(client_wrapper=self._client_wrapper)
757
+ return self._tokens
758
+
759
+ @property
760
+ def workspaces(self):
761
+ if self._workspaces is None:
762
+ from .workspaces.client import AsyncWorkspacesClient # noqa: E402
763
+
764
+ self._workspaces = AsyncWorkspacesClient(client_wrapper=self._client_wrapper)
765
+ return self._workspaces
766
+
767
+
768
+ def _get_base_url(*, base_url: typing.Optional[str] = None, environment: ElevenLabsEnvironment) -> str:
769
+ if base_url is not None:
770
+ return base_url
771
+ elif environment is not None:
772
+ return environment.value
773
+ else:
774
+ raise Exception("Please pass in either base_url or environment to construct the client")
data/src/elevenlabs/client.py ADDED
@@ -0,0 +1,175 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import typing
3
+
4
+ import httpx
5
+
6
+ from .base_client import AsyncBaseElevenLabs, BaseElevenLabs
7
+ from .environment import ElevenLabsEnvironment
8
+ from .flows_custom import AsyncFlowsClient, FlowsClient
9
+ from .music_custom import AsyncMusicClient, MusicClient
10
+ from .realtime_tts import RealtimeTextToSpeechClient
11
+ from .speech_engine_custom import AsyncSpeechEngineClient, SpeechEngineClient
12
+ from .speech_to_text_custom import AsyncSpeechToTextClient, SpeechToTextClient
13
+ from .webhooks_custom import AsyncWebhooksClient, WebhooksClient
14
+
15
+
16
+ # this is used as the default value for optional parameters
17
+ OMIT = typing.cast(typing.Any, ...)
18
+
19
+
20
+ def get_base_url_host(base_url: str) -> str:
21
+ return httpx.URL(base_url).host
22
+
23
+
24
+ class ElevenLabs(BaseElevenLabs):
25
+ """
26
+ Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions.
27
+
28
+ Parameters:
29
+ - base_url: typing.Optional[str]. The base url to use for requests from the client.
30
+
31
+ - environment: ElevenLabsEnvironment. The environment to use for requests from the client. from .environment import ElevenLabsEnvironment
32
+
33
+ Defaults to ElevenLabsEnvironment.PRODUCTION
34
+
35
+ - api_key: typing.Optional[str].
36
+
37
+ - headers: typing.Optional[typing.Dict[str, str]]. Additional headers to send with every request.
38
+
39
+ - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 240 seconds.
40
+
41
+ - follow_redirects: typing.Optional[bool]. Whether the default httpx client should follow redirects. Defaults to True. Ignored when a custom `httpx_client` is supplied.
42
+
43
+ - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.
44
+ ---
45
+ from elevenlabs.client import ElevenLabs
46
+
47
+ client = ElevenLabs(
48
+ api_key="YOUR_API_KEY",
49
+ )
50
+ """
51
+ def __init__(
52
+ self,
53
+ *,
54
+ base_url: typing.Optional[str] = None,
55
+ environment: ElevenLabsEnvironment = ElevenLabsEnvironment.PRODUCTION,
56
+ api_key: typing.Optional[str] = os.getenv("ELEVENLABS_API_KEY"),
57
+ headers: typing.Optional[typing.Dict[str, str]] = None,
58
+ timeout: typing.Optional[float] = 240,
59
+ follow_redirects: typing.Optional[bool] = True,
60
+ httpx_client: typing.Optional[httpx.Client] = None
61
+ ):
62
+ super().__init__(
63
+ base_url=base_url,
64
+ environment=environment,
65
+ api_key=api_key,
66
+ headers=headers,
67
+ timeout=timeout,
68
+ follow_redirects=follow_redirects,
69
+ httpx_client=httpx_client
70
+ )
71
+ self._text_to_speech = RealtimeTextToSpeechClient(client_wrapper=self._client_wrapper)
72
+ self._webhooks = WebhooksClient(client_wrapper=self._client_wrapper)
73
+ self._music = MusicClient(client_wrapper=self._client_wrapper)
74
+ self._speech_to_text = SpeechToTextClient(client_wrapper=self._client_wrapper)
75
+ self._speech_engine = SpeechEngineClient(client_wrapper=self._client_wrapper)
76
+ self._flows = FlowsClient(client_wrapper=self._client_wrapper)
77
+
78
+ @property
79
+ def text_to_speech(self) -> RealtimeTextToSpeechClient:
80
+ return typing.cast(RealtimeTextToSpeechClient, self._text_to_speech)
81
+
82
+ @property
83
+ def webhooks(self) -> WebhooksClient:
84
+ return typing.cast(WebhooksClient, self._webhooks)
85
+
86
+ @property
87
+ def music(self) -> MusicClient:
88
+ return typing.cast(MusicClient, self._music)
89
+
90
+ @property
91
+ def speech_to_text(self) -> SpeechToTextClient:
92
+ return typing.cast(SpeechToTextClient, self._speech_to_text)
93
+
94
+ @property
95
+ def speech_engine(self) -> SpeechEngineClient:
96
+ return typing.cast(SpeechEngineClient, self._speech_engine)
97
+
98
+ @property
99
+ def flows(self) -> FlowsClient:
100
+ return typing.cast(FlowsClient, self._flows)
101
+
102
+
103
+ class AsyncElevenLabs(AsyncBaseElevenLabs):
104
+ """
105
+ Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions.
106
+
107
+ Parameters:
108
+ - base_url: typing.Optional[str]. The base url to use for requests from the client.
109
+
110
+ - environment: ElevenLabsEnvironment. The environment to use for requests from the client. from .environment import ElevenLabsEnvironment
111
+
112
+ Defaults to ElevenLabsEnvironment.PRODUCTION
113
+
114
+ - api_key: typing.Optional[str].
115
+
116
+ - headers: typing.Optional[typing.Dict[str, str]]. Additional headers to send with every request.
117
+
118
+ - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 240 seconds.
119
+
120
+ - follow_redirects: typing.Optional[bool]. Whether the default httpx client should follow redirects. Defaults to True. Ignored when a custom `httpx_client` is supplied.
121
+
122
+ - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.
123
+ ---
124
+ from elevenlabs.client import AsyncElevenLabs
125
+
126
+ client = AsyncElevenLabs(
127
+ api_key="YOUR_API_KEY",
128
+ )
129
+ """
130
+
131
+ def __init__(
132
+ self,
133
+ *,
134
+ base_url: typing.Optional[str] = None,
135
+ environment: ElevenLabsEnvironment = ElevenLabsEnvironment.PRODUCTION,
136
+ api_key: typing.Optional[str] = os.getenv("ELEVENLABS_API_KEY"),
137
+ headers: typing.Optional[typing.Dict[str, str]] = None,
138
+ timeout: typing.Optional[float] = 240,
139
+ follow_redirects: typing.Optional[bool] = True,
140
+ httpx_client: typing.Optional[httpx.AsyncClient] = None
141
+ ):
142
+ super().__init__(
143
+ base_url=base_url,
144
+ environment=environment,
145
+ api_key=api_key,
146
+ headers=headers,
147
+ timeout=timeout,
148
+ follow_redirects=follow_redirects,
149
+ httpx_client=httpx_client
150
+ )
151
+ self._webhooks = AsyncWebhooksClient(client_wrapper=self._client_wrapper)
152
+ self._music = AsyncMusicClient(client_wrapper=self._client_wrapper)
153
+ self._speech_to_text = AsyncSpeechToTextClient(client_wrapper=self._client_wrapper)
154
+ self._speech_engine = AsyncSpeechEngineClient(client_wrapper=self._client_wrapper)
155
+ self._flows = AsyncFlowsClient(client_wrapper=self._client_wrapper)
156
+
157
+ @property
158
+ def webhooks(self) -> AsyncWebhooksClient:
159
+ return typing.cast(AsyncWebhooksClient, self._webhooks)
160
+
161
+ @property
162
+ def music(self) -> AsyncMusicClient:
163
+ return typing.cast(AsyncMusicClient, self._music)
164
+
165
+ @property
166
+ def speech_to_text(self) -> AsyncSpeechToTextClient:
167
+ return typing.cast(AsyncSpeechToTextClient, self._speech_to_text)
168
+
169
+ @property
170
+ def speech_engine(self) -> AsyncSpeechEngineClient:
171
+ return typing.cast(AsyncSpeechEngineClient, self._speech_engine)
172
+
173
+ @property
174
+ def flows(self) -> AsyncFlowsClient:
175
+ return typing.cast(AsyncFlowsClient, self._flows)
data/src/elevenlabs/conversational_ai/__init__.py ADDED
@@ -0,0 +1,253 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
5
+ import typing
6
+ from importlib import import_module
7
+
8
+ if typing.TYPE_CHECKING:
9
+ from . import (
10
+ agents,
11
+ analytics,
12
+ batch_calls,
13
+ conversations,
14
+ dashboard,
15
+ exotel,
16
+ knowledge_base,
17
+ llm,
18
+ llm_usage,
19
+ mcp_servers,
20
+ phone_numbers,
21
+ realtime,
22
+ secrets,
23
+ settings,
24
+ sip_trunk,
25
+ tests,
26
+ tools,
27
+ triage_tickets,
28
+ twilio,
29
+ users,
30
+ whatsapp,
31
+ whatsapp_accounts,
32
+ )
33
+ from .conversations import (
34
+ ConversationsGetRequestFormat,
35
+ ConversationsListRequestExcludeStatusesItem,
36
+ ConversationsListRequestSummaryMode,
37
+ )
38
+ from .knowledge_base import (
39
+ KnowledgeBaseGetOrCreateRagIndexesResponseValue,
40
+ KnowledgeBaseGetOrCreateRagIndexesResponseValue_Failure,
41
+ KnowledgeBaseGetOrCreateRagIndexesResponseValue_Success,
42
+ )
43
+ from .mcp_servers import (
44
+ McpServerConfigUpdateRequestModelAuthConnection,
45
+ McpServerConfigUpdateRequestModelRequestHeadersValue,
46
+ McpServerConfigUpdateRequestModelRequestMetaValue,
47
+ )
48
+ from .phone_numbers import (
49
+ PhoneNumbersCreateRequestBody,
50
+ PhoneNumbersCreateRequestBody_Exotel,
51
+ PhoneNumbersCreateRequestBody_SipTrunk,
52
+ PhoneNumbersCreateRequestBody_Twilio,
53
+ PhoneNumbersGetResponse,
54
+ PhoneNumbersGetResponse_Exotel,
55
+ PhoneNumbersGetResponse_SipTrunk,
56
+ PhoneNumbersGetResponse_Twilio,
57
+ PhoneNumbersListResponseItem,
58
+ PhoneNumbersListResponseItem_Exotel,
59
+ PhoneNumbersListResponseItem_SipTrunk,
60
+ PhoneNumbersListResponseItem_Twilio,
61
+ PhoneNumbersUpdateResponse,
62
+ PhoneNumbersUpdateResponse_Exotel,
63
+ PhoneNumbersUpdateResponse_SipTrunk,
64
+ PhoneNumbersUpdateResponse_Twilio,
65
+ )
66
+ from .tests import (
67
+ TestsCreateRequestBody,
68
+ TestsCreateRequestBody_Llm,
69
+ TestsCreateRequestBody_Simulation,
70
+ TestsCreateRequestBody_Tool,
71
+ TestsGetResponse,
72
+ TestsGetResponse_Llm,
73
+ TestsGetResponse_Simulation,
74
+ TestsGetResponse_Tool,
75
+ TestsListRequestSortMode,
76
+ TestsUpdateRequestBody,
77
+ TestsUpdateRequestBody_Llm,
78
+ TestsUpdateRequestBody_Simulation,
79
+ TestsUpdateRequestBody_Tool,
80
+ TestsUpdateResponse,
81
+ TestsUpdateResponse_Llm,
82
+ TestsUpdateResponse_Simulation,
83
+ TestsUpdateResponse_Tool,
84
+ )
85
+ from .whatsapp import (
86
+ BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem,
87
+ BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Body,
88
+ BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Button,
89
+ BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Header,
90
+ )
91
+ _dynamic_imports: typing.Dict[str, str] = {
92
+ "BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem": ".whatsapp",
93
+ "BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Body": ".whatsapp",
94
+ "BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Button": ".whatsapp",
95
+ "BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Header": ".whatsapp",
96
+ "ConversationsGetRequestFormat": ".conversations",
97
+ "ConversationsListRequestExcludeStatusesItem": ".conversations",
98
+ "ConversationsListRequestSummaryMode": ".conversations",
99
+ "KnowledgeBaseGetOrCreateRagIndexesResponseValue": ".knowledge_base",
100
+ "KnowledgeBaseGetOrCreateRagIndexesResponseValue_Failure": ".knowledge_base",
101
+ "KnowledgeBaseGetOrCreateRagIndexesResponseValue_Success": ".knowledge_base",
102
+ "McpServerConfigUpdateRequestModelAuthConnection": ".mcp_servers",
103
+ "McpServerConfigUpdateRequestModelRequestHeadersValue": ".mcp_servers",
104
+ "McpServerConfigUpdateRequestModelRequestMetaValue": ".mcp_servers",
105
+ "PhoneNumbersCreateRequestBody": ".phone_numbers",
106
+ "PhoneNumbersCreateRequestBody_Exotel": ".phone_numbers",
107
+ "PhoneNumbersCreateRequestBody_SipTrunk": ".phone_numbers",
108
+ "PhoneNumbersCreateRequestBody_Twilio": ".phone_numbers",
109
+ "PhoneNumbersGetResponse": ".phone_numbers",
110
+ "PhoneNumbersGetResponse_Exotel": ".phone_numbers",
111
+ "PhoneNumbersGetResponse_SipTrunk": ".phone_numbers",
112
+ "PhoneNumbersGetResponse_Twilio": ".phone_numbers",
113
+ "PhoneNumbersListResponseItem": ".phone_numbers",
114
+ "PhoneNumbersListResponseItem_Exotel": ".phone_numbers",
115
+ "PhoneNumbersListResponseItem_SipTrunk": ".phone_numbers",
116
+ "PhoneNumbersListResponseItem_Twilio": ".phone_numbers",
117
+ "PhoneNumbersUpdateResponse": ".phone_numbers",
118
+ "PhoneNumbersUpdateResponse_Exotel": ".phone_numbers",
119
+ "PhoneNumbersUpdateResponse_SipTrunk": ".phone_numbers",
120
+ "PhoneNumbersUpdateResponse_Twilio": ".phone_numbers",
121
+ "TestsCreateRequestBody": ".tests",
122
+ "TestsCreateRequestBody_Llm": ".tests",
123
+ "TestsCreateRequestBody_Simulation": ".tests",
124
+ "TestsCreateRequestBody_Tool": ".tests",
125
+ "TestsGetResponse": ".tests",
126
+ "TestsGetResponse_Llm": ".tests",
127
+ "TestsGetResponse_Simulation": ".tests",
128
+ "TestsGetResponse_Tool": ".tests",
129
+ "TestsListRequestSortMode": ".tests",
130
+ "TestsUpdateRequestBody": ".tests",
131
+ "TestsUpdateRequestBody_Llm": ".tests",
132
+ "TestsUpdateRequestBody_Simulation": ".tests",
133
+ "TestsUpdateRequestBody_Tool": ".tests",
134
+ "TestsUpdateResponse": ".tests",
135
+ "TestsUpdateResponse_Llm": ".tests",
136
+ "TestsUpdateResponse_Simulation": ".tests",
137
+ "TestsUpdateResponse_Tool": ".tests",
138
+ "agents": ".agents",
139
+ "analytics": ".analytics",
140
+ "batch_calls": ".batch_calls",
141
+ "conversations": ".conversations",
142
+ "dashboard": ".dashboard",
143
+ "exotel": ".exotel",
144
+ "knowledge_base": ".knowledge_base",
145
+ "llm": ".llm",
146
+ "llm_usage": ".llm_usage",
147
+ "mcp_servers": ".mcp_servers",
148
+ "phone_numbers": ".phone_numbers",
149
+ "realtime": ".realtime",
150
+ "secrets": ".secrets",
151
+ "settings": ".settings",
152
+ "sip_trunk": ".sip_trunk",
153
+ "tests": ".tests",
154
+ "tools": ".tools",
155
+ "triage_tickets": ".triage_tickets",
156
+ "twilio": ".twilio",
157
+ "users": ".users",
158
+ "whatsapp": ".whatsapp",
159
+ "whatsapp_accounts": ".whatsapp_accounts",
160
+ }
161
+
162
+
163
+ def __getattr__(attr_name: str) -> typing.Any:
164
+ module_name = _dynamic_imports.get(attr_name)
165
+ if module_name is None:
166
+ raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
167
+ try:
168
+ module = import_module(module_name, __package__)
169
+ if module_name == f".{attr_name}":
170
+ return module
171
+ else:
172
+ return getattr(module, attr_name)
173
+ except ImportError as e:
174
+ raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
175
+ except AttributeError as e:
176
+ raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
177
+
178
+
179
+ def __dir__():
180
+ lazy_attrs = list(_dynamic_imports.keys())
181
+ return sorted(lazy_attrs)
182
+
183
+
184
+ __all__ = [
185
+ "BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem",
186
+ "BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Body",
187
+ "BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Button",
188
+ "BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem_Header",
189
+ "ConversationsGetRequestFormat",
190
+ "ConversationsListRequestExcludeStatusesItem",
191
+ "ConversationsListRequestSummaryMode",
192
+ "KnowledgeBaseGetOrCreateRagIndexesResponseValue",
193
+ "KnowledgeBaseGetOrCreateRagIndexesResponseValue_Failure",
194
+ "KnowledgeBaseGetOrCreateRagIndexesResponseValue_Success",
195
+ "McpServerConfigUpdateRequestModelAuthConnection",
196
+ "McpServerConfigUpdateRequestModelRequestHeadersValue",
197
+ "McpServerConfigUpdateRequestModelRequestMetaValue",
198
+ "PhoneNumbersCreateRequestBody",
199
+ "PhoneNumbersCreateRequestBody_Exotel",
200
+ "PhoneNumbersCreateRequestBody_SipTrunk",
201
+ "PhoneNumbersCreateRequestBody_Twilio",
202
+ "PhoneNumbersGetResponse",
203
+ "PhoneNumbersGetResponse_Exotel",
204
+ "PhoneNumbersGetResponse_SipTrunk",
205
+ "PhoneNumbersGetResponse_Twilio",
206
+ "PhoneNumbersListResponseItem",
207
+ "PhoneNumbersListResponseItem_Exotel",
208
+ "PhoneNumbersListResponseItem_SipTrunk",
209
+ "PhoneNumbersListResponseItem_Twilio",
210
+ "PhoneNumbersUpdateResponse",
211
+ "PhoneNumbersUpdateResponse_Exotel",
212
+ "PhoneNumbersUpdateResponse_SipTrunk",
213
+ "PhoneNumbersUpdateResponse_Twilio",
214
+ "TestsCreateRequestBody",
215
+ "TestsCreateRequestBody_Llm",
216
+ "TestsCreateRequestBody_Simulation",
217
+ "TestsCreateRequestBody_Tool",
218
+ "TestsGetResponse",
219
+ "TestsGetResponse_Llm",
220
+ "TestsGetResponse_Simulation",
221
+ "TestsGetResponse_Tool",
222
+ "TestsListRequestSortMode",
223
+ "TestsUpdateRequestBody",
224
+ "TestsUpdateRequestBody_Llm",
225
+ "TestsUpdateRequestBody_Simulation",
226
+ "TestsUpdateRequestBody_Tool",
227
+ "TestsUpdateResponse",
228
+ "TestsUpdateResponse_Llm",
229
+ "TestsUpdateResponse_Simulation",
230
+ "TestsUpdateResponse_Tool",
231
+ "agents",
232
+ "analytics",
233
+ "batch_calls",
234
+ "conversations",
235
+ "dashboard",
236
+ "exotel",
237
+ "knowledge_base",
238
+ "llm",
239
+ "llm_usage",
240
+ "mcp_servers",
241
+ "phone_numbers",
242
+ "realtime",
243
+ "secrets",
244
+ "settings",
245
+ "sip_trunk",
246
+ "tests",
247
+ "tools",
248
+ "triage_tickets",
249
+ "twilio",
250
+ "users",
251
+ "whatsapp",
252
+ "whatsapp_accounts",
253
+ ]
data/src/elevenlabs/conversational_ai/agents/__init__.py ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
5
+ import typing
6
+ from importlib import import_module
7
+
8
+ if typing.TYPE_CHECKING:
9
+ from . import (
10
+ branches,
11
+ deployments,
12
+ drafts,
13
+ hold_audio,
14
+ knowledge_base,
15
+ link,
16
+ llm_usage,
17
+ merge_proposals,
18
+ procedures,
19
+ summaries,
20
+ versions,
21
+ widget,
22
+ )
23
+ from .summaries import (
24
+ SummariesGetResponseValue,
25
+ SummariesGetResponseValue_Failure,
26
+ SummariesGetResponseValue_Success,
27
+ )
28
+ _dynamic_imports: typing.Dict[str, str] = {
29
+ "SummariesGetResponseValue": ".summaries",
30
+ "SummariesGetResponseValue_Failure": ".summaries",
31
+ "SummariesGetResponseValue_Success": ".summaries",
32
+ "branches": ".branches",
33
+ "deployments": ".deployments",
34
+ "drafts": ".drafts",
35
+ "hold_audio": ".hold_audio",
36
+ "knowledge_base": ".knowledge_base",
37
+ "link": ".link",
38
+ "llm_usage": ".llm_usage",
39
+ "merge_proposals": ".merge_proposals",
40
+ "procedures": ".procedures",
41
+ "summaries": ".summaries",
42
+ "versions": ".versions",
43
+ "widget": ".widget",
44
+ }
45
+
46
+
47
+ def __getattr__(attr_name: str) -> typing.Any:
48
+ module_name = _dynamic_imports.get(attr_name)
49
+ if module_name is None:
50
+ raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
51
+ try:
52
+ module = import_module(module_name, __package__)
53
+ if module_name == f".{attr_name}":
54
+ return module
55
+ else:
56
+ return getattr(module, attr_name)
57
+ except ImportError as e:
58
+ raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
59
+ except AttributeError as e:
60
+ raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
61
+
62
+
63
+ def __dir__():
64
+ lazy_attrs = list(_dynamic_imports.keys())
65
+ return sorted(lazy_attrs)
66
+
67
+
68
+ __all__ = [
69
+ "SummariesGetResponseValue",
70
+ "SummariesGetResponseValue_Failure",
71
+ "SummariesGetResponseValue_Success",
72
+ "branches",
73
+ "deployments",
74
+ "drafts",
75
+ "hold_audio",
76
+ "knowledge_base",
77
+ "link",
78
+ "llm_usage",
79
+ "merge_proposals",
80
+ "procedures",
81
+ "summaries",
82
+ "versions",
83
+ "widget",
84
+ ]
data/src/elevenlabs/conversational_ai/agents/branches/__init__.py ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
data/src/elevenlabs/conversational_ai/agents/branches/client.py ADDED
@@ -0,0 +1,1052 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
6
+ from ....core.request_options import RequestOptions
7
+ from ....types.agent_branch_response import AgentBranchResponse
8
+ from ....types.agent_workflow_request_model import AgentWorkflowRequestModel
9
+ from ....types.branch_protection_status import BranchProtectionStatus
10
+ from ....types.create_agent_branch_response_model import CreateAgentBranchResponseModel
11
+ from ....types.list_response_agent_branch_summary import ListResponseAgentBranchSummary
12
+ from ....types.merge_preview_response_model import MergePreviewResponseModel
13
+ from .raw_client import AsyncRawBranchesClient, RawBranchesClient
14
+
15
+ # this is used as the default value for optional parameters
16
+ OMIT = typing.cast(typing.Any, ...)
17
+
18
+
19
+ class BranchesClient:
20
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
21
+ self._raw_client = RawBranchesClient(client_wrapper=client_wrapper)
22
+
23
+ @property
24
+ def with_raw_response(self) -> RawBranchesClient:
25
+ """
26
+ Retrieves a raw implementation of this client that returns raw responses.
27
+
28
+ Returns
29
+ -------
30
+ RawBranchesClient
31
+ """
32
+ return self._raw_client
33
+
34
+ def list(
35
+ self,
36
+ agent_id: str,
37
+ *,
38
+ include_archived: typing.Optional[bool] = None,
39
+ limit: typing.Optional[int] = None,
40
+ include_commit_status: typing.Optional[bool] = None,
41
+ request_options: typing.Optional[RequestOptions] = None,
42
+ ) -> ListResponseAgentBranchSummary:
43
+ """
44
+ Returns a list of branches an agent has
45
+
46
+ Parameters
47
+ ----------
48
+ agent_id : str
49
+ The id of an agent. This is returned on agent creation.
50
+
51
+ include_archived : typing.Optional[bool]
52
+ Whether archived branches should be included
53
+
54
+ limit : typing.Optional[int]
55
+ How many results at most should be returned
56
+
57
+ include_commit_status : typing.Optional[bool]
58
+ Whether to compute how far each branch has diverged from main (commits_ahead/commits_behind). This walks the version DAG of every branch, so it is slow on agents with long histories and is off by default, leaving those fields null.
59
+
60
+ request_options : typing.Optional[RequestOptions]
61
+ Request-specific configuration.
62
+
63
+ Returns
64
+ -------
65
+ ListResponseAgentBranchSummary
66
+ Successful Response
67
+
68
+ Examples
69
+ --------
70
+ from elevenlabs import ElevenLabs
71
+
72
+ client = ElevenLabs(
73
+ api_key="YOUR_API_KEY",
74
+ )
75
+ client.conversational_ai.agents.branches.list(
76
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
77
+ include_archived=True,
78
+ limit=1,
79
+ include_commit_status=True,
80
+ )
81
+ """
82
+ _response = self._raw_client.list(
83
+ agent_id,
84
+ include_archived=include_archived,
85
+ limit=limit,
86
+ include_commit_status=include_commit_status,
87
+ request_options=request_options,
88
+ )
89
+ return _response.data
90
+
91
+ def create(
92
+ self,
93
+ agent_id: str,
94
+ *,
95
+ parent_version_id: str,
96
+ name: str,
97
+ description: str,
98
+ conversation_config: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
99
+ platform_settings: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
100
+ workflow: typing.Optional[AgentWorkflowRequestModel] = OMIT,
101
+ include_draft: typing.Optional[bool] = OMIT,
102
+ request_options: typing.Optional[RequestOptions] = None,
103
+ ) -> CreateAgentBranchResponseModel:
104
+ """
105
+ Create a new branch from a given version of any branch
106
+
107
+ Parameters
108
+ ----------
109
+ agent_id : str
110
+ The id of an agent. This is returned on agent creation.
111
+
112
+ parent_version_id : str
113
+ ID of the version to branch from
114
+
115
+ name : str
116
+ Name of the branch. It is unique within the agent.
117
+
118
+ description : str
119
+ Description for the branch
120
+
121
+ conversation_config : typing.Optional[typing.Dict[str, typing.Any]]
122
+ Changes to apply to conversation config
123
+
124
+ platform_settings : typing.Optional[typing.Dict[str, typing.Any]]
125
+ Changes to apply to platform settings
126
+
127
+ workflow : typing.Optional[AgentWorkflowRequestModel]
128
+ Updated workflow definition
129
+
130
+ include_draft : typing.Optional[bool]
131
+ When true, the new branch uses the caller's draft procedure set instead of the branch tip. Requires parent_version_id to be the branch tip.
132
+
133
+ request_options : typing.Optional[RequestOptions]
134
+ Request-specific configuration.
135
+
136
+ Returns
137
+ -------
138
+ CreateAgentBranchResponseModel
139
+ Successful Response
140
+
141
+ Examples
142
+ --------
143
+ from elevenlabs import ElevenLabs
144
+
145
+ client = ElevenLabs(
146
+ api_key="YOUR_API_KEY",
147
+ )
148
+ client.conversational_ai.agents.branches.create(
149
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
150
+ parent_version_id="parent_version_id",
151
+ name="name",
152
+ description="description",
153
+ )
154
+ """
155
+ _response = self._raw_client.create(
156
+ agent_id,
157
+ parent_version_id=parent_version_id,
158
+ name=name,
159
+ description=description,
160
+ conversation_config=conversation_config,
161
+ platform_settings=platform_settings,
162
+ workflow=workflow,
163
+ include_draft=include_draft,
164
+ request_options=request_options,
165
+ )
166
+ return _response.data
167
+
168
+ def get(
169
+ self, agent_id: str, branch_id: str, *, request_options: typing.Optional[RequestOptions] = None
170
+ ) -> AgentBranchResponse:
171
+ """
172
+ Get information about a single agent branch
173
+
174
+ Parameters
175
+ ----------
176
+ agent_id : str
177
+ The id of an agent. This is returned on agent creation.
178
+
179
+ branch_id : str
180
+ Unique identifier for the branch.
181
+
182
+ request_options : typing.Optional[RequestOptions]
183
+ Request-specific configuration.
184
+
185
+ Returns
186
+ -------
187
+ AgentBranchResponse
188
+ Successful Response
189
+
190
+ Examples
191
+ --------
192
+ from elevenlabs import ElevenLabs
193
+
194
+ client = ElevenLabs(
195
+ api_key="YOUR_API_KEY",
196
+ )
197
+ client.conversational_ai.agents.branches.get(
198
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
199
+ branch_id="agtbranch_0901k4aafjxxfxt93gd841r7tv5t",
200
+ )
201
+ """
202
+ _response = self._raw_client.get(agent_id, branch_id, request_options=request_options)
203
+ return _response.data
204
+
205
+ def update(
206
+ self,
207
+ agent_id: str,
208
+ branch_id: str,
209
+ *,
210
+ name: typing.Optional[str] = OMIT,
211
+ description: typing.Optional[str] = OMIT,
212
+ is_archived: typing.Optional[bool] = OMIT,
213
+ protection_status: typing.Optional[BranchProtectionStatus] = OMIT,
214
+ auto_rebase: typing.Optional[bool] = OMIT,
215
+ request_options: typing.Optional[RequestOptions] = None,
216
+ ) -> AgentBranchResponse:
217
+ """
218
+ Update agent branch properties such as name, description, archiving status, protection level, and auto-rebase onto main
219
+
220
+ Parameters
221
+ ----------
222
+ agent_id : str
223
+ The id of an agent. This is returned on agent creation.
224
+
225
+ branch_id : str
226
+ Unique identifier for the branch.
227
+
228
+ name : typing.Optional[str]
229
+ New name for the branch. Must be unique within the agent.
230
+
231
+ description : typing.Optional[str]
232
+ New description for the branch. Pass an empty string to clear it.
233
+
234
+ is_archived : typing.Optional[bool]
235
+ Whether the branch should be archived
236
+
237
+ protection_status : typing.Optional[BranchProtectionStatus]
238
+ The protection level for the branch
239
+
240
+ auto_rebase : typing.Optional[bool]
241
+ When true, rebase this branch onto main automatically after each new main version. Cannot be enabled on the main branch.
242
+
243
+ request_options : typing.Optional[RequestOptions]
244
+ Request-specific configuration.
245
+
246
+ Returns
247
+ -------
248
+ AgentBranchResponse
249
+ Successful Response
250
+
251
+ Examples
252
+ --------
253
+ from elevenlabs import ElevenLabs
254
+
255
+ client = ElevenLabs(
256
+ api_key="YOUR_API_KEY",
257
+ )
258
+ client.conversational_ai.agents.branches.update(
259
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
260
+ branch_id="agtbranch_0901k4aafjxxfxt93gd841r7tv5t",
261
+ )
262
+ """
263
+ _response = self._raw_client.update(
264
+ agent_id,
265
+ branch_id,
266
+ name=name,
267
+ description=description,
268
+ is_archived=is_archived,
269
+ protection_status=protection_status,
270
+ auto_rebase=auto_rebase,
271
+ request_options=request_options,
272
+ )
273
+ return _response.data
274
+
275
+ def preview_merge(
276
+ self,
277
+ agent_id: str,
278
+ source_branch_id: str,
279
+ *,
280
+ target_branch_id: str,
281
+ force: typing.Optional[bool] = None,
282
+ include_procedure_generated_workflow_elements: typing.Optional[bool] = None,
283
+ request_options: typing.Optional[RequestOptions] = None,
284
+ ) -> MergePreviewResponseModel:
285
+ """
286
+ Returns the result of merging the source branch into the target branch without performing the merge. Useful for showing an accurate diff before confirming.
287
+
288
+ Parameters
289
+ ----------
290
+ agent_id : str
291
+ The id of an agent. This is returned on agent creation.
292
+
293
+ source_branch_id : str
294
+ Unique identifier for the source branch to merge from.
295
+
296
+ target_branch_id : str
297
+ The ID of the target branch to merge into.
298
+
299
+ force : typing.Optional[bool]
300
+ When true, source branch changes always win conflicts regardless of timestamps
301
+
302
+ include_procedure_generated_workflow_elements : typing.Optional[bool]
303
+ Whether to include the workflow nodes and edges generated from structured procedures. When false, the workflow contains only authored elements.
304
+
305
+ request_options : typing.Optional[RequestOptions]
306
+ Request-specific configuration.
307
+
308
+ Returns
309
+ -------
310
+ MergePreviewResponseModel
311
+ Successful Response
312
+
313
+ Examples
314
+ --------
315
+ from elevenlabs import ElevenLabs
316
+
317
+ client = ElevenLabs(
318
+ api_key="YOUR_API_KEY",
319
+ )
320
+ client.conversational_ai.agents.branches.preview_merge(
321
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
322
+ source_branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj",
323
+ target_branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj",
324
+ force=True,
325
+ include_procedure_generated_workflow_elements=True,
326
+ )
327
+ """
328
+ _response = self._raw_client.preview_merge(
329
+ agent_id,
330
+ source_branch_id,
331
+ target_branch_id=target_branch_id,
332
+ force=force,
333
+ include_procedure_generated_workflow_elements=include_procedure_generated_workflow_elements,
334
+ request_options=request_options,
335
+ )
336
+ return _response.data
337
+
338
+ def merge(
339
+ self,
340
+ agent_id: str,
341
+ source_branch_id: str,
342
+ *,
343
+ target_branch_id: str,
344
+ archive_source_branch: typing.Optional[bool] = OMIT,
345
+ force: typing.Optional[bool] = OMIT,
346
+ request_options: typing.Optional[RequestOptions] = None,
347
+ ) -> typing.Any:
348
+ """
349
+ Merge a branch into a target branch
350
+
351
+ Parameters
352
+ ----------
353
+ agent_id : str
354
+ The id of an agent. This is returned on agent creation.
355
+
356
+ source_branch_id : str
357
+ Unique identifier for the source branch to merge from.
358
+
359
+ target_branch_id : str
360
+ The ID of the target branch to merge into.
361
+
362
+ archive_source_branch : typing.Optional[bool]
363
+ Whether to archive the source branch after merging
364
+
365
+ force : typing.Optional[bool]
366
+ Force source branch changes onto the target, overriding timestamp-based conflict resolution
367
+
368
+ request_options : typing.Optional[RequestOptions]
369
+ Request-specific configuration.
370
+
371
+ Returns
372
+ -------
373
+ typing.Any
374
+ Successful Response
375
+
376
+ Examples
377
+ --------
378
+ from elevenlabs import ElevenLabs
379
+
380
+ client = ElevenLabs(
381
+ api_key="YOUR_API_KEY",
382
+ )
383
+ client.conversational_ai.agents.branches.merge(
384
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
385
+ source_branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj",
386
+ target_branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj",
387
+ )
388
+ """
389
+ _response = self._raw_client.merge(
390
+ agent_id,
391
+ source_branch_id,
392
+ target_branch_id=target_branch_id,
393
+ archive_source_branch=archive_source_branch,
394
+ force=force,
395
+ request_options=request_options,
396
+ )
397
+ return _response.data
398
+
399
+ def preview_rebase(
400
+ self,
401
+ agent_id: str,
402
+ branch_id: str,
403
+ *,
404
+ source_branch_id: typing.Optional[str] = None,
405
+ include_procedure_generated_workflow_elements: typing.Optional[bool] = None,
406
+ request_options: typing.Optional[RequestOptions] = None,
407
+ ) -> MergePreviewResponseModel:
408
+ """
409
+ Returns the result of pulling changes from a source branch (defaults to main) into the given branch without performing it, preserving the given branch's own changes. Useful for showing an accurate diff before confirming.
410
+
411
+ Parameters
412
+ ----------
413
+ agent_id : str
414
+ The id of an agent. This is returned on agent creation.
415
+
416
+ branch_id : str
417
+ Unique identifier for the source branch to merge from.
418
+
419
+ source_branch_id : typing.Optional[str]
420
+ The ID of the branch to pull changes from. Defaults to the agent's main branch.
421
+
422
+ include_procedure_generated_workflow_elements : typing.Optional[bool]
423
+ Whether to include the workflow nodes and edges generated from structured procedures. When false, the workflow contains only authored elements.
424
+
425
+ request_options : typing.Optional[RequestOptions]
426
+ Request-specific configuration.
427
+
428
+ Returns
429
+ -------
430
+ MergePreviewResponseModel
431
+ Successful Response
432
+
433
+ Examples
434
+ --------
435
+ from elevenlabs import ElevenLabs
436
+
437
+ client = ElevenLabs(
438
+ api_key="YOUR_API_KEY",
439
+ )
440
+ client.conversational_ai.agents.branches.preview_rebase(
441
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
442
+ branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj",
443
+ source_branch_id="source_branch_id",
444
+ include_procedure_generated_workflow_elements=True,
445
+ )
446
+ """
447
+ _response = self._raw_client.preview_rebase(
448
+ agent_id,
449
+ branch_id,
450
+ source_branch_id=source_branch_id,
451
+ include_procedure_generated_workflow_elements=include_procedure_generated_workflow_elements,
452
+ request_options=request_options,
453
+ )
454
+ return _response.data
455
+
456
+ def rebase(
457
+ self,
458
+ agent_id: str,
459
+ branch_id: str,
460
+ *,
461
+ source_branch_id: typing.Optional[str] = None,
462
+ request_options: typing.Optional[RequestOptions] = None,
463
+ ) -> typing.Any:
464
+ """
465
+ Pull changes from a source branch (defaults to main) into this branch as a new version, preserving this branch's own changes on conflicts.
466
+
467
+ Parameters
468
+ ----------
469
+ agent_id : str
470
+ The id of an agent. This is returned on agent creation.
471
+
472
+ branch_id : str
473
+ Unique identifier for the source branch to merge from.
474
+
475
+ source_branch_id : typing.Optional[str]
476
+ The ID of the branch to pull changes from. Defaults to the agent's main branch.
477
+
478
+ request_options : typing.Optional[RequestOptions]
479
+ Request-specific configuration.
480
+
481
+ Returns
482
+ -------
483
+ typing.Any
484
+ Successful Response
485
+
486
+ Examples
487
+ --------
488
+ from elevenlabs import ElevenLabs
489
+
490
+ client = ElevenLabs(
491
+ api_key="YOUR_API_KEY",
492
+ )
493
+ client.conversational_ai.agents.branches.rebase(
494
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
495
+ branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj",
496
+ source_branch_id="source_branch_id",
497
+ )
498
+ """
499
+ _response = self._raw_client.rebase(
500
+ agent_id, branch_id, source_branch_id=source_branch_id, request_options=request_options
501
+ )
502
+ return _response.data
503
+
504
+
505
+ class AsyncBranchesClient:
506
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
507
+ self._raw_client = AsyncRawBranchesClient(client_wrapper=client_wrapper)
508
+
509
+ @property
510
+ def with_raw_response(self) -> AsyncRawBranchesClient:
511
+ """
512
+ Retrieves a raw implementation of this client that returns raw responses.
513
+
514
+ Returns
515
+ -------
516
+ AsyncRawBranchesClient
517
+ """
518
+ return self._raw_client
519
+
520
+ async def list(
521
+ self,
522
+ agent_id: str,
523
+ *,
524
+ include_archived: typing.Optional[bool] = None,
525
+ limit: typing.Optional[int] = None,
526
+ include_commit_status: typing.Optional[bool] = None,
527
+ request_options: typing.Optional[RequestOptions] = None,
528
+ ) -> ListResponseAgentBranchSummary:
529
+ """
530
+ Returns a list of branches an agent has
531
+
532
+ Parameters
533
+ ----------
534
+ agent_id : str
535
+ The id of an agent. This is returned on agent creation.
536
+
537
+ include_archived : typing.Optional[bool]
538
+ Whether archived branches should be included
539
+
540
+ limit : typing.Optional[int]
541
+ How many results at most should be returned
542
+
543
+ include_commit_status : typing.Optional[bool]
544
+ Whether to compute how far each branch has diverged from main (commits_ahead/commits_behind). This walks the version DAG of every branch, so it is slow on agents with long histories and is off by default, leaving those fields null.
545
+
546
+ request_options : typing.Optional[RequestOptions]
547
+ Request-specific configuration.
548
+
549
+ Returns
550
+ -------
551
+ ListResponseAgentBranchSummary
552
+ Successful Response
553
+
554
+ Examples
555
+ --------
556
+ import asyncio
557
+
558
+ from elevenlabs import AsyncElevenLabs
559
+
560
+ client = AsyncElevenLabs(
561
+ api_key="YOUR_API_KEY",
562
+ )
563
+
564
+
565
+ async def main() -> None:
566
+ await client.conversational_ai.agents.branches.list(
567
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
568
+ include_archived=True,
569
+ limit=1,
570
+ include_commit_status=True,
571
+ )
572
+
573
+
574
+ asyncio.run(main())
575
+ """
576
+ _response = await self._raw_client.list(
577
+ agent_id,
578
+ include_archived=include_archived,
579
+ limit=limit,
580
+ include_commit_status=include_commit_status,
581
+ request_options=request_options,
582
+ )
583
+ return _response.data
584
+
585
+ async def create(
586
+ self,
587
+ agent_id: str,
588
+ *,
589
+ parent_version_id: str,
590
+ name: str,
591
+ description: str,
592
+ conversation_config: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
593
+ platform_settings: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
594
+ workflow: typing.Optional[AgentWorkflowRequestModel] = OMIT,
595
+ include_draft: typing.Optional[bool] = OMIT,
596
+ request_options: typing.Optional[RequestOptions] = None,
597
+ ) -> CreateAgentBranchResponseModel:
598
+ """
599
+ Create a new branch from a given version of any branch
600
+
601
+ Parameters
602
+ ----------
603
+ agent_id : str
604
+ The id of an agent. This is returned on agent creation.
605
+
606
+ parent_version_id : str
607
+ ID of the version to branch from
608
+
609
+ name : str
610
+ Name of the branch. It is unique within the agent.
611
+
612
+ description : str
613
+ Description for the branch
614
+
615
+ conversation_config : typing.Optional[typing.Dict[str, typing.Any]]
616
+ Changes to apply to conversation config
617
+
618
+ platform_settings : typing.Optional[typing.Dict[str, typing.Any]]
619
+ Changes to apply to platform settings
620
+
621
+ workflow : typing.Optional[AgentWorkflowRequestModel]
622
+ Updated workflow definition
623
+
624
+ include_draft : typing.Optional[bool]
625
+ When true, the new branch uses the caller's draft procedure set instead of the branch tip. Requires parent_version_id to be the branch tip.
626
+
627
+ request_options : typing.Optional[RequestOptions]
628
+ Request-specific configuration.
629
+
630
+ Returns
631
+ -------
632
+ CreateAgentBranchResponseModel
633
+ Successful Response
634
+
635
+ Examples
636
+ --------
637
+ import asyncio
638
+
639
+ from elevenlabs import AsyncElevenLabs
640
+
641
+ client = AsyncElevenLabs(
642
+ api_key="YOUR_API_KEY",
643
+ )
644
+
645
+
646
+ async def main() -> None:
647
+ await client.conversational_ai.agents.branches.create(
648
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
649
+ parent_version_id="parent_version_id",
650
+ name="name",
651
+ description="description",
652
+ )
653
+
654
+
655
+ asyncio.run(main())
656
+ """
657
+ _response = await self._raw_client.create(
658
+ agent_id,
659
+ parent_version_id=parent_version_id,
660
+ name=name,
661
+ description=description,
662
+ conversation_config=conversation_config,
663
+ platform_settings=platform_settings,
664
+ workflow=workflow,
665
+ include_draft=include_draft,
666
+ request_options=request_options,
667
+ )
668
+ return _response.data
669
+
670
+ async def get(
671
+ self, agent_id: str, branch_id: str, *, request_options: typing.Optional[RequestOptions] = None
672
+ ) -> AgentBranchResponse:
673
+ """
674
+ Get information about a single agent branch
675
+
676
+ Parameters
677
+ ----------
678
+ agent_id : str
679
+ The id of an agent. This is returned on agent creation.
680
+
681
+ branch_id : str
682
+ Unique identifier for the branch.
683
+
684
+ request_options : typing.Optional[RequestOptions]
685
+ Request-specific configuration.
686
+
687
+ Returns
688
+ -------
689
+ AgentBranchResponse
690
+ Successful Response
691
+
692
+ Examples
693
+ --------
694
+ import asyncio
695
+
696
+ from elevenlabs import AsyncElevenLabs
697
+
698
+ client = AsyncElevenLabs(
699
+ api_key="YOUR_API_KEY",
700
+ )
701
+
702
+
703
+ async def main() -> None:
704
+ await client.conversational_ai.agents.branches.get(
705
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
706
+ branch_id="agtbranch_0901k4aafjxxfxt93gd841r7tv5t",
707
+ )
708
+
709
+
710
+ asyncio.run(main())
711
+ """
712
+ _response = await self._raw_client.get(agent_id, branch_id, request_options=request_options)
713
+ return _response.data
714
+
715
+ async def update(
716
+ self,
717
+ agent_id: str,
718
+ branch_id: str,
719
+ *,
720
+ name: typing.Optional[str] = OMIT,
721
+ description: typing.Optional[str] = OMIT,
722
+ is_archived: typing.Optional[bool] = OMIT,
723
+ protection_status: typing.Optional[BranchProtectionStatus] = OMIT,
724
+ auto_rebase: typing.Optional[bool] = OMIT,
725
+ request_options: typing.Optional[RequestOptions] = None,
726
+ ) -> AgentBranchResponse:
727
+ """
728
+ Update agent branch properties such as name, description, archiving status, protection level, and auto-rebase onto main
729
+
730
+ Parameters
731
+ ----------
732
+ agent_id : str
733
+ The id of an agent. This is returned on agent creation.
734
+
735
+ branch_id : str
736
+ Unique identifier for the branch.
737
+
738
+ name : typing.Optional[str]
739
+ New name for the branch. Must be unique within the agent.
740
+
741
+ description : typing.Optional[str]
742
+ New description for the branch. Pass an empty string to clear it.
743
+
744
+ is_archived : typing.Optional[bool]
745
+ Whether the branch should be archived
746
+
747
+ protection_status : typing.Optional[BranchProtectionStatus]
748
+ The protection level for the branch
749
+
750
+ auto_rebase : typing.Optional[bool]
751
+ When true, rebase this branch onto main automatically after each new main version. Cannot be enabled on the main branch.
752
+
753
+ request_options : typing.Optional[RequestOptions]
754
+ Request-specific configuration.
755
+
756
+ Returns
757
+ -------
758
+ AgentBranchResponse
759
+ Successful Response
760
+
761
+ Examples
762
+ --------
763
+ import asyncio
764
+
765
+ from elevenlabs import AsyncElevenLabs
766
+
767
+ client = AsyncElevenLabs(
768
+ api_key="YOUR_API_KEY",
769
+ )
770
+
771
+
772
+ async def main() -> None:
773
+ await client.conversational_ai.agents.branches.update(
774
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
775
+ branch_id="agtbranch_0901k4aafjxxfxt93gd841r7tv5t",
776
+ )
777
+
778
+
779
+ asyncio.run(main())
780
+ """
781
+ _response = await self._raw_client.update(
782
+ agent_id,
783
+ branch_id,
784
+ name=name,
785
+ description=description,
786
+ is_archived=is_archived,
787
+ protection_status=protection_status,
788
+ auto_rebase=auto_rebase,
789
+ request_options=request_options,
790
+ )
791
+ return _response.data
792
+
793
+ async def preview_merge(
794
+ self,
795
+ agent_id: str,
796
+ source_branch_id: str,
797
+ *,
798
+ target_branch_id: str,
799
+ force: typing.Optional[bool] = None,
800
+ include_procedure_generated_workflow_elements: typing.Optional[bool] = None,
801
+ request_options: typing.Optional[RequestOptions] = None,
802
+ ) -> MergePreviewResponseModel:
803
+ """
804
+ Returns the result of merging the source branch into the target branch without performing the merge. Useful for showing an accurate diff before confirming.
805
+
806
+ Parameters
807
+ ----------
808
+ agent_id : str
809
+ The id of an agent. This is returned on agent creation.
810
+
811
+ source_branch_id : str
812
+ Unique identifier for the source branch to merge from.
813
+
814
+ target_branch_id : str
815
+ The ID of the target branch to merge into.
816
+
817
+ force : typing.Optional[bool]
818
+ When true, source branch changes always win conflicts regardless of timestamps
819
+
820
+ include_procedure_generated_workflow_elements : typing.Optional[bool]
821
+ Whether to include the workflow nodes and edges generated from structured procedures. When false, the workflow contains only authored elements.
822
+
823
+ request_options : typing.Optional[RequestOptions]
824
+ Request-specific configuration.
825
+
826
+ Returns
827
+ -------
828
+ MergePreviewResponseModel
829
+ Successful Response
830
+
831
+ Examples
832
+ --------
833
+ import asyncio
834
+
835
+ from elevenlabs import AsyncElevenLabs
836
+
837
+ client = AsyncElevenLabs(
838
+ api_key="YOUR_API_KEY",
839
+ )
840
+
841
+
842
+ async def main() -> None:
843
+ await client.conversational_ai.agents.branches.preview_merge(
844
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
845
+ source_branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj",
846
+ target_branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj",
847
+ force=True,
848
+ include_procedure_generated_workflow_elements=True,
849
+ )
850
+
851
+
852
+ asyncio.run(main())
853
+ """
854
+ _response = await self._raw_client.preview_merge(
855
+ agent_id,
856
+ source_branch_id,
857
+ target_branch_id=target_branch_id,
858
+ force=force,
859
+ include_procedure_generated_workflow_elements=include_procedure_generated_workflow_elements,
860
+ request_options=request_options,
861
+ )
862
+ return _response.data
863
+
864
+ async def merge(
865
+ self,
866
+ agent_id: str,
867
+ source_branch_id: str,
868
+ *,
869
+ target_branch_id: str,
870
+ archive_source_branch: typing.Optional[bool] = OMIT,
871
+ force: typing.Optional[bool] = OMIT,
872
+ request_options: typing.Optional[RequestOptions] = None,
873
+ ) -> typing.Any:
874
+ """
875
+ Merge a branch into a target branch
876
+
877
+ Parameters
878
+ ----------
879
+ agent_id : str
880
+ The id of an agent. This is returned on agent creation.
881
+
882
+ source_branch_id : str
883
+ Unique identifier for the source branch to merge from.
884
+
885
+ target_branch_id : str
886
+ The ID of the target branch to merge into.
887
+
888
+ archive_source_branch : typing.Optional[bool]
889
+ Whether to archive the source branch after merging
890
+
891
+ force : typing.Optional[bool]
892
+ Force source branch changes onto the target, overriding timestamp-based conflict resolution
893
+
894
+ request_options : typing.Optional[RequestOptions]
895
+ Request-specific configuration.
896
+
897
+ Returns
898
+ -------
899
+ typing.Any
900
+ Successful Response
901
+
902
+ Examples
903
+ --------
904
+ import asyncio
905
+
906
+ from elevenlabs import AsyncElevenLabs
907
+
908
+ client = AsyncElevenLabs(
909
+ api_key="YOUR_API_KEY",
910
+ )
911
+
912
+
913
+ async def main() -> None:
914
+ await client.conversational_ai.agents.branches.merge(
915
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
916
+ source_branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj",
917
+ target_branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj",
918
+ )
919
+
920
+
921
+ asyncio.run(main())
922
+ """
923
+ _response = await self._raw_client.merge(
924
+ agent_id,
925
+ source_branch_id,
926
+ target_branch_id=target_branch_id,
927
+ archive_source_branch=archive_source_branch,
928
+ force=force,
929
+ request_options=request_options,
930
+ )
931
+ return _response.data
932
+
933
+ async def preview_rebase(
934
+ self,
935
+ agent_id: str,
936
+ branch_id: str,
937
+ *,
938
+ source_branch_id: typing.Optional[str] = None,
939
+ include_procedure_generated_workflow_elements: typing.Optional[bool] = None,
940
+ request_options: typing.Optional[RequestOptions] = None,
941
+ ) -> MergePreviewResponseModel:
942
+ """
943
+ Returns the result of pulling changes from a source branch (defaults to main) into the given branch without performing it, preserving the given branch's own changes. Useful for showing an accurate diff before confirming.
944
+
945
+ Parameters
946
+ ----------
947
+ agent_id : str
948
+ The id of an agent. This is returned on agent creation.
949
+
950
+ branch_id : str
951
+ Unique identifier for the source branch to merge from.
952
+
953
+ source_branch_id : typing.Optional[str]
954
+ The ID of the branch to pull changes from. Defaults to the agent's main branch.
955
+
956
+ include_procedure_generated_workflow_elements : typing.Optional[bool]
957
+ Whether to include the workflow nodes and edges generated from structured procedures. When false, the workflow contains only authored elements.
958
+
959
+ request_options : typing.Optional[RequestOptions]
960
+ Request-specific configuration.
961
+
962
+ Returns
963
+ -------
964
+ MergePreviewResponseModel
965
+ Successful Response
966
+
967
+ Examples
968
+ --------
969
+ import asyncio
970
+
971
+ from elevenlabs import AsyncElevenLabs
972
+
973
+ client = AsyncElevenLabs(
974
+ api_key="YOUR_API_KEY",
975
+ )
976
+
977
+
978
+ async def main() -> None:
979
+ await client.conversational_ai.agents.branches.preview_rebase(
980
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
981
+ branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj",
982
+ source_branch_id="source_branch_id",
983
+ include_procedure_generated_workflow_elements=True,
984
+ )
985
+
986
+
987
+ asyncio.run(main())
988
+ """
989
+ _response = await self._raw_client.preview_rebase(
990
+ agent_id,
991
+ branch_id,
992
+ source_branch_id=source_branch_id,
993
+ include_procedure_generated_workflow_elements=include_procedure_generated_workflow_elements,
994
+ request_options=request_options,
995
+ )
996
+ return _response.data
997
+
998
+ async def rebase(
999
+ self,
1000
+ agent_id: str,
1001
+ branch_id: str,
1002
+ *,
1003
+ source_branch_id: typing.Optional[str] = None,
1004
+ request_options: typing.Optional[RequestOptions] = None,
1005
+ ) -> typing.Any:
1006
+ """
1007
+ Pull changes from a source branch (defaults to main) into this branch as a new version, preserving this branch's own changes on conflicts.
1008
+
1009
+ Parameters
1010
+ ----------
1011
+ agent_id : str
1012
+ The id of an agent. This is returned on agent creation.
1013
+
1014
+ branch_id : str
1015
+ Unique identifier for the source branch to merge from.
1016
+
1017
+ source_branch_id : typing.Optional[str]
1018
+ The ID of the branch to pull changes from. Defaults to the agent's main branch.
1019
+
1020
+ request_options : typing.Optional[RequestOptions]
1021
+ Request-specific configuration.
1022
+
1023
+ Returns
1024
+ -------
1025
+ typing.Any
1026
+ Successful Response
1027
+
1028
+ Examples
1029
+ --------
1030
+ import asyncio
1031
+
1032
+ from elevenlabs import AsyncElevenLabs
1033
+
1034
+ client = AsyncElevenLabs(
1035
+ api_key="YOUR_API_KEY",
1036
+ )
1037
+
1038
+
1039
+ async def main() -> None:
1040
+ await client.conversational_ai.agents.branches.rebase(
1041
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
1042
+ branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj",
1043
+ source_branch_id="source_branch_id",
1044
+ )
1045
+
1046
+
1047
+ asyncio.run(main())
1048
+ """
1049
+ _response = await self._raw_client.rebase(
1050
+ agent_id, branch_id, source_branch_id=source_branch_id, request_options=request_options
1051
+ )
1052
+ return _response.data
data/src/elevenlabs/conversational_ai/agents/branches/raw_client.py ADDED
@@ -0,0 +1,1294 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ from json.decoder import JSONDecodeError
5
+
6
+ from ....core.api_error import ApiError
7
+ from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
8
+ from ....core.http_response import AsyncHttpResponse, HttpResponse
9
+ from ....core.jsonable_encoder import jsonable_encoder
10
+ from ....core.parse_error import ParsingError
11
+ from ....core.request_options import RequestOptions
12
+ from ....core.serialization import convert_and_respect_annotation_metadata
13
+ from ....core.unchecked_base_model import construct_type
14
+ from ....errors.unprocessable_entity_error import UnprocessableEntityError
15
+ from ....types.agent_branch_response import AgentBranchResponse
16
+ from ....types.agent_workflow_request_model import AgentWorkflowRequestModel
17
+ from ....types.branch_protection_status import BranchProtectionStatus
18
+ from ....types.create_agent_branch_response_model import CreateAgentBranchResponseModel
19
+ from ....types.list_response_agent_branch_summary import ListResponseAgentBranchSummary
20
+ from ....types.merge_preview_response_model import MergePreviewResponseModel
21
+ from pydantic import ValidationError
22
+
23
+ # this is used as the default value for optional parameters
24
+ OMIT = typing.cast(typing.Any, ...)
25
+
26
+
27
+ class RawBranchesClient:
28
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
29
+ self._client_wrapper = client_wrapper
30
+
31
+ def list(
32
+ self,
33
+ agent_id: str,
34
+ *,
35
+ include_archived: typing.Optional[bool] = None,
36
+ limit: typing.Optional[int] = None,
37
+ include_commit_status: typing.Optional[bool] = None,
38
+ request_options: typing.Optional[RequestOptions] = None,
39
+ ) -> HttpResponse[ListResponseAgentBranchSummary]:
40
+ """
41
+ Returns a list of branches an agent has
42
+
43
+ Parameters
44
+ ----------
45
+ agent_id : str
46
+ The id of an agent. This is returned on agent creation.
47
+
48
+ include_archived : typing.Optional[bool]
49
+ Whether archived branches should be included
50
+
51
+ limit : typing.Optional[int]
52
+ How many results at most should be returned
53
+
54
+ include_commit_status : typing.Optional[bool]
55
+ Whether to compute how far each branch has diverged from main (commits_ahead/commits_behind). This walks the version DAG of every branch, so it is slow on agents with long histories and is off by default, leaving those fields null.
56
+
57
+ request_options : typing.Optional[RequestOptions]
58
+ Request-specific configuration.
59
+
60
+ Returns
61
+ -------
62
+ HttpResponse[ListResponseAgentBranchSummary]
63
+ Successful Response
64
+ """
65
+ _response = self._client_wrapper.httpx_client.request(
66
+ f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches",
67
+ method="GET",
68
+ params={
69
+ "include_archived": include_archived,
70
+ "limit": limit,
71
+ "include_commit_status": include_commit_status,
72
+ },
73
+ request_options=request_options,
74
+ )
75
+ try:
76
+ if 200 <= _response.status_code < 300:
77
+ _data = typing.cast(
78
+ ListResponseAgentBranchSummary,
79
+ construct_type(
80
+ type_=ListResponseAgentBranchSummary, # type: ignore
81
+ object_=_response.json(),
82
+ ),
83
+ )
84
+ return HttpResponse(response=_response, data=_data)
85
+ if _response.status_code == 422:
86
+ raise UnprocessableEntityError(
87
+ headers=dict(_response.headers),
88
+ body=typing.cast(
89
+ typing.Any,
90
+ construct_type(
91
+ type_=typing.Any, # type: ignore
92
+ object_=_response.json(),
93
+ ),
94
+ ),
95
+ )
96
+ _response_json = _response.json()
97
+ except JSONDecodeError:
98
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
99
+ except ValidationError as e:
100
+ raise ParsingError(
101
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
102
+ )
103
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
104
+
105
+ def create(
106
+ self,
107
+ agent_id: str,
108
+ *,
109
+ parent_version_id: str,
110
+ name: str,
111
+ description: str,
112
+ conversation_config: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
113
+ platform_settings: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
114
+ workflow: typing.Optional[AgentWorkflowRequestModel] = OMIT,
115
+ include_draft: typing.Optional[bool] = OMIT,
116
+ request_options: typing.Optional[RequestOptions] = None,
117
+ ) -> HttpResponse[CreateAgentBranchResponseModel]:
118
+ """
119
+ Create a new branch from a given version of any branch
120
+
121
+ Parameters
122
+ ----------
123
+ agent_id : str
124
+ The id of an agent. This is returned on agent creation.
125
+
126
+ parent_version_id : str
127
+ ID of the version to branch from
128
+
129
+ name : str
130
+ Name of the branch. It is unique within the agent.
131
+
132
+ description : str
133
+ Description for the branch
134
+
135
+ conversation_config : typing.Optional[typing.Dict[str, typing.Any]]
136
+ Changes to apply to conversation config
137
+
138
+ platform_settings : typing.Optional[typing.Dict[str, typing.Any]]
139
+ Changes to apply to platform settings
140
+
141
+ workflow : typing.Optional[AgentWorkflowRequestModel]
142
+ Updated workflow definition
143
+
144
+ include_draft : typing.Optional[bool]
145
+ When true, the new branch uses the caller's draft procedure set instead of the branch tip. Requires parent_version_id to be the branch tip.
146
+
147
+ request_options : typing.Optional[RequestOptions]
148
+ Request-specific configuration.
149
+
150
+ Returns
151
+ -------
152
+ HttpResponse[CreateAgentBranchResponseModel]
153
+ Successful Response
154
+ """
155
+ _response = self._client_wrapper.httpx_client.request(
156
+ f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches",
157
+ method="POST",
158
+ json={
159
+ "parent_version_id": parent_version_id,
160
+ "name": name,
161
+ "description": description,
162
+ "conversation_config": conversation_config,
163
+ "platform_settings": platform_settings,
164
+ "workflow": convert_and_respect_annotation_metadata(
165
+ object_=workflow, annotation=AgentWorkflowRequestModel, direction="write"
166
+ ),
167
+ "include_draft": include_draft,
168
+ },
169
+ headers={
170
+ "content-type": "application/json",
171
+ },
172
+ request_options=request_options,
173
+ omit=OMIT,
174
+ )
175
+ try:
176
+ if 200 <= _response.status_code < 300:
177
+ _data = typing.cast(
178
+ CreateAgentBranchResponseModel,
179
+ construct_type(
180
+ type_=CreateAgentBranchResponseModel, # type: ignore
181
+ object_=_response.json(),
182
+ ),
183
+ )
184
+ return HttpResponse(response=_response, data=_data)
185
+ if _response.status_code == 422:
186
+ raise UnprocessableEntityError(
187
+ headers=dict(_response.headers),
188
+ body=typing.cast(
189
+ typing.Any,
190
+ construct_type(
191
+ type_=typing.Any, # type: ignore
192
+ object_=_response.json(),
193
+ ),
194
+ ),
195
+ )
196
+ _response_json = _response.json()
197
+ except JSONDecodeError:
198
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
199
+ except ValidationError as e:
200
+ raise ParsingError(
201
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
202
+ )
203
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
204
+
205
+ def get(
206
+ self, agent_id: str, branch_id: str, *, request_options: typing.Optional[RequestOptions] = None
207
+ ) -> HttpResponse[AgentBranchResponse]:
208
+ """
209
+ Get information about a single agent branch
210
+
211
+ Parameters
212
+ ----------
213
+ agent_id : str
214
+ The id of an agent. This is returned on agent creation.
215
+
216
+ branch_id : str
217
+ Unique identifier for the branch.
218
+
219
+ request_options : typing.Optional[RequestOptions]
220
+ Request-specific configuration.
221
+
222
+ Returns
223
+ -------
224
+ HttpResponse[AgentBranchResponse]
225
+ Successful Response
226
+ """
227
+ _response = self._client_wrapper.httpx_client.request(
228
+ f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(branch_id)}",
229
+ method="GET",
230
+ request_options=request_options,
231
+ )
232
+ try:
233
+ if 200 <= _response.status_code < 300:
234
+ _data = typing.cast(
235
+ AgentBranchResponse,
236
+ construct_type(
237
+ type_=AgentBranchResponse, # type: ignore
238
+ object_=_response.json(),
239
+ ),
240
+ )
241
+ return HttpResponse(response=_response, data=_data)
242
+ if _response.status_code == 422:
243
+ raise UnprocessableEntityError(
244
+ headers=dict(_response.headers),
245
+ body=typing.cast(
246
+ typing.Any,
247
+ construct_type(
248
+ type_=typing.Any, # type: ignore
249
+ object_=_response.json(),
250
+ ),
251
+ ),
252
+ )
253
+ _response_json = _response.json()
254
+ except JSONDecodeError:
255
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
256
+ except ValidationError as e:
257
+ raise ParsingError(
258
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
259
+ )
260
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
261
+
262
+ def update(
263
+ self,
264
+ agent_id: str,
265
+ branch_id: str,
266
+ *,
267
+ name: typing.Optional[str] = OMIT,
268
+ description: typing.Optional[str] = OMIT,
269
+ is_archived: typing.Optional[bool] = OMIT,
270
+ protection_status: typing.Optional[BranchProtectionStatus] = OMIT,
271
+ auto_rebase: typing.Optional[bool] = OMIT,
272
+ request_options: typing.Optional[RequestOptions] = None,
273
+ ) -> HttpResponse[AgentBranchResponse]:
274
+ """
275
+ Update agent branch properties such as name, description, archiving status, protection level, and auto-rebase onto main
276
+
277
+ Parameters
278
+ ----------
279
+ agent_id : str
280
+ The id of an agent. This is returned on agent creation.
281
+
282
+ branch_id : str
283
+ Unique identifier for the branch.
284
+
285
+ name : typing.Optional[str]
286
+ New name for the branch. Must be unique within the agent.
287
+
288
+ description : typing.Optional[str]
289
+ New description for the branch. Pass an empty string to clear it.
290
+
291
+ is_archived : typing.Optional[bool]
292
+ Whether the branch should be archived
293
+
294
+ protection_status : typing.Optional[BranchProtectionStatus]
295
+ The protection level for the branch
296
+
297
+ auto_rebase : typing.Optional[bool]
298
+ When true, rebase this branch onto main automatically after each new main version. Cannot be enabled on the main branch.
299
+
300
+ request_options : typing.Optional[RequestOptions]
301
+ Request-specific configuration.
302
+
303
+ Returns
304
+ -------
305
+ HttpResponse[AgentBranchResponse]
306
+ Successful Response
307
+ """
308
+ _response = self._client_wrapper.httpx_client.request(
309
+ f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(branch_id)}",
310
+ method="PATCH",
311
+ json={
312
+ "name": name,
313
+ "description": description,
314
+ "is_archived": is_archived,
315
+ "protection_status": protection_status,
316
+ "auto_rebase": auto_rebase,
317
+ },
318
+ headers={
319
+ "content-type": "application/json",
320
+ },
321
+ request_options=request_options,
322
+ omit=OMIT,
323
+ )
324
+ try:
325
+ if 200 <= _response.status_code < 300:
326
+ _data = typing.cast(
327
+ AgentBranchResponse,
328
+ construct_type(
329
+ type_=AgentBranchResponse, # type: ignore
330
+ object_=_response.json(),
331
+ ),
332
+ )
333
+ return HttpResponse(response=_response, data=_data)
334
+ if _response.status_code == 422:
335
+ raise UnprocessableEntityError(
336
+ headers=dict(_response.headers),
337
+ body=typing.cast(
338
+ typing.Any,
339
+ construct_type(
340
+ type_=typing.Any, # type: ignore
341
+ object_=_response.json(),
342
+ ),
343
+ ),
344
+ )
345
+ _response_json = _response.json()
346
+ except JSONDecodeError:
347
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
348
+ except ValidationError as e:
349
+ raise ParsingError(
350
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
351
+ )
352
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
353
+
354
+ def preview_merge(
355
+ self,
356
+ agent_id: str,
357
+ source_branch_id: str,
358
+ *,
359
+ target_branch_id: str,
360
+ force: typing.Optional[bool] = None,
361
+ include_procedure_generated_workflow_elements: typing.Optional[bool] = None,
362
+ request_options: typing.Optional[RequestOptions] = None,
363
+ ) -> HttpResponse[MergePreviewResponseModel]:
364
+ """
365
+ Returns the result of merging the source branch into the target branch without performing the merge. Useful for showing an accurate diff before confirming.
366
+
367
+ Parameters
368
+ ----------
369
+ agent_id : str
370
+ The id of an agent. This is returned on agent creation.
371
+
372
+ source_branch_id : str
373
+ Unique identifier for the source branch to merge from.
374
+
375
+ target_branch_id : str
376
+ The ID of the target branch to merge into.
377
+
378
+ force : typing.Optional[bool]
379
+ When true, source branch changes always win conflicts regardless of timestamps
380
+
381
+ include_procedure_generated_workflow_elements : typing.Optional[bool]
382
+ Whether to include the workflow nodes and edges generated from structured procedures. When false, the workflow contains only authored elements.
383
+
384
+ request_options : typing.Optional[RequestOptions]
385
+ Request-specific configuration.
386
+
387
+ Returns
388
+ -------
389
+ HttpResponse[MergePreviewResponseModel]
390
+ Successful Response
391
+ """
392
+ _response = self._client_wrapper.httpx_client.request(
393
+ f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(source_branch_id)}/merge-preview",
394
+ method="GET",
395
+ params={
396
+ "target_branch_id": target_branch_id,
397
+ "force": force,
398
+ "include_procedure_generated_workflow_elements": include_procedure_generated_workflow_elements,
399
+ },
400
+ request_options=request_options,
401
+ )
402
+ try:
403
+ if 200 <= _response.status_code < 300:
404
+ _data = typing.cast(
405
+ MergePreviewResponseModel,
406
+ construct_type(
407
+ type_=MergePreviewResponseModel, # type: ignore
408
+ object_=_response.json(),
409
+ ),
410
+ )
411
+ return HttpResponse(response=_response, data=_data)
412
+ if _response.status_code == 422:
413
+ raise UnprocessableEntityError(
414
+ headers=dict(_response.headers),
415
+ body=typing.cast(
416
+ typing.Any,
417
+ construct_type(
418
+ type_=typing.Any, # type: ignore
419
+ object_=_response.json(),
420
+ ),
421
+ ),
422
+ )
423
+ _response_json = _response.json()
424
+ except JSONDecodeError:
425
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
426
+ except ValidationError as e:
427
+ raise ParsingError(
428
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
429
+ )
430
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
431
+
432
+ def merge(
433
+ self,
434
+ agent_id: str,
435
+ source_branch_id: str,
436
+ *,
437
+ target_branch_id: str,
438
+ archive_source_branch: typing.Optional[bool] = OMIT,
439
+ force: typing.Optional[bool] = OMIT,
440
+ request_options: typing.Optional[RequestOptions] = None,
441
+ ) -> HttpResponse[typing.Any]:
442
+ """
443
+ Merge a branch into a target branch
444
+
445
+ Parameters
446
+ ----------
447
+ agent_id : str
448
+ The id of an agent. This is returned on agent creation.
449
+
450
+ source_branch_id : str
451
+ Unique identifier for the source branch to merge from.
452
+
453
+ target_branch_id : str
454
+ The ID of the target branch to merge into.
455
+
456
+ archive_source_branch : typing.Optional[bool]
457
+ Whether to archive the source branch after merging
458
+
459
+ force : typing.Optional[bool]
460
+ Force source branch changes onto the target, overriding timestamp-based conflict resolution
461
+
462
+ request_options : typing.Optional[RequestOptions]
463
+ Request-specific configuration.
464
+
465
+ Returns
466
+ -------
467
+ HttpResponse[typing.Any]
468
+ Successful Response
469
+ """
470
+ _response = self._client_wrapper.httpx_client.request(
471
+ f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(source_branch_id)}/merge",
472
+ method="POST",
473
+ params={
474
+ "target_branch_id": target_branch_id,
475
+ },
476
+ json={
477
+ "archive_source_branch": archive_source_branch,
478
+ "force": force,
479
+ },
480
+ headers={
481
+ "content-type": "application/json",
482
+ },
483
+ request_options=request_options,
484
+ omit=OMIT,
485
+ )
486
+ try:
487
+ if _response is None or not _response.text.strip():
488
+ return HttpResponse(response=_response, data=None)
489
+ if 200 <= _response.status_code < 300:
490
+ _data = typing.cast(
491
+ typing.Any,
492
+ construct_type(
493
+ type_=typing.Any, # type: ignore
494
+ object_=_response.json(),
495
+ ),
496
+ )
497
+ return HttpResponse(response=_response, data=_data)
498
+ if _response.status_code == 422:
499
+ raise UnprocessableEntityError(
500
+ headers=dict(_response.headers),
501
+ body=typing.cast(
502
+ typing.Any,
503
+ construct_type(
504
+ type_=typing.Any, # type: ignore
505
+ object_=_response.json(),
506
+ ),
507
+ ),
508
+ )
509
+ _response_json = _response.json()
510
+ except JSONDecodeError:
511
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
512
+ except ValidationError as e:
513
+ raise ParsingError(
514
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
515
+ )
516
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
517
+
518
+ def preview_rebase(
519
+ self,
520
+ agent_id: str,
521
+ branch_id: str,
522
+ *,
523
+ source_branch_id: typing.Optional[str] = None,
524
+ include_procedure_generated_workflow_elements: typing.Optional[bool] = None,
525
+ request_options: typing.Optional[RequestOptions] = None,
526
+ ) -> HttpResponse[MergePreviewResponseModel]:
527
+ """
528
+ Returns the result of pulling changes from a source branch (defaults to main) into the given branch without performing it, preserving the given branch's own changes. Useful for showing an accurate diff before confirming.
529
+
530
+ Parameters
531
+ ----------
532
+ agent_id : str
533
+ The id of an agent. This is returned on agent creation.
534
+
535
+ branch_id : str
536
+ Unique identifier for the source branch to merge from.
537
+
538
+ source_branch_id : typing.Optional[str]
539
+ The ID of the branch to pull changes from. Defaults to the agent's main branch.
540
+
541
+ include_procedure_generated_workflow_elements : typing.Optional[bool]
542
+ Whether to include the workflow nodes and edges generated from structured procedures. When false, the workflow contains only authored elements.
543
+
544
+ request_options : typing.Optional[RequestOptions]
545
+ Request-specific configuration.
546
+
547
+ Returns
548
+ -------
549
+ HttpResponse[MergePreviewResponseModel]
550
+ Successful Response
551
+ """
552
+ _response = self._client_wrapper.httpx_client.request(
553
+ f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(branch_id)}/rebase-preview",
554
+ method="GET",
555
+ params={
556
+ "source_branch_id": source_branch_id,
557
+ "include_procedure_generated_workflow_elements": include_procedure_generated_workflow_elements,
558
+ },
559
+ request_options=request_options,
560
+ )
561
+ try:
562
+ if 200 <= _response.status_code < 300:
563
+ _data = typing.cast(
564
+ MergePreviewResponseModel,
565
+ construct_type(
566
+ type_=MergePreviewResponseModel, # type: ignore
567
+ object_=_response.json(),
568
+ ),
569
+ )
570
+ return HttpResponse(response=_response, data=_data)
571
+ if _response.status_code == 422:
572
+ raise UnprocessableEntityError(
573
+ headers=dict(_response.headers),
574
+ body=typing.cast(
575
+ typing.Any,
576
+ construct_type(
577
+ type_=typing.Any, # type: ignore
578
+ object_=_response.json(),
579
+ ),
580
+ ),
581
+ )
582
+ _response_json = _response.json()
583
+ except JSONDecodeError:
584
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
585
+ except ValidationError as e:
586
+ raise ParsingError(
587
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
588
+ )
589
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
590
+
591
+ def rebase(
592
+ self,
593
+ agent_id: str,
594
+ branch_id: str,
595
+ *,
596
+ source_branch_id: typing.Optional[str] = None,
597
+ request_options: typing.Optional[RequestOptions] = None,
598
+ ) -> HttpResponse[typing.Any]:
599
+ """
600
+ Pull changes from a source branch (defaults to main) into this branch as a new version, preserving this branch's own changes on conflicts.
601
+
602
+ Parameters
603
+ ----------
604
+ agent_id : str
605
+ The id of an agent. This is returned on agent creation.
606
+
607
+ branch_id : str
608
+ Unique identifier for the source branch to merge from.
609
+
610
+ source_branch_id : typing.Optional[str]
611
+ The ID of the branch to pull changes from. Defaults to the agent's main branch.
612
+
613
+ request_options : typing.Optional[RequestOptions]
614
+ Request-specific configuration.
615
+
616
+ Returns
617
+ -------
618
+ HttpResponse[typing.Any]
619
+ Successful Response
620
+ """
621
+ _response = self._client_wrapper.httpx_client.request(
622
+ f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(branch_id)}/rebase",
623
+ method="POST",
624
+ params={
625
+ "source_branch_id": source_branch_id,
626
+ },
627
+ request_options=request_options,
628
+ )
629
+ try:
630
+ if _response is None or not _response.text.strip():
631
+ return HttpResponse(response=_response, data=None)
632
+ if 200 <= _response.status_code < 300:
633
+ _data = typing.cast(
634
+ typing.Any,
635
+ construct_type(
636
+ type_=typing.Any, # type: ignore
637
+ object_=_response.json(),
638
+ ),
639
+ )
640
+ return HttpResponse(response=_response, data=_data)
641
+ if _response.status_code == 422:
642
+ raise UnprocessableEntityError(
643
+ headers=dict(_response.headers),
644
+ body=typing.cast(
645
+ typing.Any,
646
+ construct_type(
647
+ type_=typing.Any, # type: ignore
648
+ object_=_response.json(),
649
+ ),
650
+ ),
651
+ )
652
+ _response_json = _response.json()
653
+ except JSONDecodeError:
654
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
655
+ except ValidationError as e:
656
+ raise ParsingError(
657
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
658
+ )
659
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
660
+
661
+
662
+ class AsyncRawBranchesClient:
663
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
664
+ self._client_wrapper = client_wrapper
665
+
666
+ async def list(
667
+ self,
668
+ agent_id: str,
669
+ *,
670
+ include_archived: typing.Optional[bool] = None,
671
+ limit: typing.Optional[int] = None,
672
+ include_commit_status: typing.Optional[bool] = None,
673
+ request_options: typing.Optional[RequestOptions] = None,
674
+ ) -> AsyncHttpResponse[ListResponseAgentBranchSummary]:
675
+ """
676
+ Returns a list of branches an agent has
677
+
678
+ Parameters
679
+ ----------
680
+ agent_id : str
681
+ The id of an agent. This is returned on agent creation.
682
+
683
+ include_archived : typing.Optional[bool]
684
+ Whether archived branches should be included
685
+
686
+ limit : typing.Optional[int]
687
+ How many results at most should be returned
688
+
689
+ include_commit_status : typing.Optional[bool]
690
+ Whether to compute how far each branch has diverged from main (commits_ahead/commits_behind). This walks the version DAG of every branch, so it is slow on agents with long histories and is off by default, leaving those fields null.
691
+
692
+ request_options : typing.Optional[RequestOptions]
693
+ Request-specific configuration.
694
+
695
+ Returns
696
+ -------
697
+ AsyncHttpResponse[ListResponseAgentBranchSummary]
698
+ Successful Response
699
+ """
700
+ _response = await self._client_wrapper.httpx_client.request(
701
+ f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches",
702
+ method="GET",
703
+ params={
704
+ "include_archived": include_archived,
705
+ "limit": limit,
706
+ "include_commit_status": include_commit_status,
707
+ },
708
+ request_options=request_options,
709
+ )
710
+ try:
711
+ if 200 <= _response.status_code < 300:
712
+ _data = typing.cast(
713
+ ListResponseAgentBranchSummary,
714
+ construct_type(
715
+ type_=ListResponseAgentBranchSummary, # type: ignore
716
+ object_=_response.json(),
717
+ ),
718
+ )
719
+ return AsyncHttpResponse(response=_response, data=_data)
720
+ if _response.status_code == 422:
721
+ raise UnprocessableEntityError(
722
+ headers=dict(_response.headers),
723
+ body=typing.cast(
724
+ typing.Any,
725
+ construct_type(
726
+ type_=typing.Any, # type: ignore
727
+ object_=_response.json(),
728
+ ),
729
+ ),
730
+ )
731
+ _response_json = _response.json()
732
+ except JSONDecodeError:
733
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
734
+ except ValidationError as e:
735
+ raise ParsingError(
736
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
737
+ )
738
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
739
+
740
+ async def create(
741
+ self,
742
+ agent_id: str,
743
+ *,
744
+ parent_version_id: str,
745
+ name: str,
746
+ description: str,
747
+ conversation_config: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
748
+ platform_settings: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
749
+ workflow: typing.Optional[AgentWorkflowRequestModel] = OMIT,
750
+ include_draft: typing.Optional[bool] = OMIT,
751
+ request_options: typing.Optional[RequestOptions] = None,
752
+ ) -> AsyncHttpResponse[CreateAgentBranchResponseModel]:
753
+ """
754
+ Create a new branch from a given version of any branch
755
+
756
+ Parameters
757
+ ----------
758
+ agent_id : str
759
+ The id of an agent. This is returned on agent creation.
760
+
761
+ parent_version_id : str
762
+ ID of the version to branch from
763
+
764
+ name : str
765
+ Name of the branch. It is unique within the agent.
766
+
767
+ description : str
768
+ Description for the branch
769
+
770
+ conversation_config : typing.Optional[typing.Dict[str, typing.Any]]
771
+ Changes to apply to conversation config
772
+
773
+ platform_settings : typing.Optional[typing.Dict[str, typing.Any]]
774
+ Changes to apply to platform settings
775
+
776
+ workflow : typing.Optional[AgentWorkflowRequestModel]
777
+ Updated workflow definition
778
+
779
+ include_draft : typing.Optional[bool]
780
+ When true, the new branch uses the caller's draft procedure set instead of the branch tip. Requires parent_version_id to be the branch tip.
781
+
782
+ request_options : typing.Optional[RequestOptions]
783
+ Request-specific configuration.
784
+
785
+ Returns
786
+ -------
787
+ AsyncHttpResponse[CreateAgentBranchResponseModel]
788
+ Successful Response
789
+ """
790
+ _response = await self._client_wrapper.httpx_client.request(
791
+ f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches",
792
+ method="POST",
793
+ json={
794
+ "parent_version_id": parent_version_id,
795
+ "name": name,
796
+ "description": description,
797
+ "conversation_config": conversation_config,
798
+ "platform_settings": platform_settings,
799
+ "workflow": convert_and_respect_annotation_metadata(
800
+ object_=workflow, annotation=AgentWorkflowRequestModel, direction="write"
801
+ ),
802
+ "include_draft": include_draft,
803
+ },
804
+ headers={
805
+ "content-type": "application/json",
806
+ },
807
+ request_options=request_options,
808
+ omit=OMIT,
809
+ )
810
+ try:
811
+ if 200 <= _response.status_code < 300:
812
+ _data = typing.cast(
813
+ CreateAgentBranchResponseModel,
814
+ construct_type(
815
+ type_=CreateAgentBranchResponseModel, # type: ignore
816
+ object_=_response.json(),
817
+ ),
818
+ )
819
+ return AsyncHttpResponse(response=_response, data=_data)
820
+ if _response.status_code == 422:
821
+ raise UnprocessableEntityError(
822
+ headers=dict(_response.headers),
823
+ body=typing.cast(
824
+ typing.Any,
825
+ construct_type(
826
+ type_=typing.Any, # type: ignore
827
+ object_=_response.json(),
828
+ ),
829
+ ),
830
+ )
831
+ _response_json = _response.json()
832
+ except JSONDecodeError:
833
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
834
+ except ValidationError as e:
835
+ raise ParsingError(
836
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
837
+ )
838
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
839
+
840
+ async def get(
841
+ self, agent_id: str, branch_id: str, *, request_options: typing.Optional[RequestOptions] = None
842
+ ) -> AsyncHttpResponse[AgentBranchResponse]:
843
+ """
844
+ Get information about a single agent branch
845
+
846
+ Parameters
847
+ ----------
848
+ agent_id : str
849
+ The id of an agent. This is returned on agent creation.
850
+
851
+ branch_id : str
852
+ Unique identifier for the branch.
853
+
854
+ request_options : typing.Optional[RequestOptions]
855
+ Request-specific configuration.
856
+
857
+ Returns
858
+ -------
859
+ AsyncHttpResponse[AgentBranchResponse]
860
+ Successful Response
861
+ """
862
+ _response = await self._client_wrapper.httpx_client.request(
863
+ f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(branch_id)}",
864
+ method="GET",
865
+ request_options=request_options,
866
+ )
867
+ try:
868
+ if 200 <= _response.status_code < 300:
869
+ _data = typing.cast(
870
+ AgentBranchResponse,
871
+ construct_type(
872
+ type_=AgentBranchResponse, # type: ignore
873
+ object_=_response.json(),
874
+ ),
875
+ )
876
+ return AsyncHttpResponse(response=_response, data=_data)
877
+ if _response.status_code == 422:
878
+ raise UnprocessableEntityError(
879
+ headers=dict(_response.headers),
880
+ body=typing.cast(
881
+ typing.Any,
882
+ construct_type(
883
+ type_=typing.Any, # type: ignore
884
+ object_=_response.json(),
885
+ ),
886
+ ),
887
+ )
888
+ _response_json = _response.json()
889
+ except JSONDecodeError:
890
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
891
+ except ValidationError as e:
892
+ raise ParsingError(
893
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
894
+ )
895
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
896
+
897
+ async def update(
898
+ self,
899
+ agent_id: str,
900
+ branch_id: str,
901
+ *,
902
+ name: typing.Optional[str] = OMIT,
903
+ description: typing.Optional[str] = OMIT,
904
+ is_archived: typing.Optional[bool] = OMIT,
905
+ protection_status: typing.Optional[BranchProtectionStatus] = OMIT,
906
+ auto_rebase: typing.Optional[bool] = OMIT,
907
+ request_options: typing.Optional[RequestOptions] = None,
908
+ ) -> AsyncHttpResponse[AgentBranchResponse]:
909
+ """
910
+ Update agent branch properties such as name, description, archiving status, protection level, and auto-rebase onto main
911
+
912
+ Parameters
913
+ ----------
914
+ agent_id : str
915
+ The id of an agent. This is returned on agent creation.
916
+
917
+ branch_id : str
918
+ Unique identifier for the branch.
919
+
920
+ name : typing.Optional[str]
921
+ New name for the branch. Must be unique within the agent.
922
+
923
+ description : typing.Optional[str]
924
+ New description for the branch. Pass an empty string to clear it.
925
+
926
+ is_archived : typing.Optional[bool]
927
+ Whether the branch should be archived
928
+
929
+ protection_status : typing.Optional[BranchProtectionStatus]
930
+ The protection level for the branch
931
+
932
+ auto_rebase : typing.Optional[bool]
933
+ When true, rebase this branch onto main automatically after each new main version. Cannot be enabled on the main branch.
934
+
935
+ request_options : typing.Optional[RequestOptions]
936
+ Request-specific configuration.
937
+
938
+ Returns
939
+ -------
940
+ AsyncHttpResponse[AgentBranchResponse]
941
+ Successful Response
942
+ """
943
+ _response = await self._client_wrapper.httpx_client.request(
944
+ f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(branch_id)}",
945
+ method="PATCH",
946
+ json={
947
+ "name": name,
948
+ "description": description,
949
+ "is_archived": is_archived,
950
+ "protection_status": protection_status,
951
+ "auto_rebase": auto_rebase,
952
+ },
953
+ headers={
954
+ "content-type": "application/json",
955
+ },
956
+ request_options=request_options,
957
+ omit=OMIT,
958
+ )
959
+ try:
960
+ if 200 <= _response.status_code < 300:
961
+ _data = typing.cast(
962
+ AgentBranchResponse,
963
+ construct_type(
964
+ type_=AgentBranchResponse, # type: ignore
965
+ object_=_response.json(),
966
+ ),
967
+ )
968
+ return AsyncHttpResponse(response=_response, data=_data)
969
+ if _response.status_code == 422:
970
+ raise UnprocessableEntityError(
971
+ headers=dict(_response.headers),
972
+ body=typing.cast(
973
+ typing.Any,
974
+ construct_type(
975
+ type_=typing.Any, # type: ignore
976
+ object_=_response.json(),
977
+ ),
978
+ ),
979
+ )
980
+ _response_json = _response.json()
981
+ except JSONDecodeError:
982
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
983
+ except ValidationError as e:
984
+ raise ParsingError(
985
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
986
+ )
987
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
988
+
989
+ async def preview_merge(
990
+ self,
991
+ agent_id: str,
992
+ source_branch_id: str,
993
+ *,
994
+ target_branch_id: str,
995
+ force: typing.Optional[bool] = None,
996
+ include_procedure_generated_workflow_elements: typing.Optional[bool] = None,
997
+ request_options: typing.Optional[RequestOptions] = None,
998
+ ) -> AsyncHttpResponse[MergePreviewResponseModel]:
999
+ """
1000
+ Returns the result of merging the source branch into the target branch without performing the merge. Useful for showing an accurate diff before confirming.
1001
+
1002
+ Parameters
1003
+ ----------
1004
+ agent_id : str
1005
+ The id of an agent. This is returned on agent creation.
1006
+
1007
+ source_branch_id : str
1008
+ Unique identifier for the source branch to merge from.
1009
+
1010
+ target_branch_id : str
1011
+ The ID of the target branch to merge into.
1012
+
1013
+ force : typing.Optional[bool]
1014
+ When true, source branch changes always win conflicts regardless of timestamps
1015
+
1016
+ include_procedure_generated_workflow_elements : typing.Optional[bool]
1017
+ Whether to include the workflow nodes and edges generated from structured procedures. When false, the workflow contains only authored elements.
1018
+
1019
+ request_options : typing.Optional[RequestOptions]
1020
+ Request-specific configuration.
1021
+
1022
+ Returns
1023
+ -------
1024
+ AsyncHttpResponse[MergePreviewResponseModel]
1025
+ Successful Response
1026
+ """
1027
+ _response = await self._client_wrapper.httpx_client.request(
1028
+ f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(source_branch_id)}/merge-preview",
1029
+ method="GET",
1030
+ params={
1031
+ "target_branch_id": target_branch_id,
1032
+ "force": force,
1033
+ "include_procedure_generated_workflow_elements": include_procedure_generated_workflow_elements,
1034
+ },
1035
+ request_options=request_options,
1036
+ )
1037
+ try:
1038
+ if 200 <= _response.status_code < 300:
1039
+ _data = typing.cast(
1040
+ MergePreviewResponseModel,
1041
+ construct_type(
1042
+ type_=MergePreviewResponseModel, # type: ignore
1043
+ object_=_response.json(),
1044
+ ),
1045
+ )
1046
+ return AsyncHttpResponse(response=_response, data=_data)
1047
+ if _response.status_code == 422:
1048
+ raise UnprocessableEntityError(
1049
+ headers=dict(_response.headers),
1050
+ body=typing.cast(
1051
+ typing.Any,
1052
+ construct_type(
1053
+ type_=typing.Any, # type: ignore
1054
+ object_=_response.json(),
1055
+ ),
1056
+ ),
1057
+ )
1058
+ _response_json = _response.json()
1059
+ except JSONDecodeError:
1060
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1061
+ except ValidationError as e:
1062
+ raise ParsingError(
1063
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
1064
+ )
1065
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1066
+
1067
+ async def merge(
1068
+ self,
1069
+ agent_id: str,
1070
+ source_branch_id: str,
1071
+ *,
1072
+ target_branch_id: str,
1073
+ archive_source_branch: typing.Optional[bool] = OMIT,
1074
+ force: typing.Optional[bool] = OMIT,
1075
+ request_options: typing.Optional[RequestOptions] = None,
1076
+ ) -> AsyncHttpResponse[typing.Any]:
1077
+ """
1078
+ Merge a branch into a target branch
1079
+
1080
+ Parameters
1081
+ ----------
1082
+ agent_id : str
1083
+ The id of an agent. This is returned on agent creation.
1084
+
1085
+ source_branch_id : str
1086
+ Unique identifier for the source branch to merge from.
1087
+
1088
+ target_branch_id : str
1089
+ The ID of the target branch to merge into.
1090
+
1091
+ archive_source_branch : typing.Optional[bool]
1092
+ Whether to archive the source branch after merging
1093
+
1094
+ force : typing.Optional[bool]
1095
+ Force source branch changes onto the target, overriding timestamp-based conflict resolution
1096
+
1097
+ request_options : typing.Optional[RequestOptions]
1098
+ Request-specific configuration.
1099
+
1100
+ Returns
1101
+ -------
1102
+ AsyncHttpResponse[typing.Any]
1103
+ Successful Response
1104
+ """
1105
+ _response = await self._client_wrapper.httpx_client.request(
1106
+ f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(source_branch_id)}/merge",
1107
+ method="POST",
1108
+ params={
1109
+ "target_branch_id": target_branch_id,
1110
+ },
1111
+ json={
1112
+ "archive_source_branch": archive_source_branch,
1113
+ "force": force,
1114
+ },
1115
+ headers={
1116
+ "content-type": "application/json",
1117
+ },
1118
+ request_options=request_options,
1119
+ omit=OMIT,
1120
+ )
1121
+ try:
1122
+ if _response is None or not _response.text.strip():
1123
+ return AsyncHttpResponse(response=_response, data=None)
1124
+ if 200 <= _response.status_code < 300:
1125
+ _data = typing.cast(
1126
+ typing.Any,
1127
+ construct_type(
1128
+ type_=typing.Any, # type: ignore
1129
+ object_=_response.json(),
1130
+ ),
1131
+ )
1132
+ return AsyncHttpResponse(response=_response, data=_data)
1133
+ if _response.status_code == 422:
1134
+ raise UnprocessableEntityError(
1135
+ headers=dict(_response.headers),
1136
+ body=typing.cast(
1137
+ typing.Any,
1138
+ construct_type(
1139
+ type_=typing.Any, # type: ignore
1140
+ object_=_response.json(),
1141
+ ),
1142
+ ),
1143
+ )
1144
+ _response_json = _response.json()
1145
+ except JSONDecodeError:
1146
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1147
+ except ValidationError as e:
1148
+ raise ParsingError(
1149
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
1150
+ )
1151
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1152
+
1153
+ async def preview_rebase(
1154
+ self,
1155
+ agent_id: str,
1156
+ branch_id: str,
1157
+ *,
1158
+ source_branch_id: typing.Optional[str] = None,
1159
+ include_procedure_generated_workflow_elements: typing.Optional[bool] = None,
1160
+ request_options: typing.Optional[RequestOptions] = None,
1161
+ ) -> AsyncHttpResponse[MergePreviewResponseModel]:
1162
+ """
1163
+ Returns the result of pulling changes from a source branch (defaults to main) into the given branch without performing it, preserving the given branch's own changes. Useful for showing an accurate diff before confirming.
1164
+
1165
+ Parameters
1166
+ ----------
1167
+ agent_id : str
1168
+ The id of an agent. This is returned on agent creation.
1169
+
1170
+ branch_id : str
1171
+ Unique identifier for the source branch to merge from.
1172
+
1173
+ source_branch_id : typing.Optional[str]
1174
+ The ID of the branch to pull changes from. Defaults to the agent's main branch.
1175
+
1176
+ include_procedure_generated_workflow_elements : typing.Optional[bool]
1177
+ Whether to include the workflow nodes and edges generated from structured procedures. When false, the workflow contains only authored elements.
1178
+
1179
+ request_options : typing.Optional[RequestOptions]
1180
+ Request-specific configuration.
1181
+
1182
+ Returns
1183
+ -------
1184
+ AsyncHttpResponse[MergePreviewResponseModel]
1185
+ Successful Response
1186
+ """
1187
+ _response = await self._client_wrapper.httpx_client.request(
1188
+ f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(branch_id)}/rebase-preview",
1189
+ method="GET",
1190
+ params={
1191
+ "source_branch_id": source_branch_id,
1192
+ "include_procedure_generated_workflow_elements": include_procedure_generated_workflow_elements,
1193
+ },
1194
+ request_options=request_options,
1195
+ )
1196
+ try:
1197
+ if 200 <= _response.status_code < 300:
1198
+ _data = typing.cast(
1199
+ MergePreviewResponseModel,
1200
+ construct_type(
1201
+ type_=MergePreviewResponseModel, # type: ignore
1202
+ object_=_response.json(),
1203
+ ),
1204
+ )
1205
+ return AsyncHttpResponse(response=_response, data=_data)
1206
+ if _response.status_code == 422:
1207
+ raise UnprocessableEntityError(
1208
+ headers=dict(_response.headers),
1209
+ body=typing.cast(
1210
+ typing.Any,
1211
+ construct_type(
1212
+ type_=typing.Any, # type: ignore
1213
+ object_=_response.json(),
1214
+ ),
1215
+ ),
1216
+ )
1217
+ _response_json = _response.json()
1218
+ except JSONDecodeError:
1219
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1220
+ except ValidationError as e:
1221
+ raise ParsingError(
1222
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
1223
+ )
1224
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
1225
+
1226
+ async def rebase(
1227
+ self,
1228
+ agent_id: str,
1229
+ branch_id: str,
1230
+ *,
1231
+ source_branch_id: typing.Optional[str] = None,
1232
+ request_options: typing.Optional[RequestOptions] = None,
1233
+ ) -> AsyncHttpResponse[typing.Any]:
1234
+ """
1235
+ Pull changes from a source branch (defaults to main) into this branch as a new version, preserving this branch's own changes on conflicts.
1236
+
1237
+ Parameters
1238
+ ----------
1239
+ agent_id : str
1240
+ The id of an agent. This is returned on agent creation.
1241
+
1242
+ branch_id : str
1243
+ Unique identifier for the source branch to merge from.
1244
+
1245
+ source_branch_id : typing.Optional[str]
1246
+ The ID of the branch to pull changes from. Defaults to the agent's main branch.
1247
+
1248
+ request_options : typing.Optional[RequestOptions]
1249
+ Request-specific configuration.
1250
+
1251
+ Returns
1252
+ -------
1253
+ AsyncHttpResponse[typing.Any]
1254
+ Successful Response
1255
+ """
1256
+ _response = await self._client_wrapper.httpx_client.request(
1257
+ f"v1/convai/agents/{jsonable_encoder(agent_id)}/branches/{jsonable_encoder(branch_id)}/rebase",
1258
+ method="POST",
1259
+ params={
1260
+ "source_branch_id": source_branch_id,
1261
+ },
1262
+ request_options=request_options,
1263
+ )
1264
+ try:
1265
+ if _response is None or not _response.text.strip():
1266
+ return AsyncHttpResponse(response=_response, data=None)
1267
+ if 200 <= _response.status_code < 300:
1268
+ _data = typing.cast(
1269
+ typing.Any,
1270
+ construct_type(
1271
+ type_=typing.Any, # type: ignore
1272
+ object_=_response.json(),
1273
+ ),
1274
+ )
1275
+ return AsyncHttpResponse(response=_response, data=_data)
1276
+ if _response.status_code == 422:
1277
+ raise UnprocessableEntityError(
1278
+ headers=dict(_response.headers),
1279
+ body=typing.cast(
1280
+ typing.Any,
1281
+ construct_type(
1282
+ type_=typing.Any, # type: ignore
1283
+ object_=_response.json(),
1284
+ ),
1285
+ ),
1286
+ )
1287
+ _response_json = _response.json()
1288
+ except JSONDecodeError:
1289
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
1290
+ except ValidationError as e:
1291
+ raise ParsingError(
1292
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
1293
+ )
1294
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
data/src/elevenlabs/conversational_ai/agents/client.py ADDED
@@ -0,0 +1,1510 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from __future__ import annotations
4
+
5
+ import typing
6
+
7
+ from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
8
+ from ...core.request_options import RequestOptions
9
+ from ...types.adhoc_agent_config_override_for_test_request_model import AdhocAgentConfigOverrideForTestRequestModel
10
+ from ...types.agent_platform_settings_request_model import AgentPlatformSettingsRequestModel
11
+ from ...types.agent_simulated_chat_test_response_model import AgentSimulatedChatTestResponseModel
12
+ from ...types.agent_sort_by import AgentSortBy
13
+ from ...types.agent_workflow_request_model import AgentWorkflowRequestModel
14
+ from ...types.conversation_simulation_specification import ConversationSimulationSpecification
15
+ from ...types.conversational_config import ConversationalConfig
16
+ from ...types.create_agent_response_model import CreateAgentResponseModel
17
+ from ...types.get_agent_response_model import GetAgentResponseModel
18
+ from ...types.get_agents_page_response_model import GetAgentsPageResponseModel
19
+ from ...types.get_test_suite_invocation_response_model import GetTestSuiteInvocationResponseModel
20
+ from ...types.procedure_version_ref import ProcedureVersionRef
21
+ from ...types.prompt_evaluation_criteria import PromptEvaluationCriteria
22
+ from ...types.single_test_run_request_model import SingleTestRunRequestModel
23
+ from ...types.sort_direction import SortDirection
24
+ from .raw_client import AsyncRawAgentsClient, RawAgentsClient
25
+
26
+ if typing.TYPE_CHECKING:
27
+ from .branches.client import AsyncBranchesClient, BranchesClient
28
+ from .deployments.client import AsyncDeploymentsClient, DeploymentsClient
29
+ from .drafts.client import AsyncDraftsClient, DraftsClient
30
+ from .hold_audio.client import AsyncHoldAudioClient, HoldAudioClient
31
+ from .knowledge_base.client import AsyncKnowledgeBaseClient, KnowledgeBaseClient
32
+ from .link.client import AsyncLinkClient, LinkClient
33
+ from .llm_usage.client import AsyncLlmUsageClient, LlmUsageClient
34
+ from .merge_proposals.client import AsyncMergeProposalsClient, MergeProposalsClient
35
+ from .procedures.client import AsyncProceduresClient, ProceduresClient
36
+ from .summaries.client import AsyncSummariesClient, SummariesClient
37
+ from .versions.client import AsyncVersionsClient, VersionsClient
38
+ from .widget.client import AsyncWidgetClient, WidgetClient
39
+ # this is used as the default value for optional parameters
40
+ OMIT = typing.cast(typing.Any, ...)
41
+
42
+
43
+ class AgentsClient:
44
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
45
+ self._raw_client = RawAgentsClient(client_wrapper=client_wrapper)
46
+ self._client_wrapper = client_wrapper
47
+ self._summaries: typing.Optional[SummariesClient] = None
48
+ self._widget: typing.Optional[WidgetClient] = None
49
+ self._link: typing.Optional[LinkClient] = None
50
+ self._hold_audio: typing.Optional[HoldAudioClient] = None
51
+ self._knowledge_base: typing.Optional[KnowledgeBaseClient] = None
52
+ self._llm_usage: typing.Optional[LlmUsageClient] = None
53
+ self._branches: typing.Optional[BranchesClient] = None
54
+ self._versions: typing.Optional[VersionsClient] = None
55
+ self._deployments: typing.Optional[DeploymentsClient] = None
56
+ self._drafts: typing.Optional[DraftsClient] = None
57
+ self._merge_proposals: typing.Optional[MergeProposalsClient] = None
58
+ self._procedures: typing.Optional[ProceduresClient] = None
59
+
60
+ @property
61
+ def with_raw_response(self) -> RawAgentsClient:
62
+ """
63
+ Retrieves a raw implementation of this client that returns raw responses.
64
+
65
+ Returns
66
+ -------
67
+ RawAgentsClient
68
+ """
69
+ return self._raw_client
70
+
71
+ def create(
72
+ self,
73
+ *,
74
+ conversation_config: ConversationalConfig,
75
+ enable_versioning: typing.Optional[bool] = None,
76
+ platform_settings: typing.Optional[AgentPlatformSettingsRequestModel] = OMIT,
77
+ workflow: typing.Optional[AgentWorkflowRequestModel] = OMIT,
78
+ name: typing.Optional[str] = OMIT,
79
+ tags: typing.Optional[typing.Sequence[str]] = OMIT,
80
+ request_options: typing.Optional[RequestOptions] = None,
81
+ ) -> CreateAgentResponseModel:
82
+ """
83
+ Create an agent from a config object
84
+
85
+ Parameters
86
+ ----------
87
+ conversation_config : ConversationalConfig
88
+ Conversation configuration for an agent
89
+
90
+ enable_versioning : typing.Optional[bool]
91
+ Deprecated: all agents are versioned. This parameter is ignored.
92
+
93
+ platform_settings : typing.Optional[AgentPlatformSettingsRequestModel]
94
+ Platform settings for the agent are all settings that aren't related to the conversation orchestration and content.
95
+
96
+ workflow : typing.Optional[AgentWorkflowRequestModel]
97
+ Workflow for the agent. This is used to define the flow of the conversation and how the agent interacts with tools.
98
+
99
+ name : typing.Optional[str]
100
+ A name to make the agent easier to find
101
+
102
+ tags : typing.Optional[typing.Sequence[str]]
103
+ Tags to help classify and filter the agent
104
+
105
+ request_options : typing.Optional[RequestOptions]
106
+ Request-specific configuration.
107
+
108
+ Returns
109
+ -------
110
+ CreateAgentResponseModel
111
+ Successful Response
112
+
113
+ Examples
114
+ --------
115
+ from elevenlabs import ConversationalConfig, ElevenLabs
116
+
117
+ client = ElevenLabs(
118
+ api_key="YOUR_API_KEY",
119
+ )
120
+ client.conversational_ai.agents.create(
121
+ enable_versioning=True,
122
+ conversation_config=ConversationalConfig(),
123
+ )
124
+ """
125
+ _response = self._raw_client.create(
126
+ conversation_config=conversation_config,
127
+ enable_versioning=enable_versioning,
128
+ platform_settings=platform_settings,
129
+ workflow=workflow,
130
+ name=name,
131
+ tags=tags,
132
+ request_options=request_options,
133
+ )
134
+ return _response.data
135
+
136
+ def get(
137
+ self,
138
+ agent_id: str,
139
+ *,
140
+ version_id: typing.Optional[str] = None,
141
+ branch_id: typing.Optional[str] = None,
142
+ include_procedure_generated_workflow_elements: typing.Optional[bool] = None,
143
+ request_options: typing.Optional[RequestOptions] = None,
144
+ ) -> GetAgentResponseModel:
145
+ """
146
+ Retrieve config for an agent
147
+
148
+ Parameters
149
+ ----------
150
+ agent_id : str
151
+ The id of an agent. This is returned on agent creation.
152
+
153
+ version_id : typing.Optional[str]
154
+ The ID of the agent version to use
155
+
156
+ branch_id : typing.Optional[str]
157
+ The ID of the branch to use
158
+
159
+ include_procedure_generated_workflow_elements : typing.Optional[bool]
160
+ Whether to include the workflow nodes and edges generated from structured procedures. When false, the workflow contains only authored elements.
161
+
162
+ request_options : typing.Optional[RequestOptions]
163
+ Request-specific configuration.
164
+
165
+ Returns
166
+ -------
167
+ GetAgentResponseModel
168
+ Successful Response
169
+
170
+ Examples
171
+ --------
172
+ from elevenlabs import ElevenLabs
173
+
174
+ client = ElevenLabs(
175
+ api_key="YOUR_API_KEY",
176
+ )
177
+ client.conversational_ai.agents.get(
178
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
179
+ version_id="version_id",
180
+ branch_id="branch_id",
181
+ include_procedure_generated_workflow_elements=True,
182
+ )
183
+ """
184
+ _response = self._raw_client.get(
185
+ agent_id,
186
+ version_id=version_id,
187
+ branch_id=branch_id,
188
+ include_procedure_generated_workflow_elements=include_procedure_generated_workflow_elements,
189
+ request_options=request_options,
190
+ )
191
+ return _response.data
192
+
193
+ def delete(
194
+ self,
195
+ agent_id: str,
196
+ *,
197
+ force: typing.Optional[bool] = None,
198
+ request_options: typing.Optional[RequestOptions] = None,
199
+ ) -> None:
200
+ """
201
+ Delete an agent
202
+
203
+ Parameters
204
+ ----------
205
+ agent_id : str
206
+ The id of an agent. This is returned on agent creation.
207
+
208
+ force : typing.Optional[bool]
209
+ If set to true, the agent is deleted even if other agents use it as a subagent, and it is removed from those agents and their branches.
210
+
211
+ request_options : typing.Optional[RequestOptions]
212
+ Request-specific configuration.
213
+
214
+ Returns
215
+ -------
216
+ None
217
+
218
+ Examples
219
+ --------
220
+ from elevenlabs import ElevenLabs
221
+
222
+ client = ElevenLabs(
223
+ api_key="YOUR_API_KEY",
224
+ )
225
+ client.conversational_ai.agents.delete(
226
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
227
+ force=True,
228
+ )
229
+ """
230
+ _response = self._raw_client.delete(agent_id, force=force, request_options=request_options)
231
+ return _response.data
232
+
233
+ def update(
234
+ self,
235
+ agent_id: str,
236
+ *,
237
+ enable_versioning_if_not_enabled: typing.Optional[bool] = None,
238
+ branch_id: typing.Optional[str] = None,
239
+ include_procedure_generated_workflow_elements: typing.Optional[bool] = None,
240
+ conversation_config: typing.Optional[ConversationalConfig] = OMIT,
241
+ platform_settings: typing.Optional[AgentPlatformSettingsRequestModel] = OMIT,
242
+ workflow: typing.Optional[AgentWorkflowRequestModel] = OMIT,
243
+ name: typing.Optional[str] = OMIT,
244
+ tags: typing.Optional[typing.Sequence[str]] = OMIT,
245
+ version_description: typing.Optional[str] = OMIT,
246
+ procedures: typing.Optional[typing.Dict[str, typing.Optional[ProcedureVersionRef]]] = OMIT,
247
+ request_options: typing.Optional[RequestOptions] = None,
248
+ ) -> GetAgentResponseModel:
249
+ """
250
+ Patches an Agent settings
251
+
252
+ Parameters
253
+ ----------
254
+ agent_id : str
255
+ The id of an agent. This is returned on agent creation.
256
+
257
+ enable_versioning_if_not_enabled : typing.Optional[bool]
258
+ Deprecated: all agents are versioned. This parameter is ignored.
259
+
260
+ branch_id : typing.Optional[str]
261
+ The ID of the branch to use
262
+
263
+ include_procedure_generated_workflow_elements : typing.Optional[bool]
264
+ Whether to include the workflow nodes and edges generated from structured procedures. When false, the workflow contains only authored elements.
265
+
266
+ conversation_config : typing.Optional[ConversationalConfig]
267
+ Conversation configuration for an agent
268
+
269
+ platform_settings : typing.Optional[AgentPlatformSettingsRequestModel]
270
+ Platform settings for the agent are all settings that aren't related to the conversation orchestration and content.
271
+
272
+ workflow : typing.Optional[AgentWorkflowRequestModel]
273
+ Workflow for the agent. This is used to define the flow of the conversation and how the agent interacts with tools.
274
+
275
+ name : typing.Optional[str]
276
+ A name to make the agent easier to find
277
+
278
+ tags : typing.Optional[typing.Sequence[str]]
279
+ Tags to help classify and filter the agent
280
+
281
+ version_description : typing.Optional[str]
282
+ Description for this version when publishing changes (only applicable for versioned agents)
283
+
284
+ procedures : typing.Optional[typing.Dict[str, typing.Optional[ProcedureVersionRef]]]
285
+ Procedure versions to publish, keyed by procedure_id. When provided, this map replaces the procedures from the current draft or branch tip. When omitted or null, unpublished procedure edits are used if present; otherwise, the branch tip's procedures are retained. Pass an empty object to remove all procedures.
286
+
287
+ request_options : typing.Optional[RequestOptions]
288
+ Request-specific configuration.
289
+
290
+ Returns
291
+ -------
292
+ GetAgentResponseModel
293
+ Successful Response
294
+
295
+ Examples
296
+ --------
297
+ from elevenlabs import ElevenLabs
298
+
299
+ client = ElevenLabs(
300
+ api_key="YOUR_API_KEY",
301
+ )
302
+ client.conversational_ai.agents.update(
303
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
304
+ enable_versioning_if_not_enabled=True,
305
+ branch_id="branch_id",
306
+ include_procedure_generated_workflow_elements=True,
307
+ )
308
+ """
309
+ _response = self._raw_client.update(
310
+ agent_id,
311
+ enable_versioning_if_not_enabled=enable_versioning_if_not_enabled,
312
+ branch_id=branch_id,
313
+ include_procedure_generated_workflow_elements=include_procedure_generated_workflow_elements,
314
+ conversation_config=conversation_config,
315
+ platform_settings=platform_settings,
316
+ workflow=workflow,
317
+ name=name,
318
+ tags=tags,
319
+ version_description=version_description,
320
+ procedures=procedures,
321
+ request_options=request_options,
322
+ )
323
+ return _response.data
324
+
325
+ def list(
326
+ self,
327
+ *,
328
+ page_size: typing.Optional[int] = None,
329
+ search: typing.Optional[str] = None,
330
+ archived: typing.Optional[bool] = None,
331
+ show_only_owned_agents: typing.Optional[bool] = None,
332
+ created_by_user_id: typing.Optional[str] = None,
333
+ tags: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
334
+ sort_direction: typing.Optional[SortDirection] = None,
335
+ sort_by: typing.Optional[AgentSortBy] = None,
336
+ cursor: typing.Optional[str] = None,
337
+ request_options: typing.Optional[RequestOptions] = None,
338
+ ) -> GetAgentsPageResponseModel:
339
+ """
340
+ Returns a list of your agents and their metadata.
341
+
342
+ Parameters
343
+ ----------
344
+ page_size : typing.Optional[int]
345
+ How many Agents to return at maximum. Can not exceed 100, defaults to 30.
346
+
347
+ search : typing.Optional[str]
348
+ Search by agents name.
349
+
350
+ archived : typing.Optional[bool]
351
+ Filter agents by archived status
352
+
353
+ show_only_owned_agents : typing.Optional[bool]
354
+ If set to true, the endpoint will omit any agents that were shared with you by someone else and include only the ones you own. Deprecated: use created_by_user_id instead.
355
+
356
+ created_by_user_id : typing.Optional[str]
357
+ Filter agents by creator user ID. When set, only agents created by this user are returned. Takes precedence over show_only_owned_agents. Use '@me' to refer to the authenticated user.
358
+
359
+ tags : typing.Optional[typing.Union[str, typing.Sequence[str]]]
360
+ Filter agents by tag. Repeat the parameter to match any of several tags.
361
+
362
+ sort_direction : typing.Optional[SortDirection]
363
+ The direction to sort the results
364
+
365
+ sort_by : typing.Optional[AgentSortBy]
366
+ The field to sort the results by
367
+
368
+ cursor : typing.Optional[str]
369
+ Used for fetching next page. Cursor is returned in the response.
370
+
371
+ request_options : typing.Optional[RequestOptions]
372
+ Request-specific configuration.
373
+
374
+ Returns
375
+ -------
376
+ GetAgentsPageResponseModel
377
+ Successful Response
378
+
379
+ Examples
380
+ --------
381
+ from elevenlabs import ElevenLabs
382
+
383
+ client = ElevenLabs(
384
+ api_key="YOUR_API_KEY",
385
+ )
386
+ client.conversational_ai.agents.list(
387
+ page_size=1,
388
+ search="search",
389
+ archived=True,
390
+ show_only_owned_agents=True,
391
+ created_by_user_id="created_by_user_id",
392
+ tags=["tags"],
393
+ sort_direction="asc",
394
+ sort_by="name",
395
+ cursor="cursor",
396
+ )
397
+ """
398
+ _response = self._raw_client.list(
399
+ page_size=page_size,
400
+ search=search,
401
+ archived=archived,
402
+ show_only_owned_agents=show_only_owned_agents,
403
+ created_by_user_id=created_by_user_id,
404
+ tags=tags,
405
+ sort_direction=sort_direction,
406
+ sort_by=sort_by,
407
+ cursor=cursor,
408
+ request_options=request_options,
409
+ )
410
+ return _response.data
411
+
412
+ def duplicate(
413
+ self,
414
+ agent_id: str,
415
+ *,
416
+ name: typing.Optional[str] = OMIT,
417
+ request_options: typing.Optional[RequestOptions] = None,
418
+ ) -> CreateAgentResponseModel:
419
+ """
420
+ Create a new agent by duplicating an existing one. The new agent gets a copy of every unarchived branch of the source agent, each with the same name and description and starting from the latest version on that branch. Version history, drafts, archived branches and traffic deployments are not copied, so the new agent routes all traffic to its main branch.
421
+
422
+ Parameters
423
+ ----------
424
+ agent_id : str
425
+ The id of an agent. This is returned on agent creation.
426
+
427
+ name : typing.Optional[str]
428
+ A name to make the agent easier to find
429
+
430
+ request_options : typing.Optional[RequestOptions]
431
+ Request-specific configuration.
432
+
433
+ Returns
434
+ -------
435
+ CreateAgentResponseModel
436
+ Successful Response
437
+
438
+ Examples
439
+ --------
440
+ from elevenlabs import ElevenLabs
441
+
442
+ client = ElevenLabs(
443
+ api_key="YOUR_API_KEY",
444
+ )
445
+ client.conversational_ai.agents.duplicate(
446
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
447
+ )
448
+ """
449
+ _response = self._raw_client.duplicate(agent_id, name=name, request_options=request_options)
450
+ return _response.data
451
+
452
+ def simulate_conversation(
453
+ self,
454
+ agent_id: str,
455
+ *,
456
+ simulation_specification: ConversationSimulationSpecification,
457
+ extra_evaluation_criteria: typing.Optional[typing.Sequence[PromptEvaluationCriteria]] = OMIT,
458
+ new_turns_limit: typing.Optional[int] = OMIT,
459
+ request_options: typing.Optional[RequestOptions] = None,
460
+ ) -> AgentSimulatedChatTestResponseModel:
461
+ """
462
+ Deprecated. This endpoint will be removed on 31 Oct 2026. Use the `/v1/convai/agent-testing/create` and `/v1/convai/agents/:agent_id/run-tests` endpoints to create and run simulations. Run a conversation between the agent and a simulated user.
463
+
464
+ Parameters
465
+ ----------
466
+ agent_id : str
467
+ The id of an agent. This is returned on agent creation.
468
+
469
+ simulation_specification : ConversationSimulationSpecification
470
+ A specification detailing how the conversation should be simulated
471
+
472
+ extra_evaluation_criteria : typing.Optional[typing.Sequence[PromptEvaluationCriteria]]
473
+ A list of evaluation criteria to test
474
+
475
+ new_turns_limit : typing.Optional[int]
476
+ Maximum number of new turns to generate in the conversation simulation
477
+
478
+ request_options : typing.Optional[RequestOptions]
479
+ Request-specific configuration.
480
+
481
+ Returns
482
+ -------
483
+ AgentSimulatedChatTestResponseModel
484
+ Successful Response
485
+
486
+ Examples
487
+ --------
488
+ from elevenlabs import (
489
+ AgentConfig,
490
+ ConversationSimulationSpecification,
491
+ ElevenLabs,
492
+ )
493
+
494
+ client = ElevenLabs(
495
+ api_key="YOUR_API_KEY",
496
+ )
497
+ client.conversational_ai.agents.simulate_conversation(
498
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
499
+ simulation_specification=ConversationSimulationSpecification(
500
+ simulated_user_config=AgentConfig(
501
+ first_message="Hello, how can I help you today?",
502
+ language="en",
503
+ disable_first_message_interruptions=False,
504
+ ),
505
+ ),
506
+ )
507
+ """
508
+ _response = self._raw_client.simulate_conversation(
509
+ agent_id,
510
+ simulation_specification=simulation_specification,
511
+ extra_evaluation_criteria=extra_evaluation_criteria,
512
+ new_turns_limit=new_turns_limit,
513
+ request_options=request_options,
514
+ )
515
+ return _response.data
516
+
517
+ def simulate_conversation_stream(
518
+ self,
519
+ agent_id: str,
520
+ *,
521
+ simulation_specification: ConversationSimulationSpecification,
522
+ extra_evaluation_criteria: typing.Optional[typing.Sequence[PromptEvaluationCriteria]] = OMIT,
523
+ new_turns_limit: typing.Optional[int] = OMIT,
524
+ request_options: typing.Optional[RequestOptions] = None,
525
+ ) -> None:
526
+ """
527
+ Deprecated. This endpoint will be removed on 31 Oct 2026. Use the `/v1/convai/agent-testing/create` and `/v1/convai/agents/:agent_id/run-tests` endpoints to create and run simulations. Run a conversation between the agent and a simulated user and stream back the response. Response is streamed back as partial lists of messages that should be concatenated and once the conversation has complete a single final message with the conversation analysis will be sent.
528
+
529
+ Parameters
530
+ ----------
531
+ agent_id : str
532
+ The id of an agent. This is returned on agent creation.
533
+
534
+ simulation_specification : ConversationSimulationSpecification
535
+ A specification detailing how the conversation should be simulated
536
+
537
+ extra_evaluation_criteria : typing.Optional[typing.Sequence[PromptEvaluationCriteria]]
538
+ A list of evaluation criteria to test
539
+
540
+ new_turns_limit : typing.Optional[int]
541
+ Maximum number of new turns to generate in the conversation simulation
542
+
543
+ request_options : typing.Optional[RequestOptions]
544
+ Request-specific configuration.
545
+
546
+ Returns
547
+ -------
548
+ None
549
+
550
+ Examples
551
+ --------
552
+ from elevenlabs import (
553
+ AgentConfig,
554
+ ConversationSimulationSpecification,
555
+ ElevenLabs,
556
+ )
557
+
558
+ client = ElevenLabs(
559
+ api_key="YOUR_API_KEY",
560
+ )
561
+ client.conversational_ai.agents.simulate_conversation_stream(
562
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
563
+ simulation_specification=ConversationSimulationSpecification(
564
+ simulated_user_config=AgentConfig(
565
+ first_message="Hello, how can I help you today?",
566
+ language="en",
567
+ disable_first_message_interruptions=False,
568
+ ),
569
+ ),
570
+ )
571
+ """
572
+ _response = self._raw_client.simulate_conversation_stream(
573
+ agent_id,
574
+ simulation_specification=simulation_specification,
575
+ extra_evaluation_criteria=extra_evaluation_criteria,
576
+ new_turns_limit=new_turns_limit,
577
+ request_options=request_options,
578
+ )
579
+ return _response.data
580
+
581
+ def run_tests(
582
+ self,
583
+ agent_id: str,
584
+ *,
585
+ tests: typing.Sequence[SingleTestRunRequestModel],
586
+ agent_config_override: typing.Optional[AdhocAgentConfigOverrideForTestRequestModel] = OMIT,
587
+ branch_id: typing.Optional[str] = OMIT,
588
+ repeat_count: typing.Optional[int] = OMIT,
589
+ request_options: typing.Optional[RequestOptions] = None,
590
+ ) -> GetTestSuiteInvocationResponseModel:
591
+ """
592
+ Run selected tests on the agent with provided configuration. If the agent configuration is provided, it will be used to override default agent configuration.
593
+
594
+ Parameters
595
+ ----------
596
+ agent_id : str
597
+ The id of an agent. This is returned on agent creation.
598
+
599
+ tests : typing.Sequence[SingleTestRunRequestModel]
600
+ List of tests to run on the agent
601
+
602
+ agent_config_override : typing.Optional[AdhocAgentConfigOverrideForTestRequestModel]
603
+ Configuration overrides to use for testing. If not provided, the agent's default configuration will be used.
604
+
605
+ branch_id : typing.Optional[str]
606
+ ID of the branch to run the tests on. If not provided, the tests will be run on the agent's main branch.
607
+
608
+ repeat_count : typing.Optional[int]
609
+ Number of times to run each test. When greater than 1, results are grouped and summarized.
610
+
611
+ request_options : typing.Optional[RequestOptions]
612
+ Request-specific configuration.
613
+
614
+ Returns
615
+ -------
616
+ GetTestSuiteInvocationResponseModel
617
+ Successful Response
618
+
619
+ Examples
620
+ --------
621
+ from elevenlabs import ElevenLabs, SingleTestRunRequestModel
622
+
623
+ client = ElevenLabs(
624
+ api_key="YOUR_API_KEY",
625
+ )
626
+ client.conversational_ai.agents.run_tests(
627
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
628
+ tests=[
629
+ SingleTestRunRequestModel(
630
+ test_id="test_id",
631
+ )
632
+ ],
633
+ )
634
+ """
635
+ _response = self._raw_client.run_tests(
636
+ agent_id,
637
+ tests=tests,
638
+ agent_config_override=agent_config_override,
639
+ branch_id=branch_id,
640
+ repeat_count=repeat_count,
641
+ request_options=request_options,
642
+ )
643
+ return _response.data
644
+
645
+ @property
646
+ def summaries(self):
647
+ if self._summaries is None:
648
+ from .summaries.client import SummariesClient # noqa: E402
649
+
650
+ self._summaries = SummariesClient(client_wrapper=self._client_wrapper)
651
+ return self._summaries
652
+
653
+ @property
654
+ def widget(self):
655
+ if self._widget is None:
656
+ from .widget.client import WidgetClient # noqa: E402
657
+
658
+ self._widget = WidgetClient(client_wrapper=self._client_wrapper)
659
+ return self._widget
660
+
661
+ @property
662
+ def link(self):
663
+ if self._link is None:
664
+ from .link.client import LinkClient # noqa: E402
665
+
666
+ self._link = LinkClient(client_wrapper=self._client_wrapper)
667
+ return self._link
668
+
669
+ @property
670
+ def hold_audio(self):
671
+ if self._hold_audio is None:
672
+ from .hold_audio.client import HoldAudioClient # noqa: E402
673
+
674
+ self._hold_audio = HoldAudioClient(client_wrapper=self._client_wrapper)
675
+ return self._hold_audio
676
+
677
+ @property
678
+ def knowledge_base(self):
679
+ if self._knowledge_base is None:
680
+ from .knowledge_base.client import KnowledgeBaseClient # noqa: E402
681
+
682
+ self._knowledge_base = KnowledgeBaseClient(client_wrapper=self._client_wrapper)
683
+ return self._knowledge_base
684
+
685
+ @property
686
+ def llm_usage(self):
687
+ if self._llm_usage is None:
688
+ from .llm_usage.client import LlmUsageClient # noqa: E402
689
+
690
+ self._llm_usage = LlmUsageClient(client_wrapper=self._client_wrapper)
691
+ return self._llm_usage
692
+
693
+ @property
694
+ def branches(self):
695
+ if self._branches is None:
696
+ from .branches.client import BranchesClient # noqa: E402
697
+
698
+ self._branches = BranchesClient(client_wrapper=self._client_wrapper)
699
+ return self._branches
700
+
701
+ @property
702
+ def versions(self):
703
+ if self._versions is None:
704
+ from .versions.client import VersionsClient # noqa: E402
705
+
706
+ self._versions = VersionsClient(client_wrapper=self._client_wrapper)
707
+ return self._versions
708
+
709
+ @property
710
+ def deployments(self):
711
+ if self._deployments is None:
712
+ from .deployments.client import DeploymentsClient # noqa: E402
713
+
714
+ self._deployments = DeploymentsClient(client_wrapper=self._client_wrapper)
715
+ return self._deployments
716
+
717
+ @property
718
+ def drafts(self):
719
+ if self._drafts is None:
720
+ from .drafts.client import DraftsClient # noqa: E402
721
+
722
+ self._drafts = DraftsClient(client_wrapper=self._client_wrapper)
723
+ return self._drafts
724
+
725
+ @property
726
+ def merge_proposals(self):
727
+ if self._merge_proposals is None:
728
+ from .merge_proposals.client import MergeProposalsClient # noqa: E402
729
+
730
+ self._merge_proposals = MergeProposalsClient(client_wrapper=self._client_wrapper)
731
+ return self._merge_proposals
732
+
733
+ @property
734
+ def procedures(self):
735
+ if self._procedures is None:
736
+ from .procedures.client import ProceduresClient # noqa: E402
737
+
738
+ self._procedures = ProceduresClient(client_wrapper=self._client_wrapper)
739
+ return self._procedures
740
+
741
+
742
+ class AsyncAgentsClient:
743
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
744
+ self._raw_client = AsyncRawAgentsClient(client_wrapper=client_wrapper)
745
+ self._client_wrapper = client_wrapper
746
+ self._summaries: typing.Optional[AsyncSummariesClient] = None
747
+ self._widget: typing.Optional[AsyncWidgetClient] = None
748
+ self._link: typing.Optional[AsyncLinkClient] = None
749
+ self._hold_audio: typing.Optional[AsyncHoldAudioClient] = None
750
+ self._knowledge_base: typing.Optional[AsyncKnowledgeBaseClient] = None
751
+ self._llm_usage: typing.Optional[AsyncLlmUsageClient] = None
752
+ self._branches: typing.Optional[AsyncBranchesClient] = None
753
+ self._versions: typing.Optional[AsyncVersionsClient] = None
754
+ self._deployments: typing.Optional[AsyncDeploymentsClient] = None
755
+ self._drafts: typing.Optional[AsyncDraftsClient] = None
756
+ self._merge_proposals: typing.Optional[AsyncMergeProposalsClient] = None
757
+ self._procedures: typing.Optional[AsyncProceduresClient] = None
758
+
759
+ @property
760
+ def with_raw_response(self) -> AsyncRawAgentsClient:
761
+ """
762
+ Retrieves a raw implementation of this client that returns raw responses.
763
+
764
+ Returns
765
+ -------
766
+ AsyncRawAgentsClient
767
+ """
768
+ return self._raw_client
769
+
770
+ async def create(
771
+ self,
772
+ *,
773
+ conversation_config: ConversationalConfig,
774
+ enable_versioning: typing.Optional[bool] = None,
775
+ platform_settings: typing.Optional[AgentPlatformSettingsRequestModel] = OMIT,
776
+ workflow: typing.Optional[AgentWorkflowRequestModel] = OMIT,
777
+ name: typing.Optional[str] = OMIT,
778
+ tags: typing.Optional[typing.Sequence[str]] = OMIT,
779
+ request_options: typing.Optional[RequestOptions] = None,
780
+ ) -> CreateAgentResponseModel:
781
+ """
782
+ Create an agent from a config object
783
+
784
+ Parameters
785
+ ----------
786
+ conversation_config : ConversationalConfig
787
+ Conversation configuration for an agent
788
+
789
+ enable_versioning : typing.Optional[bool]
790
+ Deprecated: all agents are versioned. This parameter is ignored.
791
+
792
+ platform_settings : typing.Optional[AgentPlatformSettingsRequestModel]
793
+ Platform settings for the agent are all settings that aren't related to the conversation orchestration and content.
794
+
795
+ workflow : typing.Optional[AgentWorkflowRequestModel]
796
+ Workflow for the agent. This is used to define the flow of the conversation and how the agent interacts with tools.
797
+
798
+ name : typing.Optional[str]
799
+ A name to make the agent easier to find
800
+
801
+ tags : typing.Optional[typing.Sequence[str]]
802
+ Tags to help classify and filter the agent
803
+
804
+ request_options : typing.Optional[RequestOptions]
805
+ Request-specific configuration.
806
+
807
+ Returns
808
+ -------
809
+ CreateAgentResponseModel
810
+ Successful Response
811
+
812
+ Examples
813
+ --------
814
+ import asyncio
815
+
816
+ from elevenlabs import AsyncElevenLabs, ConversationalConfig
817
+
818
+ client = AsyncElevenLabs(
819
+ api_key="YOUR_API_KEY",
820
+ )
821
+
822
+
823
+ async def main() -> None:
824
+ await client.conversational_ai.agents.create(
825
+ enable_versioning=True,
826
+ conversation_config=ConversationalConfig(),
827
+ )
828
+
829
+
830
+ asyncio.run(main())
831
+ """
832
+ _response = await self._raw_client.create(
833
+ conversation_config=conversation_config,
834
+ enable_versioning=enable_versioning,
835
+ platform_settings=platform_settings,
836
+ workflow=workflow,
837
+ name=name,
838
+ tags=tags,
839
+ request_options=request_options,
840
+ )
841
+ return _response.data
842
+
843
+ async def get(
844
+ self,
845
+ agent_id: str,
846
+ *,
847
+ version_id: typing.Optional[str] = None,
848
+ branch_id: typing.Optional[str] = None,
849
+ include_procedure_generated_workflow_elements: typing.Optional[bool] = None,
850
+ request_options: typing.Optional[RequestOptions] = None,
851
+ ) -> GetAgentResponseModel:
852
+ """
853
+ Retrieve config for an agent
854
+
855
+ Parameters
856
+ ----------
857
+ agent_id : str
858
+ The id of an agent. This is returned on agent creation.
859
+
860
+ version_id : typing.Optional[str]
861
+ The ID of the agent version to use
862
+
863
+ branch_id : typing.Optional[str]
864
+ The ID of the branch to use
865
+
866
+ include_procedure_generated_workflow_elements : typing.Optional[bool]
867
+ Whether to include the workflow nodes and edges generated from structured procedures. When false, the workflow contains only authored elements.
868
+
869
+ request_options : typing.Optional[RequestOptions]
870
+ Request-specific configuration.
871
+
872
+ Returns
873
+ -------
874
+ GetAgentResponseModel
875
+ Successful Response
876
+
877
+ Examples
878
+ --------
879
+ import asyncio
880
+
881
+ from elevenlabs import AsyncElevenLabs
882
+
883
+ client = AsyncElevenLabs(
884
+ api_key="YOUR_API_KEY",
885
+ )
886
+
887
+
888
+ async def main() -> None:
889
+ await client.conversational_ai.agents.get(
890
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
891
+ version_id="version_id",
892
+ branch_id="branch_id",
893
+ include_procedure_generated_workflow_elements=True,
894
+ )
895
+
896
+
897
+ asyncio.run(main())
898
+ """
899
+ _response = await self._raw_client.get(
900
+ agent_id,
901
+ version_id=version_id,
902
+ branch_id=branch_id,
903
+ include_procedure_generated_workflow_elements=include_procedure_generated_workflow_elements,
904
+ request_options=request_options,
905
+ )
906
+ return _response.data
907
+
908
+ async def delete(
909
+ self,
910
+ agent_id: str,
911
+ *,
912
+ force: typing.Optional[bool] = None,
913
+ request_options: typing.Optional[RequestOptions] = None,
914
+ ) -> None:
915
+ """
916
+ Delete an agent
917
+
918
+ Parameters
919
+ ----------
920
+ agent_id : str
921
+ The id of an agent. This is returned on agent creation.
922
+
923
+ force : typing.Optional[bool]
924
+ If set to true, the agent is deleted even if other agents use it as a subagent, and it is removed from those agents and their branches.
925
+
926
+ request_options : typing.Optional[RequestOptions]
927
+ Request-specific configuration.
928
+
929
+ Returns
930
+ -------
931
+ None
932
+
933
+ Examples
934
+ --------
935
+ import asyncio
936
+
937
+ from elevenlabs import AsyncElevenLabs
938
+
939
+ client = AsyncElevenLabs(
940
+ api_key="YOUR_API_KEY",
941
+ )
942
+
943
+
944
+ async def main() -> None:
945
+ await client.conversational_ai.agents.delete(
946
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
947
+ force=True,
948
+ )
949
+
950
+
951
+ asyncio.run(main())
952
+ """
953
+ _response = await self._raw_client.delete(agent_id, force=force, request_options=request_options)
954
+ return _response.data
955
+
956
+ async def update(
957
+ self,
958
+ agent_id: str,
959
+ *,
960
+ enable_versioning_if_not_enabled: typing.Optional[bool] = None,
961
+ branch_id: typing.Optional[str] = None,
962
+ include_procedure_generated_workflow_elements: typing.Optional[bool] = None,
963
+ conversation_config: typing.Optional[ConversationalConfig] = OMIT,
964
+ platform_settings: typing.Optional[AgentPlatformSettingsRequestModel] = OMIT,
965
+ workflow: typing.Optional[AgentWorkflowRequestModel] = OMIT,
966
+ name: typing.Optional[str] = OMIT,
967
+ tags: typing.Optional[typing.Sequence[str]] = OMIT,
968
+ version_description: typing.Optional[str] = OMIT,
969
+ procedures: typing.Optional[typing.Dict[str, typing.Optional[ProcedureVersionRef]]] = OMIT,
970
+ request_options: typing.Optional[RequestOptions] = None,
971
+ ) -> GetAgentResponseModel:
972
+ """
973
+ Patches an Agent settings
974
+
975
+ Parameters
976
+ ----------
977
+ agent_id : str
978
+ The id of an agent. This is returned on agent creation.
979
+
980
+ enable_versioning_if_not_enabled : typing.Optional[bool]
981
+ Deprecated: all agents are versioned. This parameter is ignored.
982
+
983
+ branch_id : typing.Optional[str]
984
+ The ID of the branch to use
985
+
986
+ include_procedure_generated_workflow_elements : typing.Optional[bool]
987
+ Whether to include the workflow nodes and edges generated from structured procedures. When false, the workflow contains only authored elements.
988
+
989
+ conversation_config : typing.Optional[ConversationalConfig]
990
+ Conversation configuration for an agent
991
+
992
+ platform_settings : typing.Optional[AgentPlatformSettingsRequestModel]
993
+ Platform settings for the agent are all settings that aren't related to the conversation orchestration and content.
994
+
995
+ workflow : typing.Optional[AgentWorkflowRequestModel]
996
+ Workflow for the agent. This is used to define the flow of the conversation and how the agent interacts with tools.
997
+
998
+ name : typing.Optional[str]
999
+ A name to make the agent easier to find
1000
+
1001
+ tags : typing.Optional[typing.Sequence[str]]
1002
+ Tags to help classify and filter the agent
1003
+
1004
+ version_description : typing.Optional[str]
1005
+ Description for this version when publishing changes (only applicable for versioned agents)
1006
+
1007
+ procedures : typing.Optional[typing.Dict[str, typing.Optional[ProcedureVersionRef]]]
1008
+ Procedure versions to publish, keyed by procedure_id. When provided, this map replaces the procedures from the current draft or branch tip. When omitted or null, unpublished procedure edits are used if present; otherwise, the branch tip's procedures are retained. Pass an empty object to remove all procedures.
1009
+
1010
+ request_options : typing.Optional[RequestOptions]
1011
+ Request-specific configuration.
1012
+
1013
+ Returns
1014
+ -------
1015
+ GetAgentResponseModel
1016
+ Successful Response
1017
+
1018
+ Examples
1019
+ --------
1020
+ import asyncio
1021
+
1022
+ from elevenlabs import AsyncElevenLabs
1023
+
1024
+ client = AsyncElevenLabs(
1025
+ api_key="YOUR_API_KEY",
1026
+ )
1027
+
1028
+
1029
+ async def main() -> None:
1030
+ await client.conversational_ai.agents.update(
1031
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
1032
+ enable_versioning_if_not_enabled=True,
1033
+ branch_id="branch_id",
1034
+ include_procedure_generated_workflow_elements=True,
1035
+ )
1036
+
1037
+
1038
+ asyncio.run(main())
1039
+ """
1040
+ _response = await self._raw_client.update(
1041
+ agent_id,
1042
+ enable_versioning_if_not_enabled=enable_versioning_if_not_enabled,
1043
+ branch_id=branch_id,
1044
+ include_procedure_generated_workflow_elements=include_procedure_generated_workflow_elements,
1045
+ conversation_config=conversation_config,
1046
+ platform_settings=platform_settings,
1047
+ workflow=workflow,
1048
+ name=name,
1049
+ tags=tags,
1050
+ version_description=version_description,
1051
+ procedures=procedures,
1052
+ request_options=request_options,
1053
+ )
1054
+ return _response.data
1055
+
1056
+ async def list(
1057
+ self,
1058
+ *,
1059
+ page_size: typing.Optional[int] = None,
1060
+ search: typing.Optional[str] = None,
1061
+ archived: typing.Optional[bool] = None,
1062
+ show_only_owned_agents: typing.Optional[bool] = None,
1063
+ created_by_user_id: typing.Optional[str] = None,
1064
+ tags: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
1065
+ sort_direction: typing.Optional[SortDirection] = None,
1066
+ sort_by: typing.Optional[AgentSortBy] = None,
1067
+ cursor: typing.Optional[str] = None,
1068
+ request_options: typing.Optional[RequestOptions] = None,
1069
+ ) -> GetAgentsPageResponseModel:
1070
+ """
1071
+ Returns a list of your agents and their metadata.
1072
+
1073
+ Parameters
1074
+ ----------
1075
+ page_size : typing.Optional[int]
1076
+ How many Agents to return at maximum. Can not exceed 100, defaults to 30.
1077
+
1078
+ search : typing.Optional[str]
1079
+ Search by agents name.
1080
+
1081
+ archived : typing.Optional[bool]
1082
+ Filter agents by archived status
1083
+
1084
+ show_only_owned_agents : typing.Optional[bool]
1085
+ If set to true, the endpoint will omit any agents that were shared with you by someone else and include only the ones you own. Deprecated: use created_by_user_id instead.
1086
+
1087
+ created_by_user_id : typing.Optional[str]
1088
+ Filter agents by creator user ID. When set, only agents created by this user are returned. Takes precedence over show_only_owned_agents. Use '@me' to refer to the authenticated user.
1089
+
1090
+ tags : typing.Optional[typing.Union[str, typing.Sequence[str]]]
1091
+ Filter agents by tag. Repeat the parameter to match any of several tags.
1092
+
1093
+ sort_direction : typing.Optional[SortDirection]
1094
+ The direction to sort the results
1095
+
1096
+ sort_by : typing.Optional[AgentSortBy]
1097
+ The field to sort the results by
1098
+
1099
+ cursor : typing.Optional[str]
1100
+ Used for fetching next page. Cursor is returned in the response.
1101
+
1102
+ request_options : typing.Optional[RequestOptions]
1103
+ Request-specific configuration.
1104
+
1105
+ Returns
1106
+ -------
1107
+ GetAgentsPageResponseModel
1108
+ Successful Response
1109
+
1110
+ Examples
1111
+ --------
1112
+ import asyncio
1113
+
1114
+ from elevenlabs import AsyncElevenLabs
1115
+
1116
+ client = AsyncElevenLabs(
1117
+ api_key="YOUR_API_KEY",
1118
+ )
1119
+
1120
+
1121
+ async def main() -> None:
1122
+ await client.conversational_ai.agents.list(
1123
+ page_size=1,
1124
+ search="search",
1125
+ archived=True,
1126
+ show_only_owned_agents=True,
1127
+ created_by_user_id="created_by_user_id",
1128
+ tags=["tags"],
1129
+ sort_direction="asc",
1130
+ sort_by="name",
1131
+ cursor="cursor",
1132
+ )
1133
+
1134
+
1135
+ asyncio.run(main())
1136
+ """
1137
+ _response = await self._raw_client.list(
1138
+ page_size=page_size,
1139
+ search=search,
1140
+ archived=archived,
1141
+ show_only_owned_agents=show_only_owned_agents,
1142
+ created_by_user_id=created_by_user_id,
1143
+ tags=tags,
1144
+ sort_direction=sort_direction,
1145
+ sort_by=sort_by,
1146
+ cursor=cursor,
1147
+ request_options=request_options,
1148
+ )
1149
+ return _response.data
1150
+
1151
+ async def duplicate(
1152
+ self,
1153
+ agent_id: str,
1154
+ *,
1155
+ name: typing.Optional[str] = OMIT,
1156
+ request_options: typing.Optional[RequestOptions] = None,
1157
+ ) -> CreateAgentResponseModel:
1158
+ """
1159
+ Create a new agent by duplicating an existing one. The new agent gets a copy of every unarchived branch of the source agent, each with the same name and description and starting from the latest version on that branch. Version history, drafts, archived branches and traffic deployments are not copied, so the new agent routes all traffic to its main branch.
1160
+
1161
+ Parameters
1162
+ ----------
1163
+ agent_id : str
1164
+ The id of an agent. This is returned on agent creation.
1165
+
1166
+ name : typing.Optional[str]
1167
+ A name to make the agent easier to find
1168
+
1169
+ request_options : typing.Optional[RequestOptions]
1170
+ Request-specific configuration.
1171
+
1172
+ Returns
1173
+ -------
1174
+ CreateAgentResponseModel
1175
+ Successful Response
1176
+
1177
+ Examples
1178
+ --------
1179
+ import asyncio
1180
+
1181
+ from elevenlabs import AsyncElevenLabs
1182
+
1183
+ client = AsyncElevenLabs(
1184
+ api_key="YOUR_API_KEY",
1185
+ )
1186
+
1187
+
1188
+ async def main() -> None:
1189
+ await client.conversational_ai.agents.duplicate(
1190
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
1191
+ )
1192
+
1193
+
1194
+ asyncio.run(main())
1195
+ """
1196
+ _response = await self._raw_client.duplicate(agent_id, name=name, request_options=request_options)
1197
+ return _response.data
1198
+
1199
+ async def simulate_conversation(
1200
+ self,
1201
+ agent_id: str,
1202
+ *,
1203
+ simulation_specification: ConversationSimulationSpecification,
1204
+ extra_evaluation_criteria: typing.Optional[typing.Sequence[PromptEvaluationCriteria]] = OMIT,
1205
+ new_turns_limit: typing.Optional[int] = OMIT,
1206
+ request_options: typing.Optional[RequestOptions] = None,
1207
+ ) -> AgentSimulatedChatTestResponseModel:
1208
+ """
1209
+ Deprecated. This endpoint will be removed on 31 Oct 2026. Use the `/v1/convai/agent-testing/create` and `/v1/convai/agents/:agent_id/run-tests` endpoints to create and run simulations. Run a conversation between the agent and a simulated user.
1210
+
1211
+ Parameters
1212
+ ----------
1213
+ agent_id : str
1214
+ The id of an agent. This is returned on agent creation.
1215
+
1216
+ simulation_specification : ConversationSimulationSpecification
1217
+ A specification detailing how the conversation should be simulated
1218
+
1219
+ extra_evaluation_criteria : typing.Optional[typing.Sequence[PromptEvaluationCriteria]]
1220
+ A list of evaluation criteria to test
1221
+
1222
+ new_turns_limit : typing.Optional[int]
1223
+ Maximum number of new turns to generate in the conversation simulation
1224
+
1225
+ request_options : typing.Optional[RequestOptions]
1226
+ Request-specific configuration.
1227
+
1228
+ Returns
1229
+ -------
1230
+ AgentSimulatedChatTestResponseModel
1231
+ Successful Response
1232
+
1233
+ Examples
1234
+ --------
1235
+ import asyncio
1236
+
1237
+ from elevenlabs import (
1238
+ AgentConfig,
1239
+ AsyncElevenLabs,
1240
+ ConversationSimulationSpecification,
1241
+ )
1242
+
1243
+ client = AsyncElevenLabs(
1244
+ api_key="YOUR_API_KEY",
1245
+ )
1246
+
1247
+
1248
+ async def main() -> None:
1249
+ await client.conversational_ai.agents.simulate_conversation(
1250
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
1251
+ simulation_specification=ConversationSimulationSpecification(
1252
+ simulated_user_config=AgentConfig(
1253
+ first_message="Hello, how can I help you today?",
1254
+ language="en",
1255
+ disable_first_message_interruptions=False,
1256
+ ),
1257
+ ),
1258
+ )
1259
+
1260
+
1261
+ asyncio.run(main())
1262
+ """
1263
+ _response = await self._raw_client.simulate_conversation(
1264
+ agent_id,
1265
+ simulation_specification=simulation_specification,
1266
+ extra_evaluation_criteria=extra_evaluation_criteria,
1267
+ new_turns_limit=new_turns_limit,
1268
+ request_options=request_options,
1269
+ )
1270
+ return _response.data
1271
+
1272
+ async def simulate_conversation_stream(
1273
+ self,
1274
+ agent_id: str,
1275
+ *,
1276
+ simulation_specification: ConversationSimulationSpecification,
1277
+ extra_evaluation_criteria: typing.Optional[typing.Sequence[PromptEvaluationCriteria]] = OMIT,
1278
+ new_turns_limit: typing.Optional[int] = OMIT,
1279
+ request_options: typing.Optional[RequestOptions] = None,
1280
+ ) -> None:
1281
+ """
1282
+ Deprecated. This endpoint will be removed on 31 Oct 2026. Use the `/v1/convai/agent-testing/create` and `/v1/convai/agents/:agent_id/run-tests` endpoints to create and run simulations. Run a conversation between the agent and a simulated user and stream back the response. Response is streamed back as partial lists of messages that should be concatenated and once the conversation has complete a single final message with the conversation analysis will be sent.
1283
+
1284
+ Parameters
1285
+ ----------
1286
+ agent_id : str
1287
+ The id of an agent. This is returned on agent creation.
1288
+
1289
+ simulation_specification : ConversationSimulationSpecification
1290
+ A specification detailing how the conversation should be simulated
1291
+
1292
+ extra_evaluation_criteria : typing.Optional[typing.Sequence[PromptEvaluationCriteria]]
1293
+ A list of evaluation criteria to test
1294
+
1295
+ new_turns_limit : typing.Optional[int]
1296
+ Maximum number of new turns to generate in the conversation simulation
1297
+
1298
+ request_options : typing.Optional[RequestOptions]
1299
+ Request-specific configuration.
1300
+
1301
+ Returns
1302
+ -------
1303
+ None
1304
+
1305
+ Examples
1306
+ --------
1307
+ import asyncio
1308
+
1309
+ from elevenlabs import (
1310
+ AgentConfig,
1311
+ AsyncElevenLabs,
1312
+ ConversationSimulationSpecification,
1313
+ )
1314
+
1315
+ client = AsyncElevenLabs(
1316
+ api_key="YOUR_API_KEY",
1317
+ )
1318
+
1319
+
1320
+ async def main() -> None:
1321
+ await client.conversational_ai.agents.simulate_conversation_stream(
1322
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
1323
+ simulation_specification=ConversationSimulationSpecification(
1324
+ simulated_user_config=AgentConfig(
1325
+ first_message="Hello, how can I help you today?",
1326
+ language="en",
1327
+ disable_first_message_interruptions=False,
1328
+ ),
1329
+ ),
1330
+ )
1331
+
1332
+
1333
+ asyncio.run(main())
1334
+ """
1335
+ _response = await self._raw_client.simulate_conversation_stream(
1336
+ agent_id,
1337
+ simulation_specification=simulation_specification,
1338
+ extra_evaluation_criteria=extra_evaluation_criteria,
1339
+ new_turns_limit=new_turns_limit,
1340
+ request_options=request_options,
1341
+ )
1342
+ return _response.data
1343
+
1344
+ async def run_tests(
1345
+ self,
1346
+ agent_id: str,
1347
+ *,
1348
+ tests: typing.Sequence[SingleTestRunRequestModel],
1349
+ agent_config_override: typing.Optional[AdhocAgentConfigOverrideForTestRequestModel] = OMIT,
1350
+ branch_id: typing.Optional[str] = OMIT,
1351
+ repeat_count: typing.Optional[int] = OMIT,
1352
+ request_options: typing.Optional[RequestOptions] = None,
1353
+ ) -> GetTestSuiteInvocationResponseModel:
1354
+ """
1355
+ Run selected tests on the agent with provided configuration. If the agent configuration is provided, it will be used to override default agent configuration.
1356
+
1357
+ Parameters
1358
+ ----------
1359
+ agent_id : str
1360
+ The id of an agent. This is returned on agent creation.
1361
+
1362
+ tests : typing.Sequence[SingleTestRunRequestModel]
1363
+ List of tests to run on the agent
1364
+
1365
+ agent_config_override : typing.Optional[AdhocAgentConfigOverrideForTestRequestModel]
1366
+ Configuration overrides to use for testing. If not provided, the agent's default configuration will be used.
1367
+
1368
+ branch_id : typing.Optional[str]
1369
+ ID of the branch to run the tests on. If not provided, the tests will be run on the agent's main branch.
1370
+
1371
+ repeat_count : typing.Optional[int]
1372
+ Number of times to run each test. When greater than 1, results are grouped and summarized.
1373
+
1374
+ request_options : typing.Optional[RequestOptions]
1375
+ Request-specific configuration.
1376
+
1377
+ Returns
1378
+ -------
1379
+ GetTestSuiteInvocationResponseModel
1380
+ Successful Response
1381
+
1382
+ Examples
1383
+ --------
1384
+ import asyncio
1385
+
1386
+ from elevenlabs import AsyncElevenLabs, SingleTestRunRequestModel
1387
+
1388
+ client = AsyncElevenLabs(
1389
+ api_key="YOUR_API_KEY",
1390
+ )
1391
+
1392
+
1393
+ async def main() -> None:
1394
+ await client.conversational_ai.agents.run_tests(
1395
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
1396
+ tests=[
1397
+ SingleTestRunRequestModel(
1398
+ test_id="test_id",
1399
+ )
1400
+ ],
1401
+ )
1402
+
1403
+
1404
+ asyncio.run(main())
1405
+ """
1406
+ _response = await self._raw_client.run_tests(
1407
+ agent_id,
1408
+ tests=tests,
1409
+ agent_config_override=agent_config_override,
1410
+ branch_id=branch_id,
1411
+ repeat_count=repeat_count,
1412
+ request_options=request_options,
1413
+ )
1414
+ return _response.data
1415
+
1416
+ @property
1417
+ def summaries(self):
1418
+ if self._summaries is None:
1419
+ from .summaries.client import AsyncSummariesClient # noqa: E402
1420
+
1421
+ self._summaries = AsyncSummariesClient(client_wrapper=self._client_wrapper)
1422
+ return self._summaries
1423
+
1424
+ @property
1425
+ def widget(self):
1426
+ if self._widget is None:
1427
+ from .widget.client import AsyncWidgetClient # noqa: E402
1428
+
1429
+ self._widget = AsyncWidgetClient(client_wrapper=self._client_wrapper)
1430
+ return self._widget
1431
+
1432
+ @property
1433
+ def link(self):
1434
+ if self._link is None:
1435
+ from .link.client import AsyncLinkClient # noqa: E402
1436
+
1437
+ self._link = AsyncLinkClient(client_wrapper=self._client_wrapper)
1438
+ return self._link
1439
+
1440
+ @property
1441
+ def hold_audio(self):
1442
+ if self._hold_audio is None:
1443
+ from .hold_audio.client import AsyncHoldAudioClient # noqa: E402
1444
+
1445
+ self._hold_audio = AsyncHoldAudioClient(client_wrapper=self._client_wrapper)
1446
+ return self._hold_audio
1447
+
1448
+ @property
1449
+ def knowledge_base(self):
1450
+ if self._knowledge_base is None:
1451
+ from .knowledge_base.client import AsyncKnowledgeBaseClient # noqa: E402
1452
+
1453
+ self._knowledge_base = AsyncKnowledgeBaseClient(client_wrapper=self._client_wrapper)
1454
+ return self._knowledge_base
1455
+
1456
+ @property
1457
+ def llm_usage(self):
1458
+ if self._llm_usage is None:
1459
+ from .llm_usage.client import AsyncLlmUsageClient # noqa: E402
1460
+
1461
+ self._llm_usage = AsyncLlmUsageClient(client_wrapper=self._client_wrapper)
1462
+ return self._llm_usage
1463
+
1464
+ @property
1465
+ def branches(self):
1466
+ if self._branches is None:
1467
+ from .branches.client import AsyncBranchesClient # noqa: E402
1468
+
1469
+ self._branches = AsyncBranchesClient(client_wrapper=self._client_wrapper)
1470
+ return self._branches
1471
+
1472
+ @property
1473
+ def versions(self):
1474
+ if self._versions is None:
1475
+ from .versions.client import AsyncVersionsClient # noqa: E402
1476
+
1477
+ self._versions = AsyncVersionsClient(client_wrapper=self._client_wrapper)
1478
+ return self._versions
1479
+
1480
+ @property
1481
+ def deployments(self):
1482
+ if self._deployments is None:
1483
+ from .deployments.client import AsyncDeploymentsClient # noqa: E402
1484
+
1485
+ self._deployments = AsyncDeploymentsClient(client_wrapper=self._client_wrapper)
1486
+ return self._deployments
1487
+
1488
+ @property
1489
+ def drafts(self):
1490
+ if self._drafts is None:
1491
+ from .drafts.client import AsyncDraftsClient # noqa: E402
1492
+
1493
+ self._drafts = AsyncDraftsClient(client_wrapper=self._client_wrapper)
1494
+ return self._drafts
1495
+
1496
+ @property
1497
+ def merge_proposals(self):
1498
+ if self._merge_proposals is None:
1499
+ from .merge_proposals.client import AsyncMergeProposalsClient # noqa: E402
1500
+
1501
+ self._merge_proposals = AsyncMergeProposalsClient(client_wrapper=self._client_wrapper)
1502
+ return self._merge_proposals
1503
+
1504
+ @property
1505
+ def procedures(self):
1506
+ if self._procedures is None:
1507
+ from .procedures.client import AsyncProceduresClient # noqa: E402
1508
+
1509
+ self._procedures = AsyncProceduresClient(client_wrapper=self._client_wrapper)
1510
+ return self._procedures
data/src/elevenlabs/conversational_ai/agents/deployments/__init__.py ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
data/src/elevenlabs/conversational_ai/agents/deployments/client.py ADDED
@@ -0,0 +1,269 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
6
+ from ....core.request_options import RequestOptions
7
+ from ....types.agent_deployment_request import AgentDeploymentRequest
8
+ from ....types.agent_deployment_response import AgentDeploymentResponse
9
+ from ....types.list_response_agent_deployment_history_item import ListResponseAgentDeploymentHistoryItem
10
+ from .raw_client import AsyncRawDeploymentsClient, RawDeploymentsClient
11
+
12
+ # this is used as the default value for optional parameters
13
+ OMIT = typing.cast(typing.Any, ...)
14
+
15
+
16
+ class DeploymentsClient:
17
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
18
+ self._raw_client = RawDeploymentsClient(client_wrapper=client_wrapper)
19
+
20
+ @property
21
+ def with_raw_response(self) -> RawDeploymentsClient:
22
+ """
23
+ Retrieves a raw implementation of this client that returns raw responses.
24
+
25
+ Returns
26
+ -------
27
+ RawDeploymentsClient
28
+ """
29
+ return self._raw_client
30
+
31
+ def list(
32
+ self,
33
+ agent_id: str,
34
+ *,
35
+ page: typing.Optional[int] = None,
36
+ page_size: typing.Optional[int] = None,
37
+ request_options: typing.Optional[RequestOptions] = None,
38
+ ) -> ListResponseAgentDeploymentHistoryItem:
39
+ """
40
+ List the traffic split history of an agent, newest first
41
+
42
+ Parameters
43
+ ----------
44
+ agent_id : str
45
+ The id of an agent. This is returned on agent creation.
46
+
47
+ page : typing.Optional[int]
48
+ Page number, starting at 1
49
+
50
+ page_size : typing.Optional[int]
51
+ How many results at most should be returned
52
+
53
+ request_options : typing.Optional[RequestOptions]
54
+ Request-specific configuration.
55
+
56
+ Returns
57
+ -------
58
+ ListResponseAgentDeploymentHistoryItem
59
+ Successful Response
60
+
61
+ Examples
62
+ --------
63
+ from elevenlabs import ElevenLabs
64
+
65
+ client = ElevenLabs(
66
+ api_key="YOUR_API_KEY",
67
+ )
68
+ client.conversational_ai.agents.deployments.list(
69
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
70
+ page=1,
71
+ page_size=1,
72
+ )
73
+ """
74
+ _response = self._raw_client.list(agent_id, page=page, page_size=page_size, request_options=request_options)
75
+ return _response.data
76
+
77
+ def create(
78
+ self,
79
+ agent_id: str,
80
+ *,
81
+ deployment_request: AgentDeploymentRequest,
82
+ request_options: typing.Optional[RequestOptions] = None,
83
+ ) -> AgentDeploymentResponse:
84
+ """
85
+ Create a new deployment for an agent
86
+
87
+ Parameters
88
+ ----------
89
+ agent_id : str
90
+ The id of an agent. This is returned on agent creation.
91
+
92
+ deployment_request : AgentDeploymentRequest
93
+ Request to create a new deployment
94
+
95
+ request_options : typing.Optional[RequestOptions]
96
+ Request-specific configuration.
97
+
98
+ Returns
99
+ -------
100
+ AgentDeploymentResponse
101
+ Successful Response
102
+
103
+ Examples
104
+ --------
105
+ from elevenlabs import (
106
+ AgentDeploymentPercentageStrategy,
107
+ AgentDeploymentRequest,
108
+ AgentDeploymentRequestItem,
109
+ ElevenLabs,
110
+ )
111
+
112
+ client = ElevenLabs(
113
+ api_key="YOUR_API_KEY",
114
+ )
115
+ client.conversational_ai.agents.deployments.create(
116
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
117
+ deployment_request=AgentDeploymentRequest(
118
+ requests=[
119
+ AgentDeploymentRequestItem(
120
+ branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj",
121
+ deployment_strategy=AgentDeploymentPercentageStrategy(
122
+ traffic_percentage=0.5,
123
+ ),
124
+ )
125
+ ],
126
+ ),
127
+ )
128
+ """
129
+ _response = self._raw_client.create(
130
+ agent_id, deployment_request=deployment_request, request_options=request_options
131
+ )
132
+ return _response.data
133
+
134
+
135
+ class AsyncDeploymentsClient:
136
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
137
+ self._raw_client = AsyncRawDeploymentsClient(client_wrapper=client_wrapper)
138
+
139
+ @property
140
+ def with_raw_response(self) -> AsyncRawDeploymentsClient:
141
+ """
142
+ Retrieves a raw implementation of this client that returns raw responses.
143
+
144
+ Returns
145
+ -------
146
+ AsyncRawDeploymentsClient
147
+ """
148
+ return self._raw_client
149
+
150
+ async def list(
151
+ self,
152
+ agent_id: str,
153
+ *,
154
+ page: typing.Optional[int] = None,
155
+ page_size: typing.Optional[int] = None,
156
+ request_options: typing.Optional[RequestOptions] = None,
157
+ ) -> ListResponseAgentDeploymentHistoryItem:
158
+ """
159
+ List the traffic split history of an agent, newest first
160
+
161
+ Parameters
162
+ ----------
163
+ agent_id : str
164
+ The id of an agent. This is returned on agent creation.
165
+
166
+ page : typing.Optional[int]
167
+ Page number, starting at 1
168
+
169
+ page_size : typing.Optional[int]
170
+ How many results at most should be returned
171
+
172
+ request_options : typing.Optional[RequestOptions]
173
+ Request-specific configuration.
174
+
175
+ Returns
176
+ -------
177
+ ListResponseAgentDeploymentHistoryItem
178
+ Successful Response
179
+
180
+ Examples
181
+ --------
182
+ import asyncio
183
+
184
+ from elevenlabs import AsyncElevenLabs
185
+
186
+ client = AsyncElevenLabs(
187
+ api_key="YOUR_API_KEY",
188
+ )
189
+
190
+
191
+ async def main() -> None:
192
+ await client.conversational_ai.agents.deployments.list(
193
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
194
+ page=1,
195
+ page_size=1,
196
+ )
197
+
198
+
199
+ asyncio.run(main())
200
+ """
201
+ _response = await self._raw_client.list(
202
+ agent_id, page=page, page_size=page_size, request_options=request_options
203
+ )
204
+ return _response.data
205
+
206
+ async def create(
207
+ self,
208
+ agent_id: str,
209
+ *,
210
+ deployment_request: AgentDeploymentRequest,
211
+ request_options: typing.Optional[RequestOptions] = None,
212
+ ) -> AgentDeploymentResponse:
213
+ """
214
+ Create a new deployment for an agent
215
+
216
+ Parameters
217
+ ----------
218
+ agent_id : str
219
+ The id of an agent. This is returned on agent creation.
220
+
221
+ deployment_request : AgentDeploymentRequest
222
+ Request to create a new deployment
223
+
224
+ request_options : typing.Optional[RequestOptions]
225
+ Request-specific configuration.
226
+
227
+ Returns
228
+ -------
229
+ AgentDeploymentResponse
230
+ Successful Response
231
+
232
+ Examples
233
+ --------
234
+ import asyncio
235
+
236
+ from elevenlabs import (
237
+ AgentDeploymentPercentageStrategy,
238
+ AgentDeploymentRequest,
239
+ AgentDeploymentRequestItem,
240
+ AsyncElevenLabs,
241
+ )
242
+
243
+ client = AsyncElevenLabs(
244
+ api_key="YOUR_API_KEY",
245
+ )
246
+
247
+
248
+ async def main() -> None:
249
+ await client.conversational_ai.agents.deployments.create(
250
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
251
+ deployment_request=AgentDeploymentRequest(
252
+ requests=[
253
+ AgentDeploymentRequestItem(
254
+ branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj",
255
+ deployment_strategy=AgentDeploymentPercentageStrategy(
256
+ traffic_percentage=0.5,
257
+ ),
258
+ )
259
+ ],
260
+ ),
261
+ )
262
+
263
+
264
+ asyncio.run(main())
265
+ """
266
+ _response = await self._raw_client.create(
267
+ agent_id, deployment_request=deployment_request, request_options=request_options
268
+ )
269
+ return _response.data
data/src/elevenlabs/conversational_ai/agents/deployments/raw_client.py ADDED
@@ -0,0 +1,309 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ from json.decoder import JSONDecodeError
5
+
6
+ from ....core.api_error import ApiError
7
+ from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
8
+ from ....core.http_response import AsyncHttpResponse, HttpResponse
9
+ from ....core.jsonable_encoder import jsonable_encoder
10
+ from ....core.parse_error import ParsingError
11
+ from ....core.request_options import RequestOptions
12
+ from ....core.serialization import convert_and_respect_annotation_metadata
13
+ from ....core.unchecked_base_model import construct_type
14
+ from ....errors.unprocessable_entity_error import UnprocessableEntityError
15
+ from ....types.agent_deployment_request import AgentDeploymentRequest
16
+ from ....types.agent_deployment_response import AgentDeploymentResponse
17
+ from ....types.list_response_agent_deployment_history_item import ListResponseAgentDeploymentHistoryItem
18
+ from pydantic import ValidationError
19
+
20
+ # this is used as the default value for optional parameters
21
+ OMIT = typing.cast(typing.Any, ...)
22
+
23
+
24
+ class RawDeploymentsClient:
25
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
26
+ self._client_wrapper = client_wrapper
27
+
28
+ def list(
29
+ self,
30
+ agent_id: str,
31
+ *,
32
+ page: typing.Optional[int] = None,
33
+ page_size: typing.Optional[int] = None,
34
+ request_options: typing.Optional[RequestOptions] = None,
35
+ ) -> HttpResponse[ListResponseAgentDeploymentHistoryItem]:
36
+ """
37
+ List the traffic split history of an agent, newest first
38
+
39
+ Parameters
40
+ ----------
41
+ agent_id : str
42
+ The id of an agent. This is returned on agent creation.
43
+
44
+ page : typing.Optional[int]
45
+ Page number, starting at 1
46
+
47
+ page_size : typing.Optional[int]
48
+ How many results at most should be returned
49
+
50
+ request_options : typing.Optional[RequestOptions]
51
+ Request-specific configuration.
52
+
53
+ Returns
54
+ -------
55
+ HttpResponse[ListResponseAgentDeploymentHistoryItem]
56
+ Successful Response
57
+ """
58
+ _response = self._client_wrapper.httpx_client.request(
59
+ f"v1/convai/agents/{jsonable_encoder(agent_id)}/deployments",
60
+ method="GET",
61
+ params={
62
+ "page": page,
63
+ "page_size": page_size,
64
+ },
65
+ request_options=request_options,
66
+ )
67
+ try:
68
+ if 200 <= _response.status_code < 300:
69
+ _data = typing.cast(
70
+ ListResponseAgentDeploymentHistoryItem,
71
+ construct_type(
72
+ type_=ListResponseAgentDeploymentHistoryItem, # type: ignore
73
+ object_=_response.json(),
74
+ ),
75
+ )
76
+ return HttpResponse(response=_response, data=_data)
77
+ if _response.status_code == 422:
78
+ raise UnprocessableEntityError(
79
+ headers=dict(_response.headers),
80
+ body=typing.cast(
81
+ typing.Any,
82
+ construct_type(
83
+ type_=typing.Any, # type: ignore
84
+ object_=_response.json(),
85
+ ),
86
+ ),
87
+ )
88
+ _response_json = _response.json()
89
+ except JSONDecodeError:
90
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
91
+ except ValidationError as e:
92
+ raise ParsingError(
93
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
94
+ )
95
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
96
+
97
+ def create(
98
+ self,
99
+ agent_id: str,
100
+ *,
101
+ deployment_request: AgentDeploymentRequest,
102
+ request_options: typing.Optional[RequestOptions] = None,
103
+ ) -> HttpResponse[AgentDeploymentResponse]:
104
+ """
105
+ Create a new deployment for an agent
106
+
107
+ Parameters
108
+ ----------
109
+ agent_id : str
110
+ The id of an agent. This is returned on agent creation.
111
+
112
+ deployment_request : AgentDeploymentRequest
113
+ Request to create a new deployment
114
+
115
+ request_options : typing.Optional[RequestOptions]
116
+ Request-specific configuration.
117
+
118
+ Returns
119
+ -------
120
+ HttpResponse[AgentDeploymentResponse]
121
+ Successful Response
122
+ """
123
+ _response = self._client_wrapper.httpx_client.request(
124
+ f"v1/convai/agents/{jsonable_encoder(agent_id)}/deployments",
125
+ method="POST",
126
+ json={
127
+ "deployment_request": convert_and_respect_annotation_metadata(
128
+ object_=deployment_request, annotation=AgentDeploymentRequest, direction="write"
129
+ ),
130
+ },
131
+ headers={
132
+ "content-type": "application/json",
133
+ },
134
+ request_options=request_options,
135
+ omit=OMIT,
136
+ )
137
+ try:
138
+ if 200 <= _response.status_code < 300:
139
+ _data = typing.cast(
140
+ AgentDeploymentResponse,
141
+ construct_type(
142
+ type_=AgentDeploymentResponse, # type: ignore
143
+ object_=_response.json(),
144
+ ),
145
+ )
146
+ return HttpResponse(response=_response, data=_data)
147
+ if _response.status_code == 422:
148
+ raise UnprocessableEntityError(
149
+ headers=dict(_response.headers),
150
+ body=typing.cast(
151
+ typing.Any,
152
+ construct_type(
153
+ type_=typing.Any, # type: ignore
154
+ object_=_response.json(),
155
+ ),
156
+ ),
157
+ )
158
+ _response_json = _response.json()
159
+ except JSONDecodeError:
160
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
161
+ except ValidationError as e:
162
+ raise ParsingError(
163
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
164
+ )
165
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
166
+
167
+
168
+ class AsyncRawDeploymentsClient:
169
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
170
+ self._client_wrapper = client_wrapper
171
+
172
+ async def list(
173
+ self,
174
+ agent_id: str,
175
+ *,
176
+ page: typing.Optional[int] = None,
177
+ page_size: typing.Optional[int] = None,
178
+ request_options: typing.Optional[RequestOptions] = None,
179
+ ) -> AsyncHttpResponse[ListResponseAgentDeploymentHistoryItem]:
180
+ """
181
+ List the traffic split history of an agent, newest first
182
+
183
+ Parameters
184
+ ----------
185
+ agent_id : str
186
+ The id of an agent. This is returned on agent creation.
187
+
188
+ page : typing.Optional[int]
189
+ Page number, starting at 1
190
+
191
+ page_size : typing.Optional[int]
192
+ How many results at most should be returned
193
+
194
+ request_options : typing.Optional[RequestOptions]
195
+ Request-specific configuration.
196
+
197
+ Returns
198
+ -------
199
+ AsyncHttpResponse[ListResponseAgentDeploymentHistoryItem]
200
+ Successful Response
201
+ """
202
+ _response = await self._client_wrapper.httpx_client.request(
203
+ f"v1/convai/agents/{jsonable_encoder(agent_id)}/deployments",
204
+ method="GET",
205
+ params={
206
+ "page": page,
207
+ "page_size": page_size,
208
+ },
209
+ request_options=request_options,
210
+ )
211
+ try:
212
+ if 200 <= _response.status_code < 300:
213
+ _data = typing.cast(
214
+ ListResponseAgentDeploymentHistoryItem,
215
+ construct_type(
216
+ type_=ListResponseAgentDeploymentHistoryItem, # type: ignore
217
+ object_=_response.json(),
218
+ ),
219
+ )
220
+ return AsyncHttpResponse(response=_response, data=_data)
221
+ if _response.status_code == 422:
222
+ raise UnprocessableEntityError(
223
+ headers=dict(_response.headers),
224
+ body=typing.cast(
225
+ typing.Any,
226
+ construct_type(
227
+ type_=typing.Any, # type: ignore
228
+ object_=_response.json(),
229
+ ),
230
+ ),
231
+ )
232
+ _response_json = _response.json()
233
+ except JSONDecodeError:
234
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
235
+ except ValidationError as e:
236
+ raise ParsingError(
237
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
238
+ )
239
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
240
+
241
+ async def create(
242
+ self,
243
+ agent_id: str,
244
+ *,
245
+ deployment_request: AgentDeploymentRequest,
246
+ request_options: typing.Optional[RequestOptions] = None,
247
+ ) -> AsyncHttpResponse[AgentDeploymentResponse]:
248
+ """
249
+ Create a new deployment for an agent
250
+
251
+ Parameters
252
+ ----------
253
+ agent_id : str
254
+ The id of an agent. This is returned on agent creation.
255
+
256
+ deployment_request : AgentDeploymentRequest
257
+ Request to create a new deployment
258
+
259
+ request_options : typing.Optional[RequestOptions]
260
+ Request-specific configuration.
261
+
262
+ Returns
263
+ -------
264
+ AsyncHttpResponse[AgentDeploymentResponse]
265
+ Successful Response
266
+ """
267
+ _response = await self._client_wrapper.httpx_client.request(
268
+ f"v1/convai/agents/{jsonable_encoder(agent_id)}/deployments",
269
+ method="POST",
270
+ json={
271
+ "deployment_request": convert_and_respect_annotation_metadata(
272
+ object_=deployment_request, annotation=AgentDeploymentRequest, direction="write"
273
+ ),
274
+ },
275
+ headers={
276
+ "content-type": "application/json",
277
+ },
278
+ request_options=request_options,
279
+ omit=OMIT,
280
+ )
281
+ try:
282
+ if 200 <= _response.status_code < 300:
283
+ _data = typing.cast(
284
+ AgentDeploymentResponse,
285
+ construct_type(
286
+ type_=AgentDeploymentResponse, # type: ignore
287
+ object_=_response.json(),
288
+ ),
289
+ )
290
+ return AsyncHttpResponse(response=_response, data=_data)
291
+ if _response.status_code == 422:
292
+ raise UnprocessableEntityError(
293
+ headers=dict(_response.headers),
294
+ body=typing.cast(
295
+ typing.Any,
296
+ construct_type(
297
+ type_=typing.Any, # type: ignore
298
+ object_=_response.json(),
299
+ ),
300
+ ),
301
+ )
302
+ _response_json = _response.json()
303
+ except JSONDecodeError:
304
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
305
+ except ValidationError as e:
306
+ raise ParsingError(
307
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
308
+ )
309
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
data/src/elevenlabs/conversational_ai/agents/drafts/__init__.py ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
data/src/elevenlabs/conversational_ai/agents/drafts/client.py ADDED
@@ -0,0 +1,467 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
6
+ from ....core.request_options import RequestOptions
7
+ from ....types.agent_workflow_request_model import AgentWorkflowRequestModel
8
+ from .raw_client import AsyncRawDraftsClient, RawDraftsClient
9
+
10
+ # this is used as the default value for optional parameters
11
+ OMIT = typing.cast(typing.Any, ...)
12
+
13
+
14
+ class DraftsClient:
15
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
16
+ self._raw_client = RawDraftsClient(client_wrapper=client_wrapper)
17
+
18
+ @property
19
+ def with_raw_response(self) -> RawDraftsClient:
20
+ """
21
+ Retrieves a raw implementation of this client that returns raw responses.
22
+
23
+ Returns
24
+ -------
25
+ RawDraftsClient
26
+ """
27
+ return self._raw_client
28
+
29
+ def create(
30
+ self,
31
+ agent_id: str,
32
+ *,
33
+ branch_id: str,
34
+ conversation_config: typing.Dict[str, typing.Any],
35
+ platform_settings: typing.Dict[str, typing.Any],
36
+ workflow: AgentWorkflowRequestModel,
37
+ name: str,
38
+ tags: typing.Optional[typing.Sequence[str]] = OMIT,
39
+ request_options: typing.Optional[RequestOptions] = None,
40
+ ) -> typing.Any:
41
+ """
42
+ Create a new draft for an agent
43
+
44
+ Parameters
45
+ ----------
46
+ agent_id : str
47
+ The id of an agent. This is returned on agent creation.
48
+
49
+ branch_id : str
50
+ The ID of the agent branch to use
51
+
52
+ conversation_config : typing.Dict[str, typing.Any]
53
+ Conversation config for the draft
54
+
55
+ platform_settings : typing.Dict[str, typing.Any]
56
+ Platform settings for the draft
57
+
58
+ workflow : AgentWorkflowRequestModel
59
+ Workflow for the draft
60
+
61
+ name : str
62
+ Name for the draft
63
+
64
+ tags : typing.Optional[typing.Sequence[str]]
65
+ Tags to help classify and filter the agent
66
+
67
+ request_options : typing.Optional[RequestOptions]
68
+ Request-specific configuration.
69
+
70
+ Returns
71
+ -------
72
+ typing.Any
73
+ Successful Response
74
+
75
+ Examples
76
+ --------
77
+ from elevenlabs import (
78
+ AgentWorkflowRequestModel,
79
+ AgentWorkflowRequestModelNodesValue_End,
80
+ AstNodeInput_AndOperator,
81
+ ElevenLabs,
82
+ WorkflowEdgeModelInput,
83
+ WorkflowEdgeModelInputForwardCondition_Expression,
84
+ )
85
+
86
+ client = ElevenLabs(
87
+ api_key="YOUR_API_KEY",
88
+ )
89
+ client.conversational_ai.agents.drafts.create(
90
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
91
+ branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj",
92
+ conversation_config={"key": "value"},
93
+ platform_settings={"key": "value"},
94
+ workflow=AgentWorkflowRequestModel(
95
+ edges={
96
+ "entry_to_tool_a": WorkflowEdgeModelInput(
97
+ source="entry_node",
98
+ target="tool_node_a",
99
+ forward_condition=WorkflowEdgeModelInputForwardCondition_Expression(
100
+ expression=AstNodeInput_AndOperator(
101
+ children=[],
102
+ ),
103
+ ),
104
+ ),
105
+ "start_to_entry": WorkflowEdgeModelInput(
106
+ source="start_node",
107
+ target="entry_node",
108
+ forward_condition=WorkflowEdgeModelInputForwardCondition_Expression(
109
+ expression=AstNodeInput_AndOperator(
110
+ children=[],
111
+ ),
112
+ ),
113
+ ),
114
+ "tool_a_to_failure": WorkflowEdgeModelInput(
115
+ source="tool_node_a",
116
+ target="failure_node",
117
+ forward_condition=WorkflowEdgeModelInputForwardCondition_Expression(
118
+ expression=AstNodeInput_AndOperator(
119
+ children=[],
120
+ ),
121
+ ),
122
+ ),
123
+ "tool_a_to_tool_b": WorkflowEdgeModelInput(
124
+ source="tool_node_a",
125
+ target="tool_node_b",
126
+ forward_condition=WorkflowEdgeModelInputForwardCondition_Expression(
127
+ expression=AstNodeInput_AndOperator(
128
+ children=[],
129
+ ),
130
+ ),
131
+ ),
132
+ "tool_b_to_agent_transfer": WorkflowEdgeModelInput(
133
+ source="tool_node_b",
134
+ target="success_transfer",
135
+ forward_condition=WorkflowEdgeModelInputForwardCondition_Expression(
136
+ expression=AstNodeInput_AndOperator(
137
+ children=[],
138
+ ),
139
+ ),
140
+ ),
141
+ "tool_b_to_conversation": WorkflowEdgeModelInput(
142
+ source="tool_node_b",
143
+ target="success_conversation",
144
+ forward_condition=WorkflowEdgeModelInputForwardCondition_Expression(
145
+ expression=AstNodeInput_AndOperator(
146
+ children=[],
147
+ ),
148
+ ),
149
+ ),
150
+ "tool_b_to_end": WorkflowEdgeModelInput(
151
+ source="tool_node_b",
152
+ target="success_end",
153
+ forward_condition=WorkflowEdgeModelInputForwardCondition_Expression(
154
+ expression=AstNodeInput_AndOperator(
155
+ children=[],
156
+ ),
157
+ ),
158
+ ),
159
+ "tool_b_to_phone": WorkflowEdgeModelInput(
160
+ source="tool_node_b",
161
+ target="success_phone",
162
+ forward_condition=WorkflowEdgeModelInputForwardCondition_Expression(
163
+ expression=AstNodeInput_AndOperator(
164
+ children=[],
165
+ ),
166
+ ),
167
+ ),
168
+ },
169
+ nodes={
170
+ "entry_node": AgentWorkflowRequestModelNodesValue_End(),
171
+ "failure_node": AgentWorkflowRequestModelNodesValue_End(),
172
+ "start_node": AgentWorkflowRequestModelNodesValue_End(),
173
+ "success_conversation": AgentWorkflowRequestModelNodesValue_End(),
174
+ "success_end": AgentWorkflowRequestModelNodesValue_End(),
175
+ "success_phone": AgentWorkflowRequestModelNodesValue_End(),
176
+ "success_transfer": AgentWorkflowRequestModelNodesValue_End(),
177
+ "tool_node_a": AgentWorkflowRequestModelNodesValue_End(),
178
+ "tool_node_b": AgentWorkflowRequestModelNodesValue_End(),
179
+ },
180
+ ),
181
+ name="name",
182
+ )
183
+ """
184
+ _response = self._raw_client.create(
185
+ agent_id,
186
+ branch_id=branch_id,
187
+ conversation_config=conversation_config,
188
+ platform_settings=platform_settings,
189
+ workflow=workflow,
190
+ name=name,
191
+ tags=tags,
192
+ request_options=request_options,
193
+ )
194
+ return _response.data
195
+
196
+ def delete(
197
+ self, agent_id: str, *, branch_id: str, request_options: typing.Optional[RequestOptions] = None
198
+ ) -> typing.Any:
199
+ """
200
+ Delete a draft for an agent
201
+
202
+ Parameters
203
+ ----------
204
+ agent_id : str
205
+ The id of an agent. This is returned on agent creation.
206
+
207
+ branch_id : str
208
+ The ID of the agent branch to use
209
+
210
+ request_options : typing.Optional[RequestOptions]
211
+ Request-specific configuration.
212
+
213
+ Returns
214
+ -------
215
+ typing.Any
216
+ Successful Response
217
+
218
+ Examples
219
+ --------
220
+ from elevenlabs import ElevenLabs
221
+
222
+ client = ElevenLabs(
223
+ api_key="YOUR_API_KEY",
224
+ )
225
+ client.conversational_ai.agents.drafts.delete(
226
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
227
+ branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj",
228
+ )
229
+ """
230
+ _response = self._raw_client.delete(agent_id, branch_id=branch_id, request_options=request_options)
231
+ return _response.data
232
+
233
+
234
+ class AsyncDraftsClient:
235
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
236
+ self._raw_client = AsyncRawDraftsClient(client_wrapper=client_wrapper)
237
+
238
+ @property
239
+ def with_raw_response(self) -> AsyncRawDraftsClient:
240
+ """
241
+ Retrieves a raw implementation of this client that returns raw responses.
242
+
243
+ Returns
244
+ -------
245
+ AsyncRawDraftsClient
246
+ """
247
+ return self._raw_client
248
+
249
+ async def create(
250
+ self,
251
+ agent_id: str,
252
+ *,
253
+ branch_id: str,
254
+ conversation_config: typing.Dict[str, typing.Any],
255
+ platform_settings: typing.Dict[str, typing.Any],
256
+ workflow: AgentWorkflowRequestModel,
257
+ name: str,
258
+ tags: typing.Optional[typing.Sequence[str]] = OMIT,
259
+ request_options: typing.Optional[RequestOptions] = None,
260
+ ) -> typing.Any:
261
+ """
262
+ Create a new draft for an agent
263
+
264
+ Parameters
265
+ ----------
266
+ agent_id : str
267
+ The id of an agent. This is returned on agent creation.
268
+
269
+ branch_id : str
270
+ The ID of the agent branch to use
271
+
272
+ conversation_config : typing.Dict[str, typing.Any]
273
+ Conversation config for the draft
274
+
275
+ platform_settings : typing.Dict[str, typing.Any]
276
+ Platform settings for the draft
277
+
278
+ workflow : AgentWorkflowRequestModel
279
+ Workflow for the draft
280
+
281
+ name : str
282
+ Name for the draft
283
+
284
+ tags : typing.Optional[typing.Sequence[str]]
285
+ Tags to help classify and filter the agent
286
+
287
+ request_options : typing.Optional[RequestOptions]
288
+ Request-specific configuration.
289
+
290
+ Returns
291
+ -------
292
+ typing.Any
293
+ Successful Response
294
+
295
+ Examples
296
+ --------
297
+ import asyncio
298
+
299
+ from elevenlabs import (
300
+ AgentWorkflowRequestModel,
301
+ AgentWorkflowRequestModelNodesValue_End,
302
+ AstNodeInput_AndOperator,
303
+ AsyncElevenLabs,
304
+ WorkflowEdgeModelInput,
305
+ WorkflowEdgeModelInputForwardCondition_Expression,
306
+ )
307
+
308
+ client = AsyncElevenLabs(
309
+ api_key="YOUR_API_KEY",
310
+ )
311
+
312
+
313
+ async def main() -> None:
314
+ await client.conversational_ai.agents.drafts.create(
315
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
316
+ branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj",
317
+ conversation_config={"key": "value"},
318
+ platform_settings={"key": "value"},
319
+ workflow=AgentWorkflowRequestModel(
320
+ edges={
321
+ "entry_to_tool_a": WorkflowEdgeModelInput(
322
+ source="entry_node",
323
+ target="tool_node_a",
324
+ forward_condition=WorkflowEdgeModelInputForwardCondition_Expression(
325
+ expression=AstNodeInput_AndOperator(
326
+ children=[],
327
+ ),
328
+ ),
329
+ ),
330
+ "start_to_entry": WorkflowEdgeModelInput(
331
+ source="start_node",
332
+ target="entry_node",
333
+ forward_condition=WorkflowEdgeModelInputForwardCondition_Expression(
334
+ expression=AstNodeInput_AndOperator(
335
+ children=[],
336
+ ),
337
+ ),
338
+ ),
339
+ "tool_a_to_failure": WorkflowEdgeModelInput(
340
+ source="tool_node_a",
341
+ target="failure_node",
342
+ forward_condition=WorkflowEdgeModelInputForwardCondition_Expression(
343
+ expression=AstNodeInput_AndOperator(
344
+ children=[],
345
+ ),
346
+ ),
347
+ ),
348
+ "tool_a_to_tool_b": WorkflowEdgeModelInput(
349
+ source="tool_node_a",
350
+ target="tool_node_b",
351
+ forward_condition=WorkflowEdgeModelInputForwardCondition_Expression(
352
+ expression=AstNodeInput_AndOperator(
353
+ children=[],
354
+ ),
355
+ ),
356
+ ),
357
+ "tool_b_to_agent_transfer": WorkflowEdgeModelInput(
358
+ source="tool_node_b",
359
+ target="success_transfer",
360
+ forward_condition=WorkflowEdgeModelInputForwardCondition_Expression(
361
+ expression=AstNodeInput_AndOperator(
362
+ children=[],
363
+ ),
364
+ ),
365
+ ),
366
+ "tool_b_to_conversation": WorkflowEdgeModelInput(
367
+ source="tool_node_b",
368
+ target="success_conversation",
369
+ forward_condition=WorkflowEdgeModelInputForwardCondition_Expression(
370
+ expression=AstNodeInput_AndOperator(
371
+ children=[],
372
+ ),
373
+ ),
374
+ ),
375
+ "tool_b_to_end": WorkflowEdgeModelInput(
376
+ source="tool_node_b",
377
+ target="success_end",
378
+ forward_condition=WorkflowEdgeModelInputForwardCondition_Expression(
379
+ expression=AstNodeInput_AndOperator(
380
+ children=[],
381
+ ),
382
+ ),
383
+ ),
384
+ "tool_b_to_phone": WorkflowEdgeModelInput(
385
+ source="tool_node_b",
386
+ target="success_phone",
387
+ forward_condition=WorkflowEdgeModelInputForwardCondition_Expression(
388
+ expression=AstNodeInput_AndOperator(
389
+ children=[],
390
+ ),
391
+ ),
392
+ ),
393
+ },
394
+ nodes={
395
+ "entry_node": AgentWorkflowRequestModelNodesValue_End(),
396
+ "failure_node": AgentWorkflowRequestModelNodesValue_End(),
397
+ "start_node": AgentWorkflowRequestModelNodesValue_End(),
398
+ "success_conversation": AgentWorkflowRequestModelNodesValue_End(),
399
+ "success_end": AgentWorkflowRequestModelNodesValue_End(),
400
+ "success_phone": AgentWorkflowRequestModelNodesValue_End(),
401
+ "success_transfer": AgentWorkflowRequestModelNodesValue_End(),
402
+ "tool_node_a": AgentWorkflowRequestModelNodesValue_End(),
403
+ "tool_node_b": AgentWorkflowRequestModelNodesValue_End(),
404
+ },
405
+ ),
406
+ name="name",
407
+ )
408
+
409
+
410
+ asyncio.run(main())
411
+ """
412
+ _response = await self._raw_client.create(
413
+ agent_id,
414
+ branch_id=branch_id,
415
+ conversation_config=conversation_config,
416
+ platform_settings=platform_settings,
417
+ workflow=workflow,
418
+ name=name,
419
+ tags=tags,
420
+ request_options=request_options,
421
+ )
422
+ return _response.data
423
+
424
+ async def delete(
425
+ self, agent_id: str, *, branch_id: str, request_options: typing.Optional[RequestOptions] = None
426
+ ) -> typing.Any:
427
+ """
428
+ Delete a draft for an agent
429
+
430
+ Parameters
431
+ ----------
432
+ agent_id : str
433
+ The id of an agent. This is returned on agent creation.
434
+
435
+ branch_id : str
436
+ The ID of the agent branch to use
437
+
438
+ request_options : typing.Optional[RequestOptions]
439
+ Request-specific configuration.
440
+
441
+ Returns
442
+ -------
443
+ typing.Any
444
+ Successful Response
445
+
446
+ Examples
447
+ --------
448
+ import asyncio
449
+
450
+ from elevenlabs import AsyncElevenLabs
451
+
452
+ client = AsyncElevenLabs(
453
+ api_key="YOUR_API_KEY",
454
+ )
455
+
456
+
457
+ async def main() -> None:
458
+ await client.conversational_ai.agents.drafts.delete(
459
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
460
+ branch_id="agtbrch_8901k4t9z5defmb8vh3e9361y7nj",
461
+ )
462
+
463
+
464
+ asyncio.run(main())
465
+ """
466
+ _response = await self._raw_client.delete(agent_id, branch_id=branch_id, request_options=request_options)
467
+ return _response.data
data/src/elevenlabs/conversational_ai/agents/drafts/raw_client.py ADDED
@@ -0,0 +1,351 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ from json.decoder import JSONDecodeError
5
+
6
+ from ....core.api_error import ApiError
7
+ from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
8
+ from ....core.http_response import AsyncHttpResponse, HttpResponse
9
+ from ....core.jsonable_encoder import jsonable_encoder
10
+ from ....core.parse_error import ParsingError
11
+ from ....core.request_options import RequestOptions
12
+ from ....core.serialization import convert_and_respect_annotation_metadata
13
+ from ....core.unchecked_base_model import construct_type
14
+ from ....errors.unprocessable_entity_error import UnprocessableEntityError
15
+ from ....types.agent_workflow_request_model import AgentWorkflowRequestModel
16
+ from pydantic import ValidationError
17
+
18
+ # this is used as the default value for optional parameters
19
+ OMIT = typing.cast(typing.Any, ...)
20
+
21
+
22
+ class RawDraftsClient:
23
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
24
+ self._client_wrapper = client_wrapper
25
+
26
+ def create(
27
+ self,
28
+ agent_id: str,
29
+ *,
30
+ branch_id: str,
31
+ conversation_config: typing.Dict[str, typing.Any],
32
+ platform_settings: typing.Dict[str, typing.Any],
33
+ workflow: AgentWorkflowRequestModel,
34
+ name: str,
35
+ tags: typing.Optional[typing.Sequence[str]] = OMIT,
36
+ request_options: typing.Optional[RequestOptions] = None,
37
+ ) -> HttpResponse[typing.Any]:
38
+ """
39
+ Create a new draft for an agent
40
+
41
+ Parameters
42
+ ----------
43
+ agent_id : str
44
+ The id of an agent. This is returned on agent creation.
45
+
46
+ branch_id : str
47
+ The ID of the agent branch to use
48
+
49
+ conversation_config : typing.Dict[str, typing.Any]
50
+ Conversation config for the draft
51
+
52
+ platform_settings : typing.Dict[str, typing.Any]
53
+ Platform settings for the draft
54
+
55
+ workflow : AgentWorkflowRequestModel
56
+ Workflow for the draft
57
+
58
+ name : str
59
+ Name for the draft
60
+
61
+ tags : typing.Optional[typing.Sequence[str]]
62
+ Tags to help classify and filter the agent
63
+
64
+ request_options : typing.Optional[RequestOptions]
65
+ Request-specific configuration.
66
+
67
+ Returns
68
+ -------
69
+ HttpResponse[typing.Any]
70
+ Successful Response
71
+ """
72
+ _response = self._client_wrapper.httpx_client.request(
73
+ f"v1/convai/agents/{jsonable_encoder(agent_id)}/drafts",
74
+ method="POST",
75
+ params={
76
+ "branch_id": branch_id,
77
+ },
78
+ json={
79
+ "conversation_config": conversation_config,
80
+ "platform_settings": platform_settings,
81
+ "workflow": convert_and_respect_annotation_metadata(
82
+ object_=workflow, annotation=AgentWorkflowRequestModel, direction="write"
83
+ ),
84
+ "name": name,
85
+ "tags": tags,
86
+ },
87
+ headers={
88
+ "content-type": "application/json",
89
+ },
90
+ request_options=request_options,
91
+ omit=OMIT,
92
+ )
93
+ try:
94
+ if _response is None or not _response.text.strip():
95
+ return HttpResponse(response=_response, data=None)
96
+ if 200 <= _response.status_code < 300:
97
+ _data = typing.cast(
98
+ typing.Any,
99
+ construct_type(
100
+ type_=typing.Any, # type: ignore
101
+ object_=_response.json(),
102
+ ),
103
+ )
104
+ return HttpResponse(response=_response, data=_data)
105
+ if _response.status_code == 422:
106
+ raise UnprocessableEntityError(
107
+ headers=dict(_response.headers),
108
+ body=typing.cast(
109
+ typing.Any,
110
+ construct_type(
111
+ type_=typing.Any, # type: ignore
112
+ object_=_response.json(),
113
+ ),
114
+ ),
115
+ )
116
+ _response_json = _response.json()
117
+ except JSONDecodeError:
118
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
119
+ except ValidationError as e:
120
+ raise ParsingError(
121
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
122
+ )
123
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
124
+
125
+ def delete(
126
+ self, agent_id: str, *, branch_id: str, request_options: typing.Optional[RequestOptions] = None
127
+ ) -> HttpResponse[typing.Any]:
128
+ """
129
+ Delete a draft for an agent
130
+
131
+ Parameters
132
+ ----------
133
+ agent_id : str
134
+ The id of an agent. This is returned on agent creation.
135
+
136
+ branch_id : str
137
+ The ID of the agent branch to use
138
+
139
+ request_options : typing.Optional[RequestOptions]
140
+ Request-specific configuration.
141
+
142
+ Returns
143
+ -------
144
+ HttpResponse[typing.Any]
145
+ Successful Response
146
+ """
147
+ _response = self._client_wrapper.httpx_client.request(
148
+ f"v1/convai/agents/{jsonable_encoder(agent_id)}/drafts",
149
+ method="DELETE",
150
+ params={
151
+ "branch_id": branch_id,
152
+ },
153
+ request_options=request_options,
154
+ )
155
+ try:
156
+ if _response is None or not _response.text.strip():
157
+ return HttpResponse(response=_response, data=None)
158
+ if 200 <= _response.status_code < 300:
159
+ _data = typing.cast(
160
+ typing.Any,
161
+ construct_type(
162
+ type_=typing.Any, # type: ignore
163
+ object_=_response.json(),
164
+ ),
165
+ )
166
+ return HttpResponse(response=_response, data=_data)
167
+ if _response.status_code == 422:
168
+ raise UnprocessableEntityError(
169
+ headers=dict(_response.headers),
170
+ body=typing.cast(
171
+ typing.Any,
172
+ construct_type(
173
+ type_=typing.Any, # type: ignore
174
+ object_=_response.json(),
175
+ ),
176
+ ),
177
+ )
178
+ _response_json = _response.json()
179
+ except JSONDecodeError:
180
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
181
+ except ValidationError as e:
182
+ raise ParsingError(
183
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
184
+ )
185
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
186
+
187
+
188
+ class AsyncRawDraftsClient:
189
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
190
+ self._client_wrapper = client_wrapper
191
+
192
+ async def create(
193
+ self,
194
+ agent_id: str,
195
+ *,
196
+ branch_id: str,
197
+ conversation_config: typing.Dict[str, typing.Any],
198
+ platform_settings: typing.Dict[str, typing.Any],
199
+ workflow: AgentWorkflowRequestModel,
200
+ name: str,
201
+ tags: typing.Optional[typing.Sequence[str]] = OMIT,
202
+ request_options: typing.Optional[RequestOptions] = None,
203
+ ) -> AsyncHttpResponse[typing.Any]:
204
+ """
205
+ Create a new draft for an agent
206
+
207
+ Parameters
208
+ ----------
209
+ agent_id : str
210
+ The id of an agent. This is returned on agent creation.
211
+
212
+ branch_id : str
213
+ The ID of the agent branch to use
214
+
215
+ conversation_config : typing.Dict[str, typing.Any]
216
+ Conversation config for the draft
217
+
218
+ platform_settings : typing.Dict[str, typing.Any]
219
+ Platform settings for the draft
220
+
221
+ workflow : AgentWorkflowRequestModel
222
+ Workflow for the draft
223
+
224
+ name : str
225
+ Name for the draft
226
+
227
+ tags : typing.Optional[typing.Sequence[str]]
228
+ Tags to help classify and filter the agent
229
+
230
+ request_options : typing.Optional[RequestOptions]
231
+ Request-specific configuration.
232
+
233
+ Returns
234
+ -------
235
+ AsyncHttpResponse[typing.Any]
236
+ Successful Response
237
+ """
238
+ _response = await self._client_wrapper.httpx_client.request(
239
+ f"v1/convai/agents/{jsonable_encoder(agent_id)}/drafts",
240
+ method="POST",
241
+ params={
242
+ "branch_id": branch_id,
243
+ },
244
+ json={
245
+ "conversation_config": conversation_config,
246
+ "platform_settings": platform_settings,
247
+ "workflow": convert_and_respect_annotation_metadata(
248
+ object_=workflow, annotation=AgentWorkflowRequestModel, direction="write"
249
+ ),
250
+ "name": name,
251
+ "tags": tags,
252
+ },
253
+ headers={
254
+ "content-type": "application/json",
255
+ },
256
+ request_options=request_options,
257
+ omit=OMIT,
258
+ )
259
+ try:
260
+ if _response is None or not _response.text.strip():
261
+ return AsyncHttpResponse(response=_response, data=None)
262
+ if 200 <= _response.status_code < 300:
263
+ _data = typing.cast(
264
+ typing.Any,
265
+ construct_type(
266
+ type_=typing.Any, # type: ignore
267
+ object_=_response.json(),
268
+ ),
269
+ )
270
+ return AsyncHttpResponse(response=_response, data=_data)
271
+ if _response.status_code == 422:
272
+ raise UnprocessableEntityError(
273
+ headers=dict(_response.headers),
274
+ body=typing.cast(
275
+ typing.Any,
276
+ construct_type(
277
+ type_=typing.Any, # type: ignore
278
+ object_=_response.json(),
279
+ ),
280
+ ),
281
+ )
282
+ _response_json = _response.json()
283
+ except JSONDecodeError:
284
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
285
+ except ValidationError as e:
286
+ raise ParsingError(
287
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
288
+ )
289
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
290
+
291
+ async def delete(
292
+ self, agent_id: str, *, branch_id: str, request_options: typing.Optional[RequestOptions] = None
293
+ ) -> AsyncHttpResponse[typing.Any]:
294
+ """
295
+ Delete a draft for an agent
296
+
297
+ Parameters
298
+ ----------
299
+ agent_id : str
300
+ The id of an agent. This is returned on agent creation.
301
+
302
+ branch_id : str
303
+ The ID of the agent branch to use
304
+
305
+ request_options : typing.Optional[RequestOptions]
306
+ Request-specific configuration.
307
+
308
+ Returns
309
+ -------
310
+ AsyncHttpResponse[typing.Any]
311
+ Successful Response
312
+ """
313
+ _response = await self._client_wrapper.httpx_client.request(
314
+ f"v1/convai/agents/{jsonable_encoder(agent_id)}/drafts",
315
+ method="DELETE",
316
+ params={
317
+ "branch_id": branch_id,
318
+ },
319
+ request_options=request_options,
320
+ )
321
+ try:
322
+ if _response is None or not _response.text.strip():
323
+ return AsyncHttpResponse(response=_response, data=None)
324
+ if 200 <= _response.status_code < 300:
325
+ _data = typing.cast(
326
+ typing.Any,
327
+ construct_type(
328
+ type_=typing.Any, # type: ignore
329
+ object_=_response.json(),
330
+ ),
331
+ )
332
+ return AsyncHttpResponse(response=_response, data=_data)
333
+ if _response.status_code == 422:
334
+ raise UnprocessableEntityError(
335
+ headers=dict(_response.headers),
336
+ body=typing.cast(
337
+ typing.Any,
338
+ construct_type(
339
+ type_=typing.Any, # type: ignore
340
+ object_=_response.json(),
341
+ ),
342
+ ),
343
+ )
344
+ _response_json = _response.json()
345
+ except JSONDecodeError:
346
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
347
+ except ValidationError as e:
348
+ raise ParsingError(
349
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
350
+ )
351
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
data/src/elevenlabs/conversational_ai/agents/hold_audio/__init__.py ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
data/src/elevenlabs/conversational_ai/agents/hold_audio/client.py ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from .... import core
6
+ from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
7
+ from ....core.request_options import RequestOptions
8
+ from ....types.delete_agent_hold_audio_response_model import DeleteAgentHoldAudioResponseModel
9
+ from ....types.post_agent_hold_audio_response_model import PostAgentHoldAudioResponseModel
10
+ from .raw_client import AsyncRawHoldAudioClient, RawHoldAudioClient
11
+
12
+ # this is used as the default value for optional parameters
13
+ OMIT = typing.cast(typing.Any, ...)
14
+
15
+
16
+ class HoldAudioClient:
17
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
18
+ self._raw_client = RawHoldAudioClient(client_wrapper=client_wrapper)
19
+
20
+ @property
21
+ def with_raw_response(self) -> RawHoldAudioClient:
22
+ """
23
+ Retrieves a raw implementation of this client that returns raw responses.
24
+
25
+ Returns
26
+ -------
27
+ RawHoldAudioClient
28
+ """
29
+ return self._raw_client
30
+
31
+ def create(
32
+ self, agent_id: str, *, hold_audio_file: core.File, request_options: typing.Optional[RequestOptions] = None
33
+ ) -> PostAgentHoldAudioResponseModel:
34
+ """
35
+ Sets the custom hold audio played on loop to callers waiting in the agent's concurrency wait queue. Replaces any previously uploaded clip.
36
+
37
+ Parameters
38
+ ----------
39
+ agent_id : str
40
+ The id of an agent. This is returned on agent creation.
41
+
42
+ hold_audio_file : core.File
43
+ See core.File for more documentation
44
+
45
+ request_options : typing.Optional[RequestOptions]
46
+ Request-specific configuration.
47
+
48
+ Returns
49
+ -------
50
+ PostAgentHoldAudioResponseModel
51
+ Successful Response
52
+
53
+ Examples
54
+ --------
55
+ from elevenlabs import ElevenLabs
56
+
57
+ client = ElevenLabs(
58
+ api_key="YOUR_API_KEY",
59
+ )
60
+ client.conversational_ai.agents.hold_audio.create(
61
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
62
+ )
63
+ """
64
+ _response = self._raw_client.create(agent_id, hold_audio_file=hold_audio_file, request_options=request_options)
65
+ return _response.data
66
+
67
+ def delete(
68
+ self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None
69
+ ) -> DeleteAgentHoldAudioResponseModel:
70
+ """
71
+ Removes the agent's custom hold audio; queued callers hear the default hold tone again.
72
+
73
+ Parameters
74
+ ----------
75
+ agent_id : str
76
+ The id of an agent. This is returned on agent creation.
77
+
78
+ request_options : typing.Optional[RequestOptions]
79
+ Request-specific configuration.
80
+
81
+ Returns
82
+ -------
83
+ DeleteAgentHoldAudioResponseModel
84
+ Successful Response
85
+
86
+ Examples
87
+ --------
88
+ from elevenlabs import ElevenLabs
89
+
90
+ client = ElevenLabs(
91
+ api_key="YOUR_API_KEY",
92
+ )
93
+ client.conversational_ai.agents.hold_audio.delete(
94
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
95
+ )
96
+ """
97
+ _response = self._raw_client.delete(agent_id, request_options=request_options)
98
+ return _response.data
99
+
100
+
101
+ class AsyncHoldAudioClient:
102
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
103
+ self._raw_client = AsyncRawHoldAudioClient(client_wrapper=client_wrapper)
104
+
105
+ @property
106
+ def with_raw_response(self) -> AsyncRawHoldAudioClient:
107
+ """
108
+ Retrieves a raw implementation of this client that returns raw responses.
109
+
110
+ Returns
111
+ -------
112
+ AsyncRawHoldAudioClient
113
+ """
114
+ return self._raw_client
115
+
116
+ async def create(
117
+ self, agent_id: str, *, hold_audio_file: core.File, request_options: typing.Optional[RequestOptions] = None
118
+ ) -> PostAgentHoldAudioResponseModel:
119
+ """
120
+ Sets the custom hold audio played on loop to callers waiting in the agent's concurrency wait queue. Replaces any previously uploaded clip.
121
+
122
+ Parameters
123
+ ----------
124
+ agent_id : str
125
+ The id of an agent. This is returned on agent creation.
126
+
127
+ hold_audio_file : core.File
128
+ See core.File for more documentation
129
+
130
+ request_options : typing.Optional[RequestOptions]
131
+ Request-specific configuration.
132
+
133
+ Returns
134
+ -------
135
+ PostAgentHoldAudioResponseModel
136
+ Successful Response
137
+
138
+ Examples
139
+ --------
140
+ import asyncio
141
+
142
+ from elevenlabs import AsyncElevenLabs
143
+
144
+ client = AsyncElevenLabs(
145
+ api_key="YOUR_API_KEY",
146
+ )
147
+
148
+
149
+ async def main() -> None:
150
+ await client.conversational_ai.agents.hold_audio.create(
151
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
152
+ )
153
+
154
+
155
+ asyncio.run(main())
156
+ """
157
+ _response = await self._raw_client.create(
158
+ agent_id, hold_audio_file=hold_audio_file, request_options=request_options
159
+ )
160
+ return _response.data
161
+
162
+ async def delete(
163
+ self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None
164
+ ) -> DeleteAgentHoldAudioResponseModel:
165
+ """
166
+ Removes the agent's custom hold audio; queued callers hear the default hold tone again.
167
+
168
+ Parameters
169
+ ----------
170
+ agent_id : str
171
+ The id of an agent. This is returned on agent creation.
172
+
173
+ request_options : typing.Optional[RequestOptions]
174
+ Request-specific configuration.
175
+
176
+ Returns
177
+ -------
178
+ DeleteAgentHoldAudioResponseModel
179
+ Successful Response
180
+
181
+ Examples
182
+ --------
183
+ import asyncio
184
+
185
+ from elevenlabs import AsyncElevenLabs
186
+
187
+ client = AsyncElevenLabs(
188
+ api_key="YOUR_API_KEY",
189
+ )
190
+
191
+
192
+ async def main() -> None:
193
+ await client.conversational_ai.agents.hold_audio.delete(
194
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
195
+ )
196
+
197
+
198
+ asyncio.run(main())
199
+ """
200
+ _response = await self._raw_client.delete(agent_id, request_options=request_options)
201
+ return _response.data
data/src/elevenlabs/conversational_ai/agents/hold_audio/raw_client.py ADDED
@@ -0,0 +1,264 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ from json.decoder import JSONDecodeError
5
+
6
+ from .... import core
7
+ from ....core.api_error import ApiError
8
+ from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
9
+ from ....core.http_response import AsyncHttpResponse, HttpResponse
10
+ from ....core.jsonable_encoder import jsonable_encoder
11
+ from ....core.parse_error import ParsingError
12
+ from ....core.request_options import RequestOptions
13
+ from ....core.unchecked_base_model import construct_type
14
+ from ....errors.unprocessable_entity_error import UnprocessableEntityError
15
+ from ....types.delete_agent_hold_audio_response_model import DeleteAgentHoldAudioResponseModel
16
+ from ....types.post_agent_hold_audio_response_model import PostAgentHoldAudioResponseModel
17
+ from pydantic import ValidationError
18
+
19
+ # this is used as the default value for optional parameters
20
+ OMIT = typing.cast(typing.Any, ...)
21
+
22
+
23
+ class RawHoldAudioClient:
24
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
25
+ self._client_wrapper = client_wrapper
26
+
27
+ def create(
28
+ self, agent_id: str, *, hold_audio_file: core.File, request_options: typing.Optional[RequestOptions] = None
29
+ ) -> HttpResponse[PostAgentHoldAudioResponseModel]:
30
+ """
31
+ Sets the custom hold audio played on loop to callers waiting in the agent's concurrency wait queue. Replaces any previously uploaded clip.
32
+
33
+ Parameters
34
+ ----------
35
+ agent_id : str
36
+ The id of an agent. This is returned on agent creation.
37
+
38
+ hold_audio_file : core.File
39
+ See core.File for more documentation
40
+
41
+ request_options : typing.Optional[RequestOptions]
42
+ Request-specific configuration.
43
+
44
+ Returns
45
+ -------
46
+ HttpResponse[PostAgentHoldAudioResponseModel]
47
+ Successful Response
48
+ """
49
+ _response = self._client_wrapper.httpx_client.request(
50
+ f"v1/convai/agents/{jsonable_encoder(agent_id)}/hold-audio",
51
+ method="POST",
52
+ data={},
53
+ files={
54
+ "hold_audio_file": hold_audio_file,
55
+ },
56
+ request_options=request_options,
57
+ omit=OMIT,
58
+ force_multipart=True,
59
+ )
60
+ try:
61
+ if 200 <= _response.status_code < 300:
62
+ _data = typing.cast(
63
+ PostAgentHoldAudioResponseModel,
64
+ construct_type(
65
+ type_=PostAgentHoldAudioResponseModel, # type: ignore
66
+ object_=_response.json(),
67
+ ),
68
+ )
69
+ return HttpResponse(response=_response, data=_data)
70
+ if _response.status_code == 422:
71
+ raise UnprocessableEntityError(
72
+ headers=dict(_response.headers),
73
+ body=typing.cast(
74
+ typing.Any,
75
+ construct_type(
76
+ type_=typing.Any, # type: ignore
77
+ object_=_response.json(),
78
+ ),
79
+ ),
80
+ )
81
+ _response_json = _response.json()
82
+ except JSONDecodeError:
83
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
84
+ except ValidationError as e:
85
+ raise ParsingError(
86
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
87
+ )
88
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
89
+
90
+ def delete(
91
+ self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None
92
+ ) -> HttpResponse[DeleteAgentHoldAudioResponseModel]:
93
+ """
94
+ Removes the agent's custom hold audio; queued callers hear the default hold tone again.
95
+
96
+ Parameters
97
+ ----------
98
+ agent_id : str
99
+ The id of an agent. This is returned on agent creation.
100
+
101
+ request_options : typing.Optional[RequestOptions]
102
+ Request-specific configuration.
103
+
104
+ Returns
105
+ -------
106
+ HttpResponse[DeleteAgentHoldAudioResponseModel]
107
+ Successful Response
108
+ """
109
+ _response = self._client_wrapper.httpx_client.request(
110
+ f"v1/convai/agents/{jsonable_encoder(agent_id)}/hold-audio",
111
+ method="DELETE",
112
+ request_options=request_options,
113
+ )
114
+ try:
115
+ if 200 <= _response.status_code < 300:
116
+ _data = typing.cast(
117
+ DeleteAgentHoldAudioResponseModel,
118
+ construct_type(
119
+ type_=DeleteAgentHoldAudioResponseModel, # type: ignore
120
+ object_=_response.json(),
121
+ ),
122
+ )
123
+ return HttpResponse(response=_response, data=_data)
124
+ if _response.status_code == 422:
125
+ raise UnprocessableEntityError(
126
+ headers=dict(_response.headers),
127
+ body=typing.cast(
128
+ typing.Any,
129
+ construct_type(
130
+ type_=typing.Any, # type: ignore
131
+ object_=_response.json(),
132
+ ),
133
+ ),
134
+ )
135
+ _response_json = _response.json()
136
+ except JSONDecodeError:
137
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
138
+ except ValidationError as e:
139
+ raise ParsingError(
140
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
141
+ )
142
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
143
+
144
+
145
+ class AsyncRawHoldAudioClient:
146
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
147
+ self._client_wrapper = client_wrapper
148
+
149
+ async def create(
150
+ self, agent_id: str, *, hold_audio_file: core.File, request_options: typing.Optional[RequestOptions] = None
151
+ ) -> AsyncHttpResponse[PostAgentHoldAudioResponseModel]:
152
+ """
153
+ Sets the custom hold audio played on loop to callers waiting in the agent's concurrency wait queue. Replaces any previously uploaded clip.
154
+
155
+ Parameters
156
+ ----------
157
+ agent_id : str
158
+ The id of an agent. This is returned on agent creation.
159
+
160
+ hold_audio_file : core.File
161
+ See core.File for more documentation
162
+
163
+ request_options : typing.Optional[RequestOptions]
164
+ Request-specific configuration.
165
+
166
+ Returns
167
+ -------
168
+ AsyncHttpResponse[PostAgentHoldAudioResponseModel]
169
+ Successful Response
170
+ """
171
+ _response = await self._client_wrapper.httpx_client.request(
172
+ f"v1/convai/agents/{jsonable_encoder(agent_id)}/hold-audio",
173
+ method="POST",
174
+ data={},
175
+ files={
176
+ "hold_audio_file": hold_audio_file,
177
+ },
178
+ request_options=request_options,
179
+ omit=OMIT,
180
+ force_multipart=True,
181
+ )
182
+ try:
183
+ if 200 <= _response.status_code < 300:
184
+ _data = typing.cast(
185
+ PostAgentHoldAudioResponseModel,
186
+ construct_type(
187
+ type_=PostAgentHoldAudioResponseModel, # type: ignore
188
+ object_=_response.json(),
189
+ ),
190
+ )
191
+ return AsyncHttpResponse(response=_response, data=_data)
192
+ if _response.status_code == 422:
193
+ raise UnprocessableEntityError(
194
+ headers=dict(_response.headers),
195
+ body=typing.cast(
196
+ typing.Any,
197
+ construct_type(
198
+ type_=typing.Any, # type: ignore
199
+ object_=_response.json(),
200
+ ),
201
+ ),
202
+ )
203
+ _response_json = _response.json()
204
+ except JSONDecodeError:
205
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
206
+ except ValidationError as e:
207
+ raise ParsingError(
208
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
209
+ )
210
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
211
+
212
+ async def delete(
213
+ self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None
214
+ ) -> AsyncHttpResponse[DeleteAgentHoldAudioResponseModel]:
215
+ """
216
+ Removes the agent's custom hold audio; queued callers hear the default hold tone again.
217
+
218
+ Parameters
219
+ ----------
220
+ agent_id : str
221
+ The id of an agent. This is returned on agent creation.
222
+
223
+ request_options : typing.Optional[RequestOptions]
224
+ Request-specific configuration.
225
+
226
+ Returns
227
+ -------
228
+ AsyncHttpResponse[DeleteAgentHoldAudioResponseModel]
229
+ Successful Response
230
+ """
231
+ _response = await self._client_wrapper.httpx_client.request(
232
+ f"v1/convai/agents/{jsonable_encoder(agent_id)}/hold-audio",
233
+ method="DELETE",
234
+ request_options=request_options,
235
+ )
236
+ try:
237
+ if 200 <= _response.status_code < 300:
238
+ _data = typing.cast(
239
+ DeleteAgentHoldAudioResponseModel,
240
+ construct_type(
241
+ type_=DeleteAgentHoldAudioResponseModel, # type: ignore
242
+ object_=_response.json(),
243
+ ),
244
+ )
245
+ return AsyncHttpResponse(response=_response, data=_data)
246
+ if _response.status_code == 422:
247
+ raise UnprocessableEntityError(
248
+ headers=dict(_response.headers),
249
+ body=typing.cast(
250
+ typing.Any,
251
+ construct_type(
252
+ type_=typing.Any, # type: ignore
253
+ object_=_response.json(),
254
+ ),
255
+ ),
256
+ )
257
+ _response_json = _response.json()
258
+ except JSONDecodeError:
259
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
260
+ except ValidationError as e:
261
+ raise ParsingError(
262
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
263
+ )
264
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
data/src/elevenlabs/conversational_ai/agents/knowledge_base/__init__.py ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
data/src/elevenlabs/conversational_ai/agents/knowledge_base/client.py ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
6
+ from ....core.request_options import RequestOptions
7
+ from ....types.get_agent_knowledgebase_size_response_model import GetAgentKnowledgebaseSizeResponseModel
8
+ from .raw_client import AsyncRawKnowledgeBaseClient, RawKnowledgeBaseClient
9
+
10
+
11
+ class KnowledgeBaseClient:
12
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
13
+ self._raw_client = RawKnowledgeBaseClient(client_wrapper=client_wrapper)
14
+
15
+ @property
16
+ def with_raw_response(self) -> RawKnowledgeBaseClient:
17
+ """
18
+ Retrieves a raw implementation of this client that returns raw responses.
19
+
20
+ Returns
21
+ -------
22
+ RawKnowledgeBaseClient
23
+ """
24
+ return self._raw_client
25
+
26
+ def size(
27
+ self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None
28
+ ) -> GetAgentKnowledgebaseSizeResponseModel:
29
+ """
30
+ Returns the number of pages in the agent's knowledge base.
31
+
32
+ Parameters
33
+ ----------
34
+ agent_id : str
35
+
36
+ request_options : typing.Optional[RequestOptions]
37
+ Request-specific configuration.
38
+
39
+ Returns
40
+ -------
41
+ GetAgentKnowledgebaseSizeResponseModel
42
+ Successful Response
43
+
44
+ Examples
45
+ --------
46
+ from elevenlabs import ElevenLabs
47
+
48
+ client = ElevenLabs(
49
+ api_key="YOUR_API_KEY",
50
+ )
51
+ client.conversational_ai.agents.knowledge_base.size(
52
+ agent_id="agent_id",
53
+ )
54
+ """
55
+ _response = self._raw_client.size(agent_id, request_options=request_options)
56
+ return _response.data
57
+
58
+
59
+ class AsyncKnowledgeBaseClient:
60
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
61
+ self._raw_client = AsyncRawKnowledgeBaseClient(client_wrapper=client_wrapper)
62
+
63
+ @property
64
+ def with_raw_response(self) -> AsyncRawKnowledgeBaseClient:
65
+ """
66
+ Retrieves a raw implementation of this client that returns raw responses.
67
+
68
+ Returns
69
+ -------
70
+ AsyncRawKnowledgeBaseClient
71
+ """
72
+ return self._raw_client
73
+
74
+ async def size(
75
+ self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None
76
+ ) -> GetAgentKnowledgebaseSizeResponseModel:
77
+ """
78
+ Returns the number of pages in the agent's knowledge base.
79
+
80
+ Parameters
81
+ ----------
82
+ agent_id : str
83
+
84
+ request_options : typing.Optional[RequestOptions]
85
+ Request-specific configuration.
86
+
87
+ Returns
88
+ -------
89
+ GetAgentKnowledgebaseSizeResponseModel
90
+ Successful Response
91
+
92
+ Examples
93
+ --------
94
+ import asyncio
95
+
96
+ from elevenlabs import AsyncElevenLabs
97
+
98
+ client = AsyncElevenLabs(
99
+ api_key="YOUR_API_KEY",
100
+ )
101
+
102
+
103
+ async def main() -> None:
104
+ await client.conversational_ai.agents.knowledge_base.size(
105
+ agent_id="agent_id",
106
+ )
107
+
108
+
109
+ asyncio.run(main())
110
+ """
111
+ _response = await self._raw_client.size(agent_id, request_options=request_options)
112
+ return _response.data
data/src/elevenlabs/conversational_ai/agents/knowledge_base/raw_client.py ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ from json.decoder import JSONDecodeError
5
+
6
+ from ....core.api_error import ApiError
7
+ from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
8
+ from ....core.http_response import AsyncHttpResponse, HttpResponse
9
+ from ....core.jsonable_encoder import jsonable_encoder
10
+ from ....core.parse_error import ParsingError
11
+ from ....core.request_options import RequestOptions
12
+ from ....core.unchecked_base_model import construct_type
13
+ from ....errors.unprocessable_entity_error import UnprocessableEntityError
14
+ from ....types.get_agent_knowledgebase_size_response_model import GetAgentKnowledgebaseSizeResponseModel
15
+ from pydantic import ValidationError
16
+
17
+
18
+ class RawKnowledgeBaseClient:
19
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
20
+ self._client_wrapper = client_wrapper
21
+
22
+ def size(
23
+ self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None
24
+ ) -> HttpResponse[GetAgentKnowledgebaseSizeResponseModel]:
25
+ """
26
+ Returns the number of pages in the agent's knowledge base.
27
+
28
+ Parameters
29
+ ----------
30
+ agent_id : str
31
+
32
+ request_options : typing.Optional[RequestOptions]
33
+ Request-specific configuration.
34
+
35
+ Returns
36
+ -------
37
+ HttpResponse[GetAgentKnowledgebaseSizeResponseModel]
38
+ Successful Response
39
+ """
40
+ _response = self._client_wrapper.httpx_client.request(
41
+ f"v1/convai/agent/{jsonable_encoder(agent_id)}/knowledge-base/size",
42
+ method="GET",
43
+ request_options=request_options,
44
+ )
45
+ try:
46
+ if 200 <= _response.status_code < 300:
47
+ _data = typing.cast(
48
+ GetAgentKnowledgebaseSizeResponseModel,
49
+ construct_type(
50
+ type_=GetAgentKnowledgebaseSizeResponseModel, # type: ignore
51
+ object_=_response.json(),
52
+ ),
53
+ )
54
+ return HttpResponse(response=_response, data=_data)
55
+ if _response.status_code == 422:
56
+ raise UnprocessableEntityError(
57
+ headers=dict(_response.headers),
58
+ body=typing.cast(
59
+ typing.Any,
60
+ construct_type(
61
+ type_=typing.Any, # type: ignore
62
+ object_=_response.json(),
63
+ ),
64
+ ),
65
+ )
66
+ _response_json = _response.json()
67
+ except JSONDecodeError:
68
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
69
+ except ValidationError as e:
70
+ raise ParsingError(
71
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
72
+ )
73
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
74
+
75
+
76
+ class AsyncRawKnowledgeBaseClient:
77
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
78
+ self._client_wrapper = client_wrapper
79
+
80
+ async def size(
81
+ self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None
82
+ ) -> AsyncHttpResponse[GetAgentKnowledgebaseSizeResponseModel]:
83
+ """
84
+ Returns the number of pages in the agent's knowledge base.
85
+
86
+ Parameters
87
+ ----------
88
+ agent_id : str
89
+
90
+ request_options : typing.Optional[RequestOptions]
91
+ Request-specific configuration.
92
+
93
+ Returns
94
+ -------
95
+ AsyncHttpResponse[GetAgentKnowledgebaseSizeResponseModel]
96
+ Successful Response
97
+ """
98
+ _response = await self._client_wrapper.httpx_client.request(
99
+ f"v1/convai/agent/{jsonable_encoder(agent_id)}/knowledge-base/size",
100
+ method="GET",
101
+ request_options=request_options,
102
+ )
103
+ try:
104
+ if 200 <= _response.status_code < 300:
105
+ _data = typing.cast(
106
+ GetAgentKnowledgebaseSizeResponseModel,
107
+ construct_type(
108
+ type_=GetAgentKnowledgebaseSizeResponseModel, # type: ignore
109
+ object_=_response.json(),
110
+ ),
111
+ )
112
+ return AsyncHttpResponse(response=_response, data=_data)
113
+ if _response.status_code == 422:
114
+ raise UnprocessableEntityError(
115
+ headers=dict(_response.headers),
116
+ body=typing.cast(
117
+ typing.Any,
118
+ construct_type(
119
+ type_=typing.Any, # type: ignore
120
+ object_=_response.json(),
121
+ ),
122
+ ),
123
+ )
124
+ _response_json = _response.json()
125
+ except JSONDecodeError:
126
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
127
+ except ValidationError as e:
128
+ raise ParsingError(
129
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
130
+ )
131
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
data/src/elevenlabs/conversational_ai/agents/link/__init__.py ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+
data/src/elevenlabs/conversational_ai/agents/link/client.py ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
6
+ from ....core.request_options import RequestOptions
7
+ from ....types.get_agent_link_response_model import GetAgentLinkResponseModel
8
+ from .raw_client import AsyncRawLinkClient, RawLinkClient
9
+
10
+
11
+ class LinkClient:
12
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
13
+ self._raw_client = RawLinkClient(client_wrapper=client_wrapper)
14
+
15
+ @property
16
+ def with_raw_response(self) -> RawLinkClient:
17
+ """
18
+ Retrieves a raw implementation of this client that returns raw responses.
19
+
20
+ Returns
21
+ -------
22
+ RawLinkClient
23
+ """
24
+ return self._raw_client
25
+
26
+ def get(
27
+ self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None
28
+ ) -> GetAgentLinkResponseModel:
29
+ """
30
+ Get the current link used to share the agent with others
31
+
32
+ Parameters
33
+ ----------
34
+ agent_id : str
35
+ The id of an agent. This is returned on agent creation.
36
+
37
+ request_options : typing.Optional[RequestOptions]
38
+ Request-specific configuration.
39
+
40
+ Returns
41
+ -------
42
+ GetAgentLinkResponseModel
43
+ Successful Response
44
+
45
+ Examples
46
+ --------
47
+ from elevenlabs import ElevenLabs
48
+
49
+ client = ElevenLabs(
50
+ api_key="YOUR_API_KEY",
51
+ )
52
+ client.conversational_ai.agents.link.get(
53
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
54
+ )
55
+ """
56
+ _response = self._raw_client.get(agent_id, request_options=request_options)
57
+ return _response.data
58
+
59
+
60
+ class AsyncLinkClient:
61
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
62
+ self._raw_client = AsyncRawLinkClient(client_wrapper=client_wrapper)
63
+
64
+ @property
65
+ def with_raw_response(self) -> AsyncRawLinkClient:
66
+ """
67
+ Retrieves a raw implementation of this client that returns raw responses.
68
+
69
+ Returns
70
+ -------
71
+ AsyncRawLinkClient
72
+ """
73
+ return self._raw_client
74
+
75
+ async def get(
76
+ self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None
77
+ ) -> GetAgentLinkResponseModel:
78
+ """
79
+ Get the current link used to share the agent with others
80
+
81
+ Parameters
82
+ ----------
83
+ agent_id : str
84
+ The id of an agent. This is returned on agent creation.
85
+
86
+ request_options : typing.Optional[RequestOptions]
87
+ Request-specific configuration.
88
+
89
+ Returns
90
+ -------
91
+ GetAgentLinkResponseModel
92
+ Successful Response
93
+
94
+ Examples
95
+ --------
96
+ import asyncio
97
+
98
+ from elevenlabs import AsyncElevenLabs
99
+
100
+ client = AsyncElevenLabs(
101
+ api_key="YOUR_API_KEY",
102
+ )
103
+
104
+
105
+ async def main() -> None:
106
+ await client.conversational_ai.agents.link.get(
107
+ agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
108
+ )
109
+
110
+
111
+ asyncio.run(main())
112
+ """
113
+ _response = await self._raw_client.get(agent_id, request_options=request_options)
114
+ return _response.data