Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: move class-level attributes to instance-level in Conversation class #418

Merged
Merged
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
10 changes: 7 additions & 3 deletions src/elevenlabs/conversational_ai/conversation.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ class Conversation:
callback_user_transcript: Optional[Callable[[str], None]]
callback_latency_measurement: Optional[Callable[[int], None]]

_thread: Optional[threading.Thread] = None
_thread: Optional[threading.Thread]
_should_stop: threading.Event
_conversation_id: Optional[str] = None
_last_interrupt_id: int = 0
_conversation_id: Optional[str]
_last_interrupt_id: int

def __init__(
self,
Expand Down Expand Up @@ -119,7 +119,11 @@ def __init__(
self.callback_agent_response_correction = callback_agent_response_correction
self.callback_user_transcript = callback_user_transcript
self.callback_latency_measurement = callback_latency_measurement

self._thread = None
self._should_stop = threading.Event()
self._conversation_id = None
self._last_interrupt_id = 0

def start_session(self):
"""Starts the conversation session.
Expand Down