intellema-vdk 0.2.1__py3-none-any.whl → 0.2.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- intellema_vdk/__init__.py +67 -10
- intellema_vdk/config.py +14 -0
- intellema_vdk/providers/__init__.py +35 -0
- intellema_vdk/providers/livekit/__init__.py +19 -0
- intellema_vdk/providers/livekit/client.py +612 -0
- intellema_vdk/providers/livekit/exceptions.py +23 -0
- intellema_vdk/providers/protocols.py +33 -0
- intellema_vdk/providers/retell/__init__.py +17 -0
- intellema_vdk/providers/retell/client.py +468 -0
- intellema_vdk/providers/retell/exceptions.py +19 -0
- intellema_vdk/{retell_lib → providers/retell}/import_phone_number.py +1 -1
- intellema_vdk/stt/__init__.py +17 -0
- intellema_vdk/stt/client.py +482 -0
- intellema_vdk/stt/exceptions.py +19 -0
- intellema_vdk/tts/__init__.py +15 -0
- intellema_vdk/tts/__pycache__/__init__.cpython-312.pyc +0 -0
- intellema_vdk/tts/__pycache__/client.cpython-312.pyc +0 -0
- intellema_vdk/tts/__pycache__/exceptions.cpython-312.pyc +0 -0
- intellema_vdk/tts/__pycache__/providers.cpython-312.pyc +0 -0
- intellema_vdk/tts/client.py +541 -0
- intellema_vdk/tts/exceptions.py +15 -0
- intellema_vdk/tts/providers.py +293 -0
- intellema_vdk/utils/logger_config.py +41 -0
- intellema_vdk-0.2.2.dist-info/METADATA +311 -0
- intellema_vdk-0.2.2.dist-info/RECORD +29 -0
- {intellema_vdk-0.2.1.dist-info → intellema_vdk-0.2.2.dist-info}/WHEEL +1 -1
- intellema_vdk/__pycache__/__init__.cpython-312.pyc +0 -0
- intellema_vdk/livekit_lib/__init__.py +0 -3
- intellema_vdk/livekit_lib/__pycache__/__init__.cpython-312.pyc +0 -0
- intellema_vdk/livekit_lib/__pycache__/client.cpython-312.pyc +0 -0
- intellema_vdk/livekit_lib/client.py +0 -280
- intellema_vdk/retell_lib/__pycache__/__init__.cpython-312.pyc +0 -0
- intellema_vdk/retell_lib/__pycache__/retell_client.cpython-312.pyc +0 -0
- intellema_vdk/retell_lib/retell_client.py +0 -248
- intellema_vdk/speech_lib/__init__.py +0 -2
- intellema_vdk/speech_lib/__pycache__/__init__.cpython-312.pyc +0 -0
- intellema_vdk/speech_lib/__pycache__/stt_client.cpython-312.pyc +0 -0
- intellema_vdk/speech_lib/__pycache__/tts_streamer.cpython-312.pyc +0 -0
- intellema_vdk/speech_lib/stt_client.py +0 -110
- intellema_vdk/speech_lib/tts_streamer.py +0 -188
- intellema_vdk-0.2.1.dist-info/METADATA +0 -221
- intellema_vdk-0.2.1.dist-info/RECORD +0 -22
- /intellema_vdk/{retell_lib/__init__.py → stt/providers.py} +0 -0
- {intellema_vdk-0.2.1.dist-info → intellema_vdk-0.2.2.dist-info}/licenses/LICENSE +0 -0
- {intellema_vdk-0.2.1.dist-info → intellema_vdk-0.2.2.dist-info}/top_level.txt +0 -0
intellema_vdk/__init__.py
CHANGED
|
@@ -1,11 +1,72 @@
|
|
|
1
1
|
from typing import Optional, List, Any
|
|
2
2
|
|
|
3
|
-
from .
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
from .providers import (
|
|
4
|
+
VoiceProvider,
|
|
5
|
+
LiveKitManager,
|
|
6
|
+
RetellManager,
|
|
7
|
+
# LiveKit Exceptions
|
|
8
|
+
LiveKitError,
|
|
9
|
+
LiveKitConfigurationError,
|
|
10
|
+
LiveKitRoomError,
|
|
11
|
+
LiveKitSIPError,
|
|
12
|
+
LiveKitDispatchError,
|
|
13
|
+
LiveKitEgressError,
|
|
14
|
+
# Retell Exceptions
|
|
15
|
+
RetellError,
|
|
16
|
+
RetellConfigurationError,
|
|
17
|
+
RetellAPIError,
|
|
18
|
+
RetellPhoneNumberError,
|
|
19
|
+
RetellCallError,
|
|
20
|
+
)
|
|
21
|
+
from .stt import (
|
|
22
|
+
STTManager,
|
|
23
|
+
STTAgentError,
|
|
24
|
+
STTConfigurationError,
|
|
25
|
+
STTError,
|
|
26
|
+
STTFileError,
|
|
27
|
+
STTTranscriptionError
|
|
28
|
+
)
|
|
29
|
+
from .tts import (
|
|
30
|
+
TTSStreamer,
|
|
31
|
+
TTSError,
|
|
32
|
+
TTSConfigurationError,
|
|
33
|
+
TTSStreamError,
|
|
34
|
+
TTSAPIError,
|
|
35
|
+
)
|
|
36
|
+
from .utils.logger_config import setup_logging
|
|
7
37
|
|
|
8
|
-
|
|
38
|
+
__all__ = [
|
|
39
|
+
"VoiceClient",
|
|
40
|
+
"start_outbound_call",
|
|
41
|
+
"VoiceProvider",
|
|
42
|
+
"LiveKitManager",
|
|
43
|
+
"RetellManager",
|
|
44
|
+
"STTManager",
|
|
45
|
+
"TTSStreamer",
|
|
46
|
+
"setup_logging",
|
|
47
|
+
"LiveKitError",
|
|
48
|
+
"LiveKitConfigurationError",
|
|
49
|
+
"LiveKitRoomError",
|
|
50
|
+
"LiveKitSIPError",
|
|
51
|
+
"LiveKitDispatchError",
|
|
52
|
+
"LiveKitEgressError",
|
|
53
|
+
"RetellError",
|
|
54
|
+
"RetellConfigurationError",
|
|
55
|
+
"RetellAPIError",
|
|
56
|
+
"RetellPhoneNumberError",
|
|
57
|
+
"RetellCallError",
|
|
58
|
+
"STTAgentError",
|
|
59
|
+
"STTConfigurationError",
|
|
60
|
+
"STTError",
|
|
61
|
+
"STTFileError",
|
|
62
|
+
"STTTranscriptionError",
|
|
63
|
+
"TTSError",
|
|
64
|
+
"TTSConfigurationError",
|
|
65
|
+
"TTSStreamError",
|
|
66
|
+
"TTSAPIError",
|
|
67
|
+
]
|
|
68
|
+
|
|
69
|
+
def VoiceClient(provider: str, **kwargs) -> VoiceProvider:
|
|
9
70
|
"""
|
|
10
71
|
Factory function that returns a specific provider client.
|
|
11
72
|
|
|
@@ -28,8 +89,4 @@ async def start_outbound_call(provider: str, *args, **kwargs):
|
|
|
28
89
|
Convenience wrapper to start an outbound call.
|
|
29
90
|
"""
|
|
30
91
|
client = VoiceClient(provider)
|
|
31
|
-
|
|
32
|
-
if provider == "livekit":
|
|
33
|
-
return await client.start_outbound_call(*args, **kwargs)
|
|
34
|
-
else:
|
|
35
|
-
return client.start_outbound_call(*args, **kwargs)
|
|
92
|
+
return await client.start_outbound_call(*args, **kwargs)
|
intellema_vdk/config.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from dotenv import load_dotenv
|
|
3
|
+
|
|
4
|
+
# Load environment variables
|
|
5
|
+
load_dotenv(dotenv_path=".env.local")
|
|
6
|
+
load_dotenv()
|
|
7
|
+
|
|
8
|
+
def get_env(key: str, default: str = None) -> str:
|
|
9
|
+
"""Get an environment variable."""
|
|
10
|
+
return os.getenv(key, default)
|
|
11
|
+
|
|
12
|
+
# TTS Configuration
|
|
13
|
+
TTS_AUDIO_SAMPLE_RATE = 24000
|
|
14
|
+
WAV_HEADER_SIZE = 44
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
from .livekit import (
|
|
2
|
+
LiveKitManager,
|
|
3
|
+
LiveKitError,
|
|
4
|
+
LiveKitConfigurationError,
|
|
5
|
+
LiveKitRoomError,
|
|
6
|
+
LiveKitSIPError,
|
|
7
|
+
LiveKitDispatchError,
|
|
8
|
+
LiveKitEgressError,
|
|
9
|
+
)
|
|
10
|
+
from .retell import (
|
|
11
|
+
RetellManager,
|
|
12
|
+
RetellError,
|
|
13
|
+
RetellConfigurationError,
|
|
14
|
+
RetellAPIError,
|
|
15
|
+
RetellPhoneNumberError,
|
|
16
|
+
RetellCallError,
|
|
17
|
+
)
|
|
18
|
+
from .protocols import VoiceProvider
|
|
19
|
+
|
|
20
|
+
__all__ = [
|
|
21
|
+
"LiveKitManager",
|
|
22
|
+
"LiveKitError",
|
|
23
|
+
"LiveKitConfigurationError",
|
|
24
|
+
"LiveKitRoomError",
|
|
25
|
+
"LiveKitSIPError",
|
|
26
|
+
"LiveKitDispatchError",
|
|
27
|
+
"LiveKitEgressError",
|
|
28
|
+
"RetellManager",
|
|
29
|
+
"RetellError",
|
|
30
|
+
"RetellConfigurationError",
|
|
31
|
+
"RetellAPIError",
|
|
32
|
+
"RetellPhoneNumberError",
|
|
33
|
+
"RetellCallError",
|
|
34
|
+
"VoiceProvider",
|
|
35
|
+
]
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from .client import LiveKitManager
|
|
2
|
+
from .exceptions import (
|
|
3
|
+
LiveKitError,
|
|
4
|
+
LiveKitConfigurationError,
|
|
5
|
+
LiveKitRoomError,
|
|
6
|
+
LiveKitSIPError,
|
|
7
|
+
LiveKitDispatchError,
|
|
8
|
+
LiveKitEgressError,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
__all__ = [
|
|
12
|
+
"LiveKitManager",
|
|
13
|
+
"LiveKitError",
|
|
14
|
+
"LiveKitConfigurationError",
|
|
15
|
+
"LiveKitRoomError",
|
|
16
|
+
"LiveKitSIPError",
|
|
17
|
+
"LiveKitDispatchError",
|
|
18
|
+
"LiveKitEgressError",
|
|
19
|
+
]
|