Skip to content

Commit 61512eb

Browse files
committed
fix
1 parent 8b1ebe7 commit 61512eb

1 file changed

Lines changed: 3 additions & 14 deletions

File tree

src/elevenlabs/conversational_ai/conversation.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import base64
33
import json
44
import threading
5-
from typing import Callable, Optional, Awaitable, Union, Any, Literal
5+
from typing import Callable, Optional, Awaitable, Union, Any, Literal, Dict, Tuple
66
import asyncio
77
from concurrent.futures import ThreadPoolExecutor
88
from enum import Enum
@@ -119,7 +119,7 @@ class ClientTools:
119119
"""
120120

121121
def __init__(self) -> None:
122-
self.tools: dict[str, tuple[Union[Callable[[dict], Any], Callable[[dict], Awaitable[Any]]], bool]] = {}
122+
self.tools: Dict[str, Tuple[Union[Callable[[dict], Any], Callable[[dict], Awaitable[Any]]], bool]] = {}
123123
self.lock = threading.Lock()
124124
self._loop = None
125125
self._thread = None
@@ -296,11 +296,10 @@ def __init__(
296296
self.client_tools.start()
297297

298298
self._thread = None
299-
self._ws: Optional[ClientConnection] = None
299+
self._ws: Optional[Connection] = None
300300
self._should_stop = threading.Event()
301301
self._conversation_id = None
302302
self._last_interrupt_id = 0
303-
self._ws = None
304303

305304
def start_session(self):
306305
"""Starts the conversation session.
@@ -491,16 +490,6 @@ def send_response(response):
491490
else:
492491
pass # Ignore all other message types.
493492

494-
def send_contextual_update(self, text: str):
495-
if not self._ws:
496-
raise RuntimeError("WebSocket is not connected")
497-
498-
payload = {
499-
"type": "contextual_update",
500-
"text": text,
501-
}
502-
self._ws.send(json.dumps(payload))
503-
504493
def _get_wss_url(self):
505494
base_ws_url = self.client._client_wrapper.get_environment().wss
506495
return f"{base_ws_url}/v1/convai/conversation?agent_id={self.agent_id}"

0 commit comments

Comments
 (0)