Skip to content

Commit 724cc49

Browse files
authored
sdk fix contextual update (elevenlabs#582)
* fix contextual update * update gitignore
1 parent 7b0c4c7 commit 724cc49

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
__pycache__/
44
dist/
55
poetry.toml
6+
venv

src/elevenlabs/conversational_ai/conversation.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ def to_dict(self) -> dict:
5656
class ContextualUpdateClientToOrchestratorEvent:
5757
"""Event for sending non-interrupting contextual updates to the conversation state."""
5858

59-
def __init__(self, content: str):
59+
def __init__(self, text: str):
6060
self.type: Literal[ClientToOrchestratorEvent.CONTEXTUAL_UPDATE] = ClientToOrchestratorEvent.CONTEXTUAL_UPDATE
61-
self.content = content
61+
self.text = text
6262

6363
def to_dict(self) -> dict:
6464
return {
6565
"type": self.type,
66-
"content": self.content
66+
"content": self.text
6767
}
6868

6969

@@ -369,7 +369,7 @@ def register_user_activity(self):
369369
print(f"Error registering user activity: {e}")
370370
raise
371371

372-
def send_contextual_update(self, content: str):
372+
def send_contextual_update(self, text: str):
373373
"""Send a contextual update to the conversation.
374374
375375
Contextual updates are non-interrupting content that is sent to the server
@@ -384,7 +384,7 @@ def send_contextual_update(self, content: str):
384384
if not self._ws:
385385
raise RuntimeError("Session not started or websocket not connected.")
386386

387-
event = ContextualUpdateClientToOrchestratorEvent(content=content)
387+
event = ContextualUpdateClientToOrchestratorEvent(text=text)
388388
try:
389389
self._ws.send(json.dumps(event.to_dict()))
390390
except Exception as e:

0 commit comments

Comments
 (0)