Skip to content

Commit

Permalink
fix: move class-level attributes to instance-level in Conversation cl…
Browse files Browse the repository at this point in the history
…ass (#418)
  • Loading branch information
acse-efk23 authored Dec 17, 2024
1 parent 8b7d1ab commit 95bd48e
Showing 1 changed file with 7 additions and 3 deletions.
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

0 comments on commit 95bd48e

Please sign in to comment.