rasa-pro 3.11.10__py3-none-any.whl → 3.11.11__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.
Potentially problematic release.
This version of rasa-pro might be problematic. Click here for more details.
- rasa/core/channels/voice_ready/audiocodes.py +39 -16
- rasa/version.py +1 -1
- {rasa_pro-3.11.10.dist-info → rasa_pro-3.11.11.dist-info}/METADATA +1 -1
- {rasa_pro-3.11.10.dist-info → rasa_pro-3.11.11.dist-info}/RECORD +7 -7
- {rasa_pro-3.11.10.dist-info → rasa_pro-3.11.11.dist-info}/NOTICE +0 -0
- {rasa_pro-3.11.10.dist-info → rasa_pro-3.11.11.dist-info}/WHEEL +0 -0
- {rasa_pro-3.11.10.dist-info → rasa_pro-3.11.11.dist-info}/entry_points.txt +0 -0
|
@@ -6,7 +6,18 @@ import uuid
|
|
|
6
6
|
from collections import defaultdict
|
|
7
7
|
from dataclasses import asdict
|
|
8
8
|
from datetime import datetime, timedelta, timezone
|
|
9
|
-
from typing import
|
|
9
|
+
from typing import (
|
|
10
|
+
Any,
|
|
11
|
+
Awaitable,
|
|
12
|
+
Callable,
|
|
13
|
+
Dict,
|
|
14
|
+
List,
|
|
15
|
+
Optional,
|
|
16
|
+
Set,
|
|
17
|
+
Text,
|
|
18
|
+
Union,
|
|
19
|
+
Tuple,
|
|
20
|
+
)
|
|
10
21
|
|
|
11
22
|
import structlog
|
|
12
23
|
from jsonschema import ValidationError, validate
|
|
@@ -48,8 +59,8 @@ def map_call_params(parameters: Dict[Text, Any]) -> CallParameters:
|
|
|
48
59
|
"""Map the Audiocodes parameters to the CallParameters dataclass."""
|
|
49
60
|
return CallParameters(
|
|
50
61
|
call_id=parameters.get("vaigConversationId"),
|
|
51
|
-
user_phone=parameters.get("
|
|
52
|
-
bot_phone=parameters.get("
|
|
62
|
+
user_phone=parameters.get("caller"),
|
|
63
|
+
bot_phone=parameters.get("callee"),
|
|
53
64
|
user_name=parameters.get("callerDisplayName"),
|
|
54
65
|
user_host=parameters.get("callerHost"),
|
|
55
66
|
bot_host=parameters.get("calleeHost"),
|
|
@@ -76,35 +87,45 @@ class Conversation:
|
|
|
76
87
|
|
|
77
88
|
@staticmethod
|
|
78
89
|
def get_metadata(activity: Dict[Text, Any]) -> Optional[Dict[Text, Any]]:
|
|
79
|
-
"""Get metadata from the activity.
|
|
80
|
-
|
|
90
|
+
"""Get metadata from the activity.
|
|
91
|
+
|
|
92
|
+
ONLY used for activities NOT for events (see _handle_event)."""
|
|
93
|
+
return activity.get("parameters")
|
|
81
94
|
|
|
82
95
|
@staticmethod
|
|
83
|
-
def _handle_event(event: Dict[Text, Any]) -> Text:
|
|
84
|
-
"""Handle
|
|
96
|
+
def _handle_event(event: Dict[Text, Any]) -> Tuple[Text, Dict[Text, Any]]:
|
|
97
|
+
"""Handle events and return a tuple of text and metadata.
|
|
98
|
+
|
|
99
|
+
Args:
|
|
100
|
+
event: The event to handle.
|
|
101
|
+
|
|
102
|
+
Returns:
|
|
103
|
+
Tuple of text and metadata.
|
|
104
|
+
text is either /session_start or /vaig_event_<event_name>
|
|
105
|
+
metadata is a dictionary with the event parameters.
|
|
106
|
+
"""
|
|
85
107
|
structlogger.debug("audiocodes.handle.event", event_payload=event)
|
|
86
108
|
if "name" not in event:
|
|
87
109
|
structlogger.warning(
|
|
88
110
|
"audiocodes.handle.event.no_name_key", event_payload=event
|
|
89
111
|
)
|
|
90
|
-
return ""
|
|
112
|
+
return "", {}
|
|
91
113
|
|
|
92
114
|
if event["name"] == EVENT_START:
|
|
93
115
|
text = f"{INTENT_MESSAGE_PREFIX}{USER_INTENT_SESSION_START}"
|
|
116
|
+
metadata = asdict(map_call_params(event.get("parameters", {})))
|
|
94
117
|
elif event["name"] == EVENT_DTMF:
|
|
95
118
|
text = f"{INTENT_MESSAGE_PREFIX}vaig_event_DTMF"
|
|
96
|
-
|
|
97
|
-
text += json.dumps(event_params)
|
|
119
|
+
metadata = {"value": event["value"]}
|
|
98
120
|
else:
|
|
99
121
|
# handle other events described by Audiocodes
|
|
100
122
|
# https://techdocs.audiocodes.com/voice-ai-connect/#VAIG_Combined/inactivity-detection.htm?TocPath=Bot%2520integration%257CReceiving%2520notifications%257C_____3
|
|
101
123
|
text = f"{INTENT_MESSAGE_PREFIX}vaig_event_{event['name']}"
|
|
102
|
-
|
|
124
|
+
metadata = {**event.get("parameters", {})}
|
|
103
125
|
if "value" in event:
|
|
104
|
-
|
|
105
|
-
text += json.dumps(event_params)
|
|
126
|
+
metadata["value"] = event["value"]
|
|
106
127
|
|
|
107
|
-
return text
|
|
128
|
+
return text, metadata
|
|
108
129
|
|
|
109
130
|
def is_active_conversation(self, now: datetime, delta: timedelta) -> bool:
|
|
110
131
|
"""Check if the conversation is active."""
|
|
@@ -150,16 +171,18 @@ class Conversation:
|
|
|
150
171
|
self.activity_ids.append(activity[ACTIVITY_ID_KEY])
|
|
151
172
|
if activity["type"] == ACTIVITY_MESSAGE:
|
|
152
173
|
text = activity["text"]
|
|
174
|
+
metadata = self.get_metadata(activity)
|
|
153
175
|
elif activity["type"] == ACTIVITY_EVENT:
|
|
154
|
-
text = self._handle_event(activity)
|
|
176
|
+
text, metadata = self._handle_event(activity)
|
|
155
177
|
else:
|
|
156
178
|
structlogger.warning(
|
|
157
179
|
"audiocodes.handle.activities.unknown_activity_type",
|
|
158
180
|
activity=activity,
|
|
159
181
|
)
|
|
182
|
+
continue
|
|
183
|
+
|
|
160
184
|
if not text:
|
|
161
185
|
continue
|
|
162
|
-
metadata = self.get_metadata(activity)
|
|
163
186
|
user_msg = UserMessage(
|
|
164
187
|
text=text,
|
|
165
188
|
input_channel=input_channel_name,
|
rasa/version.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: rasa-pro
|
|
3
|
-
Version: 3.11.
|
|
3
|
+
Version: 3.11.11
|
|
4
4
|
Summary: State-of-the-art open-core Conversational AI framework for Enterprises that natively leverages generative AI for effortless assistant development.
|
|
5
5
|
Keywords: nlp,machine-learning,machine-learning-library,bot,bots,botkit,rasa conversational-agents,conversational-ai,chatbot,chatbot-framework,bot-framework
|
|
6
6
|
Author: Rasa Technologies GmbH
|
|
@@ -265,7 +265,7 @@ rasa/core/channels/telegram.py,sha256=5BrNECFM3qe9XjNpDb8Q9fbqCT5aKr5L6IH21W8sum
|
|
|
265
265
|
rasa/core/channels/twilio.py,sha256=GsdjfplZdBj0fRB60bSggPF1DXFZ_x18V_dlcDy5VFs,5943
|
|
266
266
|
rasa/core/channels/vier_cvg.py,sha256=PfvSluQqgJbP0JzZPFUvum3z7H55JPPeobcD-z5zCkw,13544
|
|
267
267
|
rasa/core/channels/voice_ready/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
268
|
-
rasa/core/channels/voice_ready/audiocodes.py,sha256=
|
|
268
|
+
rasa/core/channels/voice_ready/audiocodes.py,sha256=T1Tx2z4HvDhNiehsRynQ9xaJkgP9wbpILCzI_SYyD78,22289
|
|
269
269
|
rasa/core/channels/voice_ready/jambonz.py,sha256=S7yjdj7nYwQWMalqcGv8eomZGj0c2Dza-51tiNHEpVM,4784
|
|
270
270
|
rasa/core/channels/voice_ready/jambonz_protocol.py,sha256=OzW-6YMU2SIc88Mur_wktbiE46igHR8vH17DCfRijIU,13139
|
|
271
271
|
rasa/core/channels/voice_ready/twilio_voice.py,sha256=z2pdausxQnXQP9htGh8AL2q9AvcMIx70Y5tErWpssV4,16224
|
|
@@ -779,9 +779,9 @@ rasa/utils/train_utils.py,sha256=f1NWpp5y6al0dzoQyyio4hc4Nf73DRoRSHDzEK6-C4E,212
|
|
|
779
779
|
rasa/utils/url_tools.py,sha256=JQcHL2aLqLHu82k7_d9imUoETCm2bmlHaDpOJ-dKqBc,1218
|
|
780
780
|
rasa/utils/yaml.py,sha256=KjbZq5C94ZP7Jdsw8bYYF7HASI6K4-C_kdHfrnPLpSI,2000
|
|
781
781
|
rasa/validator.py,sha256=O1wjCeV7ITJ0luvb3GCWy8x1fGgzWVbClEMlPnLBowQ,67265
|
|
782
|
-
rasa/version.py,sha256=
|
|
783
|
-
rasa_pro-3.11.
|
|
784
|
-
rasa_pro-3.11.
|
|
785
|
-
rasa_pro-3.11.
|
|
786
|
-
rasa_pro-3.11.
|
|
787
|
-
rasa_pro-3.11.
|
|
782
|
+
rasa/version.py,sha256=_ZBgTfcNiibsOC-yzALLSC5ZIpzax2a9zTS3lVn3J3s,118
|
|
783
|
+
rasa_pro-3.11.11.dist-info/METADATA,sha256=rZj6MixMKB8347G-ug6_VB0ArvBxd2HI-s0_EHHrSMU,10729
|
|
784
|
+
rasa_pro-3.11.11.dist-info/NOTICE,sha256=7HlBoMHJY9CL2GlYSfTQ-PZsVmLmVkYmMiPlTjhuCqA,218
|
|
785
|
+
rasa_pro-3.11.11.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
|
|
786
|
+
rasa_pro-3.11.11.dist-info/entry_points.txt,sha256=ckJ2SfEyTPgBqj_I6vm_tqY9dZF_LAPJZA335Xp0Q9U,43
|
|
787
|
+
rasa_pro-3.11.11.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|