Skip to content

Commit 9e9e5c9

Browse files
committed
fic
1 parent f947886 commit 9e9e5c9

5 files changed

Lines changed: 368 additions & 48 deletions

File tree

src/elevenlabs/conversational_ai/connection_factory.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1-
from typing import Optional
1+
from typing import Optional, Dict, Any, Callable
22

33
from .base_connection import BaseConnection, ConnectionType
44
from .websocket_connection import WebSocketConnection
5-
from .webrtc_connection import WebRTCConnection
5+
from .webrtc_connection import WebRTCConnection, WebRTCConnectionConfig
66

77

88
def create_connection(
99
connection_type: ConnectionType,
1010
*,
1111
ws_url: Optional[str] = None,
1212
conversation_token: Optional[str] = None,
13-
agent_id: Optional[str] = None
13+
agent_id: Optional[str] = None,
14+
livekit_url: Optional[str] = None,
15+
api_origin: Optional[str] = None,
16+
overrides: Optional[Dict[str, Any]] = None,
17+
on_debug: Optional[Callable[[Dict[str, Any]], None]] = None,
1418
) -> BaseConnection:
1519
"""Factory function to create connections based on type."""
1620

@@ -20,7 +24,14 @@ def create_connection(
2024
return WebSocketConnection(ws_url)
2125

2226
elif connection_type == ConnectionType.WEBRTC:
23-
return WebRTCConnection(conversation_token=conversation_token, agent_id=agent_id)
27+
return WebRTCConnection(
28+
conversation_token=conversation_token,
29+
agent_id=agent_id,
30+
livekit_url=livekit_url,
31+
api_origin=api_origin,
32+
overrides=overrides,
33+
on_debug=on_debug,
34+
)
2435

2536
else:
2637
raise ValueError(f"Unknown connection type: {connection_type}")

0 commit comments

Comments
 (0)