elevenlabs / elevenlabs-python

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

ElevenLabs Python Client's voice_generation.generate does not return a generated_voice_id #345

Open yvanaquino opened 4 weeks ago

yvanaquino commented 4 weeks ago

Hi team,

elevenlabs==1.7.0

This is w.r.t. the python client's voice_generation.generate method which, at this point in time, returns a generator representing a stream of chunks that, when concatenated, result in a 'preview' mp3 of the generated voice.

The problem is that the return does not include the generated_voice_id which is necessary for re-using the voice. Please review the APIs return type to include the necessary parameters. According to the documentation, the generated_voice_id is returned as a response header which the client abstracts out.

xi = ElevenLabs(api_key='...')
xi_generated_voice = xi.voice_generation.generate(
    gender = 'female',
    age = 'young',
    accent = 'american',
    accent_strength=1.0,
    text = 'The quick brown fox jumps over the lazy dog.  Fifty-six crazy penguins jumped quickly over the awesome iceberg'
)
type(xi_generated_voice) # generator - where is the generated_voice_id?

Sincerest Regards,

dsinghvi commented 3 weeks ago

@yvanaquino thanks for filing this issue, we'll be updating the python client to handle response headers. Will let you know when that is supported.