elevenlabs/elevenlabs-python: The official Python SDK for the ElevenLabs API.

3 phút đọc

elevenlabs/elevenlabs-python: The official Python SDK for the ElevenLabs API. – Repository elevenlabs/elevenlabs-python. Mô tả: The official Python SDK for the ElevenLabs API.. 3106 stars, 449 forks, ngôn ngữ chính Python, cập nhật 2026-09-24.

1. Repository làm gì?

The official Python SDK for ElevenLabs. ElevenLabs brings the most compelling, rich and lifelike voices to creators and developers in just a few lines of code.

Check out the HTTP API documentation.

Eleven Multilingual v2 (eleven_multilingual_v2)

Eleven Flash v2.5 (eleven_flash_v2_5)

Eleven Turbo v2.5 (eleven_turbo_v2_5)

For more detailed information about these models and others, visit the ElevenLabs Models documentation.

elevenlabs/elevenlabs-python: The official Python SDK for the ElevenLabs API.
Hình 1: Minh họa elevenlabs/elevenlabs-python: The official Python SDK for the ElevenLabs API.

2. Dữ liệu và cấu trúc đáng chú ý

🎧 Try it out! Want to hear our voices in action? Visit the ElevenLabs Voice Lab to experiment with different voices, languages, and settings.

List all your available voices with search().

For information about the structure of the voices output, please refer to the official ElevenLabs API documentation for Get Voices.

Build a voice object with custom settings to personalize the voice style, or call elevenlabs.voices.settings.get("your-voice-id") to get the default settings for the voice.

Clone your voice in an instant. Note that voice cloning requires an API key, see below.

Stream audio in real-time, as it's being generated.

Use AsyncElevenLabs if you want to make API calls asynchronously.

3. Khả năng ứng dụng và giới hạn

Build interactive AI agents with real-time audio capabilities using ElevenAgents.

For advanced use cases involving context propagation, resource reuse, or specific event loop management, ClientTools supports custom asyncio event loops:

Important: When using a custom loop, you're responsible for its lifecycle Don't close the loop while ClientTools are still using it.

Register custom tools that the AI agent can call during conversations:

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.

Speech Engine is async-only and available on AsyncElevenLabs.

When engine.serve() starts, it opens a WebSocket server on the specified port. For each incoming connection from the ElevenLabs API:

send_response() accepts strings or async iterators. LLM stream formats from OpenAI, Anthropic, and Google Gemini are auto-detected:

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.

Số liệu repository có thể thay đổi; nên mở liên kết nguồn để kiểm tra README, giấy phép và trạng thái phát hành.

Nguồn tham khảo: Xem bài gốc

📆
Âm Lịch: 17/8
Giáp Thìn

📆 Lịch Âm Dương NsN

×
Hôm Nay - Chủ Nhật
Âm Lịch: 17 Tháng 8
Năm Bính Ngọ
📌 Ngày Can Chi: Giáp Thìn
✨ Giờ Hoàng Đạo: Dần (3-5), Thìn (7-9), Tỵ (9-11), Thân (15-17), Dậu (17-19), Hợi (21-23)
Vĩnh Phúc (Liên Bảo - Vĩnh Yên)
27°C
Nắng Đẹp
💧 89% | 💨 15 km/h
Hôm nay 32°
28/09 33°
29/09 34°
30/09 33°
01/10 31°