elevenlabs-python icon indicating copy to clipboard operation
elevenlabs-python copied to clipboard

Documentation example on adding client tool returns exception

Open BonifacioCalindoro opened this issue 10 months ago • 7 comments

Description

with latest pip release of elevenlabs python sdk (1.56.0)

Steps to reproduce

  1. Create a client-side tool from the elevenlabs dashboard as mentioned in the client-tools documentation
  2. Run the example code for registering client-tools with the appropiate api_key and agent_id that is mentioned in the documentation

Expected behavior

  • Basically that it works as intended with the instructions provided by the documentation.

Actual behavior

  • Returns an exception:

Traceback (most recent call last):
  File "[redacted]/elevenlabs_client.py", line 15, in <module>
    conversation = Conversation(
                   ^^^^^^^^^^^^^
TypeError: Conversation.__init__() missing 2 required keyword-only arguments: 'requires_auth' and 'audio_interface'`

### Code example

```python

from elevenlabs import ElevenLabs
from elevenlabs.conversational_ai.conversation import Conversation, ClientTools
import os
from dotenv import load_dotenv

load_dotenv()

def log_message(parameters):
    message = parameters.get("message")
    print(message)

client_tools = ClientTools()
client_tools.register("logMessage", log_message)

conversation = Conversation(
    client=ElevenLabs(api_key=os.getenv('ELEVENLABS_API_KEY')),
    agent_id=os.getenv('ELEVENLABS_AGENT_ID'),
    client_tools=client_tools,
    # ...
)

conversation.start_session()

Additional context

When setting requires_auth=False and audio_interfacte=None, i get this other exception:


Traceback (most recent call last):
  File "[redacted]/elevenlabs_client.py", line 24, in <module>
    conversation.start_session()
  File "[redacted]/.venv/lib/python3.12/site-packages/elevenlabs/conversational_ai/conversation.py", line 252, in start_session
    ws_url = self._get_signed_url() if self.requires_auth else self._get_wss_url()
                                                               ^^^^^^^^^^^^^^^^^^^
  File "[redacted]/.venv/lib/python3.12/site-packages/elevenlabs/conversational_ai/conversation.py", line 373, in _get_wss_url
    base_url = self.client._client_wrapper._base_url
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'SyncClientWrapper' object has no attribute '_base_url'`

BonifacioCalindoro avatar Apr 05 '25 17:04 BonifacioCalindoro

Facing the same issue - would be great to get some clarity here.

iajaiaiai avatar Apr 06 '25 19:04 iajaiaiai

Same issue here

repeating avatar Apr 12 '25 16:04 repeating

Hey! thanks for reporting this issue! Will fix soon

AngeloGiacco avatar Apr 13 '25 17:04 AngeloGiacco

Why would you close an issue related to developer experience?? This bug will make lots of devs not use elevenlabs

Sent from Proton Mail for Android.

-------- Original Message -------- On Saturday, 11/08/25 at 12:17 linear[bot] @.***> wrote:

Closed #519 as not planned.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

BonifacioCalindoro avatar Nov 08 '25 11:11 BonifacioCalindoro

@PaulAsjes , Is this issue still open, or has it been resolved?

ParagGhatage avatar Nov 12 '25 21:11 ParagGhatage

@ParagGhatage this is still open if you'd like to submit a PR.

PaulAsjes avatar Nov 13 '25 09:11 PaulAsjes

@ParagGhatage this is still open if you'd like to submit a PR.

Got it, I’ll take this up and start working on a fix.

ParagGhatage avatar Nov 14 '25 09:11 ParagGhatage

@PaulAsjes , Hey Paul, one quick question before I submit the PR - the example shown in the ElevenLabs docs (the Client Tools page under Agents Platform → Customization → Tools) seems out of sync with the current SDK. Could you confirm where the source for those website docs lives, or if those updates should be made directly here in the elevenlabs-python repo (e.g., in reference.md or docstrings)?

Just want to make sure I update the correct place. Thanks!

ParagGhatage avatar Nov 16 '25 08:11 ParagGhatage