Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
__pycache__/
dist/
poetry.toml
venv
10 changes: 5 additions & 5 deletions src/elevenlabs/conversational_ai/conversation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
}


Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down