From 35dad457089135969a9f71f17efd12959d15e53e Mon Sep 17 00:00:00 2001 From: Angelo Giacco Date: Thu, 3 Jul 2025 17:43:57 +0100 Subject: [PATCH 1/2] fix contextual update --- src/elevenlabs/conversational_ai/conversation.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/elevenlabs/conversational_ai/conversation.py b/src/elevenlabs/conversational_ai/conversation.py index 497dc8ea..818efea2 100644 --- a/src/elevenlabs/conversational_ai/conversation.py +++ b/src/elevenlabs/conversational_ai/conversation.py @@ -56,14 +56,14 @@ def to_dict(self) -> dict: class ContextualUpdateClientToOrchestratorEvent: """Event for sending non-interrupting contextual updates to the conversation state.""" - def __init__(self, content: str): + def __init__(self, text: str): self.type: Literal[ClientToOrchestratorEvent.CONTEXTUAL_UPDATE] = ClientToOrchestratorEvent.CONTEXTUAL_UPDATE - self.content = content + self.text = text def to_dict(self) -> dict: return { "type": self.type, - "content": self.content + "content": self.text } @@ -369,7 +369,7 @@ def register_user_activity(self): print(f"Error registering user activity: {e}") raise - def send_contextual_update(self, content: str): + def send_contextual_update(self, text: str): """Send a contextual update to the conversation. Contextual updates are non-interrupting content that is sent to the server @@ -384,7 +384,7 @@ def send_contextual_update(self, content: str): if not self._ws: raise RuntimeError("Session not started or websocket not connected.") - event = ContextualUpdateClientToOrchestratorEvent(content=content) + event = ContextualUpdateClientToOrchestratorEvent(text=text) try: self._ws.send(json.dumps(event.to_dict())) except Exception as e: From bfc69e20a7d319f9cee6020661d27662bb4fa6ec Mon Sep 17 00:00:00 2001 From: Angelo Giacco Date: Thu, 3 Jul 2025 17:44:13 +0100 Subject: [PATCH 2/2] update gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index d2e4ca80..367c9b00 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ __pycache__/ dist/ poetry.toml +venv \ No newline at end of file