API has changed:
ImportError: cannot import name 'generate' from 'elevenlabs' (/home/codespace/.local/lib/python3.10/site-packages/elevenlabs/__init__.py)
Use client object:
from elevenlabs import play
from elevenlabs.client import ElevenLabs
client = ElevenLabs(
api_key="YOUR_API_KEY", # Defaults to ELEVEN_API_KEY
)
audio = client.generate(
text="Hello! 你好! Hola! नमस्ते! Bonjour! こんにちは! مرحبا! 안녕하세요! Ciao! Cześć! Привіт! வணக்கம்!",
voice="Rachel",
model="eleven_multilingual_v2"
)
play(audio)
API has changed:
ImportError: cannot import name 'generate' from 'elevenlabs' (/home/codespace/.local/lib/python3.10/site-packages/elevenlabs/__init__.py)
Use
client
object:https://github.com/elevenlabs/elevenlabs-python