Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
yvanaquino opened this issue Aug 15, 2024 · 2 comments

Comments

@yvanaquino
Copy link

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
Copy link
Collaborator

@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.

@andychert
Copy link

andychert commented Oct 15, 2024

Hey, @yvanaquino

Also encountered this problem, please have a look at the package: https://github.com/andychert/elevenlabs-s3

from elevenlabs_s3 import VoiceSettings, text_to_speech

result = text_to_speech(
    text="Hello, this is a test.",
    elevenlabs_api_key="YOUR_ELEVENLABS_API_KEY",
    voice_id="YOUR_VOICE_ID"
)

print(result)

"""
Elevenlabs ID: `I8xNqL3yp2LqoGrqUdyV`
Example: `previous_request_ids=["I8xNqL3yp2LqoGrqUdyV"]`

{
   "id": "I8xNqL3yp2LqoGrqUdyV"
}
"""

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants