rasa-pro 3.12.0.dev11__py3-none-any.whl → 3.12.0.dev12__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/cli/inspect.py +1 -20
- rasa/cli/shell.py +3 -3
- rasa/core/actions/action.py +7 -20
- rasa/core/actions/forms.py +5 -10
- rasa/core/channels/__init__.py +0 -2
- rasa/core/channels/voice_ready/audiocodes.py +23 -42
- rasa/core/channels/voice_stream/browser_audio.py +0 -1
- rasa/core/channels/voice_stream/call_state.py +1 -7
- rasa/core/channels/voice_stream/tts/azure.py +1 -2
- rasa/core/channels/voice_stream/tts/cartesia.py +3 -16
- rasa/core/channels/voice_stream/twilio_media_streams.py +1 -2
- rasa/core/channels/voice_stream/voice_channel.py +1 -2
- rasa/core/migrate.py +2 -2
- rasa/core/policies/flows/flow_executor.py +42 -36
- rasa/core/run.py +3 -4
- rasa/dialogue_understanding/commands/can_not_handle_command.py +2 -2
- rasa/dialogue_understanding/commands/cancel_flow_command.py +4 -62
- rasa/dialogue_understanding/commands/change_flow_command.py +2 -2
- rasa/dialogue_understanding/commands/chit_chat_answer_command.py +2 -2
- rasa/dialogue_understanding/commands/clarify_command.py +2 -2
- rasa/dialogue_understanding/commands/correct_slots_command.py +2 -11
- rasa/dialogue_understanding/commands/human_handoff_command.py +2 -2
- rasa/dialogue_understanding/commands/knowledge_answer_command.py +2 -2
- rasa/dialogue_understanding/commands/repeat_bot_messages_command.py +2 -2
- rasa/dialogue_understanding/commands/set_slot_command.py +15 -7
- rasa/dialogue_understanding/commands/skip_question_command.py +2 -2
- rasa/dialogue_understanding/commands/start_flow_command.py +2 -43
- rasa/dialogue_understanding/commands/utils.py +1 -1
- rasa/dialogue_understanding/constants.py +0 -1
- rasa/dialogue_understanding/generator/command_generator.py +73 -110
- rasa/dialogue_understanding/generator/command_parser.py +1 -1
- rasa/dialogue_understanding/generator/llm_based_command_generator.py +3 -161
- rasa/dialogue_understanding/generator/multi_step/multi_step_llm_command_generator.py +2 -10
- rasa/dialogue_understanding/generator/nlu_command_adapter.py +3 -44
- rasa/dialogue_understanding/generator/single_step/command_prompt_template.jinja2 +79 -53
- rasa/dialogue_understanding/generator/single_step/single_step_llm_command_generator.py +19 -11
- rasa/dialogue_understanding/generator/utils.py +1 -32
- rasa/dialogue_understanding/patterns/correction.py +1 -13
- rasa/dialogue_understanding/patterns/default_flows_for_patterns.yml +2 -62
- rasa/dialogue_understanding/processor/command_processor.py +28 -115
- rasa/dialogue_understanding/utils.py +0 -31
- rasa/dialogue_understanding_test/README.md +0 -50
- rasa/dialogue_understanding_test/test_case_simulation/test_case_tracker_simulator.py +3 -3
- rasa/model_service.py +0 -4
- rasa/model_training.py +27 -24
- rasa/shared/core/constants.py +3 -28
- rasa/shared/core/domain.py +20 -13
- rasa/shared/core/events.py +2 -13
- rasa/shared/core/flows/flow.py +0 -17
- rasa/shared/core/flows/flows_yaml_schema.json +0 -38
- rasa/shared/core/flows/steps/collect.py +1 -18
- rasa/shared/core/flows/utils.py +1 -16
- rasa/shared/core/slot_mappings.py +108 -144
- rasa/shared/core/slots.py +2 -23
- rasa/shared/core/trackers.py +1 -3
- rasa/shared/nlu/constants.py +0 -1
- rasa/shared/utils/llm.py +1 -1
- rasa/shared/utils/schemas/domain.yml +1 -0
- rasa/telemetry.py +13 -43
- rasa/utils/common.py +1 -0
- rasa/validator.py +82 -189
- rasa/version.py +1 -1
- {rasa_pro-3.12.0.dev11.dist-info → rasa_pro-3.12.0.dev12.dist-info}/METADATA +1 -1
- {rasa_pro-3.12.0.dev11.dist-info → rasa_pro-3.12.0.dev12.dist-info}/RECORD +67 -71
- rasa/core/actions/action_handle_digressions.py +0 -142
- rasa/core/channels/voice_stream/genesys.py +0 -331
- rasa/dialogue_understanding/commands/handle_digressions_command.py +0 -150
- rasa/dialogue_understanding/patterns/handle_digressions.py +0 -81
- {rasa_pro-3.12.0.dev11.dist-info → rasa_pro-3.12.0.dev12.dist-info}/NOTICE +0 -0
- {rasa_pro-3.12.0.dev11.dist-info → rasa_pro-3.12.0.dev12.dist-info}/WHEEL +0 -0
- {rasa_pro-3.12.0.dev11.dist-info → rasa_pro-3.12.0.dev12.dist-info}/entry_points.txt +0 -0
rasa/telemetry.py
CHANGED
|
@@ -15,7 +15,7 @@ from collections import defaultdict
|
|
|
15
15
|
from datetime import datetime
|
|
16
16
|
from functools import wraps
|
|
17
17
|
from pathlib import Path
|
|
18
|
-
from typing import Any, Callable, Dict, List, Optional, Text
|
|
18
|
+
from typing import Any, Callable, Dict, List, Optional, Text
|
|
19
19
|
|
|
20
20
|
import importlib_resources
|
|
21
21
|
import requests
|
|
@@ -35,7 +35,6 @@ from rasa.constants import (
|
|
|
35
35
|
)
|
|
36
36
|
from rasa.engine.storage.local_model_storage import LocalModelStorage
|
|
37
37
|
from rasa.shared.constants import (
|
|
38
|
-
ASSISTANT_ID_KEY,
|
|
39
38
|
CONFIG_LANGUAGE_KEY,
|
|
40
39
|
CONFIG_PIPELINE_KEY,
|
|
41
40
|
CONFIG_POLICIES_KEY,
|
|
@@ -112,7 +111,6 @@ CI_ENVIRONMENT_TELL = [
|
|
|
112
111
|
# https://rasa.com/docs/rasa-pro/telemetry/reference
|
|
113
112
|
TRAINING_STARTED_EVENT = "Training Started"
|
|
114
113
|
TRAINING_COMPLETED_EVENT = "Training Completed"
|
|
115
|
-
TRAINING_FAILED_EVENT = "Training Failed"
|
|
116
114
|
TELEMETRY_DISABLED_EVENT = "Telemetry Disabled"
|
|
117
115
|
TELEMETRY_DATA_SPLIT_EVENT = "Training Data Split"
|
|
118
116
|
TELEMETRY_DATA_VALIDATED_EVENT = "Training Data Validated"
|
|
@@ -978,7 +976,6 @@ def track_model_training(
|
|
|
978
976
|
"language": config.get(CONFIG_LANGUAGE_KEY),
|
|
979
977
|
"training_id": training_id,
|
|
980
978
|
"type": model_type,
|
|
981
|
-
"assistant_id": config.get(ASSISTANT_ID_KEY),
|
|
982
979
|
"pipeline": config.get(CONFIG_PIPELINE_KEY),
|
|
983
980
|
"policies": config.get(CONFIG_POLICIES_KEY),
|
|
984
981
|
"train_schema": config.get(CONFIG_TRAIN_SCHEMA),
|
|
@@ -1024,28 +1021,13 @@ def track_model_training(
|
|
|
1024
1021
|
tracking_data,
|
|
1025
1022
|
)
|
|
1026
1023
|
start = datetime.now()
|
|
1027
|
-
|
|
1028
|
-
yield
|
|
1029
|
-
except (Exception, SystemExit):
|
|
1030
|
-
runtime = datetime.now() - start
|
|
1031
|
-
_track(
|
|
1032
|
-
TRAINING_FAILED_EVENT,
|
|
1033
|
-
{
|
|
1034
|
-
"training_id": training_id,
|
|
1035
|
-
"assistant_id": config.get(ASSISTANT_ID_KEY),
|
|
1036
|
-
"type": model_type,
|
|
1037
|
-
"runtime": int(runtime.total_seconds()),
|
|
1038
|
-
},
|
|
1039
|
-
)
|
|
1040
|
-
raise
|
|
1041
|
-
|
|
1024
|
+
yield
|
|
1042
1025
|
runtime = datetime.now() - start
|
|
1043
1026
|
|
|
1044
1027
|
_track(
|
|
1045
1028
|
TRAINING_COMPLETED_EVENT,
|
|
1046
1029
|
{
|
|
1047
1030
|
"training_id": training_id,
|
|
1048
|
-
"assistant_id": config.get(ASSISTANT_ID_KEY),
|
|
1049
1031
|
"type": model_type,
|
|
1050
1032
|
"runtime": int(runtime.total_seconds()),
|
|
1051
1033
|
},
|
|
@@ -1344,28 +1326,24 @@ def track_server_start(
|
|
|
1344
1326
|
"""
|
|
1345
1327
|
from rasa.core.utils import AvailableEndpoints
|
|
1346
1328
|
|
|
1347
|
-
def
|
|
1329
|
+
def project_fingerprint_from_model(
|
|
1348
1330
|
_model_directory: Optional[Text],
|
|
1349
|
-
) ->
|
|
1331
|
+
) -> Optional[Text]:
|
|
1350
1332
|
"""Gets project fingerprint from an app's loaded model."""
|
|
1351
1333
|
if not model_directory:
|
|
1352
|
-
return None
|
|
1334
|
+
return None
|
|
1353
1335
|
|
|
1354
1336
|
try:
|
|
1355
1337
|
model_archive = model.get_local_model(_model_directory)
|
|
1356
1338
|
metadata = LocalModelStorage.metadata_from_archive(model_archive)
|
|
1357
1339
|
|
|
1358
|
-
return metadata.project_fingerprint
|
|
1340
|
+
return metadata.project_fingerprint
|
|
1359
1341
|
except Exception:
|
|
1360
|
-
return None
|
|
1342
|
+
return None
|
|
1361
1343
|
|
|
1362
1344
|
if not endpoints:
|
|
1363
1345
|
endpoints = AvailableEndpoints()
|
|
1364
1346
|
|
|
1365
|
-
project, assistant_id = project_fingerprint_and_assistant_id_from_model(
|
|
1366
|
-
model_directory
|
|
1367
|
-
)
|
|
1368
|
-
|
|
1369
1347
|
_track(
|
|
1370
1348
|
TELEMETRY_SERVER_STARTED_EVENT,
|
|
1371
1349
|
{
|
|
@@ -1387,8 +1365,7 @@ def track_server_start(
|
|
|
1387
1365
|
"endpoints_event_broker": endpoints.event_broker.type
|
|
1388
1366
|
if endpoints.event_broker
|
|
1389
1367
|
else None,
|
|
1390
|
-
"project":
|
|
1391
|
-
"assistant_id": assistant_id,
|
|
1368
|
+
"project": project_fingerprint_from_model(model_directory),
|
|
1392
1369
|
},
|
|
1393
1370
|
)
|
|
1394
1371
|
|
|
@@ -1406,30 +1383,23 @@ def track_project_init(path: Text) -> None:
|
|
|
1406
1383
|
|
|
1407
1384
|
|
|
1408
1385
|
@ensure_telemetry_enabled
|
|
1409
|
-
def track_shell_started(model_type: Text
|
|
1386
|
+
def track_shell_started(model_type: Text) -> None:
|
|
1410
1387
|
"""Track when a user starts a bot using rasa shell.
|
|
1411
1388
|
|
|
1412
1389
|
Args:
|
|
1413
1390
|
model_type: Type of the model, core / nlu or rasa.
|
|
1414
1391
|
"""
|
|
1415
|
-
_track(
|
|
1416
|
-
TELEMETRY_SHELL_STARTED_EVENT,
|
|
1417
|
-
{"type": model_type, "assistant_id": assistant_id},
|
|
1418
|
-
)
|
|
1392
|
+
_track(TELEMETRY_SHELL_STARTED_EVENT, {"type": model_type})
|
|
1419
1393
|
|
|
1420
1394
|
|
|
1421
1395
|
@ensure_telemetry_enabled
|
|
1422
|
-
def track_inspect_started(
|
|
1396
|
+
def track_inspect_started(model_type: Text) -> None:
|
|
1423
1397
|
"""Track when a user starts a bot using rasa inspect.
|
|
1424
1398
|
|
|
1425
1399
|
Args:
|
|
1426
|
-
|
|
1427
|
-
assistant_id: ID of the assistant being inspected.
|
|
1400
|
+
model_type: Type of the model, core / nlu or rasa.
|
|
1428
1401
|
"""
|
|
1429
|
-
_track(
|
|
1430
|
-
TELEMETRY_INSPECT_STARTED_EVENT,
|
|
1431
|
-
{"type": channel, "assistant_id": assistant_id},
|
|
1432
|
-
)
|
|
1402
|
+
_track(TELEMETRY_INSPECT_STARTED_EVENT, {"type": model_type})
|
|
1433
1403
|
|
|
1434
1404
|
|
|
1435
1405
|
@ensure_telemetry_enabled
|
rasa/utils/common.py
CHANGED
|
@@ -70,6 +70,7 @@ EXPECTED_WARNINGS: List[Tuple[Type[Warning], str]] = [
|
|
|
70
70
|
"Converting sparse IndexedSlices.* to a dense Tensor of unknown "
|
|
71
71
|
"shape. This may consume a large amount of memory.",
|
|
72
72
|
),
|
|
73
|
+
(UserWarning, "Slot auto-fill has been removed in 3.0 .*"),
|
|
73
74
|
# Cannot fix this deprecation warning since we need to support two
|
|
74
75
|
# numpy versions as long as we keep python 37 around
|
|
75
76
|
(DeprecationWarning, "the `interpolation=` argument to quantile was renamed"),
|
rasa/validator.py
CHANGED
|
@@ -35,7 +35,9 @@ from rasa.shared.core.command_payload_reader import (
|
|
|
35
35
|
CommandPayloadReader,
|
|
36
36
|
)
|
|
37
37
|
from rasa.shared.core.constants import (
|
|
38
|
-
|
|
38
|
+
ACTIVE_LOOP,
|
|
39
|
+
MAPPING_CONDITIONS,
|
|
40
|
+
MAPPING_TYPE,
|
|
39
41
|
SlotMappingType,
|
|
40
42
|
)
|
|
41
43
|
from rasa.shared.core.domain import (
|
|
@@ -43,14 +45,13 @@ from rasa.shared.core.domain import (
|
|
|
43
45
|
Domain,
|
|
44
46
|
)
|
|
45
47
|
from rasa.shared.core.events import ActionExecuted, ActiveLoop, UserUttered
|
|
46
|
-
from rasa.shared.core.flows import
|
|
48
|
+
from rasa.shared.core.flows import FlowsList
|
|
47
49
|
from rasa.shared.core.flows.flow_step_links import IfFlowStepLink
|
|
48
50
|
from rasa.shared.core.flows.steps.action import ActionFlowStep
|
|
49
51
|
from rasa.shared.core.flows.steps.collect import CollectInformationFlowStep
|
|
50
52
|
from rasa.shared.core.flows.steps.link import LinkFlowStep
|
|
51
53
|
from rasa.shared.core.flows.steps.set_slots import SetSlotsFlowStep
|
|
52
54
|
from rasa.shared.core.flows.utils import (
|
|
53
|
-
ALL_LABEL,
|
|
54
55
|
get_duplicate_slot_persistence_config_error_message,
|
|
55
56
|
get_invalid_slot_persistence_config_error_message,
|
|
56
57
|
warn_deprecated_collect_step_config,
|
|
@@ -517,9 +518,9 @@ class Validator:
|
|
|
517
518
|
|
|
518
519
|
for slot in self.domain.slots:
|
|
519
520
|
for mapping in slot.mappings:
|
|
520
|
-
for condition in mapping.
|
|
521
|
-
condition_active_loop = condition.
|
|
522
|
-
mapping_type = mapping.
|
|
521
|
+
for condition in mapping.get(MAPPING_CONDITIONS, []):
|
|
522
|
+
condition_active_loop = condition.get(ACTIVE_LOOP)
|
|
523
|
+
mapping_type = SlotMappingType(mapping.get(MAPPING_TYPE))
|
|
523
524
|
if (
|
|
524
525
|
condition_active_loop
|
|
525
526
|
and condition_active_loop not in self.domain.form_names
|
|
@@ -1263,7 +1264,6 @@ class Validator:
|
|
|
1263
1264
|
self.verify_unique_flows(),
|
|
1264
1265
|
self.verify_predicates(),
|
|
1265
1266
|
self.verify_slot_persistence_configuration(),
|
|
1266
|
-
self.verify_digression_configuration(),
|
|
1267
1267
|
]
|
|
1268
1268
|
|
|
1269
1269
|
all_good = all(flow_validation_conditions)
|
|
@@ -1392,22 +1392,34 @@ class Validator:
|
|
|
1392
1392
|
|
|
1393
1393
|
for slot in self.domain._user_slots:
|
|
1394
1394
|
nlu_mappings = any(
|
|
1395
|
-
[
|
|
1395
|
+
[
|
|
1396
|
+
SlotMappingType(
|
|
1397
|
+
mapping.get("type", SlotMappingType.FROM_LLM.value)
|
|
1398
|
+
).is_predefined_type()
|
|
1399
|
+
for mapping in slot.mappings
|
|
1400
|
+
]
|
|
1396
1401
|
)
|
|
1397
1402
|
llm_mappings = any(
|
|
1398
|
-
[
|
|
1403
|
+
[
|
|
1404
|
+
SlotMappingType(mapping.get("type", SlotMappingType.FROM_LLM.value))
|
|
1405
|
+
== SlotMappingType.FROM_LLM
|
|
1406
|
+
for mapping in slot.mappings
|
|
1407
|
+
]
|
|
1399
1408
|
)
|
|
1400
|
-
|
|
1409
|
+
custom_mappings = any(
|
|
1401
1410
|
[
|
|
1402
|
-
mapping.type
|
|
1411
|
+
SlotMappingType(mapping.get("type", SlotMappingType.FROM_LLM.value))
|
|
1412
|
+
== SlotMappingType.CUSTOM
|
|
1403
1413
|
for mapping in slot.mappings
|
|
1404
1414
|
]
|
|
1405
1415
|
)
|
|
1406
1416
|
|
|
1407
|
-
all_good = self.
|
|
1417
|
+
all_good = self._slot_contains_all_mappings_types(
|
|
1418
|
+
llm_mappings, nlu_mappings, custom_mappings, slot.name, all_good
|
|
1419
|
+
)
|
|
1408
1420
|
|
|
1409
1421
|
all_good = self._custom_action_name_is_defined_in_the_domain(
|
|
1410
|
-
|
|
1422
|
+
custom_mappings, slot, all_good
|
|
1411
1423
|
)
|
|
1412
1424
|
|
|
1413
1425
|
all_good = self._config_contains_nlu_command_adapter(
|
|
@@ -1421,45 +1433,23 @@ class Validator:
|
|
|
1421
1433
|
return all_good
|
|
1422
1434
|
|
|
1423
1435
|
@staticmethod
|
|
1424
|
-
def
|
|
1425
|
-
|
|
1436
|
+
def _slot_contains_all_mappings_types(
|
|
1437
|
+
llm_mappings: bool,
|
|
1438
|
+
nlu_mappings: bool,
|
|
1439
|
+
custom_mappings: bool,
|
|
1440
|
+
slot_name: str,
|
|
1441
|
+
all_good: bool,
|
|
1426
1442
|
) -> bool:
|
|
1427
|
-
|
|
1428
|
-
if not slot.mappings:
|
|
1429
|
-
return all_good
|
|
1430
|
-
|
|
1431
|
-
invalid_usage = False
|
|
1432
|
-
|
|
1433
|
-
for mapping in slot.mappings:
|
|
1434
|
-
allow_nlu_correction = mapping.allow_nlu_correction
|
|
1435
|
-
if allow_nlu_correction and mapping.type != SlotMappingType.FROM_LLM:
|
|
1436
|
-
invalid_usage = True
|
|
1437
|
-
|
|
1438
|
-
if allow_nlu_correction and not nlu_mappings:
|
|
1439
|
-
structlogger.error(
|
|
1440
|
-
"validator.validate_slot_mappings_in_CALM.nlu_mappings_not_present",
|
|
1441
|
-
slot_name=slot.name,
|
|
1442
|
-
event_info=(
|
|
1443
|
-
f"The slot '{slot.name}' does not have any "
|
|
1444
|
-
f"NLU-based slot mappings. "
|
|
1445
|
-
f"The property `allow_nlu_correction` is only "
|
|
1446
|
-
f"applicable when the slot "
|
|
1447
|
-
f"contains both NLU-based and LLM-based slot mappings."
|
|
1448
|
-
),
|
|
1449
|
-
)
|
|
1450
|
-
all_good = False
|
|
1451
|
-
|
|
1452
|
-
if invalid_usage:
|
|
1443
|
+
if llm_mappings and (nlu_mappings or custom_mappings):
|
|
1453
1444
|
structlogger.error(
|
|
1454
|
-
"validator.validate_slot_mappings_in_CALM.
|
|
1455
|
-
slot_name=
|
|
1445
|
+
"validator.validate_slot_mappings_in_CALM.llm_and_nlu_mappings",
|
|
1446
|
+
slot_name=slot_name,
|
|
1456
1447
|
event_info=(
|
|
1457
|
-
f"The slot '{
|
|
1458
|
-
f"
|
|
1459
|
-
f"the slot
|
|
1460
|
-
f"Please set the slot mapping type to 'from_llm' "
|
|
1461
|
-
f"to allow the LLM to correct this slot."
|
|
1448
|
+
f"The slot '{slot_name}' has both LLM and "
|
|
1449
|
+
f"NLU or custom slot mappings. "
|
|
1450
|
+
f"Please make sure that the slot has only one type of mapping."
|
|
1462
1451
|
),
|
|
1452
|
+
docs_link=DOCS_URL_DOMAIN + "#calm-slot-mappings",
|
|
1463
1453
|
)
|
|
1464
1454
|
all_good = False
|
|
1465
1455
|
|
|
@@ -1467,32 +1457,55 @@ class Validator:
|
|
|
1467
1457
|
|
|
1468
1458
|
def _custom_action_name_is_defined_in_the_domain(
|
|
1469
1459
|
self,
|
|
1470
|
-
|
|
1460
|
+
custom_mappings: bool,
|
|
1471
1461
|
slot: Slot,
|
|
1472
1462
|
all_good: bool,
|
|
1473
1463
|
) -> bool:
|
|
1474
|
-
if not
|
|
1464
|
+
if not custom_mappings:
|
|
1475
1465
|
return all_good
|
|
1476
1466
|
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1467
|
+
if not self.flows:
|
|
1468
|
+
return all_good
|
|
1469
|
+
|
|
1470
|
+
is_custom_action_defined = any(
|
|
1471
|
+
[
|
|
1472
|
+
mapping.get("action") is not None
|
|
1473
|
+
and mapping.get("action") in self.domain.action_names_or_texts
|
|
1474
|
+
for mapping in slot.mappings
|
|
1475
|
+
]
|
|
1476
|
+
)
|
|
1477
|
+
|
|
1478
|
+
if is_custom_action_defined:
|
|
1479
|
+
return all_good
|
|
1480
|
+
|
|
1481
|
+
slot_collected_by_flows = any(
|
|
1482
|
+
[
|
|
1483
|
+
step.collect == slot.name
|
|
1484
|
+
for flow in self.flows.underlying_flows
|
|
1485
|
+
for step in flow.steps
|
|
1486
|
+
if isinstance(step, CollectInformationFlowStep)
|
|
1487
|
+
]
|
|
1488
|
+
)
|
|
1489
|
+
|
|
1490
|
+
if not slot_collected_by_flows:
|
|
1491
|
+
# if the slot is not collected by any flow,
|
|
1492
|
+
# it could be a DM1 custom slot
|
|
1493
|
+
return all_good
|
|
1494
|
+
|
|
1495
|
+
custom_action_ask_name = f"action_ask_{slot.name}"
|
|
1496
|
+
if custom_action_ask_name not in self.domain.action_names_or_texts:
|
|
1497
|
+
structlogger.error(
|
|
1498
|
+
"validator.validate_slot_mappings_in_CALM.custom_action_not_in_domain",
|
|
1499
|
+
slot_name=slot.name,
|
|
1500
|
+
event_info=(
|
|
1501
|
+
f"The slot '{slot.name}' has a custom slot mapping, but "
|
|
1502
|
+
f"neither the action '{custom_action_ask_name}' nor "
|
|
1503
|
+
f"another custom action are defined in the domain file. "
|
|
1504
|
+
f"Please add one of the actions to your domain file."
|
|
1505
|
+
),
|
|
1506
|
+
docs_link=DOCS_URL_DOMAIN + "#custom-slot-mappings",
|
|
1507
|
+
)
|
|
1508
|
+
all_good = False
|
|
1496
1509
|
|
|
1497
1510
|
return all_good
|
|
1498
1511
|
|
|
@@ -1645,123 +1658,3 @@ class Validator:
|
|
|
1645
1658
|
)
|
|
1646
1659
|
|
|
1647
1660
|
return all_good
|
|
1648
|
-
|
|
1649
|
-
def verify_digression_configuration(self) -> bool:
|
|
1650
|
-
"""Validates the digression configuration in flows."""
|
|
1651
|
-
all_good = True
|
|
1652
|
-
|
|
1653
|
-
for flow in self.flows.underlying_flows:
|
|
1654
|
-
all_good = self._validate_ask_confirm_digressions(flow, all_good)
|
|
1655
|
-
all_good = self._validate_block_digressions(flow, all_good)
|
|
1656
|
-
|
|
1657
|
-
return all_good
|
|
1658
|
-
|
|
1659
|
-
def _validate_ask_confirm_digressions(self, flow: Flow, all_good: bool) -> bool:
|
|
1660
|
-
"""Validates the ask_confirm_digressions configuration in a flow."""
|
|
1661
|
-
for flow_id in flow.ask_confirm_digressions:
|
|
1662
|
-
if flow_id == ALL_LABEL:
|
|
1663
|
-
continue
|
|
1664
|
-
if flow_id not in self.flows.flow_ids:
|
|
1665
|
-
structlogger.error(
|
|
1666
|
-
"validator.verify_digression_configuration.ask_confirm_digressions",
|
|
1667
|
-
flow=flow.id,
|
|
1668
|
-
event_info=(
|
|
1669
|
-
f"The flow '{flow_id}' is listed in the "
|
|
1670
|
-
f"`ask_confirm_digressions` configuration of flow "
|
|
1671
|
-
f"'{flow.id}', but it is not found in the "
|
|
1672
|
-
f"flows file. Please make sure that the flow id is correct."
|
|
1673
|
-
),
|
|
1674
|
-
)
|
|
1675
|
-
all_good = False
|
|
1676
|
-
|
|
1677
|
-
if flow_id in flow.block_digressions:
|
|
1678
|
-
structlogger.error(
|
|
1679
|
-
"validator.verify_digression_configuration.overlap_digressions",
|
|
1680
|
-
flow=flow.id,
|
|
1681
|
-
event_info=(
|
|
1682
|
-
f"The flow '{flow_id}' is listed in both the "
|
|
1683
|
-
f"`ask_confirm_digressions` and `block_digressions` "
|
|
1684
|
-
f"configuration of flow '{flow.id}'. "
|
|
1685
|
-
f"Please make sure that the flow id is not listed in both "
|
|
1686
|
-
f"configurations."
|
|
1687
|
-
),
|
|
1688
|
-
)
|
|
1689
|
-
all_good = False
|
|
1690
|
-
|
|
1691
|
-
for step in flow.get_collect_steps():
|
|
1692
|
-
for flow_id in step.ask_confirm_digressions:
|
|
1693
|
-
if flow_id == ALL_LABEL:
|
|
1694
|
-
continue
|
|
1695
|
-
|
|
1696
|
-
if flow_id not in self.flows.flow_ids:
|
|
1697
|
-
structlogger.error(
|
|
1698
|
-
"validator.verify_digression_configuration.ask_confirm_digressions",
|
|
1699
|
-
flow=flow.id,
|
|
1700
|
-
step_id=step.id,
|
|
1701
|
-
event_info=(
|
|
1702
|
-
f"The flow '{flow_id}' is listed in the "
|
|
1703
|
-
f"`ask_confirm_digressions` configuration of step "
|
|
1704
|
-
f"'{step.id}' in flow '{flow.id}', but it is "
|
|
1705
|
-
f"not found in the flows file. "
|
|
1706
|
-
f"Please make sure that the flow id is correct."
|
|
1707
|
-
),
|
|
1708
|
-
)
|
|
1709
|
-
all_good = False
|
|
1710
|
-
|
|
1711
|
-
if flow_id in step.block_digressions:
|
|
1712
|
-
structlogger.error(
|
|
1713
|
-
"validator.verify_digression_configuration.overlap_digressions",
|
|
1714
|
-
flow=flow.id,
|
|
1715
|
-
step_id=step.id,
|
|
1716
|
-
event_info=(
|
|
1717
|
-
f"The flow '{flow_id}' is listed in both the "
|
|
1718
|
-
f"`ask_confirm_digressions` and `block_digressions` "
|
|
1719
|
-
f"configuration of step '{step.id}' in flow '{flow.id}'. "
|
|
1720
|
-
f"Please make sure that the flow id is not listed in both "
|
|
1721
|
-
f"configurations."
|
|
1722
|
-
),
|
|
1723
|
-
)
|
|
1724
|
-
all_good = False
|
|
1725
|
-
|
|
1726
|
-
return all_good
|
|
1727
|
-
|
|
1728
|
-
def _validate_block_digressions(self, flow: Flow, all_good: bool) -> bool:
|
|
1729
|
-
"""Validates the block_digressions configuration in a flow."""
|
|
1730
|
-
for flow_id in flow.block_digressions:
|
|
1731
|
-
if flow_id == ALL_LABEL:
|
|
1732
|
-
continue
|
|
1733
|
-
|
|
1734
|
-
if flow_id not in self.flows.flow_ids:
|
|
1735
|
-
structlogger.error(
|
|
1736
|
-
"validator.verify_digression_configuration.block_digressions",
|
|
1737
|
-
flow=flow.id,
|
|
1738
|
-
event_info=(
|
|
1739
|
-
f"The flow '{flow_id}' is listed in the `block_digressions` "
|
|
1740
|
-
f"configuration of flow '{flow.id}', but it is not found "
|
|
1741
|
-
f"in the flows file. Please make sure that the flow id "
|
|
1742
|
-
f"is correct."
|
|
1743
|
-
),
|
|
1744
|
-
)
|
|
1745
|
-
all_good = False
|
|
1746
|
-
|
|
1747
|
-
for step in flow.get_collect_steps():
|
|
1748
|
-
for flow_id in step.block_digressions:
|
|
1749
|
-
if flow_id == ALL_LABEL:
|
|
1750
|
-
continue
|
|
1751
|
-
|
|
1752
|
-
if flow_id not in self.flows.flow_ids:
|
|
1753
|
-
structlogger.error(
|
|
1754
|
-
"validator.verify_digression_configuration.block_digressions",
|
|
1755
|
-
flow=flow.id,
|
|
1756
|
-
step_id=step.id,
|
|
1757
|
-
event_info=(
|
|
1758
|
-
f"The flow '{flow_id}' is listed in the "
|
|
1759
|
-
f"`block_digressions` configuration of step "
|
|
1760
|
-
f"'{step.id}' in flow '{flow.id}', but it is "
|
|
1761
|
-
f"not found in the flows file. "
|
|
1762
|
-
f"Please make sure that the flow id is correct."
|
|
1763
|
-
),
|
|
1764
|
-
)
|
|
1765
|
-
all_good = False
|
|
1766
|
-
|
|
1767
|
-
return all_good
|
rasa/version.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: rasa-pro
|
|
3
|
-
Version: 3.12.0.
|
|
3
|
+
Version: 3.12.0.dev12
|
|
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
|
Home-page: https://rasa.com
|
|
6
6
|
Keywords: nlp,machine-learning,machine-learning-library,bot,bots,botkit,rasa conversational-agents,conversational-ai,chatbot,chatbot-framework,bot-framework
|