rasa-pro 3.11.6__py3-none-any.whl → 3.11.7__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 +57 -24
- rasa/core/policies/intentless_policy.py +5 -59
- rasa/dialogue_understanding/generator/nlu_command_adapter.py +1 -1
- rasa/dialogue_understanding/processor/command_processor.py +20 -5
- rasa/dialogue_understanding/processor/command_processor_component.py +5 -2
- rasa/engine/validation.py +37 -2
- rasa/model_training.py +2 -1
- rasa/shared/constants.py +3 -0
- rasa/shared/core/domain.py +12 -3
- rasa/shared/core/policies/__init__.py +0 -0
- rasa/shared/core/policies/utils.py +87 -0
- rasa/tracing/instrumentation/attribute_extractors.py +2 -0
- rasa/version.py +1 -1
- {rasa_pro-3.11.6.dist-info → rasa_pro-3.11.7.dist-info}/METADATA +4 -5
- {rasa_pro-3.11.6.dist-info → rasa_pro-3.11.7.dist-info}/RECORD +18 -18
- {rasa_pro-3.11.6.dist-info → rasa_pro-3.11.7.dist-info}/WHEEL +1 -1
- README.md +0 -41
- rasa/keys +0 -1
- {rasa_pro-3.11.6.dist-info → rasa_pro-3.11.7.dist-info}/NOTICE +0 -0
- {rasa_pro-3.11.6.dist-info → rasa_pro-3.11.7.dist-info}/entry_points.txt +0 -0
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
import asyncio
|
|
2
2
|
import copy
|
|
3
|
-
|
|
3
|
+
import hmac
|
|
4
4
|
import json
|
|
5
5
|
import uuid
|
|
6
6
|
from collections import defaultdict
|
|
7
7
|
from dataclasses import asdict
|
|
8
|
+
from datetime import datetime, timedelta, timezone
|
|
8
9
|
from typing import Any, Awaitable, Callable, Dict, List, Optional, Set, Text, Union
|
|
9
10
|
|
|
10
11
|
import structlog
|
|
11
12
|
from jsonschema import ValidationError, validate
|
|
13
|
+
from sanic import Blueprint, response
|
|
14
|
+
from sanic.exceptions import NotFound, SanicException, ServerError
|
|
15
|
+
from sanic.request import Request
|
|
16
|
+
from sanic.response import HTTPResponse
|
|
17
|
+
|
|
12
18
|
from rasa.core import jobs
|
|
13
19
|
from rasa.core.channels.channel import InputChannel, OutputChannel, UserMessage
|
|
14
20
|
from rasa.core.channels.voice_ready.utils import (
|
|
15
|
-
validate_voice_license_scope,
|
|
16
21
|
CallParameters,
|
|
22
|
+
validate_voice_license_scope,
|
|
17
23
|
)
|
|
18
24
|
from rasa.shared.constants import INTENT_MESSAGE_PREFIX
|
|
19
25
|
from rasa.shared.core.constants import USER_INTENT_SESSION_START
|
|
20
26
|
from rasa.shared.exceptions import RasaException
|
|
21
|
-
from sanic import Blueprint, response
|
|
22
|
-
from sanic.exceptions import NotFound, SanicException, ServerError
|
|
23
|
-
from sanic.request import Request
|
|
24
|
-
from sanic.response import HTTPResponse
|
|
25
|
-
|
|
26
27
|
from rasa.utils.io import remove_emojis
|
|
27
28
|
|
|
28
29
|
structlogger = structlog.get_logger()
|
|
@@ -114,11 +115,21 @@ class Conversation:
|
|
|
114
115
|
async def handle_activities(
|
|
115
116
|
self,
|
|
116
117
|
message: Dict[Text, Any],
|
|
118
|
+
input_channel_name: str,
|
|
117
119
|
output_channel: OutputChannel,
|
|
118
120
|
on_new_message: Callable[[UserMessage], Awaitable[Any]],
|
|
119
121
|
) -> None:
|
|
120
122
|
"""Handle activities sent by Audiocodes."""
|
|
121
123
|
structlogger.debug("audiocodes.handle.activities")
|
|
124
|
+
if input_channel_name == "":
|
|
125
|
+
structlogger.warning(
|
|
126
|
+
"audiocodes.handle.activities.empty_input_channel_name",
|
|
127
|
+
event_info=(
|
|
128
|
+
f"Audiocodes input channel name is empty "
|
|
129
|
+
f"for conversation {self.conversation_id}"
|
|
130
|
+
),
|
|
131
|
+
)
|
|
132
|
+
|
|
122
133
|
for activity in message["activities"]:
|
|
123
134
|
text = None
|
|
124
135
|
if activity[ACTIVITY_ID_KEY] in self.activity_ids:
|
|
@@ -142,6 +153,7 @@ class Conversation:
|
|
|
142
153
|
metadata = self.get_metadata(activity)
|
|
143
154
|
user_msg = UserMessage(
|
|
144
155
|
text=text,
|
|
156
|
+
input_channel=input_channel_name,
|
|
145
157
|
output_channel=output_channel,
|
|
146
158
|
sender_id=self.conversation_id,
|
|
147
159
|
metadata=metadata,
|
|
@@ -246,6 +258,9 @@ class AudiocodesInput(InputChannel):
|
|
|
246
258
|
def _check_token(self, token: Optional[Text]) -> None:
|
|
247
259
|
if not token:
|
|
248
260
|
raise HttpUnauthorized("Authentication token required.")
|
|
261
|
+
if not hmac.compare_digest(str(token), str(self.token)):
|
|
262
|
+
structlogger.error("audiocodes.invalid_token", invalid_token=token)
|
|
263
|
+
raise HttpUnauthorized("Invalid authentication token.")
|
|
249
264
|
|
|
250
265
|
def _get_conversation(
|
|
251
266
|
self, token: Optional[Text], conversation_id: Text
|
|
@@ -388,7 +403,12 @@ class AudiocodesInput(InputChannel):
|
|
|
388
403
|
# start a background task to handle activities
|
|
389
404
|
self._create_task(
|
|
390
405
|
conversation_id,
|
|
391
|
-
conversation.handle_activities(
|
|
406
|
+
conversation.handle_activities(
|
|
407
|
+
request.json,
|
|
408
|
+
input_channel_name=self.name(),
|
|
409
|
+
output_channel=ac_output,
|
|
410
|
+
on_new_message=on_new_message,
|
|
411
|
+
),
|
|
392
412
|
)
|
|
393
413
|
return response.json(response_json)
|
|
394
414
|
|
|
@@ -401,23 +421,9 @@ class AudiocodesInput(InputChannel):
|
|
|
401
421
|
Example of payload:
|
|
402
422
|
{"conversation": <conversation_id>, "reason": Optional[Text]}.
|
|
403
423
|
"""
|
|
404
|
-
self.
|
|
405
|
-
|
|
406
|
-
await on_new_message(
|
|
407
|
-
UserMessage(
|
|
408
|
-
text=f"{INTENT_MESSAGE_PREFIX}session_end",
|
|
409
|
-
output_channel=None,
|
|
410
|
-
sender_id=conversation_id,
|
|
411
|
-
metadata=reason,
|
|
412
|
-
)
|
|
424
|
+
return await self._handle_disconnect(
|
|
425
|
+
request, conversation_id, on_new_message
|
|
413
426
|
)
|
|
414
|
-
del self.conversations[conversation_id]
|
|
415
|
-
structlogger.debug(
|
|
416
|
-
"audiocodes.disconnect",
|
|
417
|
-
conversation=conversation_id,
|
|
418
|
-
request=request.json,
|
|
419
|
-
)
|
|
420
|
-
return response.json({})
|
|
421
427
|
|
|
422
428
|
@ac_webhook.route("/conversation/<conversation_id>/keepalive", methods=["POST"])
|
|
423
429
|
async def keepalive(request: Request, conversation_id: Text) -> HTTPResponse:
|
|
@@ -432,6 +438,32 @@ class AudiocodesInput(InputChannel):
|
|
|
432
438
|
|
|
433
439
|
return ac_webhook
|
|
434
440
|
|
|
441
|
+
async def _handle_disconnect(
|
|
442
|
+
self,
|
|
443
|
+
request: Request,
|
|
444
|
+
conversation_id: Text,
|
|
445
|
+
on_new_message: Callable[[UserMessage], Awaitable[Any]],
|
|
446
|
+
) -> HTTPResponse:
|
|
447
|
+
"""Triggered when the call is disconnected."""
|
|
448
|
+
self._get_conversation(request.token, conversation_id)
|
|
449
|
+
reason = {"reason": request.json.get("reason")}
|
|
450
|
+
await on_new_message(
|
|
451
|
+
UserMessage(
|
|
452
|
+
text=f"{INTENT_MESSAGE_PREFIX}session_end",
|
|
453
|
+
input_channel=self.name(),
|
|
454
|
+
output_channel=None,
|
|
455
|
+
sender_id=conversation_id,
|
|
456
|
+
metadata=reason,
|
|
457
|
+
)
|
|
458
|
+
)
|
|
459
|
+
del self.conversations[conversation_id]
|
|
460
|
+
structlogger.debug(
|
|
461
|
+
"audiocodes.disconnect",
|
|
462
|
+
conversation=conversation_id,
|
|
463
|
+
request=request.json,
|
|
464
|
+
)
|
|
465
|
+
return response.json({})
|
|
466
|
+
|
|
435
467
|
|
|
436
468
|
class AudiocodesOutput(OutputChannel):
|
|
437
469
|
@classmethod
|
|
@@ -439,6 +471,7 @@ class AudiocodesOutput(OutputChannel):
|
|
|
439
471
|
return CHANNEL_NAME
|
|
440
472
|
|
|
441
473
|
def __init__(self) -> None:
|
|
474
|
+
super().__init__()
|
|
442
475
|
self.messages: List[Dict] = []
|
|
443
476
|
|
|
444
477
|
async def add_message(self, message: Dict) -> None:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import importlib.resources
|
|
2
2
|
import math
|
|
3
3
|
from dataclasses import dataclass, field
|
|
4
|
-
from typing import Any, Dict, List, Optional,
|
|
4
|
+
from typing import Any, Dict, List, Optional, TYPE_CHECKING, Text, Tuple
|
|
5
5
|
|
|
6
6
|
import structlog
|
|
7
7
|
import tiktoken
|
|
@@ -18,7 +18,6 @@ from rasa.core.constants import (
|
|
|
18
18
|
UTTER_SOURCE_METADATA_KEY,
|
|
19
19
|
)
|
|
20
20
|
from rasa.core.policies.policy import Policy, PolicyPrediction, SupportedData
|
|
21
|
-
from rasa.dialogue_understanding.patterns.chitchat import FLOW_PATTERN_CHITCHAT
|
|
22
21
|
from rasa.dialogue_understanding.stack.frames import (
|
|
23
22
|
ChitChatStackFrame,
|
|
24
23
|
DialogueStackFrame,
|
|
@@ -30,7 +29,6 @@ from rasa.engine.storage.storage import ModelStorage
|
|
|
30
29
|
from rasa.graph_components.providers.forms_provider import Forms
|
|
31
30
|
from rasa.graph_components.providers.responses_provider import Responses
|
|
32
31
|
from rasa.shared.constants import (
|
|
33
|
-
REQUIRED_SLOTS_KEY,
|
|
34
32
|
EMBEDDINGS_CONFIG_KEY,
|
|
35
33
|
LLM_CONFIG_KEY,
|
|
36
34
|
MODEL_CONFIG_KEY,
|
|
@@ -42,7 +40,6 @@ from rasa.shared.constants import (
|
|
|
42
40
|
MODEL_GROUP_ID_CONFIG_KEY,
|
|
43
41
|
)
|
|
44
42
|
from rasa.shared.core.constants import ACTION_LISTEN_NAME
|
|
45
|
-
from rasa.shared.core.constants import ACTION_TRIGGER_CHITCHAT
|
|
46
43
|
from rasa.shared.core.domain import KEY_RESPONSES_TEXT, Domain
|
|
47
44
|
from rasa.shared.core.events import (
|
|
48
45
|
ActionExecuted,
|
|
@@ -52,6 +49,7 @@ from rasa.shared.core.events import (
|
|
|
52
49
|
)
|
|
53
50
|
from rasa.shared.core.flows import FlowsList
|
|
54
51
|
from rasa.shared.core.generator import TrackerWithCachedStates
|
|
52
|
+
from rasa.shared.core.policies.utils import filter_responses_for_intentless_policy
|
|
55
53
|
from rasa.shared.core.trackers import DialogueStateTracker
|
|
56
54
|
from rasa.shared.exceptions import FileIOException, RasaCoreException
|
|
57
55
|
from rasa.shared.nlu.constants import PREDICTED_CONFIDENCE_KEY
|
|
@@ -147,59 +145,6 @@ class Conversation:
|
|
|
147
145
|
interactions: List[Interaction] = field(default_factory=list)
|
|
148
146
|
|
|
149
147
|
|
|
150
|
-
def collect_form_responses(forms: Forms) -> Set[Text]:
|
|
151
|
-
"""Collect responses that belong the requested slots in forms.
|
|
152
|
-
|
|
153
|
-
Args:
|
|
154
|
-
forms: the forms from the domain
|
|
155
|
-
Returns:
|
|
156
|
-
all utterances used in forms
|
|
157
|
-
"""
|
|
158
|
-
form_responses = set()
|
|
159
|
-
for _, form_info in forms.data.items():
|
|
160
|
-
for required_slot in form_info.get(REQUIRED_SLOTS_KEY, []):
|
|
161
|
-
form_responses.add(f"utter_ask_{required_slot}")
|
|
162
|
-
return form_responses
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
def filter_responses(responses: Responses, forms: Forms, flows: FlowsList) -> Responses:
|
|
166
|
-
"""Filters out responses that are unwanted for the intentless policy.
|
|
167
|
-
|
|
168
|
-
This includes utterances used in flows and forms.
|
|
169
|
-
|
|
170
|
-
Args:
|
|
171
|
-
responses: the responses from the domain
|
|
172
|
-
forms: the forms from the domain
|
|
173
|
-
flows: all flows
|
|
174
|
-
Returns:
|
|
175
|
-
The remaining, relevant responses for the intentless policy.
|
|
176
|
-
"""
|
|
177
|
-
form_responses = collect_form_responses(forms)
|
|
178
|
-
flow_responses = flows.utterances
|
|
179
|
-
combined_responses = form_responses | flow_responses
|
|
180
|
-
filtered_responses = {
|
|
181
|
-
name: variants
|
|
182
|
-
for name, variants in responses.data.items()
|
|
183
|
-
if name not in combined_responses
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
pattern_chitchat = flows.flow_by_id(FLOW_PATTERN_CHITCHAT)
|
|
187
|
-
|
|
188
|
-
# The following condition is highly unlikely, but mypy requires the case
|
|
189
|
-
# of pattern_chitchat == None to be addressed
|
|
190
|
-
if not pattern_chitchat:
|
|
191
|
-
return Responses(data=filtered_responses)
|
|
192
|
-
|
|
193
|
-
# if action_trigger_chitchat, filter out "utter_free_chitchat_response"
|
|
194
|
-
has_action_trigger_chitchat = pattern_chitchat.has_action_step(
|
|
195
|
-
ACTION_TRIGGER_CHITCHAT
|
|
196
|
-
)
|
|
197
|
-
if has_action_trigger_chitchat:
|
|
198
|
-
filtered_responses.pop("utter_free_chitchat_response", None)
|
|
199
|
-
|
|
200
|
-
return Responses(data=filtered_responses)
|
|
201
|
-
|
|
202
|
-
|
|
203
148
|
def action_from_response(
|
|
204
149
|
text: Optional[str], responses: Dict[Text, List[Dict[Text, Any]]]
|
|
205
150
|
) -> Optional[str]:
|
|
@@ -513,7 +458,9 @@ class IntentlessPolicy(LLMHealthCheckMixin, EmbeddingsHealthCheckMixin, Policy):
|
|
|
513
458
|
# Perform health checks of both LLM and embeddings client configs
|
|
514
459
|
self._perform_health_checks(self.config, "intentless_policy.train")
|
|
515
460
|
|
|
516
|
-
responses =
|
|
461
|
+
responses = filter_responses_for_intentless_policy(
|
|
462
|
+
responses, forms, flows or FlowsList([])
|
|
463
|
+
)
|
|
517
464
|
telemetry.track_intentless_policy_train()
|
|
518
465
|
response_texts = [r for r in extract_ai_response_examples(responses.data)]
|
|
519
466
|
|
|
@@ -948,7 +895,6 @@ class IntentlessPolicy(LLMHealthCheckMixin, EmbeddingsHealthCheckMixin, Policy):
|
|
|
948
895
|
**kwargs: Any,
|
|
949
896
|
) -> "IntentlessPolicy":
|
|
950
897
|
"""Loads a trained policy (see parent class for full docstring)."""
|
|
951
|
-
|
|
952
898
|
# Perform health checks of both LLM and embeddings client configs
|
|
953
899
|
cls._perform_health_checks(config, "intentless_policy.load")
|
|
954
900
|
|
|
@@ -139,7 +139,7 @@ class NLUCommandAdapter(GraphComponent, CommandGenerator):
|
|
|
139
139
|
|
|
140
140
|
if commands:
|
|
141
141
|
commands = clean_up_commands(
|
|
142
|
-
commands, tracker, flows, self._execution_context
|
|
142
|
+
commands, tracker, flows, self._execution_context, domain
|
|
143
143
|
)
|
|
144
144
|
log_llm(
|
|
145
145
|
logger=structlogger,
|
|
@@ -41,9 +41,11 @@ from rasa.shared.constants import (
|
|
|
41
41
|
)
|
|
42
42
|
from rasa.shared.core.constants import ACTION_TRIGGER_CHITCHAT, SlotMappingType
|
|
43
43
|
from rasa.shared.core.constants import FLOW_HASHES_SLOT
|
|
44
|
+
from rasa.shared.core.domain import Domain
|
|
44
45
|
from rasa.shared.core.events import Event, SlotSet
|
|
45
46
|
from rasa.shared.core.flows import FlowsList
|
|
46
47
|
from rasa.shared.core.flows.steps.collect import CollectInformationFlowStep
|
|
48
|
+
from rasa.shared.core.policies.utils import contains_intentless_policy_responses
|
|
47
49
|
from rasa.shared.core.slots import Slot
|
|
48
50
|
from rasa.shared.core.trackers import DialogueStateTracker
|
|
49
51
|
from rasa.shared.nlu.constants import COMMANDS
|
|
@@ -182,6 +184,7 @@ def execute_commands(
|
|
|
182
184
|
all_flows: FlowsList,
|
|
183
185
|
execution_context: ExecutionContext,
|
|
184
186
|
story_graph: Optional[StoryGraph] = None,
|
|
187
|
+
domain: Optional[Domain] = None,
|
|
185
188
|
) -> List[Event]:
|
|
186
189
|
"""Executes a list of commands.
|
|
187
190
|
|
|
@@ -191,6 +194,7 @@ def execute_commands(
|
|
|
191
194
|
all_flows: All flows.
|
|
192
195
|
execution_context: Information about the single graph run.
|
|
193
196
|
story_graph: StoryGraph object with stories available for training.
|
|
197
|
+
domain: The domain of the bot.
|
|
194
198
|
|
|
195
199
|
Returns:
|
|
196
200
|
A list of the events that were created.
|
|
@@ -199,7 +203,7 @@ def execute_commands(
|
|
|
199
203
|
original_tracker = tracker.copy()
|
|
200
204
|
|
|
201
205
|
commands = clean_up_commands(
|
|
202
|
-
commands, tracker, all_flows, execution_context, story_graph
|
|
206
|
+
commands, tracker, all_flows, execution_context, story_graph, domain
|
|
203
207
|
)
|
|
204
208
|
|
|
205
209
|
updated_flows = find_updated_flows(tracker, all_flows)
|
|
@@ -333,6 +337,7 @@ def clean_up_commands(
|
|
|
333
337
|
all_flows: FlowsList,
|
|
334
338
|
execution_context: ExecutionContext,
|
|
335
339
|
story_graph: Optional[StoryGraph] = None,
|
|
340
|
+
domain: Optional[Domain] = None,
|
|
336
341
|
) -> List[Command]:
|
|
337
342
|
"""Clean up a list of commands.
|
|
338
343
|
|
|
@@ -348,10 +353,13 @@ def clean_up_commands(
|
|
|
348
353
|
all_flows: All flows.
|
|
349
354
|
execution_context: Information about a single graph run.
|
|
350
355
|
story_graph: StoryGraph object with stories available for training.
|
|
356
|
+
domain: The domain of the bot.
|
|
351
357
|
|
|
352
358
|
Returns:
|
|
353
359
|
The cleaned up commands.
|
|
354
360
|
"""
|
|
361
|
+
domain = domain if domain else Domain.empty()
|
|
362
|
+
|
|
355
363
|
slots_so_far, active_flow = filled_slots_for_active_flow(tracker, all_flows)
|
|
356
364
|
|
|
357
365
|
clean_commands: List[Command] = []
|
|
@@ -394,7 +402,12 @@ def clean_up_commands(
|
|
|
394
402
|
# handle chitchat command differently from other free-form answer commands
|
|
395
403
|
elif isinstance(command, ChitChatAnswerCommand):
|
|
396
404
|
clean_commands = clean_up_chitchat_command(
|
|
397
|
-
clean_commands,
|
|
405
|
+
clean_commands,
|
|
406
|
+
command,
|
|
407
|
+
all_flows,
|
|
408
|
+
execution_context,
|
|
409
|
+
domain,
|
|
410
|
+
story_graph,
|
|
398
411
|
)
|
|
399
412
|
|
|
400
413
|
elif isinstance(command, FreeFormAnswerCommand):
|
|
@@ -590,6 +603,7 @@ def clean_up_chitchat_command(
|
|
|
590
603
|
command: ChitChatAnswerCommand,
|
|
591
604
|
flows: FlowsList,
|
|
592
605
|
execution_context: ExecutionContext,
|
|
606
|
+
domain: Domain,
|
|
593
607
|
story_graph: Optional[StoryGraph] = None,
|
|
594
608
|
) -> List[Command]:
|
|
595
609
|
"""Clean up a chitchat answer command.
|
|
@@ -603,6 +617,8 @@ def clean_up_chitchat_command(
|
|
|
603
617
|
flows: All flows.
|
|
604
618
|
execution_context: Information about a single graph run.
|
|
605
619
|
story_graph: StoryGraph object with stories available for training.
|
|
620
|
+
domain: The domain of the bot.
|
|
621
|
+
|
|
606
622
|
Returns:
|
|
607
623
|
The cleaned up commands.
|
|
608
624
|
"""
|
|
@@ -628,10 +644,9 @@ def clean_up_chitchat_command(
|
|
|
628
644
|
)
|
|
629
645
|
defines_intentless_policy = execution_context.has_node(IntentlessPolicy)
|
|
630
646
|
|
|
631
|
-
has_e2e_stories = True if (story_graph and story_graph.has_e2e_stories()) else False
|
|
632
|
-
|
|
633
647
|
if (has_action_trigger_chitchat and not defines_intentless_policy) or (
|
|
634
|
-
defines_intentless_policy
|
|
648
|
+
defines_intentless_policy
|
|
649
|
+
and not contains_intentless_policy_responses(flows, domain, story_graph)
|
|
635
650
|
):
|
|
636
651
|
resulting_commands.insert(
|
|
637
652
|
0, CannotHandleCommand(RASA_PATTERN_CANNOT_HANDLE_CHITCHAT)
|
|
@@ -6,6 +6,7 @@ import rasa.dialogue_understanding.processor.command_processor
|
|
|
6
6
|
from rasa.engine.graph import ExecutionContext, GraphComponent
|
|
7
7
|
from rasa.engine.storage.resource import Resource
|
|
8
8
|
from rasa.engine.storage.storage import ModelStorage
|
|
9
|
+
from rasa.shared.core.domain import Domain
|
|
9
10
|
from rasa.shared.core.events import Event
|
|
10
11
|
from rasa.shared.core.flows import FlowsList
|
|
11
12
|
from rasa.shared.core.trackers import DialogueStateTracker
|
|
@@ -15,7 +16,8 @@ from rasa.shared.core.training_data.structures import StoryGraph
|
|
|
15
16
|
class CommandProcessorComponent(GraphComponent):
|
|
16
17
|
"""Processes commands by issuing events to modify a tracker.
|
|
17
18
|
|
|
18
|
-
Minimal component that applies commands to a tracker.
|
|
19
|
+
Minimal component that applies commands to a tracker.
|
|
20
|
+
"""
|
|
19
21
|
|
|
20
22
|
def __init__(self, execution_context: ExecutionContext):
|
|
21
23
|
self._execution_context = execution_context
|
|
@@ -36,8 +38,9 @@ class CommandProcessorComponent(GraphComponent):
|
|
|
36
38
|
tracker: DialogueStateTracker,
|
|
37
39
|
flows: FlowsList,
|
|
38
40
|
story_graph: StoryGraph,
|
|
41
|
+
domain: Domain,
|
|
39
42
|
) -> List[Event]:
|
|
40
43
|
"""Execute commands to update tracker state."""
|
|
41
44
|
return rasa.dialogue_understanding.processor.command_processor.execute_commands(
|
|
42
|
-
tracker, flows, self._execution_context, story_graph
|
|
45
|
+
tracker, flows, self._execution_context, story_graph, domain
|
|
43
46
|
)
|
rasa/engine/validation.py
CHANGED
|
@@ -84,8 +84,10 @@ from rasa.shared.constants import (
|
|
|
84
84
|
)
|
|
85
85
|
from rasa.shared.core.constants import ACTION_RESET_ROUTING, ACTION_TRIGGER_CHITCHAT
|
|
86
86
|
from rasa.shared.core.domain import Domain
|
|
87
|
-
from rasa.shared.core.flows import
|
|
87
|
+
from rasa.shared.core.flows import Flow, FlowsList
|
|
88
|
+
from rasa.shared.core.policies.utils import contains_intentless_policy_responses
|
|
88
89
|
from rasa.shared.core.slots import Slot
|
|
90
|
+
from rasa.shared.core.training_data.structures import StoryGraph
|
|
89
91
|
from rasa.shared.exceptions import RasaException
|
|
90
92
|
from rasa.shared.nlu.training_data.message import Message
|
|
91
93
|
|
|
@@ -640,11 +642,18 @@ def _recursively_check_required_components(
|
|
|
640
642
|
|
|
641
643
|
|
|
642
644
|
def validate_flow_component_dependencies(
|
|
643
|
-
flows: FlowsList,
|
|
645
|
+
flows: FlowsList,
|
|
646
|
+
domain: Domain,
|
|
647
|
+
story_graph: StoryGraph,
|
|
648
|
+
model_configuration: GraphModelConfiguration,
|
|
644
649
|
) -> None:
|
|
645
650
|
if (pattern_chitchat := flows.flow_by_id(FLOW_PATTERN_CHITCHAT)) is not None:
|
|
646
651
|
_validate_chitchat_dependencies(pattern_chitchat, model_configuration)
|
|
647
652
|
|
|
653
|
+
_validate_intentless_policy_responses(
|
|
654
|
+
flows, domain, story_graph, model_configuration
|
|
655
|
+
)
|
|
656
|
+
|
|
648
657
|
|
|
649
658
|
def _validate_chitchat_dependencies(
|
|
650
659
|
pattern_chitchat: Flow, model_configuration: GraphModelConfiguration
|
|
@@ -672,6 +681,32 @@ def _validate_chitchat_dependencies(
|
|
|
672
681
|
)
|
|
673
682
|
|
|
674
683
|
|
|
684
|
+
def _validate_intentless_policy_responses(
|
|
685
|
+
flows: FlowsList,
|
|
686
|
+
domain: Domain,
|
|
687
|
+
story_graph: StoryGraph,
|
|
688
|
+
model_configuration: GraphModelConfiguration,
|
|
689
|
+
) -> None:
|
|
690
|
+
"""If IntentlessPolicy is configured, validate that it has responses to use:
|
|
691
|
+
either responses from the domain that are not part of any flow, or from
|
|
692
|
+
end-to-end stories.
|
|
693
|
+
"""
|
|
694
|
+
if not model_configuration.predict_schema.has_node(IntentlessPolicy):
|
|
695
|
+
return
|
|
696
|
+
|
|
697
|
+
if not contains_intentless_policy_responses(flows, domain, story_graph):
|
|
698
|
+
structlogger.error(
|
|
699
|
+
"validation.intentless_policy.no_applicable_responses_found",
|
|
700
|
+
event_info=(
|
|
701
|
+
"IntentlessPolicy is configured, but no applicable responses are "
|
|
702
|
+
"found. Please make sure that there are responses defined in the "
|
|
703
|
+
"domain that are not part of any flow, or that there are "
|
|
704
|
+
"end-to-end stories in the training data."
|
|
705
|
+
),
|
|
706
|
+
)
|
|
707
|
+
sys.exit(1)
|
|
708
|
+
|
|
709
|
+
|
|
675
710
|
def get_component_index(schema: GraphSchema, component_class: Type) -> Optional[int]:
|
|
676
711
|
"""Extracts the index of a component of the given class in the schema.
|
|
677
712
|
This function assumes that each component's node name is stored in a way
|
rasa/model_training.py
CHANGED
|
@@ -312,6 +312,7 @@ async def _train_graph(
|
|
|
312
312
|
)
|
|
313
313
|
flows = file_importer.get_flows()
|
|
314
314
|
domain = file_importer.get_domain()
|
|
315
|
+
story_graph = file_importer.get_stories()
|
|
315
316
|
model_configuration = recipe.graph_config_for_recipe(
|
|
316
317
|
config,
|
|
317
318
|
kwargs,
|
|
@@ -327,7 +328,7 @@ async def _train_graph(
|
|
|
327
328
|
config
|
|
328
329
|
)
|
|
329
330
|
rasa.engine.validation.validate_flow_component_dependencies(
|
|
330
|
-
flows, model_configuration
|
|
331
|
+
flows, domain, story_graph, model_configuration
|
|
331
332
|
)
|
|
332
333
|
rasa.engine.validation.validate_command_generator_setup(model_configuration)
|
|
333
334
|
|
rasa/shared/constants.py
CHANGED
|
@@ -98,6 +98,8 @@ UTTER_ASK_PREFIX = "utter_ask_"
|
|
|
98
98
|
ACTION_ASK_PREFIX = "action_ask_"
|
|
99
99
|
FLOW_PREFIX = "flow_"
|
|
100
100
|
|
|
101
|
+
UTTER_FREE_CHITCHAT_RESPONSE = "utter_free_chitchat_response"
|
|
102
|
+
|
|
101
103
|
ASSISTANT_ID_KEY = "assistant_id"
|
|
102
104
|
ASSISTANT_ID_DEFAULT_VALUE = "placeholder_default"
|
|
103
105
|
|
|
@@ -113,6 +115,7 @@ CONFIG_KEYS = CONFIG_KEYS_CORE + CONFIG_KEYS_NLU
|
|
|
113
115
|
CONFIG_MANDATORY_KEYS_CORE: List[Text] = [] + CONFIG_MANDATORY_COMMON_KEYS
|
|
114
116
|
CONFIG_MANDATORY_KEYS_NLU = ["language"] + CONFIG_MANDATORY_COMMON_KEYS
|
|
115
117
|
CONFIG_MANDATORY_KEYS = CONFIG_MANDATORY_KEYS_CORE + CONFIG_MANDATORY_KEYS_NLU
|
|
118
|
+
CONFIG_RECIPE_KEY = "recipe"
|
|
116
119
|
|
|
117
120
|
# Keys related to Forms (in the Domain)
|
|
118
121
|
REQUIRED_SLOTS_KEY = "required_slots"
|
rasa/shared/core/domain.py
CHANGED
|
@@ -1683,6 +1683,14 @@ class Domain:
|
|
|
1683
1683
|
"""Write domain to a file."""
|
|
1684
1684
|
as_yaml = self.as_yaml()
|
|
1685
1685
|
rasa.shared.utils.io.write_text_file(as_yaml, filename)
|
|
1686
|
+
# run the check again on the written domain to catch any errors
|
|
1687
|
+
# that may have been missed in the user defined domain files
|
|
1688
|
+
structlogger.info(
|
|
1689
|
+
"domain.persist.domain_written_to_file",
|
|
1690
|
+
event_info="The entire domain content has been written to file.",
|
|
1691
|
+
filename=filename,
|
|
1692
|
+
)
|
|
1693
|
+
Domain.is_domain_file(filename)
|
|
1686
1694
|
|
|
1687
1695
|
def as_yaml(self) -> Text:
|
|
1688
1696
|
"""Dump the `Domain` object as a YAML string.
|
|
@@ -1977,17 +1985,18 @@ class Domain:
|
|
|
1977
1985
|
|
|
1978
1986
|
try:
|
|
1979
1987
|
content = read_yaml_file(filename, expand_env_vars=cls.expand_env_vars)
|
|
1980
|
-
except (RasaException, YamlSyntaxException):
|
|
1981
|
-
structlogger.
|
|
1988
|
+
except (RasaException, YamlSyntaxException) as error:
|
|
1989
|
+
structlogger.error(
|
|
1982
1990
|
"domain.cannot_load_domain_file",
|
|
1983
1991
|
file=filename,
|
|
1992
|
+
error=error,
|
|
1984
1993
|
event_info=(
|
|
1985
1994
|
f"The file {filename} could not be loaded as domain file. "
|
|
1986
1995
|
f"You can use https://yamlchecker.com/ to validate "
|
|
1987
1996
|
f"the YAML syntax of your file."
|
|
1988
1997
|
),
|
|
1989
1998
|
)
|
|
1990
|
-
|
|
1999
|
+
raise RasaException(f"Domain could not be loaded: {error}")
|
|
1991
2000
|
|
|
1992
2001
|
return any(key in content for key in ALL_DOMAIN_KEYS)
|
|
1993
2002
|
|
|
File without changes
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
from typing import Set, Text
|
|
2
|
+
|
|
3
|
+
from rasa.dialogue_understanding.patterns.chitchat import FLOW_PATTERN_CHITCHAT
|
|
4
|
+
from rasa.graph_components.providers.forms_provider import Forms
|
|
5
|
+
from rasa.graph_components.providers.responses_provider import Responses
|
|
6
|
+
from rasa.shared.constants import (
|
|
7
|
+
REQUIRED_SLOTS_KEY,
|
|
8
|
+
UTTER_ASK_PREFIX,
|
|
9
|
+
UTTER_FREE_CHITCHAT_RESPONSE,
|
|
10
|
+
)
|
|
11
|
+
from rasa.shared.core.constants import ACTION_TRIGGER_CHITCHAT
|
|
12
|
+
from rasa.shared.core.domain import Domain
|
|
13
|
+
from rasa.shared.core.flows import FlowsList
|
|
14
|
+
from rasa.shared.core.training_data.structures import StoryGraph
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def collect_form_responses(forms: Forms) -> Set[Text]:
|
|
18
|
+
"""Collect responses that belong the requested slots in forms.
|
|
19
|
+
|
|
20
|
+
Args:
|
|
21
|
+
forms: the forms from the domain
|
|
22
|
+
Returns:
|
|
23
|
+
all utterances used in forms
|
|
24
|
+
"""
|
|
25
|
+
form_responses = set()
|
|
26
|
+
for _, form_info in forms.data.items():
|
|
27
|
+
for required_slot in form_info.get(REQUIRED_SLOTS_KEY, []):
|
|
28
|
+
form_responses.add(f"{UTTER_ASK_PREFIX}{required_slot}")
|
|
29
|
+
return form_responses
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def filter_responses_for_intentless_policy(
|
|
33
|
+
responses: Responses, forms: Forms, flows: FlowsList
|
|
34
|
+
) -> Responses:
|
|
35
|
+
"""Filters out responses that are unwanted for the intentless policy.
|
|
36
|
+
|
|
37
|
+
This includes utterances used in flows and forms.
|
|
38
|
+
|
|
39
|
+
Args:
|
|
40
|
+
responses: the responses from the domain
|
|
41
|
+
forms: the forms from the domain
|
|
42
|
+
flows: all flows
|
|
43
|
+
Returns:
|
|
44
|
+
The remaining, relevant responses for the intentless policy.
|
|
45
|
+
"""
|
|
46
|
+
form_responses = collect_form_responses(forms)
|
|
47
|
+
flow_responses = flows.utterances
|
|
48
|
+
combined_responses = form_responses | flow_responses
|
|
49
|
+
filtered_responses = {
|
|
50
|
+
name: variants
|
|
51
|
+
for name, variants in responses.data.items()
|
|
52
|
+
if name not in combined_responses
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
pattern_chitchat = flows.flow_by_id(FLOW_PATTERN_CHITCHAT)
|
|
56
|
+
|
|
57
|
+
# The following condition is highly unlikely, but mypy requires the case
|
|
58
|
+
# of pattern_chitchat == None to be addressed
|
|
59
|
+
if not pattern_chitchat:
|
|
60
|
+
return Responses(data=filtered_responses)
|
|
61
|
+
|
|
62
|
+
# if action_trigger_chitchat, filter out "utter_free_chitchat_response"
|
|
63
|
+
has_action_trigger_chitchat = pattern_chitchat.has_action_step(
|
|
64
|
+
ACTION_TRIGGER_CHITCHAT
|
|
65
|
+
)
|
|
66
|
+
if has_action_trigger_chitchat:
|
|
67
|
+
filtered_responses.pop(UTTER_FREE_CHITCHAT_RESPONSE, None)
|
|
68
|
+
|
|
69
|
+
return Responses(data=filtered_responses)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def contains_intentless_policy_responses(
|
|
73
|
+
flows: FlowsList, domain: Domain, story_graph: StoryGraph
|
|
74
|
+
) -> bool:
|
|
75
|
+
"""Checks if IntentlessPolicy has applicable responses: either responses in the
|
|
76
|
+
domain that are not part of any flow, or if there are e2e stories.
|
|
77
|
+
"""
|
|
78
|
+
responses = filter_responses_for_intentless_policy(
|
|
79
|
+
Responses(data=domain.responses), Forms(data=domain.forms), flows
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
has_applicable_responses = bool(
|
|
83
|
+
responses and responses.data and len(responses.data) > 0
|
|
84
|
+
)
|
|
85
|
+
has_e2e_stories = bool(story_graph and story_graph.has_e2e_stories())
|
|
86
|
+
|
|
87
|
+
return has_applicable_responses or has_e2e_stories
|
|
@@ -439,6 +439,7 @@ def extract_attrs_for_execute_commands(
|
|
|
439
439
|
all_flows: FlowsList,
|
|
440
440
|
execution_context: ExecutionContext,
|
|
441
441
|
story_graph: Optional[StoryGraph] = None,
|
|
442
|
+
domain: Optional[Domain] = None,
|
|
442
443
|
) -> Dict[str, Any]:
|
|
443
444
|
return {
|
|
444
445
|
"number_of_events": len(tracker.events),
|
|
@@ -482,6 +483,7 @@ def extract_attrs_for_clean_up_commands(
|
|
|
482
483
|
all_flows: FlowsList,
|
|
483
484
|
execution_context: ExecutionContext,
|
|
484
485
|
story_graph: Optional[StoryGraph] = None,
|
|
486
|
+
domain: Optional[Domain] = None,
|
|
485
487
|
) -> Dict[str, Any]:
|
|
486
488
|
commands_list = []
|
|
487
489
|
|
rasa/version.py
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
2
|
Name: rasa-pro
|
|
3
|
-
Version: 3.11.
|
|
3
|
+
Version: 3.11.7
|
|
4
4
|
Summary: State-of-the-art open-core Conversational AI framework for Enterprises that natively leverages generative AI for effortless assistant development.
|
|
5
|
-
Home-page: https://rasa.com
|
|
6
5
|
Keywords: nlp,machine-learning,machine-learning-library,bot,bots,botkit,rasa conversational-agents,conversational-ai,chatbot,chatbot-framework,bot-framework
|
|
7
6
|
Author: Rasa Technologies GmbH
|
|
8
7
|
Author-email: hi@rasa.com
|
|
@@ -86,7 +85,6 @@ Requires-Dist: protobuf (>=4.23.3,<4.25.4)
|
|
|
86
85
|
Requires-Dist: psutil (>=5.9.5,<6.0.0)
|
|
87
86
|
Requires-Dist: psycopg2-binary (>=2.9.9,<2.10.0)
|
|
88
87
|
Requires-Dist: pycountry (>=22.3.5,<23.0.0)
|
|
89
|
-
Requires-Dist: pydantic (>=2.0,<3.0)
|
|
90
88
|
Requires-Dist: pydot (>=1.4,<1.5)
|
|
91
89
|
Requires-Dist: pykwalify (>=1.8,<1.9)
|
|
92
90
|
Requires-Dist: pymilvus (>=2.4.0,<2.4.2)
|
|
@@ -135,7 +133,7 @@ Requires-Dist: tensorflow-io-gcs-filesystem (==0.34) ; sys_platform == "darwin"
|
|
|
135
133
|
Requires-Dist: tensorflow-io-gcs-filesystem (==0.34) ; sys_platform == "linux"
|
|
136
134
|
Requires-Dist: tensorflow-macos (==2.14.1) ; sys_platform == "darwin" and platform_machine == "arm64"
|
|
137
135
|
Requires-Dist: tensorflow-metal (==1.1.0) ; (sys_platform == "darwin" and platform_machine == "arm64") and (extra == "metal")
|
|
138
|
-
Requires-Dist: tensorflow-text (==2.14.0) ; sys_platform != "win32" and
|
|
136
|
+
Requires-Dist: tensorflow-text (==2.14.0) ; sys_platform != "win32" and platform_machine != "arm64" and platform_machine != "aarch64"
|
|
139
137
|
Requires-Dist: tensorflow_hub (>=0.13.0,<0.14.0)
|
|
140
138
|
Requires-Dist: terminaltables (>=3.1.10,<3.2.0)
|
|
141
139
|
Requires-Dist: tiktoken (>=0.7.0,<0.8.0)
|
|
@@ -150,6 +148,7 @@ Requires-Dist: webexteamssdk (>=1.6.1,<1.7.0)
|
|
|
150
148
|
Requires-Dist: websockets (>=10.4,<11.0)
|
|
151
149
|
Requires-Dist: wheel (>=0.40.0)
|
|
152
150
|
Project-URL: Documentation, https://rasa.com/docs
|
|
151
|
+
Project-URL: Homepage, https://rasa.com
|
|
153
152
|
Project-URL: Repository, https://github.com/rasahq/rasa
|
|
154
153
|
Description-Content-Type: text/markdown
|
|
155
154
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
README.md,sha256=hu3oA1lnwNcUZbeb3AlbNJidVy64MCYzXIqai8rPORY,3298
|
|
2
1
|
rasa/__init__.py,sha256=YXG8RzVxiSJ__v-AewtV453YoCbmzWlHsU_4S0O2XpE,206
|
|
3
2
|
rasa/__main__.py,sha256=B20zSO8RqjWeVCaRmYN4HgwrK4ZRDbdHs08sfDVCEdw,6472
|
|
4
3
|
rasa/anonymization/__init__.py,sha256=Z-ZUW2ofZGfI6ysjYIS7U0JL4JSzDNOkHiiXK488Zik,86
|
|
@@ -265,7 +264,7 @@ rasa/core/channels/telegram.py,sha256=5BrNECFM3qe9XjNpDb8Q9fbqCT5aKr5L6IH21W8sum
|
|
|
265
264
|
rasa/core/channels/twilio.py,sha256=GsdjfplZdBj0fRB60bSggPF1DXFZ_x18V_dlcDy5VFs,5943
|
|
266
265
|
rasa/core/channels/vier_cvg.py,sha256=PfvSluQqgJbP0JzZPFUvum3z7H55JPPeobcD-z5zCkw,13544
|
|
267
266
|
rasa/core/channels/voice_ready/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
268
|
-
rasa/core/channels/voice_ready/audiocodes.py,sha256=
|
|
267
|
+
rasa/core/channels/voice_ready/audiocodes.py,sha256=2t63t-mTfpJgqPIRifLbfY7G0FMJ2ICMbmSN3HtJCNc,20717
|
|
269
268
|
rasa/core/channels/voice_ready/jambonz.py,sha256=Xks2sHoX6DANQHJdYciMkBxqzOE7qPqwgXWoiA1Y0DE,4154
|
|
270
269
|
rasa/core/channels/voice_ready/jambonz_protocol.py,sha256=cVbp1wpAzl3c-CR_QEcGWrLROEhJKzRB68AXtf7DRQE,12998
|
|
271
270
|
rasa/core/channels/voice_ready/twilio_voice.py,sha256=FcNHuJoNm4175YAgtURLUDFz92nXsrnZOZcnpK7PLR0,14519
|
|
@@ -329,7 +328,7 @@ rasa/core/policies/flows/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
|
|
|
329
328
|
rasa/core/policies/flows/flow_exceptions.py,sha256=_FQuN-cerQDM1pivce9bz4zylh5UYkljvYS1gjDukHI,1527
|
|
330
329
|
rasa/core/policies/flows/flow_executor.py,sha256=fhjoCKixn0QjHgzWyhAZPaOOVAdgYscvaQdWpMB7S20,25915
|
|
331
330
|
rasa/core/policies/flows/flow_step_result.py,sha256=agjPrD6lahGSe2ViO5peBeoMdI9ngVGRSgtytgxmJmg,1360
|
|
332
|
-
rasa/core/policies/intentless_policy.py,sha256
|
|
331
|
+
rasa/core/policies/intentless_policy.py,sha256=Kwx_5jlVcEcztkpoA9h9OgNpd2y_YfLsnMH6JslNdpk,36091
|
|
333
332
|
rasa/core/policies/intentless_prompt_template.jinja2,sha256=KhIL3cruMmkxhrs5oVbqgSvK6ZiN_6TQ_jXrgtEB-ZY,677
|
|
334
333
|
rasa/core/policies/memoization.py,sha256=XoRxUdYUGRfO47tAEyc5k5pUgt38a4fipO336EU5Vdc,19466
|
|
335
334
|
rasa/core/policies/policy.py,sha256=HeVtIaV0dA1QcAG3vjdn-4g7-oUEJPL4u01ETJt78YA,27464
|
|
@@ -395,7 +394,7 @@ rasa/dialogue_understanding/generator/multi_step/__init__.py,sha256=47DEQpj8HBSa
|
|
|
395
394
|
rasa/dialogue_understanding/generator/multi_step/fill_slots_prompt.jinja2,sha256=Y0m673tAML3cFPaLM-urMXDsBYUUcXIw9YUpkAhGUuA,2933
|
|
396
395
|
rasa/dialogue_understanding/generator/multi_step/handle_flows_prompt.jinja2,sha256=8l93_QBKBYnqLICVdiTu5ejZDE8F36BU8-qwba0px44,1927
|
|
397
396
|
rasa/dialogue_understanding/generator/multi_step/multi_step_llm_command_generator.py,sha256=Nadnfu0PdpY6c7kvL_g1-UJfbh20HtA6aRU3F161wfs,32668
|
|
398
|
-
rasa/dialogue_understanding/generator/nlu_command_adapter.py,sha256=
|
|
397
|
+
rasa/dialogue_understanding/generator/nlu_command_adapter.py,sha256=wEqoSVUtr00lhbE9L9WqKfZkMKOvm7UGe_E5aqXgn6I,9210
|
|
399
398
|
rasa/dialogue_understanding/generator/single_step/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
400
399
|
rasa/dialogue_understanding/generator/single_step/command_prompt_template.jinja2,sha256=nMayu-heJYH1QmcL1cFmXb8SeiJzfdDR_9Oy5IRUXsM,3937
|
|
401
400
|
rasa/dialogue_understanding/generator/single_step/single_step_llm_command_generator.py,sha256=R3jtKevzzq0un9WRHYCOrWWViGkAEun-XMhW6qg8ExU,18168
|
|
@@ -419,8 +418,8 @@ rasa/dialogue_understanding/patterns/session_start.py,sha256=yglhIEkkquRf0YppZ4C
|
|
|
419
418
|
rasa/dialogue_understanding/patterns/skip_question.py,sha256=rvZuVUxulikwUhP01MAIgkcHZ4Si7mzxNedH6QBPdX4,1214
|
|
420
419
|
rasa/dialogue_understanding/patterns/user_silence.py,sha256=uwpCJRkRmeSvFDZQBZnEL4rumweF6mQ8ht_WqrTPVKU,1140
|
|
421
420
|
rasa/dialogue_understanding/processor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
422
|
-
rasa/dialogue_understanding/processor/command_processor.py,sha256=
|
|
423
|
-
rasa/dialogue_understanding/processor/command_processor_component.py,sha256=
|
|
421
|
+
rasa/dialogue_understanding/processor/command_processor.py,sha256=mPyvsQPx0BIRNZj6S469LW_NxblPt5HoTFX78BXaAEY,26136
|
|
422
|
+
rasa/dialogue_understanding/processor/command_processor_component.py,sha256=xpHTGfZQ2RHm7s1mfM9RLGyADzNosUde0edECMwmDuc,1606
|
|
424
423
|
rasa/dialogue_understanding/stack/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
425
424
|
rasa/dialogue_understanding/stack/dialogue_stack.py,sha256=j8MnLCyv6cAZVpKRaUVM-Z5HqgWP-scrnaiQXzLNBwY,5243
|
|
426
425
|
rasa/dialogue_understanding/stack/frames/__init__.py,sha256=CXLs8I_eeJ-d2tQmS19V26OM6CHy3VN5whH5uHBodj4,656
|
|
@@ -474,7 +473,7 @@ rasa/engine/training/components.py,sha256=ZOSTbPEHth545q41B9geXKdEtIYZ3PaZdwSXrA
|
|
|
474
473
|
rasa/engine/training/fingerprinting.py,sha256=lY4wHte37470MR6sBaERt0WT9NF06NUGTX9bRAh-W_4,2006
|
|
475
474
|
rasa/engine/training/graph_trainer.py,sha256=fCnFZAv7UNxFjaLRY0MxPd18d3mO9It4Uk1Joq7Q3Mc,10636
|
|
476
475
|
rasa/engine/training/hooks.py,sha256=u7HQXDJJT4pBzQUaIIfuM3YEreGjRdp0IEv6XUrRFtk,5469
|
|
477
|
-
rasa/engine/validation.py,sha256=
|
|
476
|
+
rasa/engine/validation.py,sha256=4PIePeTuS-3I5reVXM-qGKEy2LnWWUCF0-98gfj6zV4,60704
|
|
478
477
|
rasa/env.py,sha256=zLzQMkATVIZj6s4C7RsLLOLT8g6-Q96m5iBaHW_mEA8,480
|
|
479
478
|
rasa/exceptions.py,sha256=acZiGDb5zC1ZGv1oBPHImBeRKxyHOA_mW6N8e9nOEaU,2116
|
|
480
479
|
rasa/graph_components/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -495,7 +494,6 @@ rasa/graph_components/validators/default_recipe_validator.py,sha256=BHrF6NTfJz42
|
|
|
495
494
|
rasa/graph_components/validators/finetuning_validator.py,sha256=38AcwmV8cF5TIlWhUIzh98wtZf934ix04HcczCJiWkU,12863
|
|
496
495
|
rasa/hooks.py,sha256=3nsfCA142V56mBQ7ktBXhD_RyaSrfj7fY3t7HnsD4Pc,3709
|
|
497
496
|
rasa/jupyter.py,sha256=x_GF9PK2zMhltb48GEIV9YZ4pRhCto8nV5SioYSCljI,1782
|
|
498
|
-
rasa/keys,sha256=2Stg1fstgJ203cOoW1B2gGMY29fhEnjIfTVxKv_fqPo,101
|
|
499
497
|
rasa/llm_fine_tuning/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
500
498
|
rasa/llm_fine_tuning/annotation_module.py,sha256=wFmW3d6lI5o49OWmdbYQlgr24rqHDgA0T0hLM1pSb9U,8578
|
|
501
499
|
rasa/llm_fine_tuning/conversations.py,sha256=iW2hoR23Km5wnMC7t8pOXH2Zj3LVcA62xrx2aKDRP78,5208
|
|
@@ -525,7 +523,7 @@ rasa/model_manager/utils.py,sha256=tgj215CsJreqc4Ym8tAvv-hBieAC94nL0c4caPWIcZM,2
|
|
|
525
523
|
rasa/model_manager/warm_rasa_process.py,sha256=xFNP-ANZfUBKs_Sur2deAT2qqatWD3_XZJcUgQy2iiQ,5716
|
|
526
524
|
rasa/model_service.py,sha256=nj0wNoByYWg5WVd5GtIc5V-RhpVR_xspi-MeNQxurLE,3753
|
|
527
525
|
rasa/model_testing.py,sha256=h0QUpJu6p_TDse3aHjCfYwI6OGH47b3Iuo5Ot0HQADM,14959
|
|
528
|
-
rasa/model_training.py,sha256=
|
|
526
|
+
rasa/model_training.py,sha256=M2UdEXERh6XXTflfnvuAiWjPAK2BYYHSXe4EO3x2NeA,21693
|
|
529
527
|
rasa/nlu/__init__.py,sha256=D0IYuTK_ZQ_F_9xsy0bXxVCAtU62Fzvp8S7J9tmfI_c,123
|
|
530
528
|
rasa/nlu/classifiers/__init__.py,sha256=Qvrf7_rfiMxm2Vt2fClb56R3QFExf7WPdFdL-AOvgsk,118
|
|
531
529
|
rasa/nlu/classifiers/classifier.py,sha256=9fm1mORuFf1vowYIXmqE9yLRKdSC4nGQW7UqNZQipKY,133
|
|
@@ -587,12 +585,12 @@ rasa/nlu/utils/spacy_utils.py,sha256=pBvsCVKVuZ3b2Pjn-XuOVZ6lzZu9Voc2R4N1VczwtCM
|
|
|
587
585
|
rasa/plugin.py,sha256=H_OZcHy_U3eAK-JHr43TSxcPqS0JEGcZkFvmumeeJEs,2670
|
|
588
586
|
rasa/server.py,sha256=X3BbY9cxul-2vI28SMim2J2ncU4hJgkNAe3TKKLS1ow,59321
|
|
589
587
|
rasa/shared/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
590
|
-
rasa/shared/constants.py,sha256=
|
|
588
|
+
rasa/shared/constants.py,sha256=GctBGCVeXYFALuTusaCbZTl-8i9ia3Bcmj0M9PIhtcs,11364
|
|
591
589
|
rasa/shared/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
592
590
|
rasa/shared/core/command_payload_reader.py,sha256=Vhiop9LWFawaEruRifBBrVmoEJ-fj1Tli1wBvsYu2_I,3563
|
|
593
591
|
rasa/shared/core/constants.py,sha256=NczxSU0aGYNQQRsOYyNF1VEEx2knOxbF-gUEz1RgU0E,5735
|
|
594
592
|
rasa/shared/core/conversation.py,sha256=tw1fD2XB3gOdQjDI8hHo5TAAmE2JYNogQGWe3rE929w,1385
|
|
595
|
-
rasa/shared/core/domain.py,sha256=
|
|
593
|
+
rasa/shared/core/domain.py,sha256=bGjonMV54wbwGLPjKHI2NoWwxr2wyUZwhEvjBWhP-W0,81710
|
|
596
594
|
rasa/shared/core/events.py,sha256=zdGSP1bNV1RyKC9Z54S7EbQ8TfGne_n9XKj64aoghdI,85803
|
|
597
595
|
rasa/shared/core/flows/__init__.py,sha256=HszhIvEARpmyxABFc1MKYvj8oy04WiZW1xmCdToakbs,181
|
|
598
596
|
rasa/shared/core/flows/flow.py,sha256=n9vB1SKwRczlymxrY19KiWq2BXR-LKpVUr5-Zh9827s,21530
|
|
@@ -619,6 +617,8 @@ rasa/shared/core/flows/utils.py,sha256=DpNwgF3SQ_5ovtFADiDjA_73V0t31_s2xI7qRh4L9
|
|
|
619
617
|
rasa/shared/core/flows/validation.py,sha256=VaFAMRgG2do5m9FS2deM8jLJ6QT-yinhKhMqBCPMyG4,27469
|
|
620
618
|
rasa/shared/core/flows/yaml_flows_io.py,sha256=85ln95jpkh7ZqDl1cheFa8Q21gnadLjWrW8ADmQlrUQ,14385
|
|
621
619
|
rasa/shared/core/generator.py,sha256=y2B2Vn2xOl7k_smzefryoX048b_MTtSDqclx9Ompz9s,35687
|
|
620
|
+
rasa/shared/core/policies/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
621
|
+
rasa/shared/core/policies/utils.py,sha256=rWE_-48Ovc__V7wOKCJ-2lTerVRtN3iRHV4ZvuU2b2g,3070
|
|
622
622
|
rasa/shared/core/slot_mappings.py,sha256=3tNc8IETfgUZktV5iELT3dwFMHN1zCI35OlHAMqezEM,17854
|
|
623
623
|
rasa/shared/core/slots.py,sha256=M2J-9NGmYBh8S-da_sjN4QP8JYdYrlFtMVmVR7QOCkQ,23852
|
|
624
624
|
rasa/shared/core/trackers.py,sha256=HOlmGPAuu89qKGQ7EPzrN1xIwYgik_SPjEeVJcVNMQc,42399
|
|
@@ -737,7 +737,7 @@ rasa/tracing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
737
737
|
rasa/tracing/config.py,sha256=kA-xEY2oAc07gw1RzGeMuNnDKd_ZrVXT_B63pxGW-uI,12860
|
|
738
738
|
rasa/tracing/constants.py,sha256=N_MJLStE3IkmPKQCQv42epd3jdBMJ4Ith1dVO65N5ho,2425
|
|
739
739
|
rasa/tracing/instrumentation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
740
|
-
rasa/tracing/instrumentation/attribute_extractors.py,sha256=
|
|
740
|
+
rasa/tracing/instrumentation/attribute_extractors.py,sha256=CVGEQCEUMSBMQ0g2L1Tw6LJhA8zIpUkjTEIDhU9WCrY,26048
|
|
741
741
|
rasa/tracing/instrumentation/instrumentation.py,sha256=5g_Hp9CE7bqIKUVfLcpGan0s2SK3h5rikjumpADs4SY,51103
|
|
742
742
|
rasa/tracing/instrumentation/intentless_policy_instrumentation.py,sha256=8AdMOy_2mlKnlmt-muV8-eoT8jA52GXDzM0avejfg8A,4821
|
|
743
743
|
rasa/tracing/instrumentation/metrics.py,sha256=ByfKshoxNOqjKZwKTulqL71s5b3WugqLfjha3So0OEU,10534
|
|
@@ -778,9 +778,9 @@ rasa/utils/train_utils.py,sha256=f1NWpp5y6al0dzoQyyio4hc4Nf73DRoRSHDzEK6-C4E,212
|
|
|
778
778
|
rasa/utils/url_tools.py,sha256=JQcHL2aLqLHu82k7_d9imUoETCm2bmlHaDpOJ-dKqBc,1218
|
|
779
779
|
rasa/utils/yaml.py,sha256=KjbZq5C94ZP7Jdsw8bYYF7HASI6K4-C_kdHfrnPLpSI,2000
|
|
780
780
|
rasa/validator.py,sha256=W_iCpCASGYqpvVLR-XZYRVKCN2NxGgy1eHtpGSbcCNU,67318
|
|
781
|
-
rasa/version.py,sha256=
|
|
782
|
-
rasa_pro-3.11.
|
|
783
|
-
rasa_pro-3.11.
|
|
784
|
-
rasa_pro-3.11.
|
|
785
|
-
rasa_pro-3.11.
|
|
786
|
-
rasa_pro-3.11.
|
|
781
|
+
rasa/version.py,sha256=0eco0jZ1vf_3FprpicpaOcsU06TLS6g-iUTpvz8Xi4Q,117
|
|
782
|
+
rasa_pro-3.11.7.dist-info/METADATA,sha256=DK-Jjt_l2LarnAlzrySksrfCHeSu6WxBdioXJSq3Z9Y,10728
|
|
783
|
+
rasa_pro-3.11.7.dist-info/NOTICE,sha256=7HlBoMHJY9CL2GlYSfTQ-PZsVmLmVkYmMiPlTjhuCqA,218
|
|
784
|
+
rasa_pro-3.11.7.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
|
|
785
|
+
rasa_pro-3.11.7.dist-info/entry_points.txt,sha256=ckJ2SfEyTPgBqj_I6vm_tqY9dZF_LAPJZA335Xp0Q9U,43
|
|
786
|
+
rasa_pro-3.11.7.dist-info/RECORD,,
|
README.md
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
<h1 align="center">Rasa Pro</h1>
|
|
2
|
-
|
|
3
|
-
<div align="center">
|
|
4
|
-
|
|
5
|
-
[](https://github.com/RasaHQ/rasa-private/actions)
|
|
6
|
-
[](https://sonarcloud.io/summary/new_code?id=RasaHQ_rasa)
|
|
7
|
-
[](https://rasa.com/docs/rasa-pro/)
|
|
8
|
-
|
|
9
|
-
</div>
|
|
10
|
-
|
|
11
|
-
<hr />
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
Rasa Pro is a framework for building scalable, dynamic conversational AI assistants that integrate large language models (LLMs) to enable more contextually aware and agentic interactions. Whether you’re new to conversational AI or an experienced developer, Rasa Pro offers enhanced flexibility, control, and performance for mission-critical applications.
|
|
15
|
-
|
|
16
|
-
Building on the foundation of Rasa Open Source, Rasa Pro adds advanced features like CALM (Conversational AI with Language Models) and Dialogue Understanding (DU), which enable developers to shift from traditional intent-driven systems to LLM-based agents. This allows for more robust, responsive interactions that adhere strictly to business logic, while reducing risks like prompt injection and minimizing hallucinations.
|
|
17
|
-
|
|
18
|
-
**Key Features:**
|
|
19
|
-
|
|
20
|
-
- **Flows for Business Logic:** Easily define business logic through Flows, a simplified way to describe how your AI assistant should handle conversations. Flows help streamline the development process, focusing on key tasks and reducing the complexity involved in managing conversations.
|
|
21
|
-
- **Automatic Conversation Repair:** Ensure seamless interactions by automatically handling interruptions or unexpected inputs. Developers have full control to customize these repairs based on specific use cases.
|
|
22
|
-
- **Customizable and Open:** Fully customizable code that allows developers to modify Rasa Pro to meet specific requirements, ensuring flexibility and adaptability to various conversational AI needs.
|
|
23
|
-
- **Robustness and Control:** Maintain strict adherence to business logic, preventing unwanted behaviors like prompt injection and hallucinations, leading to more reliable responses and secure interactions.
|
|
24
|
-
- **Built-in Security:** Safeguard sensitive data, control access, and ensure secure deployment, essential for production environments that demand high levels of security and compliance.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
A [free developer license](https://rasa.com/docs/rasa-pro/developer-edition/) is available so you can explore and get to know Rasa Pro. For small production deployments, the Extended Developer License allows you to take your assistant live in a limited capacity. A paid license is required for larger-scale production use, but all code is visible and can be customized as needed.
|
|
29
|
-
|
|
30
|
-
To get started right now, you can
|
|
31
|
-
|
|
32
|
-
`pip install rasa-pro`
|
|
33
|
-
|
|
34
|
-
Check out our
|
|
35
|
-
|
|
36
|
-
- [Rasa-pro Quickstart](https://rasa.com/docs/rasa-pro/installation/quickstart/),
|
|
37
|
-
- [Conversational AI with Language Models (CALM) conceptual rundown](https://rasa.com/docs/rasa-pro/calm/),
|
|
38
|
-
- [Rasa Pro / CALM tutorial](https://rasa.com/docs/rasa-pro/tutorial), and
|
|
39
|
-
- [Rasa pro changelog](https://rasa.com/docs/rasa/rasa-pro-changelog/)
|
|
40
|
-
|
|
41
|
-
for more. Also feel free to reach out to us on the [Rasa forum](https://forum.rasa.com/).
|
rasa/keys
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"segment": "CcvVD1I68Nkkxrv93cIqv1twIwrwG8nz", "sentry": "a283f1fde04347b099c8d729109dd450@o251570"}
|
|
File without changes
|
|
File without changes
|