rasa-pro 3.9.18__py3-none-any.whl → 3.10.16__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.
- README.md +0 -374
- rasa/__init__.py +1 -2
- rasa/__main__.py +5 -0
- rasa/anonymization/anonymization_rule_executor.py +2 -2
- rasa/api.py +27 -23
- rasa/cli/arguments/data.py +27 -2
- rasa/cli/arguments/default_arguments.py +25 -3
- rasa/cli/arguments/run.py +9 -9
- rasa/cli/arguments/train.py +11 -3
- rasa/cli/data.py +70 -8
- rasa/cli/e2e_test.py +104 -431
- rasa/cli/evaluate.py +1 -1
- rasa/cli/interactive.py +1 -0
- rasa/cli/llm_fine_tuning.py +398 -0
- rasa/cli/project_templates/calm/endpoints.yml +1 -1
- rasa/cli/project_templates/tutorial/endpoints.yml +1 -1
- rasa/cli/run.py +15 -14
- rasa/cli/scaffold.py +10 -8
- rasa/cli/studio/studio.py +35 -5
- rasa/cli/train.py +56 -8
- rasa/cli/utils.py +22 -5
- rasa/cli/x.py +1 -1
- rasa/constants.py +7 -1
- rasa/core/actions/action.py +98 -49
- rasa/core/actions/action_run_slot_rejections.py +4 -1
- rasa/core/actions/custom_action_executor.py +9 -6
- rasa/core/actions/direct_custom_actions_executor.py +80 -0
- rasa/core/actions/e2e_stub_custom_action_executor.py +68 -0
- rasa/core/actions/grpc_custom_action_executor.py +2 -2
- rasa/core/actions/http_custom_action_executor.py +6 -5
- rasa/core/agent.py +21 -17
- rasa/core/channels/__init__.py +2 -0
- rasa/core/channels/audiocodes.py +1 -16
- rasa/core/channels/voice_aware/__init__.py +0 -0
- rasa/core/channels/voice_aware/jambonz.py +103 -0
- rasa/core/channels/voice_aware/jambonz_protocol.py +344 -0
- rasa/core/channels/voice_aware/utils.py +20 -0
- rasa/core/channels/voice_native/__init__.py +0 -0
- rasa/core/constants.py +6 -1
- rasa/core/information_retrieval/faiss.py +7 -4
- rasa/core/information_retrieval/information_retrieval.py +8 -0
- rasa/core/information_retrieval/milvus.py +9 -2
- rasa/core/information_retrieval/qdrant.py +1 -1
- rasa/core/nlg/contextual_response_rephraser.py +32 -10
- rasa/core/nlg/summarize.py +4 -3
- rasa/core/policies/enterprise_search_policy.py +113 -45
- rasa/core/policies/flows/flow_executor.py +122 -76
- rasa/core/policies/intentless_policy.py +83 -29
- rasa/core/processor.py +72 -54
- rasa/core/run.py +5 -4
- rasa/core/tracker_store.py +8 -4
- rasa/core/training/interactive.py +1 -1
- rasa/core/utils.py +56 -57
- rasa/dialogue_understanding/coexistence/llm_based_router.py +53 -13
- rasa/dialogue_understanding/commands/__init__.py +6 -0
- rasa/dialogue_understanding/commands/restart_command.py +58 -0
- rasa/dialogue_understanding/commands/session_start_command.py +59 -0
- rasa/dialogue_understanding/commands/utils.py +40 -0
- rasa/dialogue_understanding/generator/constants.py +10 -3
- rasa/dialogue_understanding/generator/flow_retrieval.py +21 -5
- rasa/dialogue_understanding/generator/llm_based_command_generator.py +13 -3
- rasa/dialogue_understanding/generator/multi_step/multi_step_llm_command_generator.py +134 -90
- rasa/dialogue_understanding/generator/nlu_command_adapter.py +47 -7
- rasa/dialogue_understanding/generator/single_step/single_step_llm_command_generator.py +127 -41
- rasa/dialogue_understanding/patterns/restart.py +37 -0
- rasa/dialogue_understanding/patterns/session_start.py +37 -0
- rasa/dialogue_understanding/processor/command_processor.py +16 -3
- rasa/dialogue_understanding/processor/command_processor_component.py +6 -2
- rasa/e2e_test/aggregate_test_stats_calculator.py +134 -0
- rasa/e2e_test/assertions.py +1223 -0
- rasa/e2e_test/assertions_schema.yml +106 -0
- rasa/e2e_test/constants.py +20 -0
- rasa/e2e_test/e2e_config.py +220 -0
- rasa/e2e_test/e2e_config_schema.yml +26 -0
- rasa/e2e_test/e2e_test_case.py +131 -8
- rasa/e2e_test/e2e_test_converter.py +363 -0
- rasa/e2e_test/e2e_test_converter_prompt.jinja2 +70 -0
- rasa/e2e_test/e2e_test_coverage_report.py +364 -0
- rasa/e2e_test/e2e_test_result.py +26 -6
- rasa/e2e_test/e2e_test_runner.py +493 -71
- rasa/e2e_test/e2e_test_schema.yml +96 -0
- rasa/e2e_test/pykwalify_extensions.py +39 -0
- rasa/e2e_test/stub_custom_action.py +70 -0
- rasa/e2e_test/utils/__init__.py +0 -0
- rasa/e2e_test/utils/e2e_yaml_utils.py +55 -0
- rasa/e2e_test/utils/io.py +598 -0
- rasa/e2e_test/utils/validation.py +80 -0
- rasa/engine/graph.py +9 -3
- rasa/engine/recipes/default_components.py +0 -2
- rasa/engine/recipes/default_recipe.py +10 -2
- rasa/engine/storage/local_model_storage.py +40 -12
- rasa/engine/validation.py +78 -1
- rasa/env.py +9 -0
- rasa/graph_components/providers/story_graph_provider.py +59 -6
- rasa/llm_fine_tuning/__init__.py +0 -0
- rasa/llm_fine_tuning/annotation_module.py +241 -0
- rasa/llm_fine_tuning/conversations.py +144 -0
- rasa/llm_fine_tuning/llm_data_preparation_module.py +178 -0
- rasa/llm_fine_tuning/notebooks/unsloth_finetuning.ipynb +407 -0
- rasa/llm_fine_tuning/paraphrasing/__init__.py +0 -0
- rasa/llm_fine_tuning/paraphrasing/conversation_rephraser.py +281 -0
- rasa/llm_fine_tuning/paraphrasing/default_rephrase_prompt_template.jina2 +44 -0
- rasa/llm_fine_tuning/paraphrasing/rephrase_validator.py +121 -0
- rasa/llm_fine_tuning/paraphrasing/rephrased_user_message.py +10 -0
- rasa/llm_fine_tuning/paraphrasing_module.py +128 -0
- rasa/llm_fine_tuning/storage.py +174 -0
- rasa/llm_fine_tuning/train_test_split_module.py +441 -0
- rasa/model_training.py +56 -16
- rasa/nlu/persistor.py +157 -36
- rasa/server.py +45 -10
- rasa/shared/constants.py +76 -16
- rasa/shared/core/domain.py +27 -19
- rasa/shared/core/events.py +28 -2
- rasa/shared/core/flows/flow.py +208 -13
- rasa/shared/core/flows/flow_path.py +84 -0
- rasa/shared/core/flows/flows_list.py +33 -11
- rasa/shared/core/flows/flows_yaml_schema.json +269 -193
- rasa/shared/core/flows/validation.py +112 -25
- rasa/shared/core/flows/yaml_flows_io.py +149 -10
- rasa/shared/core/trackers.py +6 -0
- rasa/shared/core/training_data/structures.py +20 -0
- rasa/shared/core/training_data/visualization.html +2 -2
- rasa/shared/exceptions.py +4 -0
- rasa/shared/importers/importer.py +64 -16
- rasa/shared/nlu/constants.py +2 -0
- rasa/shared/providers/_configs/__init__.py +0 -0
- rasa/shared/providers/_configs/azure_openai_client_config.py +183 -0
- rasa/shared/providers/_configs/client_config.py +57 -0
- rasa/shared/providers/_configs/default_litellm_client_config.py +130 -0
- rasa/shared/providers/_configs/huggingface_local_embedding_client_config.py +234 -0
- rasa/shared/providers/_configs/openai_client_config.py +175 -0
- rasa/shared/providers/_configs/self_hosted_llm_client_config.py +176 -0
- rasa/shared/providers/_configs/utils.py +101 -0
- rasa/shared/providers/_ssl_verification_utils.py +124 -0
- rasa/shared/providers/embedding/__init__.py +0 -0
- rasa/shared/providers/embedding/_base_litellm_embedding_client.py +259 -0
- rasa/shared/providers/embedding/_langchain_embedding_client_adapter.py +74 -0
- rasa/shared/providers/embedding/azure_openai_embedding_client.py +277 -0
- rasa/shared/providers/embedding/default_litellm_embedding_client.py +102 -0
- rasa/shared/providers/embedding/embedding_client.py +90 -0
- rasa/shared/providers/embedding/embedding_response.py +41 -0
- rasa/shared/providers/embedding/huggingface_local_embedding_client.py +191 -0
- rasa/shared/providers/embedding/openai_embedding_client.py +172 -0
- rasa/shared/providers/llm/__init__.py +0 -0
- rasa/shared/providers/llm/_base_litellm_client.py +251 -0
- rasa/shared/providers/llm/azure_openai_llm_client.py +338 -0
- rasa/shared/providers/llm/default_litellm_llm_client.py +84 -0
- rasa/shared/providers/llm/llm_client.py +76 -0
- rasa/shared/providers/llm/llm_response.py +50 -0
- rasa/shared/providers/llm/openai_llm_client.py +155 -0
- rasa/shared/providers/llm/self_hosted_llm_client.py +293 -0
- rasa/shared/providers/mappings.py +75 -0
- rasa/shared/utils/cli.py +30 -0
- rasa/shared/utils/io.py +65 -2
- rasa/shared/utils/llm.py +246 -200
- rasa/shared/utils/yaml.py +121 -15
- rasa/studio/auth.py +6 -4
- rasa/studio/config.py +13 -4
- rasa/studio/constants.py +1 -0
- rasa/studio/data_handler.py +10 -3
- rasa/studio/download.py +19 -13
- rasa/studio/train.py +2 -3
- rasa/studio/upload.py +19 -11
- rasa/telemetry.py +113 -58
- rasa/tracing/instrumentation/attribute_extractors.py +32 -17
- rasa/utils/common.py +18 -19
- rasa/utils/endpoints.py +7 -4
- rasa/utils/json_utils.py +60 -0
- rasa/utils/licensing.py +9 -1
- rasa/utils/ml_utils.py +4 -2
- rasa/validator.py +213 -3
- rasa/version.py +1 -1
- rasa_pro-3.10.16.dist-info/METADATA +196 -0
- {rasa_pro-3.9.18.dist-info → rasa_pro-3.10.16.dist-info}/RECORD +179 -113
- rasa/nlu/classifiers/llm_intent_classifier.py +0 -519
- rasa/shared/providers/openai/clients.py +0 -43
- rasa/shared/providers/openai/session_handler.py +0 -110
- rasa_pro-3.9.18.dist-info/METADATA +0 -563
- /rasa/{shared/providers/openai → cli/project_templates/tutorial/actions}/__init__.py +0 -0
- /rasa/cli/project_templates/tutorial/{actions.py → actions/actions.py} +0 -0
- {rasa_pro-3.9.18.dist-info → rasa_pro-3.10.16.dist-info}/NOTICE +0 -0
- {rasa_pro-3.9.18.dist-info → rasa_pro-3.10.16.dist-info}/WHEEL +0 -0
- {rasa_pro-3.9.18.dist-info → rasa_pro-3.10.16.dist-info}/entry_points.txt +0 -0
rasa/validator.py
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import logging
|
|
2
|
-
import structlog
|
|
3
2
|
import re
|
|
4
3
|
import string
|
|
5
4
|
from collections import defaultdict
|
|
6
5
|
from typing import Set, Text, Optional, Dict, Any, List, Tuple
|
|
7
6
|
|
|
7
|
+
import structlog
|
|
8
8
|
from jinja2 import Template
|
|
9
9
|
from pypred import Predicate
|
|
10
|
+
from pypred.ast import Literal, CompareOperator, NegateOperator
|
|
10
11
|
|
|
11
12
|
import rasa.core.training.story_conflict
|
|
12
13
|
from rasa.core.channels import UserMessage
|
|
@@ -44,7 +45,7 @@ from rasa.shared.core.domain import (
|
|
|
44
45
|
)
|
|
45
46
|
from rasa.shared.core.generator import TrainingDataGenerator
|
|
46
47
|
from rasa.shared.core.constants import SlotMappingType, MAPPING_TYPE
|
|
47
|
-
from rasa.shared.core.slots import ListSlot, Slot
|
|
48
|
+
from rasa.shared.core.slots import BooleanSlot, CategoricalSlot, ListSlot, Slot
|
|
48
49
|
from rasa.shared.core.training_data.story_reader.yaml_story_reader import (
|
|
49
50
|
YAMLStoryReader,
|
|
50
51
|
)
|
|
@@ -302,6 +303,18 @@ class Validator:
|
|
|
302
303
|
everything_is_alright = True
|
|
303
304
|
|
|
304
305
|
for response_text, response_variations in self.domain.responses.items():
|
|
306
|
+
if not response_variations:
|
|
307
|
+
structlogger.error(
|
|
308
|
+
"validator.empty_response",
|
|
309
|
+
response=response_text,
|
|
310
|
+
event_info=(
|
|
311
|
+
f"The response '{response_text}' in the domain file "
|
|
312
|
+
f"does not have any variations. Please add at least one "
|
|
313
|
+
f"variation to the response."
|
|
314
|
+
),
|
|
315
|
+
)
|
|
316
|
+
everything_is_alright = False
|
|
317
|
+
|
|
305
318
|
for response in response_variations:
|
|
306
319
|
if any(
|
|
307
320
|
self.check_for_placeholder(response.get(key))
|
|
@@ -595,6 +608,7 @@ class Validator:
|
|
|
595
608
|
collect: CollectInformationFlowStep,
|
|
596
609
|
all_good: bool,
|
|
597
610
|
domain_slots: Dict[Text, Slot],
|
|
611
|
+
flow_id: str,
|
|
598
612
|
) -> bool:
|
|
599
613
|
"""Validates that a collect step can have either an action or an utterance.
|
|
600
614
|
Also logs an error if neither an action nor an utterance is defined.
|
|
@@ -624,6 +638,7 @@ class Validator:
|
|
|
624
638
|
collect=collect.collect,
|
|
625
639
|
has_utterance_defined=has_utterance_defined,
|
|
626
640
|
has_action_defined=has_action_defined,
|
|
641
|
+
flow=flow_id,
|
|
627
642
|
event_info=(
|
|
628
643
|
f"The collect step '{collect.collect}' has an utterance "
|
|
629
644
|
f"'{collect.utter}' as well as an action "
|
|
@@ -647,6 +662,7 @@ class Validator:
|
|
|
647
662
|
collect=collect.collect,
|
|
648
663
|
has_utterance_defined=has_utterance_defined,
|
|
649
664
|
has_action_defined=has_action_defined,
|
|
665
|
+
flow=flow_id,
|
|
650
666
|
event_info=(
|
|
651
667
|
f"The collect step '{collect.collect}' has neither an utterance "
|
|
652
668
|
f"nor an action defined, or an initial value defined in the domain."
|
|
@@ -715,7 +731,7 @@ class Validator:
|
|
|
715
731
|
if isinstance(step, CollectInformationFlowStep):
|
|
716
732
|
all_good = (
|
|
717
733
|
self._log_error_if_either_action_or_utterance_are_not_defined(
|
|
718
|
-
step, all_good, domain_slots
|
|
734
|
+
step, all_good, domain_slots, flow.id
|
|
719
735
|
)
|
|
720
736
|
)
|
|
721
737
|
|
|
@@ -893,6 +909,191 @@ class Validator:
|
|
|
893
909
|
|
|
894
910
|
return pred, all_good
|
|
895
911
|
|
|
912
|
+
def _extract_predicate_syntax_tree(self, predicate: Predicate) -> Any:
|
|
913
|
+
"""Extract the predicate syntax tree from the given predicate.
|
|
914
|
+
|
|
915
|
+
Args:
|
|
916
|
+
predicate: The predicate from which to extract the syntax tree.
|
|
917
|
+
|
|
918
|
+
Returns:
|
|
919
|
+
The extracted syntax tree.
|
|
920
|
+
"""
|
|
921
|
+
if isinstance(predicate.ast, NegateOperator):
|
|
922
|
+
return predicate.ast.left
|
|
923
|
+
return predicate.ast
|
|
924
|
+
|
|
925
|
+
def _extract_slot_name_and_slot_value(
|
|
926
|
+
self,
|
|
927
|
+
predicate_syntax_tree: Any,
|
|
928
|
+
) -> tuple:
|
|
929
|
+
"""Extract the slot name and slot value from the predicate syntax tree.
|
|
930
|
+
|
|
931
|
+
Args:
|
|
932
|
+
predicate_syntax_tree: The predicate syntax tree.
|
|
933
|
+
|
|
934
|
+
Returns:
|
|
935
|
+
A tuple containing the slot name and slot value.
|
|
936
|
+
"""
|
|
937
|
+
try:
|
|
938
|
+
if isinstance(predicate_syntax_tree.left, Literal):
|
|
939
|
+
slot_name = predicate_syntax_tree.left.value.split(".")
|
|
940
|
+
slot_value = predicate_syntax_tree.right.value
|
|
941
|
+
else:
|
|
942
|
+
slot_name = predicate_syntax_tree.right.value.split(".")
|
|
943
|
+
slot_value = predicate_syntax_tree.left.value
|
|
944
|
+
except AttributeError:
|
|
945
|
+
# predicate only has negation and doesn't need to be checked further
|
|
946
|
+
return None, None
|
|
947
|
+
return slot_name, slot_value
|
|
948
|
+
|
|
949
|
+
def _validate_categorical_value_check(
|
|
950
|
+
self,
|
|
951
|
+
slot_name: str,
|
|
952
|
+
slot_value: Any,
|
|
953
|
+
valid_slot_values: List[str],
|
|
954
|
+
all_good: bool,
|
|
955
|
+
step_id: str,
|
|
956
|
+
link_condition: str,
|
|
957
|
+
flow_id: str,
|
|
958
|
+
) -> bool:
|
|
959
|
+
"""Validates the categorical slot check.
|
|
960
|
+
|
|
961
|
+
Validates that the categorical slot is checked against valid values.
|
|
962
|
+
|
|
963
|
+
Args:
|
|
964
|
+
slot_name: name of the slot to be checked
|
|
965
|
+
slot_value: value of the slot to be checked
|
|
966
|
+
valid_slot_values: valid values for the given slot
|
|
967
|
+
all_good: flag whether all the validations have passed so far
|
|
968
|
+
step_id: id of the step in which the values are being checked
|
|
969
|
+
link_condition: condition where the values are being checked
|
|
970
|
+
flow_id: id of the flow where the values are being checked
|
|
971
|
+
|
|
972
|
+
Returns:
|
|
973
|
+
False, if validation failed, previous value of all_good, otherwise
|
|
974
|
+
"""
|
|
975
|
+
valid_slot_values.append(None)
|
|
976
|
+
# slot_value can either be None, a string or a list of Literal objects
|
|
977
|
+
if slot_value is None:
|
|
978
|
+
slot_value = [None]
|
|
979
|
+
if isinstance(slot_value, str):
|
|
980
|
+
slot_value = [Literal(slot_value)]
|
|
981
|
+
|
|
982
|
+
slot_values_validity = [
|
|
983
|
+
sv is None
|
|
984
|
+
or re.sub(r'^[\'"](.+)[\'"]$', r"\1", sv.value) in valid_slot_values
|
|
985
|
+
for sv in slot_value
|
|
986
|
+
]
|
|
987
|
+
if not all(slot_values_validity):
|
|
988
|
+
invalid_slot_values = [
|
|
989
|
+
sv
|
|
990
|
+
for (sv, slot_value_valid) in zip(slot_value, slot_values_validity)
|
|
991
|
+
if not slot_value_valid
|
|
992
|
+
]
|
|
993
|
+
structlogger.error(
|
|
994
|
+
"validator.verify_predicates.link.invalid_condition",
|
|
995
|
+
step=step_id,
|
|
996
|
+
link=link_condition,
|
|
997
|
+
flow=flow_id,
|
|
998
|
+
event_info=(
|
|
999
|
+
f"Detected invalid condition '{link_condition}' "
|
|
1000
|
+
f"at step '{step_id}' for flow id '{flow_id}'. "
|
|
1001
|
+
f"Values {invalid_slot_values} are not valid values "
|
|
1002
|
+
f"for slot {slot_name}. "
|
|
1003
|
+
f"Please make sure that all conditions are valid."
|
|
1004
|
+
),
|
|
1005
|
+
)
|
|
1006
|
+
return False
|
|
1007
|
+
return all_good
|
|
1008
|
+
|
|
1009
|
+
def _validate_categorical_and_boolean_values_check(
|
|
1010
|
+
self,
|
|
1011
|
+
predicate: Predicate,
|
|
1012
|
+
all_good: bool,
|
|
1013
|
+
step_id: str,
|
|
1014
|
+
link_condition: str,
|
|
1015
|
+
flow_id: str,
|
|
1016
|
+
) -> bool:
|
|
1017
|
+
"""Validates the categorical and boolean slot checks.
|
|
1018
|
+
|
|
1019
|
+
Validates that the categorical and boolean slots
|
|
1020
|
+
are checked against valid values.
|
|
1021
|
+
|
|
1022
|
+
Args:
|
|
1023
|
+
predicate: condition that is supposed to be validated
|
|
1024
|
+
all_good: flag whether all the validations have passed so far
|
|
1025
|
+
step_id: id of the step in which the values are being checked
|
|
1026
|
+
link_condition: condition where the values are being checked
|
|
1027
|
+
flow_id: id of the flow where the values are being checked
|
|
1028
|
+
|
|
1029
|
+
Returns:
|
|
1030
|
+
False, if validation failed, previous value of all_good, otherwise
|
|
1031
|
+
"""
|
|
1032
|
+
predicate_syntax_tree = self._extract_predicate_syntax_tree(predicate)
|
|
1033
|
+
slot_name, slot_value = self._extract_slot_name_and_slot_value(
|
|
1034
|
+
predicate_syntax_tree
|
|
1035
|
+
)
|
|
1036
|
+
|
|
1037
|
+
if slot_name is None:
|
|
1038
|
+
return all_good
|
|
1039
|
+
|
|
1040
|
+
if slot_name[0] == "slots":
|
|
1041
|
+
slot_name = slot_name[1]
|
|
1042
|
+
# slots.{{context.variable}} gets evaluated to `slots.None`,
|
|
1043
|
+
# these predicates can only be validated during runtime
|
|
1044
|
+
if slot_name == "None":
|
|
1045
|
+
return all_good
|
|
1046
|
+
else:
|
|
1047
|
+
return all_good
|
|
1048
|
+
|
|
1049
|
+
try:
|
|
1050
|
+
slot = next(slot for slot in self.domain.slots if slot.name == slot_name)
|
|
1051
|
+
except StopIteration:
|
|
1052
|
+
structlogger.error(
|
|
1053
|
+
"validator.verify_predicates.link.invalid_condition",
|
|
1054
|
+
step=step_id,
|
|
1055
|
+
link=link_condition,
|
|
1056
|
+
flow=flow_id,
|
|
1057
|
+
event_info=(
|
|
1058
|
+
f"Detected invalid condition '{link_condition}' "
|
|
1059
|
+
f"at step '{step_id}' for flow id '{flow_id}'. "
|
|
1060
|
+
f"Slot {slot_name} is not defined in the domain file. "
|
|
1061
|
+
f"Please make sure that all conditions are valid."
|
|
1062
|
+
),
|
|
1063
|
+
)
|
|
1064
|
+
return False
|
|
1065
|
+
if isinstance(slot, CategoricalSlot):
|
|
1066
|
+
return self._validate_categorical_value_check(
|
|
1067
|
+
slot_name,
|
|
1068
|
+
slot_value,
|
|
1069
|
+
slot.values,
|
|
1070
|
+
all_good,
|
|
1071
|
+
step_id,
|
|
1072
|
+
link_condition,
|
|
1073
|
+
flow_id,
|
|
1074
|
+
)
|
|
1075
|
+
|
|
1076
|
+
if (
|
|
1077
|
+
isinstance(slot, BooleanSlot)
|
|
1078
|
+
and isinstance(predicate_syntax_tree, CompareOperator)
|
|
1079
|
+
and not isinstance(predicate_syntax_tree.right.value, bool)
|
|
1080
|
+
):
|
|
1081
|
+
structlogger.error(
|
|
1082
|
+
"validator.verify_predicates.link.invalid_condition",
|
|
1083
|
+
step=step_id,
|
|
1084
|
+
link=link_condition,
|
|
1085
|
+
flow=flow_id,
|
|
1086
|
+
event_info=(
|
|
1087
|
+
f"Detected invalid condition '{link_condition}' "
|
|
1088
|
+
f"at step '{step_id}' for flow id '{flow_id}'. "
|
|
1089
|
+
f"Boolean slots can only be compared to "
|
|
1090
|
+
f"boolean values (true, false). "
|
|
1091
|
+
f"Please make sure that all conditions are valid."
|
|
1092
|
+
),
|
|
1093
|
+
)
|
|
1094
|
+
return False
|
|
1095
|
+
return all_good
|
|
1096
|
+
|
|
896
1097
|
def verify_predicates(self) -> bool:
|
|
897
1098
|
"""Validate predicates used in flow step links and slot rejections."""
|
|
898
1099
|
all_good = True
|
|
@@ -946,6 +1147,15 @@ class Validator:
|
|
|
946
1147
|
),
|
|
947
1148
|
)
|
|
948
1149
|
all_good = False
|
|
1150
|
+
|
|
1151
|
+
all_good = self._validate_categorical_and_boolean_values_check(
|
|
1152
|
+
predicate,
|
|
1153
|
+
all_good=all_good,
|
|
1154
|
+
step_id=step.id,
|
|
1155
|
+
link_condition=link.condition,
|
|
1156
|
+
flow_id=flow.id,
|
|
1157
|
+
)
|
|
1158
|
+
|
|
949
1159
|
if isinstance(step, CollectInformationFlowStep):
|
|
950
1160
|
predicates = [predicate.if_ for predicate in step.rejections]
|
|
951
1161
|
for predicate in predicates:
|
rasa/version.py
CHANGED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: rasa-pro
|
|
3
|
+
Version: 3.10.16
|
|
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
|
+
Keywords: nlp,machine-learning,machine-learning-library,bot,bots,botkit,rasa conversational-agents,conversational-ai,chatbot,chatbot-framework,bot-framework
|
|
7
|
+
Author: Rasa Technologies GmbH
|
|
8
|
+
Author-email: hi@rasa.com
|
|
9
|
+
Maintainer: Tom Bocklisch
|
|
10
|
+
Maintainer-email: tom@rasa.com
|
|
11
|
+
Requires-Python: >=3.9,<3.11
|
|
12
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
18
|
+
Provides-Extra: full
|
|
19
|
+
Provides-Extra: gh-release-notes
|
|
20
|
+
Provides-Extra: jieba
|
|
21
|
+
Provides-Extra: metal
|
|
22
|
+
Provides-Extra: mlflow
|
|
23
|
+
Provides-Extra: spacy
|
|
24
|
+
Provides-Extra: transformers
|
|
25
|
+
Requires-Dist: CacheControl (>=0.12.14,<0.13.0)
|
|
26
|
+
Requires-Dist: PyJWT[crypto] (>=2.8.0,<3.0.0)
|
|
27
|
+
Requires-Dist: SQLAlchemy (>=2.0.22,<2.1.0)
|
|
28
|
+
Requires-Dist: absl-py (>=2.0,<2.1)
|
|
29
|
+
Requires-Dist: aio-pika (>=8.2.3,<8.2.4)
|
|
30
|
+
Requires-Dist: aiogram (>=2.15,<2.26)
|
|
31
|
+
Requires-Dist: aiohttp (>=3.9.4,<3.10)
|
|
32
|
+
Requires-Dist: apscheduler (>=3.10,<3.11)
|
|
33
|
+
Requires-Dist: attrs (>=23.1,<23.2)
|
|
34
|
+
Requires-Dist: azure-storage-blob (>=12.16.0,<12.17.0)
|
|
35
|
+
Requires-Dist: boto3 (>=1.35.5,<1.36.0)
|
|
36
|
+
Requires-Dist: certifi (>=2024.07.04)
|
|
37
|
+
Requires-Dist: colorama (>=0.4.6,<0.5.0) ; sys_platform == "win32"
|
|
38
|
+
Requires-Dist: colorclass (>=2.2,<2.3)
|
|
39
|
+
Requires-Dist: coloredlogs (>=15,<16)
|
|
40
|
+
Requires-Dist: colorhash (>=2.0,<2.1.0)
|
|
41
|
+
Requires-Dist: confluent-kafka (>=2.3.0,<3.0.0)
|
|
42
|
+
Requires-Dist: cryptography (>=42.0.5)
|
|
43
|
+
Requires-Dist: cvg-python-sdk (>=0.5.1,<0.6.0)
|
|
44
|
+
Requires-Dist: dask (==2022.10.2) ; python_version >= "3.9" and python_version < "3.11"
|
|
45
|
+
Requires-Dist: diskcache (>=5.6.3,<5.7.0)
|
|
46
|
+
Requires-Dist: dnspython (==2.6.1)
|
|
47
|
+
Requires-Dist: faiss-cpu (>=1.7.4,<2.0.0)
|
|
48
|
+
Requires-Dist: faker (>=26.0.0,<27.0.0)
|
|
49
|
+
Requires-Dist: fbmessenger (>=6.0.0,<6.1.0)
|
|
50
|
+
Requires-Dist: github3.py (>=3.2.0,<3.3.0) ; extra == "gh-release-notes"
|
|
51
|
+
Requires-Dist: gitpython (>=3.1.41,<3.2.0) ; extra == "full"
|
|
52
|
+
Requires-Dist: google-auth (>=2.23.4,<3)
|
|
53
|
+
Requires-Dist: google-cloud-storage (>=2.14.0,<3.0.0)
|
|
54
|
+
Requires-Dist: hvac (>=1.2.1,<2.0.0)
|
|
55
|
+
Requires-Dist: importlib-metadata (>=8.5.0,<8.6.0)
|
|
56
|
+
Requires-Dist: importlib-resources (==6.1.3)
|
|
57
|
+
Requires-Dist: jieba (>=0.42.1,<0.43) ; extra == "jieba" or extra == "full"
|
|
58
|
+
Requires-Dist: jinja2 (>=3.1.4,<4.0.0)
|
|
59
|
+
Requires-Dist: jsonpatch (>=1.33,<2.0)
|
|
60
|
+
Requires-Dist: jsonpickle (>=3.3.0,<3.4)
|
|
61
|
+
Requires-Dist: jsonschema (>=4.22)
|
|
62
|
+
Requires-Dist: keras (==2.14.0)
|
|
63
|
+
Requires-Dist: langchain (>=0.2.0,<0.3.0)
|
|
64
|
+
Requires-Dist: langchain-community (>=0.2.0,<0.3.0)
|
|
65
|
+
Requires-Dist: litellm (>=1.52.6,<1.53.0)
|
|
66
|
+
Requires-Dist: matplotlib (>=3.7,<3.8)
|
|
67
|
+
Requires-Dist: mattermostwrapper (>=2.2,<2.3)
|
|
68
|
+
Requires-Dist: mlflow (>=2.15.1,<3.0.0) ; extra == "mlflow"
|
|
69
|
+
Requires-Dist: networkx (>=3.1,<3.2)
|
|
70
|
+
Requires-Dist: numpy (>=1.23.5,<1.25.0) ; python_version >= "3.9" and python_version < "3.11"
|
|
71
|
+
Requires-Dist: openai (>=1.55.3,<1.56.0)
|
|
72
|
+
Requires-Dist: openpyxl (>=3.1.5,<4.0.0)
|
|
73
|
+
Requires-Dist: opentelemetry-api (>=1.16.0,<1.17.0)
|
|
74
|
+
Requires-Dist: opentelemetry-exporter-jaeger (>=1.16.0,<1.17.0)
|
|
75
|
+
Requires-Dist: opentelemetry-exporter-otlp (>=1.16.0,<1.17.0)
|
|
76
|
+
Requires-Dist: opentelemetry-sdk (>=1.16.0,<1.17.0)
|
|
77
|
+
Requires-Dist: packaging (>=23.2,<23.3)
|
|
78
|
+
Requires-Dist: pep440-version-utils (>=1.1.0,<1.2.0)
|
|
79
|
+
Requires-Dist: pluggy (>=1.2.0,<2.0.0)
|
|
80
|
+
Requires-Dist: portalocker (>=2.7.0,<3.0.0)
|
|
81
|
+
Requires-Dist: presidio-analyzer (>=2.2.33,<2.2.34)
|
|
82
|
+
Requires-Dist: presidio-anonymizer (>=2.2.354,<3.0.0)
|
|
83
|
+
Requires-Dist: prompt-toolkit (>=3.0.28,<3.0.29)
|
|
84
|
+
Requires-Dist: protobuf (>=4.23.3,<4.25.4)
|
|
85
|
+
Requires-Dist: psutil (>=5.9.5,<6.0.0)
|
|
86
|
+
Requires-Dist: psycopg2-binary (>=2.9.9,<2.10.0)
|
|
87
|
+
Requires-Dist: pycountry (>=22.3.5,<23.0.0)
|
|
88
|
+
Requires-Dist: pydantic (>=2.0,<3.0)
|
|
89
|
+
Requires-Dist: pydot (>=1.4,<1.5)
|
|
90
|
+
Requires-Dist: pykwalify (>=1.8,<1.9)
|
|
91
|
+
Requires-Dist: pymilvus (>=2.4.0,<2.4.2)
|
|
92
|
+
Requires-Dist: pymongo[srv,tls] (>=4.6.3,<4.7)
|
|
93
|
+
Requires-Dist: pypred (>=0.4.0,<0.5.0)
|
|
94
|
+
Requires-Dist: python-dateutil (>=2.8.2,<2.9.0)
|
|
95
|
+
Requires-Dist: python-dotenv (>=1.0.1,<2.0.0)
|
|
96
|
+
Requires-Dist: python-engineio (>=4.5.1,<6,!=5.0.0)
|
|
97
|
+
Requires-Dist: python-keycloak (>=3.12.0,<4.0.0)
|
|
98
|
+
Requires-Dist: python-socketio (>=5.8,<6)
|
|
99
|
+
Requires-Dist: pytz (>=2022.7.1,<2023.0)
|
|
100
|
+
Requires-Dist: pyyaml (>=6.0)
|
|
101
|
+
Requires-Dist: qdrant-client (>=1.9.0,<2.0.0)
|
|
102
|
+
Requires-Dist: questionary (>=1.10.0,<2.1.0)
|
|
103
|
+
Requires-Dist: randomname (>=0.2.1,<0.3.0)
|
|
104
|
+
Requires-Dist: rasa-sdk (>=3.10.0,<3.11.0)
|
|
105
|
+
Requires-Dist: redis (>=4.6.0,<6.0)
|
|
106
|
+
Requires-Dist: regex (>=2022.10.31,<2022.11)
|
|
107
|
+
Requires-Dist: requests (>=2.31.0,<2.32.0)
|
|
108
|
+
Requires-Dist: rich (>=13.4.2,<14.0.0)
|
|
109
|
+
Requires-Dist: rocketchat_API (>=1.30.0,<1.31.0)
|
|
110
|
+
Requires-Dist: ruamel.yaml (>=0.17.21,<0.17.22)
|
|
111
|
+
Requires-Dist: safetensors (>=0.4.5,<0.5.0)
|
|
112
|
+
Requires-Dist: sanic (>=22.12,<22.13)
|
|
113
|
+
Requires-Dist: sanic-cors (>=2.2.0,<2.3.0)
|
|
114
|
+
Requires-Dist: sanic-jwt (>=1.8.0,<2.0.0)
|
|
115
|
+
Requires-Dist: sanic-routing (>=22.8.0,<23.0.0)
|
|
116
|
+
Requires-Dist: scikit-learn (>=1.1.3,<1.2) ; python_version >= "3.9" and python_version < "3.11"
|
|
117
|
+
Requires-Dist: scipy (>=1.10.1,<1.11.0) ; python_version >= "3.9" and python_version < "3.11"
|
|
118
|
+
Requires-Dist: sentencepiece[sentencepiece] (>=0.1.99,<0.2.0) ; extra == "transformers" or extra == "full"
|
|
119
|
+
Requires-Dist: sentry-sdk (>=1.14.0,<1.15.0)
|
|
120
|
+
Requires-Dist: setuptools (>=70.0.0,<70.1.0)
|
|
121
|
+
Requires-Dist: sklearn-crfsuite (>=0.3.6,<0.4.0)
|
|
122
|
+
Requires-Dist: skops (>=0.10.0,<0.11.0)
|
|
123
|
+
Requires-Dist: slack-sdk (>=3.27.1,<4.0.0)
|
|
124
|
+
Requires-Dist: spacy (>=3.5.4,<4.0.0) ; extra == "spacy" or extra == "full"
|
|
125
|
+
Requires-Dist: structlog (>=23.1.0,<23.2.0)
|
|
126
|
+
Requires-Dist: structlog-sentry (>=2.0.3,<3.0.0)
|
|
127
|
+
Requires-Dist: tarsafe (>=0.0.5,<0.0.6)
|
|
128
|
+
Requires-Dist: tenacity (>=8.4.1,<8.5.0)
|
|
129
|
+
Requires-Dist: tensorflow (==2.14.1) ; sys_platform != "darwin" or platform_machine != "arm64"
|
|
130
|
+
Requires-Dist: tensorflow-cpu-aws (==2.14.1) ; sys_platform == "linux" and (platform_machine == "arm64" or platform_machine == "aarch64")
|
|
131
|
+
Requires-Dist: tensorflow-intel (==2.14.1) ; sys_platform == "win32"
|
|
132
|
+
Requires-Dist: tensorflow-io-gcs-filesystem (==0.31) ; sys_platform == "win32"
|
|
133
|
+
Requires-Dist: tensorflow-io-gcs-filesystem (==0.34) ; sys_platform == "darwin" and platform_machine != "arm64"
|
|
134
|
+
Requires-Dist: tensorflow-io-gcs-filesystem (==0.34) ; sys_platform == "linux"
|
|
135
|
+
Requires-Dist: tensorflow-macos (==2.14.1) ; sys_platform == "darwin" and platform_machine == "arm64"
|
|
136
|
+
Requires-Dist: tensorflow-metal (==1.1.0) ; (sys_platform == "darwin" and platform_machine == "arm64") and (extra == "metal")
|
|
137
|
+
Requires-Dist: tensorflow-text (==2.14.0) ; sys_platform != "win32" and (platform_machine != "arm64" and platform_machine != "aarch64")
|
|
138
|
+
Requires-Dist: tensorflow_hub (>=0.13.0,<0.14.0)
|
|
139
|
+
Requires-Dist: terminaltables (>=3.1.10,<3.2.0)
|
|
140
|
+
Requires-Dist: tiktoken (>=0.7.0,<0.8.0)
|
|
141
|
+
Requires-Dist: tqdm (>=4.66.2,<5.0.0)
|
|
142
|
+
Requires-Dist: transformers (>=4.36.2,<4.37.0) ; extra == "transformers" or extra == "full"
|
|
143
|
+
Requires-Dist: twilio (>=8.4,<8.5)
|
|
144
|
+
Requires-Dist: types-protobuf (==4.25.0.20240417)
|
|
145
|
+
Requires-Dist: typing-extensions (>=4.7.1,<5.0.0)
|
|
146
|
+
Requires-Dist: typing-utils (>=0.1.0,<0.2.0)
|
|
147
|
+
Requires-Dist: ujson (>=5.8,<6.0)
|
|
148
|
+
Requires-Dist: webexteamssdk (>=1.6.1,<1.7.0)
|
|
149
|
+
Requires-Dist: websockets (>=10.4,<11.0)
|
|
150
|
+
Requires-Dist: wheel (>=0.40.0)
|
|
151
|
+
Project-URL: Documentation, https://rasa.com/docs
|
|
152
|
+
Project-URL: Repository, https://github.com/rasahq/rasa
|
|
153
|
+
Description-Content-Type: text/markdown
|
|
154
|
+
|
|
155
|
+
<h1 align="center">Rasa Pro</h1>
|
|
156
|
+
|
|
157
|
+
<div align="center">
|
|
158
|
+
|
|
159
|
+
[](https://github.com/RasaHQ/rasa-private/actions)
|
|
160
|
+
[](https://sonarcloud.io/summary/new_code?id=RasaHQ_rasa)
|
|
161
|
+
[](https://rasa.com/docs/rasa-pro/)
|
|
162
|
+
|
|
163
|
+
</div>
|
|
164
|
+
|
|
165
|
+
<hr />
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
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.
|
|
169
|
+
|
|
170
|
+
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.
|
|
171
|
+
|
|
172
|
+
**Key Features:**
|
|
173
|
+
|
|
174
|
+
- **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.
|
|
175
|
+
- **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.
|
|
176
|
+
- **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.
|
|
177
|
+
- **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.
|
|
178
|
+
- **Built-in Security:** Safeguard sensitive data, control access, and ensure secure deployment, essential for production environments that demand high levels of security and compliance.
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
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.
|
|
183
|
+
|
|
184
|
+
To get started right now, you can
|
|
185
|
+
|
|
186
|
+
`pip install rasa-pro`
|
|
187
|
+
|
|
188
|
+
Check out our
|
|
189
|
+
|
|
190
|
+
- [Rasa-pro Quickstart](https://rasa.com/docs/rasa-pro/installation/quickstart/),
|
|
191
|
+
- [Conversational AI with Language Models (CALM) conceptual rundown](https://rasa.com/docs/rasa-pro/calm/),
|
|
192
|
+
- [Rasa Pro / CALM tutorial](https://rasa.com/docs/rasa-pro/tutorial), and
|
|
193
|
+
- [Rasa pro changelog](https://rasa.com/docs/rasa/rasa-pro-changelog/)
|
|
194
|
+
|
|
195
|
+
for more. Also feel free to reach out to us on the [Rasa forum](https://forum.rasa.com/).
|
|
196
|
+
|