elevenlabs / elevenlabs-python

The official Python API for ElevenLabs Text to Speech.
https://elevenlabs.io/docs/api-reference/getting-started
MIT License
2.2k stars 255 forks source link

First example doesn't work? #313

Closed bryanhpchiang closed 4 months ago

bryanhpchiang commented 4 months ago

First example from the README doesn't even work?

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)
Name: elevenlabs
Version: 1.3.1
Summary: 
Home-page: 
Author: 
Author-email: 
License: 
Location: /opt/homebrew/lib/python3.10/site-packages
Requires: httpx, pydantic, requests, typing_extensions, websockets
Required-by: 
bryanhpchiang commented 4 months ago
(turbo) bryan@Bryans-MBP-7 lang % python eleven_test.py 
Traceback (most recent call last):
  File "/Users/bryan/work/lang/eleven_test.py", line 8, in <module>
    audio = client.generate(
AttributeError: 'ElevenLabs' object has no attribute 'generate'
dsinghvi commented 4 months ago

@bryanhpchiang we haven't been able to reproduce this error -- if you can link a zip with the example we will look into it further. I would make sure that you are on the latest version of the client library.

Screenshot 2024-07-14 at 7 29 38 AM