You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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
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
The text was updated successfully, but these errors were encountered: