Skip to content

Conversation

@PaulAsjes
Copy link
Contributor

No description provided.

@PaulAsjes PaulAsjes requested a review from thorwebdev May 28, 2025 14:48
@vercel
Copy link

vercel bot commented May 28, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
convai-nextjs-post-call-webhook Error Error Sep 16, 2025 3:11pm
screenshot-to-sfx Ready Ready Preview Comment Sep 16, 2025 3:11pm
talk-to-santa Error Error Sep 16, 2025 3:11pm
v0-eleven-labs-conversational-ai Error Error Sep 16, 2025 3:11pm
video-to-sfx Ready Ready Preview Comment Sep 16, 2025 3:11pm
x-to-voice Ready Ready Preview Comment Sep 16, 2025 3:11pm

return

client = ElevenLabs(api_key=ELEVENLABS_API_KEY)
elevenlabs = ElevenLabs(api_key=ELEVENLABS_API_KEY)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The print_rules function uses the old API path pronunciation_dictionary.download() which should be updated to match the new v2 SDK API structure.

View Details
📝 Patch Details
diff --git a/examples/pronunciation-dictionaries/python/main.py b/examples/pronunciation-dictionaries/python/main.py
index 394ba57..e48a4a2 100644
--- a/examples/pronunciation-dictionaries/python/main.py
+++ b/examples/pronunciation-dictionaries/python/main.py
@@ -17,7 +17,7 @@ if not ELEVENLABS_API_KEY:
 
 
 def print_rules(client: ElevenLabs, dictionary_id: str, version_id: str):
-    rules = client.pronunciation_dictionary.download(
+    rules = client.pronunciation_dictionaries.download(
         dictionary_id=dictionary_id,
         version_id=version_id,
     )

Analysis

Outdated API call in print_rules() function causes AttributeError

What fails: Function print_rules() in examples/pronunciation-dictionaries/python/main.py:20 uses client.pronunciation_dictionary.download() but pronunciation_dictionary attribute doesn't exist in ElevenLabs SDK v2

How to reproduce:

from elevenlabs.client import ElevenLabs
client = ElevenLabs()
client.pronunciation_dictionary.download(dictionary_id="test", version_id="test")

Result: AttributeError: 'ElevenLabs' object has no attribute 'pronunciation_dictionary'

Expected: Should use client.pronunciation_dictionaries.download() per ElevenLabs v2 upgrade guide where pronunciation dictionary methods were moved to pronunciation_dictionaries

let event;

try {
event = await elevenLabsClient.webhooks.constructEvent(req.text(), req.headers.get("ElevenLabs-Signature"), secret);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
event = await elevenLabsClient.webhooks.constructEvent(req.text(), req.headers.get("ElevenLabs-Signature"), secret);
event = await elevenLabsClient.webhooks.constructEvent(await req.text(), req.headers.get("ElevenLabs-Signature"), secret);

The req.text() method call is missing the await keyword, causing the webhook construction to receive a Promise object instead of the actual request body string.

View Details

Analysis

Missing await keyword causes webhook signature verification to fail

What fails: elevenLabsClient.webhooks.constructEvent() in app/api/convai-webhook/route.ts:25 receives Promise instead of string, causing webhook signature verification to reject valid requests

How to reproduce:

# Send POST request to webhook endpoint with valid signature
curl -X POST http://localhost:3000/api/convai-webhook \
  -H "Content-Type: application/json" \
  -H "ElevenLabs-Signature: t=timestamp,v0=hash" \
  -d '{"type":"post_call_transcription","data":{}}'

Result: Returns 401 Unauthorized with signature verification error due to Promise object being passed instead of request body string

Expected: Should validate signature correctly when req.text() is properly awaited per Request.text() Web API documentation which returns Promise

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

Successfully merging this pull request may close these issues.

2 participants