Skip to content

Commit 1c8c319

Browse files
authored
add query params (#589)
1 parent 37cc495 commit 1c8c319

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/elevenlabs/conversational_ai/conversation.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from websockets.exceptions import ConnectionClosedOK
1212

1313
from ..base_client import BaseElevenLabs
14+
from ..version import __version__
1415

1516

1617
class ClientToOrchestratorEvent(str, Enum):
@@ -491,8 +492,11 @@ def send_response(response):
491492

492493
def _get_wss_url(self):
493494
base_ws_url = self.client._client_wrapper.get_environment().wss
494-
return f"{base_ws_url}/v1/convai/conversation?agent_id={self.agent_id}"
495+
return f"{base_ws_url}/v1/convai/conversation?agent_id={self.agent_id}&source=python_sdk&version={__version__}"
495496

496497
def _get_signed_url(self):
497498
response = self.client.conversational_ai.conversations.get_signed_url(agent_id=self.agent_id)
498-
return response.signed_url
499+
signed_url = response.signed_url
500+
# Append source and version query parameters to the signed URL
501+
separator = "&" if "?" in signed_url else "?"
502+
return f"{signed_url}{separator}source=python_sdk&version={__version__}"

0 commit comments

Comments
 (0)