rasa-pro 3.10.8__py3-none-any.whl → 3.10.9__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/processor.py +57 -8
- rasa/e2e_test/utils/io.py +3 -1
- rasa/version.py +1 -1
- {rasa_pro-3.10.8.dist-info → rasa_pro-3.10.9.dist-info}/METADATA +3 -3
- {rasa_pro-3.10.8.dist-info → rasa_pro-3.10.9.dist-info}/RECORD +8 -9
- rasa/keys +0 -1
- {rasa_pro-3.10.8.dist-info → rasa_pro-3.10.9.dist-info}/NOTICE +0 -0
- {rasa_pro-3.10.8.dist-info → rasa_pro-3.10.9.dist-info}/WHEEL +0 -0
- {rasa_pro-3.10.8.dist-info → rasa_pro-3.10.9.dist-info}/entry_points.txt +0 -0
rasa/core/processor.py
CHANGED
|
@@ -101,6 +101,9 @@ logger = logging.getLogger(__name__)
|
|
|
101
101
|
structlogger = structlog.get_logger()
|
|
102
102
|
|
|
103
103
|
MAX_NUMBER_OF_PREDICTIONS = int(os.environ.get("MAX_NUMBER_OF_PREDICTIONS", "10"))
|
|
104
|
+
MAX_NUMBER_OF_PREDICTIONS_CALM = int(
|
|
105
|
+
os.environ.get("MAX_NUMBER_OF_PREDICTIONS_CALM", "1000")
|
|
106
|
+
)
|
|
104
107
|
|
|
105
108
|
|
|
106
109
|
class MessageProcessor:
|
|
@@ -114,6 +117,7 @@ class MessageProcessor:
|
|
|
114
117
|
generator: NaturalLanguageGenerator,
|
|
115
118
|
action_endpoint: Optional[EndpointConfig] = None,
|
|
116
119
|
max_number_of_predictions: int = MAX_NUMBER_OF_PREDICTIONS,
|
|
120
|
+
max_number_of_predictions_calm: int = MAX_NUMBER_OF_PREDICTIONS_CALM,
|
|
117
121
|
on_circuit_break: Optional[LambdaType] = None,
|
|
118
122
|
http_interpreter: Optional[RasaNLUHttpInterpreter] = None,
|
|
119
123
|
endpoints: Optional["AvailableEndpoints"] = None,
|
|
@@ -122,7 +126,6 @@ class MessageProcessor:
|
|
|
122
126
|
self.nlg = generator
|
|
123
127
|
self.tracker_store = tracker_store
|
|
124
128
|
self.lock_store = lock_store
|
|
125
|
-
self.max_number_of_predictions = max_number_of_predictions
|
|
126
129
|
self.on_circuit_break = on_circuit_break
|
|
127
130
|
self.action_endpoint = action_endpoint
|
|
128
131
|
self.model_filename, self.model_metadata, self.graph_runner = self._load_model(
|
|
@@ -130,6 +133,10 @@ class MessageProcessor:
|
|
|
130
133
|
)
|
|
131
134
|
self.endpoints = endpoints
|
|
132
135
|
|
|
136
|
+
self.max_number_of_predictions = max_number_of_predictions
|
|
137
|
+
self.max_number_of_predictions_calm = max_number_of_predictions_calm
|
|
138
|
+
self.is_calm_assistant = self._is_calm_assistant()
|
|
139
|
+
|
|
133
140
|
if self.model_metadata.assistant_id is None:
|
|
134
141
|
rasa.shared.utils.io.raise_warning(
|
|
135
142
|
f"The model metadata does not contain a value for the "
|
|
@@ -972,11 +979,15 @@ class MessageProcessor:
|
|
|
972
979
|
) -> int:
|
|
973
980
|
"""Select the action limit based on the tracker state.
|
|
974
981
|
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
982
|
+
This function determines the maximum number of predictions that should be
|
|
983
|
+
made during a dialogue conversation. Typically, the number of predictions
|
|
984
|
+
is limited to the number of actions executed so far in the conversation.
|
|
985
|
+
However, in certain states (e.g., when the user is correcting the
|
|
986
|
+
conversation flow), more predictions may be allowed as the system traverses
|
|
987
|
+
through a long dialogue flow.
|
|
988
|
+
|
|
989
|
+
Additionally, if the `ROUTE_TO_CALM_SLOT` is present in the tracker slots,
|
|
990
|
+
the action limit is adjusted to a separate limit for CALM-based flows.
|
|
980
991
|
|
|
981
992
|
Args:
|
|
982
993
|
tracker: instance of DialogueStateTracker.
|
|
@@ -984,6 +995,18 @@ class MessageProcessor:
|
|
|
984
995
|
Returns:
|
|
985
996
|
The maximum number of predictions to make.
|
|
986
997
|
"""
|
|
998
|
+
# Check if it is a CALM assistant and if so, that the `ROUTE_TO_CALM_SLOT`
|
|
999
|
+
# is either not present or set to `True`.
|
|
1000
|
+
# If it does, use the specific prediction limit for CALM assistants.
|
|
1001
|
+
# Otherwise, use the default prediction limit.
|
|
1002
|
+
if self.is_calm_assistant and (
|
|
1003
|
+
not tracker.has_coexistence_routing_slot
|
|
1004
|
+
or tracker.get_slot(ROUTE_TO_CALM_SLOT)
|
|
1005
|
+
):
|
|
1006
|
+
max_number_of_predictions = self.max_number_of_predictions_calm
|
|
1007
|
+
else:
|
|
1008
|
+
max_number_of_predictions = self.max_number_of_predictions
|
|
1009
|
+
|
|
987
1010
|
reversed_events = list(tracker.events)[::-1]
|
|
988
1011
|
is_conversation_in_flow_correction = False
|
|
989
1012
|
for e in reversed_events:
|
|
@@ -998,8 +1021,10 @@ class MessageProcessor:
|
|
|
998
1021
|
# allow for more predictions to be made as we might be traversing through
|
|
999
1022
|
# a long flow. We multiply the number of predictions by 10 to allow for
|
|
1000
1023
|
# more predictions to be made - the factor is a best guess.
|
|
1001
|
-
return
|
|
1002
|
-
|
|
1024
|
+
return max_number_of_predictions * 5
|
|
1025
|
+
|
|
1026
|
+
# Return the default
|
|
1027
|
+
return max_number_of_predictions
|
|
1003
1028
|
|
|
1004
1029
|
def is_action_limit_reached(
|
|
1005
1030
|
self, tracker: DialogueStateTracker, should_predict_another_action: bool
|
|
@@ -1387,3 +1412,27 @@ class MessageProcessor:
|
|
|
1387
1412
|
]
|
|
1388
1413
|
|
|
1389
1414
|
return len(filtered_commands) > 0
|
|
1415
|
+
|
|
1416
|
+
def _is_calm_assistant(self) -> bool:
|
|
1417
|
+
"""Inspects the nodes of the graph schema to determine whether
|
|
1418
|
+
any node is associated with the `FlowPolicy`, which is indicative of a
|
|
1419
|
+
CALM assistant setup.
|
|
1420
|
+
|
|
1421
|
+
Returns:
|
|
1422
|
+
bool: True if any node in the graph schema uses `FlowPolicy`.
|
|
1423
|
+
"""
|
|
1424
|
+
# Get the graph schema's nodes from the graph runner.
|
|
1425
|
+
nodes: dict[str, Any] = self.graph_runner._graph_schema.nodes # type: ignore[attr-defined]
|
|
1426
|
+
|
|
1427
|
+
flow_policy_class_path = "rasa.core.policies.flow_policy.FlowPolicy"
|
|
1428
|
+
# Iterate over the nodes and check if any node uses `FlowPolicy`.
|
|
1429
|
+
for node_name, schema_node in nodes.items():
|
|
1430
|
+
if (
|
|
1431
|
+
schema_node.uses is not None
|
|
1432
|
+
and f"{schema_node.uses.__module__}.{schema_node.uses.__name__}"
|
|
1433
|
+
== flow_policy_class_path
|
|
1434
|
+
):
|
|
1435
|
+
return True
|
|
1436
|
+
|
|
1437
|
+
# Return False if no node is found using `FlowPolicy`.
|
|
1438
|
+
return False
|
rasa/e2e_test/utils/io.py
CHANGED
|
@@ -346,7 +346,7 @@ def read_test_cases(path: str) -> TestSuite:
|
|
|
346
346
|
beta_flag_verified = False
|
|
347
347
|
|
|
348
348
|
for test_file in test_files:
|
|
349
|
-
test_file_content = parse_raw_yaml(Path(test_file).read_text())
|
|
349
|
+
test_file_content = parse_raw_yaml(Path(test_file).read_text(encoding="utf-8"))
|
|
350
350
|
|
|
351
351
|
validate_yaml_data_using_schema_with_assertions(
|
|
352
352
|
yaml_data=test_file_content, schema_content=e2e_test_schema
|
|
@@ -506,6 +506,8 @@ def transform_results_output_to_yaml(yaml_string: str) -> str:
|
|
|
506
506
|
result.append(s)
|
|
507
507
|
elif s.startswith("\n"):
|
|
508
508
|
result.append(s.strip())
|
|
509
|
+
elif s.strip().startswith("#"):
|
|
510
|
+
continue
|
|
509
511
|
else:
|
|
510
512
|
result.append(s)
|
|
511
513
|
return "".join(result)
|
rasa/version.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: rasa-pro
|
|
3
|
-
Version: 3.10.
|
|
3
|
+
Version: 3.10.9
|
|
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
|
|
@@ -64,13 +64,13 @@ Requires-Dist: jsonschema (>=4.22)
|
|
|
64
64
|
Requires-Dist: keras (==2.14.0)
|
|
65
65
|
Requires-Dist: langchain (>=0.2.0,<0.3.0)
|
|
66
66
|
Requires-Dist: langchain-community (>=0.2.0,<0.3.0)
|
|
67
|
-
Requires-Dist: litellm (>=1.
|
|
67
|
+
Requires-Dist: litellm (>=1.52.6,<1.53.0)
|
|
68
68
|
Requires-Dist: matplotlib (>=3.7,<3.8)
|
|
69
69
|
Requires-Dist: mattermostwrapper (>=2.2,<2.3)
|
|
70
70
|
Requires-Dist: mlflow (>=2.15.1,<3.0.0) ; extra == "mlflow"
|
|
71
71
|
Requires-Dist: networkx (>=3.1,<3.2)
|
|
72
72
|
Requires-Dist: numpy (>=1.23.5,<1.25.0) ; python_version >= "3.9" and python_version < "3.11"
|
|
73
|
-
Requires-Dist: openai (>=1.
|
|
73
|
+
Requires-Dist: openai (>=1.54.0,<1.55.0)
|
|
74
74
|
Requires-Dist: openpyxl (>=3.1.5,<4.0.0)
|
|
75
75
|
Requires-Dist: opentelemetry-api (>=1.16.0,<1.17.0)
|
|
76
76
|
Requires-Dist: opentelemetry-exporter-jaeger (>=1.16.0,<1.17.0)
|
|
@@ -309,7 +309,7 @@ rasa/core/policies/policy.py,sha256=HeVtIaV0dA1QcAG3vjdn-4g7-oUEJPL4u01ETJt78YA,
|
|
|
309
309
|
rasa/core/policies/rule_policy.py,sha256=YNDPZUZkpKFCvZwKe1kSfP6LQnDL9CQ6JU69JRwdmWw,50729
|
|
310
310
|
rasa/core/policies/ted_policy.py,sha256=TFTM-Ujp1Mu7dQKnX5euKY81cvzDkzokGqAT813PKkY,86658
|
|
311
311
|
rasa/core/policies/unexpected_intent_policy.py,sha256=zeV4atIW9K2QHr4io_8RWOtreABSHoAQHjiznwcmUSo,39441
|
|
312
|
-
rasa/core/processor.py,sha256
|
|
312
|
+
rasa/core/processor.py,sha256=-Jf2WliPA7lUZ8DCNt4r7fdU7qLNQf4g-IhoGZIswN0,54434
|
|
313
313
|
rasa/core/run.py,sha256=s32pZE3B1uKIs20xIbSty0HxeQ9One63_8NeCODwpQE,11050
|
|
314
314
|
rasa/core/secrets_manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
315
315
|
rasa/core/secrets_manager/constants.py,sha256=jVhtn_2PN2LQVq-FkeBEipztCQPYSVQq4_n2xq0wfoY,1051
|
|
@@ -416,7 +416,7 @@ rasa/e2e_test/pykwalify_extensions.py,sha256=OGYKIKYJXd2S0NrWknoQuijyBQaE-oMLkfV
|
|
|
416
416
|
rasa/e2e_test/stub_custom_action.py,sha256=teq8c5I6IuUsFX4lPdeBLY3j0SLSMCC95KmKx7GrE8I,2369
|
|
417
417
|
rasa/e2e_test/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
418
418
|
rasa/e2e_test/utils/e2e_yaml_utils.py,sha256=_3yxv18fUkmO8tvOcXzBzVVBhRdV-d9o2YAlrmCAZcE,1603
|
|
419
|
-
rasa/e2e_test/utils/io.py,sha256=
|
|
419
|
+
rasa/e2e_test/utils/io.py,sha256=HVsFb8uVPTlu7PcQdFmMNUFf0rRrD5Wiys0oMZqu2nA,19016
|
|
420
420
|
rasa/e2e_test/utils/validation.py,sha256=BRjTg3KOAlvGtfZJApOKW29V__cX6hJIG8A5RjzoW54,2348
|
|
421
421
|
rasa/engine/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
422
422
|
rasa/engine/caching.py,sha256=Uu-0yn_eQGysmW7nsub-tb3gD8QNz6TNssNd-GIthuI,16451
|
|
@@ -463,7 +463,6 @@ rasa/graph_components/validators/default_recipe_validator.py,sha256=BHrF6NTfJz42
|
|
|
463
463
|
rasa/graph_components/validators/finetuning_validator.py,sha256=38AcwmV8cF5TIlWhUIzh98wtZf934ix04HcczCJiWkU,12863
|
|
464
464
|
rasa/hooks.py,sha256=3nsfCA142V56mBQ7ktBXhD_RyaSrfj7fY3t7HnsD4Pc,3709
|
|
465
465
|
rasa/jupyter.py,sha256=x_GF9PK2zMhltb48GEIV9YZ4pRhCto8nV5SioYSCljI,1782
|
|
466
|
-
rasa/keys,sha256=2Stg1fstgJ203cOoW1B2gGMY29fhEnjIfTVxKv_fqPo,101
|
|
467
466
|
rasa/llm_fine_tuning/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
468
467
|
rasa/llm_fine_tuning/annotation_module.py,sha256=wFmW3d6lI5o49OWmdbYQlgr24rqHDgA0T0hLM1pSb9U,8578
|
|
469
468
|
rasa/llm_fine_tuning/conversations.py,sha256=QvsgoL8wes5Pad22J1LFOKqtl90SCnjZ1HvawbxZ5tw,5197
|
|
@@ -721,9 +720,9 @@ rasa/utils/train_utils.py,sha256=f1NWpp5y6al0dzoQyyio4hc4Nf73DRoRSHDzEK6-C4E,212
|
|
|
721
720
|
rasa/utils/url_tools.py,sha256=JQcHL2aLqLHu82k7_d9imUoETCm2bmlHaDpOJ-dKqBc,1218
|
|
722
721
|
rasa/utils/yaml.py,sha256=KjbZq5C94ZP7Jdsw8bYYF7HASI6K4-C_kdHfrnPLpSI,2000
|
|
723
722
|
rasa/validator.py,sha256=ToRaa4dS859CJO3H2VGqS943O5qWOg45ypbDfFMKECU,62699
|
|
724
|
-
rasa/version.py,sha256=
|
|
725
|
-
rasa_pro-3.10.
|
|
726
|
-
rasa_pro-3.10.
|
|
727
|
-
rasa_pro-3.10.
|
|
728
|
-
rasa_pro-3.10.
|
|
729
|
-
rasa_pro-3.10.
|
|
723
|
+
rasa/version.py,sha256=DK8n4XcyRXMG-ezphYn9efLxc4P02gVlclLzdO4NdwI,117
|
|
724
|
+
rasa_pro-3.10.9.dist-info/METADATA,sha256=VZG80CP9Yg2VvP5pCXTC8cuqd76qeVkSR6okEihMW_U,30892
|
|
725
|
+
rasa_pro-3.10.9.dist-info/NOTICE,sha256=7HlBoMHJY9CL2GlYSfTQ-PZsVmLmVkYmMiPlTjhuCqA,218
|
|
726
|
+
rasa_pro-3.10.9.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
727
|
+
rasa_pro-3.10.9.dist-info/entry_points.txt,sha256=ckJ2SfEyTPgBqj_I6vm_tqY9dZF_LAPJZA335Xp0Q9U,43
|
|
728
|
+
rasa_pro-3.10.9.dist-info/RECORD,,
|
rasa/keys
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"segment": "CcvVD1I68Nkkxrv93cIqv1twIwrwG8nz", "sentry": "a283f1fde04347b099c8d729109dd450@o251570"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|