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

Async Function Issue in Conversation Class #484

Open
OsKrg opened this issue Feb 12, 2025 · 1 comment · May be fixed by #487
Open

Async Function Issue in Conversation Class #484

OsKrg opened this issue Feb 12, 2025 · 1 comment · May be fixed by #487
Assignees
Labels
bug Something isn't working

Comments

@OsKrg
Copy link
Contributor

OsKrg commented Feb 12, 2025

Description

I'm encountering an issue while using the ElevenLabs Python package.

I'm importing the async version:
from elevenlabs.client import AsyncElevenLabs

Then, I initialize the async client:
client = AsyncElevenLabs(api_key=ELEVENLABS_API_KEY)

However, when attempting to use the Conversation class, I noticed a problem in conversation.py, specifically in the session_start function:
ws_url = self._get_signed_url() if self.requires_auth else self._get_wss_url()

This calls _get_signed_url():
def _get_signed_url(self):
response = self.client.conversational_ai.get_signed_url(agent_id=self.agent_id)
return response.signed_url
The issue is that get_signed_url is an async function (in case of Async Elevenlab Client), but it is being called without await, which leads to errors.

As a temporary fix, I patched it like this:
class PatchedConversation(Conversation):
def _get_signed_url(self):
return signed_url_response.signed_url

self.conversation = PatchedConversation(client=client)

This workaround solves the issue for now, but I believe the library may need a proper fix.

Code example

No response

Additional context

No response

@OsKrg OsKrg added the bug Something isn't working label Feb 12, 2025
@AngeloGiacco
Copy link
Collaborator

AngeloGiacco commented Feb 13, 2025

thanks for the issue oswin, yeah our async lib needs a bit of a rework. but is currently coming from fern so tricky to make big changes without things being overwritten. will get up a patch and then try to figure out with fern how to make this permanent

@AngeloGiacco AngeloGiacco linked a pull request Feb 17, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants