rasa-pro 3.11.3a1.dev7__py3-none-any.whl → 3.11.4__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/actions/action.py +7 -16
- rasa/core/actions/direct_custom_actions_executor.py +0 -1
- rasa/core/channels/__init__.py +0 -2
- rasa/core/channels/inspector/dist/assets/{arc-861ddd57.js → arc-632a63ec.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{c4Diagram-d0fbc5ce-921f02db.js → c4Diagram-d0fbc5ce-081e0df4.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{classDiagram-936ed81e-b436c4f8.js → classDiagram-936ed81e-3df0afc2.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{classDiagram-v2-c3cb15f1-511a23cb.js → classDiagram-v2-c3cb15f1-8c5ed31e.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{createText-62fc7601-ef476ecd.js → createText-62fc7601-89c73b31.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{edges-f2ad444c-f1878e0a.js → edges-f2ad444c-4fc48c3e.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{erDiagram-9d236eb7-fac75185.js → erDiagram-9d236eb7-907e0440.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{flowDb-1972c806-201c5bbc.js → flowDb-1972c806-9ec53a3c.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{flowDiagram-7ea5b25a-f904ae41.js → flowDiagram-7ea5b25a-41da787a.js} +1 -1
- rasa/core/channels/inspector/dist/assets/flowDiagram-v2-855bc5b3-8bea338b.js +1 -0
- rasa/core/channels/inspector/dist/assets/{flowchart-elk-definition-abe16c3d-1813da66.js → flowchart-elk-definition-abe16c3d-ce370633.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{ganttDiagram-9b5ea136-872af172.js → ganttDiagram-9b5ea136-90a36523.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{gitGraphDiagram-99d0ae7c-34a0af5a.js → gitGraphDiagram-99d0ae7c-41e1aa3f.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{index-2c4b9a3b-42ba3e3d.js → index-2c4b9a3b-e6f2af62.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{index-37817b51.js → index-e793d777.js} +3 -3
- rasa/core/channels/inspector/dist/assets/{infoDiagram-736b4530-6b731386.js → infoDiagram-736b4530-8ceba4db.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{journeyDiagram-df861f2b-e8579ac6.js → journeyDiagram-df861f2b-960d3809.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{layout-89e6403a.js → layout-498807d8.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{line-dc73d3fc.js → line-eeccc4e2.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{linear-f5b1d2bc.js → linear-8a078617.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{mindmap-definition-beec6740-82cb74fa.js → mindmap-definition-beec6740-396d17dd.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{pieDiagram-dbbf0591-bdf5f29b.js → pieDiagram-dbbf0591-dc9b5e1b.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{quadrantDiagram-4d7f4fd6-c7a0cbe4.js → quadrantDiagram-4d7f4fd6-a08cba6d.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{requirementDiagram-6fc4c22a-7ec5410f.js → requirementDiagram-6fc4c22a-87242b9e.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{sankeyDiagram-8f13d901-caee5554.js → sankeyDiagram-8f13d901-53f6f391.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{sequenceDiagram-b655622a-2935f8db.js → sequenceDiagram-b655622a-715c9c20.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{stateDiagram-59f0c015-8f5d9693.js → stateDiagram-59f0c015-2e8fb31f.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{stateDiagram-v2-2b26beab-d565d1de.js → stateDiagram-v2-2b26beab-7e2d2aa0.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-080da4f6-75ad421d.js → styles-080da4f6-4420cea6.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-3dcbcfbf-7e764226.js → styles-3dcbcfbf-28676cf4.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-9c745c82-7a4e0e61.js → styles-9c745c82-cef936a6.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{svgDrawCommon-4835440b-4019d1bf.js → svgDrawCommon-4835440b-151251e9.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{timeline-definition-5b62e21b-01ea12df.js → timeline-definition-5b62e21b-0d39bdb2.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{xychartDiagram-2b33534f-89407137.js → xychartDiagram-2b33534f-a03fa445.js} +1 -1
- rasa/core/channels/inspector/dist/index.html +3 -1
- rasa/core/channels/inspector/index.html +2 -0
- rasa/core/channels/inspector/src/App.tsx +1 -4
- rasa/core/channels/socketio.py +23 -2
- rasa/core/nlg/contextual_response_rephraser.py +9 -62
- rasa/core/policies/enterprise_search_policy.py +12 -77
- rasa/core/policies/flows/flow_executor.py +2 -26
- rasa/core/processor.py +8 -11
- rasa/dialogue_understanding/generator/command_generator.py +5 -120
- rasa/dialogue_understanding/generator/llm_based_command_generator.py +5 -5
- rasa/dialogue_understanding/generator/llm_command_generator.py +1 -2
- rasa/dialogue_understanding/generator/multi_step/multi_step_llm_command_generator.py +4 -50
- rasa/dialogue_understanding/generator/nlu_command_adapter.py +0 -3
- rasa/dialogue_understanding/generator/single_step/single_step_llm_command_generator.py +3 -16
- rasa/dialogue_understanding/patterns/continue_interrupted.py +9 -0
- rasa/dialogue_understanding/stack/utils.py +1 -0
- rasa/e2e_test/e2e_test_case.py +1 -2
- rasa/e2e_test/utils/e2e_yaml_utils.py +1 -1
- rasa/e2e_test/utils/io.py +1 -1
- rasa/e2e_test/utils/validation.py +2 -100
- rasa/engine/recipes/default_recipe.py +49 -63
- rasa/engine/recipes/graph_recipe.py +7 -8
- rasa/hooks.py +9 -14
- rasa/model_manager/socket_bridge.py +2 -7
- rasa/model_manager/warm_rasa_process.py +4 -9
- rasa/model_training.py +1 -2
- rasa/nlu/classifiers/fallback_classifier.py +0 -3
- rasa/plugin.py +0 -11
- rasa/server.py +37 -1
- rasa/shared/constants.py +6 -26
- rasa/shared/core/events.py +8 -8
- rasa/shared/core/flows/flow.py +4 -4
- rasa/shared/core/flows/flow_step.py +15 -10
- rasa/shared/core/flows/flow_step_links.py +20 -12
- rasa/shared/core/flows/flow_step_sequence.py +5 -3
- rasa/shared/core/flows/steps/action.py +3 -2
- rasa/shared/core/flows/steps/call.py +3 -3
- rasa/shared/core/flows/steps/collect.py +6 -3
- rasa/shared/core/flows/steps/continuation.py +3 -1
- rasa/shared/core/flows/steps/end.py +3 -1
- rasa/shared/core/flows/steps/internal.py +2 -1
- rasa/shared/core/flows/steps/link.py +5 -3
- rasa/shared/core/flows/steps/no_operation.py +5 -3
- rasa/shared/core/flows/steps/set_slots.py +3 -2
- rasa/shared/core/flows/steps/start.py +3 -1
- rasa/shared/nlu/constants.py +0 -7
- rasa/shared/providers/llm/llm_response.py +1 -42
- rasa/shared/utils/llm.py +1 -1
- rasa/shared/utils/schemas/events.py +1 -1
- rasa/shared/utils/yaml.py +5 -6
- rasa/studio/upload.py +5 -19
- rasa/telemetry.py +33 -40
- rasa/tracing/instrumentation/attribute_extractors.py +9 -12
- rasa/validator.py +41 -32
- rasa/version.py +1 -1
- {rasa_pro-3.11.3a1.dev7.dist-info → rasa_pro-3.11.4.dist-info}/METADATA +7 -7
- {rasa_pro-3.11.3a1.dev7.dist-info → rasa_pro-3.11.4.dist-info}/RECORD +97 -104
- rasa/core/channels/inspector/dist/assets/flowDiagram-v2-855bc5b3-b080d6f2.js +0 -1
- rasa/core/channels/studio_chat.py +0 -192
- rasa/dialogue_understanding/constants.py +0 -1
- rasa/dialogue_understanding/utils.py +0 -21
- rasa/dialogue_understanding_test/__init__.py +0 -0
- rasa/dialogue_understanding_test/constants.py +0 -15
- rasa/dialogue_understanding_test/du_test_case.py +0 -118
- rasa/dialogue_understanding_test/du_test_result.py +0 -11
- {rasa_pro-3.11.3a1.dev7.dist-info → rasa_pro-3.11.4.dist-info}/NOTICE +0 -0
- {rasa_pro-3.11.3a1.dev7.dist-info → rasa_pro-3.11.4.dist-info}/WHEEL +0 -0
- {rasa_pro-3.11.3a1.dev7.dist-info → rasa_pro-3.11.4.dist-info}/entry_points.txt +0 -0
|
@@ -1,71 +1,65 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import copy
|
|
4
|
-
import dataclasses
|
|
5
4
|
import enum
|
|
6
5
|
import logging
|
|
7
6
|
import math
|
|
8
7
|
from enum import Enum
|
|
9
|
-
from typing import
|
|
8
|
+
from typing import Dict, Text, Any, Tuple, Type, Optional, List, Callable, Set, Union
|
|
9
|
+
|
|
10
|
+
import dataclasses
|
|
10
11
|
|
|
11
|
-
import rasa.shared.constants
|
|
12
12
|
from rasa.core.featurizers.precomputation import (
|
|
13
|
-
CoreFeaturizationCollector,
|
|
14
13
|
CoreFeaturizationInputConverter,
|
|
14
|
+
CoreFeaturizationCollector,
|
|
15
15
|
)
|
|
16
|
-
from rasa.
|
|
16
|
+
from rasa.graph_components.providers.flows_provider import FlowsProvider
|
|
17
17
|
from rasa.dialogue_understanding.processor.command_processor_component import (
|
|
18
18
|
CommandProcessorComponent,
|
|
19
19
|
)
|
|
20
|
+
from rasa.shared.exceptions import FileNotFoundException
|
|
21
|
+
from rasa.core.policies.ensemble import DefaultPolicyPredictionEnsemble
|
|
22
|
+
|
|
23
|
+
from rasa.engine.graph import (
|
|
24
|
+
GraphSchema,
|
|
25
|
+
GraphComponent,
|
|
26
|
+
SchemaNode,
|
|
27
|
+
GraphModelConfiguration,
|
|
28
|
+
)
|
|
20
29
|
from rasa.engine.constants import (
|
|
21
|
-
PLACEHOLDER_ENDPOINTS,
|
|
22
30
|
PLACEHOLDER_IMPORTER,
|
|
23
31
|
PLACEHOLDER_MESSAGE,
|
|
24
32
|
PLACEHOLDER_TRACKER,
|
|
25
|
-
|
|
26
|
-
from rasa.engine.graph import (
|
|
27
|
-
GraphComponent,
|
|
28
|
-
GraphModelConfiguration,
|
|
29
|
-
GraphSchema,
|
|
30
|
-
SchemaNode,
|
|
33
|
+
PLACEHOLDER_ENDPOINTS,
|
|
31
34
|
)
|
|
32
35
|
from rasa.engine.recipes.recipe import Recipe
|
|
33
36
|
from rasa.engine.storage.resource import Resource
|
|
34
37
|
from rasa.graph_components.converters.nlu_message_converter import NLUMessageConverter
|
|
38
|
+
from rasa.graph_components.providers.domain_provider import DomainProvider
|
|
39
|
+
from rasa.graph_components.providers.forms_provider import FormsProvider
|
|
40
|
+
from rasa.graph_components.providers.responses_provider import ResponsesProvider
|
|
35
41
|
from rasa.graph_components.providers.domain_for_core_training_provider import (
|
|
36
42
|
DomainForCoreTrainingProvider,
|
|
37
43
|
)
|
|
38
|
-
from rasa.graph_components.providers.domain_provider import DomainProvider
|
|
39
|
-
from rasa.graph_components.providers.flows_provider import FlowsProvider
|
|
40
|
-
from rasa.graph_components.providers.forms_provider import FormsProvider
|
|
41
44
|
from rasa.graph_components.providers.nlu_training_data_provider import (
|
|
42
45
|
NLUTrainingDataProvider,
|
|
43
46
|
)
|
|
44
|
-
from rasa.graph_components.providers.responses_provider import ResponsesProvider
|
|
45
47
|
from rasa.graph_components.providers.rule_only_provider import RuleOnlyDataProvider
|
|
46
48
|
from rasa.graph_components.providers.story_graph_provider import StoryGraphProvider
|
|
47
49
|
from rasa.graph_components.providers.training_tracker_provider import (
|
|
48
50
|
TrainingTrackerProvider,
|
|
49
51
|
)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
CONFIG_NAME_KEY,
|
|
54
|
-
CONFIG_PIPELINE_KEY,
|
|
55
|
-
CONFIG_POLICIES_KEY,
|
|
56
|
-
)
|
|
52
|
+
import rasa.shared.constants
|
|
53
|
+
from rasa.shared.exceptions import RasaException, InvalidConfigException
|
|
54
|
+
from rasa.shared.constants import ASSISTANT_ID_KEY
|
|
57
55
|
from rasa.shared.data import TrainingType
|
|
58
|
-
from rasa.shared.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
RasaException,
|
|
62
|
-
)
|
|
56
|
+
from rasa.shared.utils.yaml import read_config_file
|
|
57
|
+
|
|
58
|
+
from rasa.utils.tensorflow.constants import EPOCHS
|
|
63
59
|
from rasa.shared.utils.common import (
|
|
64
60
|
class_from_module_path,
|
|
65
61
|
transform_collection_to_sentence,
|
|
66
62
|
)
|
|
67
|
-
from rasa.shared.utils.yaml import read_config_file
|
|
68
|
-
from rasa.utils.tensorflow.constants import EPOCHS
|
|
69
63
|
|
|
70
64
|
logger = logging.getLogger(__name__)
|
|
71
65
|
|
|
@@ -73,13 +67,13 @@ logger = logging.getLogger(__name__)
|
|
|
73
67
|
DEFAULT_PREDICT_KWARGS = dict(constructor_name="load", eager=True, is_target=False)
|
|
74
68
|
|
|
75
69
|
COMMENTS_FOR_KEYS = {
|
|
76
|
-
|
|
70
|
+
"pipeline": (
|
|
77
71
|
f"# # No configuration for the NLU pipeline was provided. The following "
|
|
78
72
|
f"default pipeline was used to train your model.\n"
|
|
79
73
|
f"# # If you'd like to customize it, uncomment and adjust the pipeline.\n"
|
|
80
74
|
f"# # See {rasa.shared.constants.DOCS_URL_PIPELINE} for more information.\n"
|
|
81
75
|
),
|
|
82
|
-
|
|
76
|
+
"policies": (
|
|
83
77
|
f"# # No configuration for policies was provided. The following default "
|
|
84
78
|
f"policies were used to train your model.\n"
|
|
85
79
|
f"# # If you'd like to customize them, uncomment and adjust the policies.\n"
|
|
@@ -88,10 +82,6 @@ COMMENTS_FOR_KEYS = {
|
|
|
88
82
|
}
|
|
89
83
|
|
|
90
84
|
|
|
91
|
-
GRAPH_NODE_RUN_PREFIX = "run_"
|
|
92
|
-
GRAPH_NODE_TRAIN_PREFIX = "train_"
|
|
93
|
-
|
|
94
|
-
|
|
95
85
|
class DefaultV1RecipeRegisterException(RasaException):
|
|
96
86
|
"""If you register a class which is not of type `GraphComponent`."""
|
|
97
87
|
|
|
@@ -204,12 +194,10 @@ class DefaultV1Recipe(Recipe):
|
|
|
204
194
|
) -> GraphModelConfiguration:
|
|
205
195
|
"""Converts the default config to graphs (see interface for full docstring)."""
|
|
206
196
|
self._use_core = (
|
|
207
|
-
bool(config.get(
|
|
208
|
-
and not training_type == TrainingType.NLU
|
|
197
|
+
bool(config.get("policies")) and not training_type == TrainingType.NLU
|
|
209
198
|
)
|
|
210
199
|
self._use_nlu = (
|
|
211
|
-
bool(config.get(
|
|
212
|
-
and not training_type == TrainingType.CORE
|
|
200
|
+
bool(config.get("pipeline")) and not training_type == TrainingType.CORE
|
|
213
201
|
)
|
|
214
202
|
|
|
215
203
|
if not self._use_nlu and training_type == TrainingType.NLU:
|
|
@@ -244,9 +232,9 @@ class DefaultV1Recipe(Recipe):
|
|
|
244
232
|
predict_schema=GraphSchema(predict_nodes),
|
|
245
233
|
training_type=training_type,
|
|
246
234
|
assistant_id=config.get(ASSISTANT_ID_KEY),
|
|
247
|
-
language=config.get(
|
|
235
|
+
language=config.get("language"),
|
|
248
236
|
core_target=core_target,
|
|
249
|
-
nlu_target=f"{
|
|
237
|
+
nlu_target=f"run_{RegexMessageHandler.__name__}",
|
|
250
238
|
)
|
|
251
239
|
|
|
252
240
|
def _create_train_nodes(
|
|
@@ -329,7 +317,7 @@ class DefaultV1Recipe(Recipe):
|
|
|
329
317
|
constructor_name="create",
|
|
330
318
|
fn="provide",
|
|
331
319
|
config={
|
|
332
|
-
"language": train_config.get(
|
|
320
|
+
"language": train_config.get("language"),
|
|
333
321
|
"persist": persist_nlu_data,
|
|
334
322
|
},
|
|
335
323
|
is_target=persist_nlu_data,
|
|
@@ -339,8 +327,8 @@ class DefaultV1Recipe(Recipe):
|
|
|
339
327
|
last_run_node = "nlu_training_data_provider"
|
|
340
328
|
preprocessors: List[Text] = []
|
|
341
329
|
|
|
342
|
-
for idx, config in enumerate(train_config[
|
|
343
|
-
component_name = config.pop(
|
|
330
|
+
for idx, config in enumerate(train_config["pipeline"]):
|
|
331
|
+
component_name = config.pop("name")
|
|
344
332
|
component = self._from_registry(component_name)
|
|
345
333
|
component_name = f"{component_name}{idx}"
|
|
346
334
|
|
|
@@ -463,7 +451,7 @@ class DefaultV1Recipe(Recipe):
|
|
|
463
451
|
needs.update(self._get_model_provider_needs(train_nodes, component))
|
|
464
452
|
needs["training_data"] = last_run_node
|
|
465
453
|
|
|
466
|
-
train_node_name = f"{
|
|
454
|
+
train_node_name = f"train_{component_name}"
|
|
467
455
|
train_nodes[train_node_name] = SchemaNode(
|
|
468
456
|
needs=needs,
|
|
469
457
|
uses=component,
|
|
@@ -481,10 +469,10 @@ class DefaultV1Recipe(Recipe):
|
|
|
481
469
|
component_config: Dict[Text, Any],
|
|
482
470
|
) -> Dict[Text, Any]:
|
|
483
471
|
from rasa.nlu.classifiers.mitie_intent_classifier import MitieIntentClassifier
|
|
472
|
+
from rasa.nlu.extractors.mitie_entity_extractor import MitieEntityExtractor
|
|
484
473
|
from rasa.nlu.classifiers.sklearn_intent_classifier import (
|
|
485
474
|
SklearnIntentClassifier,
|
|
486
475
|
)
|
|
487
|
-
from rasa.nlu.extractors.mitie_entity_extractor import MitieEntityExtractor
|
|
488
476
|
|
|
489
477
|
cli_args_mapping: Dict[Type[GraphComponent], List[Text]] = {
|
|
490
478
|
MitieIntentClassifier: ["num_threads"],
|
|
@@ -532,7 +520,7 @@ class DefaultV1Recipe(Recipe):
|
|
|
532
520
|
|
|
533
521
|
needs["training_data"] = last_run_node
|
|
534
522
|
|
|
535
|
-
node_name = f"{
|
|
523
|
+
node_name = f"run_{component_name}"
|
|
536
524
|
train_nodes[node_name] = SchemaNode(
|
|
537
525
|
needs=needs,
|
|
538
526
|
uses=component_class,
|
|
@@ -639,8 +627,8 @@ class DefaultV1Recipe(Recipe):
|
|
|
639
627
|
)
|
|
640
628
|
|
|
641
629
|
policy_with_end_to_end_support_used = False
|
|
642
|
-
for idx, config in enumerate(train_config[
|
|
643
|
-
component_name = config.pop(
|
|
630
|
+
for idx, config in enumerate(train_config["policies"]):
|
|
631
|
+
component_name = config.pop("name")
|
|
644
632
|
component = self._from_registry(component_name)
|
|
645
633
|
|
|
646
634
|
extra_config_from_cli = self._extra_config_from_cli(
|
|
@@ -659,7 +647,7 @@ class DefaultV1Recipe(Recipe):
|
|
|
659
647
|
needs["precomputations"] = "end_to_end_features_provider"
|
|
660
648
|
# during core training we use a stripped down version of the domain
|
|
661
649
|
needs["domain"] = "domain_for_core_training_provider"
|
|
662
|
-
train_nodes[f"{
|
|
650
|
+
train_nodes[f"train_{component_name}{idx}"] = SchemaNode(
|
|
663
651
|
needs=needs,
|
|
664
652
|
uses=component.clazz,
|
|
665
653
|
constructor_name="load" if self._is_finetuning else "create",
|
|
@@ -734,9 +722,7 @@ class DefaultV1Recipe(Recipe):
|
|
|
734
722
|
if self._use_core:
|
|
735
723
|
domain_needs["domain"] = "domain_provider"
|
|
736
724
|
|
|
737
|
-
regex_handler_node_name =
|
|
738
|
-
f"{GRAPH_NODE_RUN_PREFIX}{RegexMessageHandler.__name__}"
|
|
739
|
-
)
|
|
725
|
+
regex_handler_node_name = f"run_{RegexMessageHandler.__name__}"
|
|
740
726
|
predict_nodes[regex_handler_node_name] = SchemaNode(
|
|
741
727
|
**DEFAULT_PREDICT_KWARGS,
|
|
742
728
|
needs={"messages": last_run_nlu_node, **domain_needs},
|
|
@@ -776,8 +762,8 @@ class DefaultV1Recipe(Recipe):
|
|
|
776
762
|
resource=Resource("domain_provider"),
|
|
777
763
|
)
|
|
778
764
|
|
|
779
|
-
for idx, config in enumerate(predict_config[
|
|
780
|
-
component_name = config.pop(
|
|
765
|
+
for idx, config in enumerate(predict_config["pipeline"]):
|
|
766
|
+
component_name = config.pop("name")
|
|
781
767
|
component = self._from_registry(component_name)
|
|
782
768
|
component_name = f"{component_name}{idx}"
|
|
783
769
|
if self.ComponentType.MODEL_LOADER in component.types:
|
|
@@ -844,10 +830,10 @@ class DefaultV1Recipe(Recipe):
|
|
|
844
830
|
item_config: Dict[Text, Any],
|
|
845
831
|
from_resource: bool = False,
|
|
846
832
|
) -> Text:
|
|
847
|
-
train_node_name = f"{
|
|
833
|
+
train_node_name = f"run_{node_name}"
|
|
848
834
|
resource = None
|
|
849
835
|
if from_resource:
|
|
850
|
-
train_node_name = f"{
|
|
836
|
+
train_node_name = f"train_{node_name}"
|
|
851
837
|
resource = Resource(train_node_name)
|
|
852
838
|
|
|
853
839
|
return self._add_nlu_predict_node(
|
|
@@ -866,7 +852,7 @@ class DefaultV1Recipe(Recipe):
|
|
|
866
852
|
component_name: Text,
|
|
867
853
|
last_run_node: Text,
|
|
868
854
|
) -> Text:
|
|
869
|
-
node_name = f"{
|
|
855
|
+
node_name = f"run_{component_name}"
|
|
870
856
|
|
|
871
857
|
needs = self._get_needs_from_args(node.uses, "process")
|
|
872
858
|
needs.update(self._get_model_provider_needs(predict_nodes, node.uses))
|
|
@@ -933,12 +919,12 @@ class DefaultV1Recipe(Recipe):
|
|
|
933
919
|
rule_policy_resource = None
|
|
934
920
|
policies: List[Text] = []
|
|
935
921
|
|
|
936
|
-
for idx, config in enumerate(predict_config[
|
|
937
|
-
component_name = config.pop(
|
|
922
|
+
for idx, config in enumerate(predict_config["policies"]):
|
|
923
|
+
component_name = config.pop("name")
|
|
938
924
|
component = self._from_registry(component_name)
|
|
939
925
|
|
|
940
|
-
train_node_name = f"{
|
|
941
|
-
node_name = f"{
|
|
926
|
+
train_node_name = f"train_{component_name}{idx}"
|
|
927
|
+
node_name = f"run_{component_name}{idx}"
|
|
942
928
|
|
|
943
929
|
from rasa.core.policies.rule_policy import RulePolicy
|
|
944
930
|
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import logging
|
|
2
|
-
from typing import Any, Dict, Text, Tuple
|
|
3
2
|
|
|
4
|
-
from rasa.engine.graph import GraphModelConfiguration, GraphSchema
|
|
5
3
|
from rasa.engine.recipes.recipe import Recipe
|
|
6
|
-
from rasa.
|
|
7
|
-
|
|
8
|
-
CONFIG_LANGUAGE_KEY,
|
|
9
|
-
DOCS_URL_GRAPH_RECIPE,
|
|
10
|
-
)
|
|
4
|
+
from rasa.engine.graph import GraphModelConfiguration
|
|
5
|
+
from rasa.shared.constants import DOCS_URL_GRAPH_RECIPE, ASSISTANT_ID_KEY
|
|
11
6
|
from rasa.shared.data import TrainingType
|
|
12
7
|
from rasa.shared.exceptions import InvalidConfigException
|
|
13
8
|
from rasa.shared.utils.common import mark_as_experimental_feature
|
|
14
9
|
from rasa.shared.utils.io import raise_warning
|
|
10
|
+
from rasa.engine.graph import GraphSchema
|
|
11
|
+
|
|
12
|
+
from typing import Dict, Text, Any, Tuple
|
|
13
|
+
|
|
15
14
|
|
|
16
15
|
logger = logging.getLogger(__name__)
|
|
17
16
|
|
|
@@ -73,7 +72,7 @@ class GraphV1Recipe(Recipe):
|
|
|
73
72
|
predict_schema=GraphSchema.from_dict(config.get("predict_schema")),
|
|
74
73
|
training_type=training_type,
|
|
75
74
|
assistant_id=config.get(ASSISTANT_ID_KEY),
|
|
76
|
-
language=config.get(
|
|
75
|
+
language=config.get("language"),
|
|
77
76
|
core_target=core_target,
|
|
78
77
|
nlu_target=nlu_target,
|
|
79
78
|
)
|
rasa/hooks.py
CHANGED
|
@@ -3,14 +3,17 @@ import logging
|
|
|
3
3
|
from typing import Optional, TYPE_CHECKING, List, Text, Union
|
|
4
4
|
|
|
5
5
|
import pluggy
|
|
6
|
+
from rasa.cli import SubParsersAction
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
from rasa.cli import x as rasa_x
|
|
9
|
+
from rasa.utils.endpoints import EndpointConfig
|
|
10
|
+
|
|
11
|
+
from rasa.core.auth_retry_tracker_store import AuthRetryTrackerStore
|
|
12
|
+
from rasa.core.secrets_manager.factory import load_secret_manager
|
|
13
|
+
|
|
14
|
+
from rasa.tracing import config
|
|
10
15
|
|
|
11
16
|
if TYPE_CHECKING:
|
|
12
|
-
from rasa.cli import SubParsersAction
|
|
13
|
-
from rasa.utils.endpoints import EndpointConfig
|
|
14
17
|
from rasa.core.brokers.broker import EventBroker
|
|
15
18
|
from rasa.core.tracker_store import TrackerStore
|
|
16
19
|
from rasa.shared.core.domain import Domain
|
|
@@ -22,7 +25,7 @@ logger = logging.getLogger(__name__)
|
|
|
22
25
|
|
|
23
26
|
@hookimpl # type: ignore[misc]
|
|
24
27
|
def refine_cli(
|
|
25
|
-
subparsers:
|
|
28
|
+
subparsers: SubParsersAction,
|
|
26
29
|
parent_parsers: List[argparse.ArgumentParser],
|
|
27
30
|
) -> None:
|
|
28
31
|
from rasa.cli import e2e_test, inspect, markers
|
|
@@ -40,9 +43,6 @@ def refine_cli(
|
|
|
40
43
|
|
|
41
44
|
@hookimpl # type: ignore[misc]
|
|
42
45
|
def configure_commandline(cmdline_arguments: argparse.Namespace) -> Optional[Text]:
|
|
43
|
-
from rasa.tracing import config
|
|
44
|
-
from rasa.cli import x as rasa_x
|
|
45
|
-
|
|
46
46
|
endpoints_file = None
|
|
47
47
|
|
|
48
48
|
if cmdline_arguments.func.__name__ == "rasa_x":
|
|
@@ -69,8 +69,6 @@ def init_telemetry(endpoints_file: Optional[Text]) -> None:
|
|
|
69
69
|
|
|
70
70
|
@hookimpl # type: ignore[misc]
|
|
71
71
|
def init_managers(endpoints_file: Optional[Text]) -> None:
|
|
72
|
-
from rasa.core.secrets_manager.factory import load_secret_manager
|
|
73
|
-
|
|
74
72
|
load_secret_manager(endpoints_file)
|
|
75
73
|
|
|
76
74
|
|
|
@@ -80,9 +78,6 @@ def create_tracker_store(
|
|
|
80
78
|
domain: "Domain",
|
|
81
79
|
event_broker: Optional["EventBroker"],
|
|
82
80
|
) -> "TrackerStore":
|
|
83
|
-
from rasa.utils.endpoints import EndpointConfig
|
|
84
|
-
from rasa.core.auth_retry_tracker_store import AuthRetryTrackerStore
|
|
85
|
-
|
|
86
81
|
if isinstance(endpoint_config, EndpointConfig):
|
|
87
82
|
return AuthRetryTrackerStore(
|
|
88
83
|
endpoint_config=endpoint_config, domain=domain, event_broker=event_broker
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import json
|
|
2
1
|
from typing import Any, Dict, Optional
|
|
3
2
|
|
|
4
3
|
from socketio import AsyncServer
|
|
@@ -93,7 +92,7 @@ def create_bridge_server(sio: AsyncServer, running_bots: Dict[str, BotSession])
|
|
|
93
92
|
|
|
94
93
|
@sio.on("*")
|
|
95
94
|
async def handle_message(event: str, sid: str, data: Dict[str, Any]) -> None:
|
|
96
|
-
"""Bridge messages between user and bot.
|
|
95
|
+
""" "Bridge messages between user and bot.
|
|
97
96
|
|
|
98
97
|
Both incoming user messages to the bot_url and
|
|
99
98
|
bot responses sent back to the client need to
|
|
@@ -112,7 +111,7 @@ async def create_bridge_client(
|
|
|
112
111
|
) -> AsyncClient:
|
|
113
112
|
"""Create a new socket bridge client.
|
|
114
113
|
|
|
115
|
-
Forwards messages
|
|
114
|
+
Forwards messages comming from the bot to the user.
|
|
116
115
|
"""
|
|
117
116
|
client = AsyncClient()
|
|
118
117
|
|
|
@@ -130,10 +129,6 @@ async def create_bridge_client(
|
|
|
130
129
|
structlogger.debug("model_runner.bot_message", deployment_id=deployment_id)
|
|
131
130
|
await sio.emit("bot_message", data, room=sid)
|
|
132
131
|
|
|
133
|
-
@client.event # type: ignore[misc]
|
|
134
|
-
async def tracker(data: Dict[str, Any]) -> None:
|
|
135
|
-
await sio.emit("tracker", json.loads(data), room=sid)
|
|
136
|
-
|
|
137
132
|
@client.event # type: ignore[misc]
|
|
138
133
|
async def disconnect() -> None:
|
|
139
134
|
structlogger.debug(
|
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
import os
|
|
2
1
|
import shlex
|
|
3
2
|
import subprocess
|
|
4
|
-
import
|
|
5
|
-
|
|
3
|
+
from rasa.__main__ import main
|
|
4
|
+
import os
|
|
6
5
|
from typing import List
|
|
7
|
-
|
|
8
6
|
import structlog
|
|
7
|
+
from dataclasses import dataclass
|
|
8
|
+
import uuid
|
|
9
9
|
|
|
10
|
-
from rasa.__main__ import main
|
|
11
|
-
from rasa.dialogue_understanding.constants import (
|
|
12
|
-
RASA_RECORD_COMMANDS_AND_PROMPTS_ENV_VAR_NAME,
|
|
13
|
-
)
|
|
14
10
|
from rasa.model_manager import config
|
|
15
11
|
from rasa.model_manager.utils import ensure_base_directory_exists, logs_path
|
|
16
12
|
|
|
@@ -47,7 +43,6 @@ def _create_warm_rasa_process() -> WarmRasaProcess:
|
|
|
47
43
|
|
|
48
44
|
envs = os.environ.copy()
|
|
49
45
|
envs["RASA_TELEMETRY_ENABLED"] = "false"
|
|
50
|
-
envs[RASA_RECORD_COMMANDS_AND_PROMPTS_ENV_VAR_NAME] = "true"
|
|
51
46
|
|
|
52
47
|
log_id = uuid.uuid4().hex
|
|
53
48
|
log_path = logs_path(log_id)
|
rasa/model_training.py
CHANGED
|
@@ -23,7 +23,6 @@ from rasa.engine.storage.local_model_storage import LocalModelStorage
|
|
|
23
23
|
from rasa.engine.storage.storage import ModelStorage
|
|
24
24
|
from rasa.engine.training.components import FingerprintStatus
|
|
25
25
|
from rasa.engine.training.graph_trainer import GraphTrainer
|
|
26
|
-
from rasa.shared.constants import CONFIG_RECIPE_KEY
|
|
27
26
|
from rasa.shared.core.domain import Domain
|
|
28
27
|
from rasa.shared.core.events import SlotSet
|
|
29
28
|
from rasa.shared.core.training_data.structures import StoryGraph
|
|
@@ -305,7 +304,7 @@ async def _train_graph(
|
|
|
305
304
|
is_finetuning = model_to_finetune is not None
|
|
306
305
|
|
|
307
306
|
config = file_importer.get_config()
|
|
308
|
-
recipe = Recipe.recipe_for_name(config.get(
|
|
307
|
+
recipe = Recipe.recipe_for_name(config.get("recipe"))
|
|
309
308
|
config, _missing_keys, _configured_keys = recipe.auto_configure(
|
|
310
309
|
file_importer.get_config_file_for_auto_config(),
|
|
311
310
|
config,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
-
import copy
|
|
3
2
|
import logging
|
|
4
3
|
from typing import Any, List, Text, Dict, Type, Union, Tuple, Optional
|
|
5
4
|
|
|
@@ -185,8 +184,6 @@ def undo_fallback_prediction(prediction: Dict[Text, Any]) -> Dict[Text, Any]:
|
|
|
185
184
|
if len(intent_ranking) < 2:
|
|
186
185
|
return prediction
|
|
187
186
|
|
|
188
|
-
prediction = copy.deepcopy(prediction)
|
|
189
187
|
prediction[INTENT] = intent_ranking[1]
|
|
190
188
|
prediction[INTENT_RANKING_KEY] = prediction[INTENT_RANKING_KEY][1:]
|
|
191
|
-
|
|
192
189
|
return prediction
|
rasa/plugin.py
CHANGED
|
@@ -14,7 +14,6 @@ if TYPE_CHECKING:
|
|
|
14
14
|
from rasa.core.tracker_store import TrackerStore
|
|
15
15
|
from rasa.shared.core.domain import Domain
|
|
16
16
|
from rasa.utils.endpoints import EndpointConfig
|
|
17
|
-
from rasa.shared.core.trackers import DialogueStateTracker
|
|
18
17
|
|
|
19
18
|
|
|
20
19
|
hookspec = pluggy.HookspecMarker("rasa")
|
|
@@ -89,13 +88,3 @@ def after_server_stop() -> None:
|
|
|
89
88
|
Use this hook to de-initialize any resources that require explicit cleanup like,
|
|
90
89
|
thread shutdown, closing connections, etc.
|
|
91
90
|
"""
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
@hookspec # type: ignore[misc]
|
|
95
|
-
def after_new_user_message(tracker: "DialogueStateTracker") -> None:
|
|
96
|
-
"""Hook specification for after a new user message is received."""
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
@hookspec # type: ignore[misc]
|
|
100
|
-
def after_action_executed(tracker: "DialogueStateTracker") -> None:
|
|
101
|
-
"""Hook specification for after an action is executed."""
|
rasa/server.py
CHANGED
|
@@ -62,9 +62,11 @@ from rasa.shared.constants import (
|
|
|
62
62
|
DOCS_BASE_URL,
|
|
63
63
|
DOCS_URL_TRAINING_DATA,
|
|
64
64
|
TEST_STORIES_FILE_PREFIX,
|
|
65
|
+
DOCS_URL_FLOWS,
|
|
65
66
|
)
|
|
66
67
|
from rasa.shared.core.domain import Domain, InvalidDomain
|
|
67
68
|
from rasa.shared.core.events import Event
|
|
69
|
+
from rasa.shared.core.flows.yaml_flows_io import YAMLFlowsReader
|
|
68
70
|
from rasa.shared.core.trackers import (
|
|
69
71
|
DialogueStateTracker,
|
|
70
72
|
EventVerbosity,
|
|
@@ -72,6 +74,7 @@ from rasa.shared.core.trackers import (
|
|
|
72
74
|
from rasa.shared.core.training_data.story_writer.yaml_story_writer import (
|
|
73
75
|
YAMLStoryWriter,
|
|
74
76
|
)
|
|
77
|
+
from rasa.shared.exceptions import YamlException, RasaException
|
|
75
78
|
from rasa.shared.importers.importer import TrainingDataImporter
|
|
76
79
|
from rasa.shared.nlu.training_data.formats import RasaYAMLReader
|
|
77
80
|
from rasa.shared.utils.schemas.events import EVENTS_SCHEMA
|
|
@@ -1566,7 +1569,8 @@ def _nlu_training_payload_from_json(
|
|
|
1566
1569
|
)
|
|
1567
1570
|
|
|
1568
1571
|
|
|
1569
|
-
def
|
|
1572
|
+
def _validate_nlu_training_data_payload(yaml_text: str) -> None:
|
|
1573
|
+
"""Validate the NLU training data payload of the request body."""
|
|
1570
1574
|
try:
|
|
1571
1575
|
RasaYAMLReader().validate(yaml_text)
|
|
1572
1576
|
except Exception as e:
|
|
@@ -1578,6 +1582,38 @@ def _validate_yaml_training_payload(yaml_text: Text) -> None:
|
|
|
1578
1582
|
)
|
|
1579
1583
|
|
|
1580
1584
|
|
|
1585
|
+
def _validate_flows_payload(yaml_text: str) -> None:
|
|
1586
|
+
"""Validate the flows payload of the request body."""
|
|
1587
|
+
try:
|
|
1588
|
+
YAMLFlowsReader().read_from_string(yaml_text)
|
|
1589
|
+
except (YamlException, RasaException) as exc:
|
|
1590
|
+
# if the payload does not contain any flows, we can ignore the error
|
|
1591
|
+
if (
|
|
1592
|
+
hasattr(exc, "validation_errors")
|
|
1593
|
+
and exc.validation_errors is not None
|
|
1594
|
+
and any(
|
|
1595
|
+
[
|
|
1596
|
+
"'flows' is a required property" in error.message
|
|
1597
|
+
for error in exc.validation_errors
|
|
1598
|
+
]
|
|
1599
|
+
)
|
|
1600
|
+
):
|
|
1601
|
+
return None
|
|
1602
|
+
|
|
1603
|
+
raise ErrorResponse(
|
|
1604
|
+
HTTPStatus.BAD_REQUEST,
|
|
1605
|
+
"BadRequest",
|
|
1606
|
+
f"The request body does not contain valid YAML. Error: {exc}",
|
|
1607
|
+
help_url=DOCS_URL_FLOWS,
|
|
1608
|
+
)
|
|
1609
|
+
|
|
1610
|
+
|
|
1611
|
+
def _validate_yaml_training_payload(yaml_text: str) -> None:
|
|
1612
|
+
"""Validate the YAML training payload of the request body."""
|
|
1613
|
+
_validate_nlu_training_data_payload(yaml_text)
|
|
1614
|
+
_validate_flows_payload(yaml_text)
|
|
1615
|
+
|
|
1616
|
+
|
|
1581
1617
|
def _extract_core_additional_arguments(request: Request) -> Dict[Text, Any]:
|
|
1582
1618
|
return {
|
|
1583
1619
|
"augmentation_factor": rasa.utils.endpoints.int_arg(request, "augmentation", 50)
|
rasa/shared/constants.py
CHANGED
|
@@ -19,6 +19,7 @@ DOCS_URL_GRAPH_COMPONENTS = DOCS_URL_CONCEPTS + "/components/custom-graph-compon
|
|
|
19
19
|
DOCS_URL_GRAPH_RECIPE = DOCS_URL_CONCEPTS + "/components/graph-recipe"
|
|
20
20
|
DOCS_URL_CATEGORICAL_SLOTS = DOCS_URL_CONCEPTS + "/domain#categorical-slot"
|
|
21
21
|
DOCS_URL_DOMAIN = DOCS_URL_CONCEPTS + "/domain"
|
|
22
|
+
DOCS_URL_FLOWS = DOCS_URL_CONCEPTS + "/flows"
|
|
22
23
|
|
|
23
24
|
# Docs URLs for NLU-based assistants
|
|
24
25
|
DOCS_URL_TRAINING_DATA = DOCS_URL_NLU_BASED + "/training-data-format"
|
|
@@ -101,28 +102,16 @@ ASSISTANT_ID_KEY = "assistant_id"
|
|
|
101
102
|
ASSISTANT_ID_DEFAULT_VALUE = "placeholder_default"
|
|
102
103
|
|
|
103
104
|
CONFIG_MANDATORY_COMMON_KEYS = [ASSISTANT_ID_KEY]
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
CONFIG_PIPELINE_KEY = "pipeline"
|
|
107
|
-
CONFIG_LANGUAGE_KEY = "language"
|
|
108
|
-
CONFIG_RECIPE_KEY = "recipe"
|
|
109
|
-
CONFIG_LLM_KEY = "llm"
|
|
110
|
-
CONFIG_MODEL_NAME_KEY = "model_name"
|
|
111
|
-
CONFIG_TRAIN_SCHEMA = "train_schema"
|
|
112
|
-
CONFIG_PREDICT_SCHEMA = "predict_schema"
|
|
113
|
-
CONFIG_AUTOCONFIGURABLE_KEYS_CORE = [CONFIG_POLICIES_KEY]
|
|
114
|
-
CONFIG_AUTOCONFIGURABLE_KEYS_NLU = [CONFIG_PIPELINE_KEY]
|
|
105
|
+
CONFIG_AUTOCONFIGURABLE_KEYS_CORE = ["policies"]
|
|
106
|
+
CONFIG_AUTOCONFIGURABLE_KEYS_NLU = ["pipeline"]
|
|
115
107
|
CONFIG_AUTOCONFIGURABLE_KEYS = (
|
|
116
108
|
CONFIG_AUTOCONFIGURABLE_KEYS_CORE + CONFIG_AUTOCONFIGURABLE_KEYS_NLU
|
|
117
109
|
)
|
|
118
|
-
CONFIG_KEYS_CORE = [
|
|
119
|
-
CONFIG_KEYS_NLU = [
|
|
120
|
-
CONFIG_LANGUAGE_KEY,
|
|
121
|
-
CONFIG_PIPELINE_KEY,
|
|
122
|
-
] + CONFIG_MANDATORY_COMMON_KEYS
|
|
110
|
+
CONFIG_KEYS_CORE = ["policies"] + CONFIG_MANDATORY_COMMON_KEYS
|
|
111
|
+
CONFIG_KEYS_NLU = ["language", "pipeline"] + CONFIG_MANDATORY_COMMON_KEYS
|
|
123
112
|
CONFIG_KEYS = CONFIG_KEYS_CORE + CONFIG_KEYS_NLU
|
|
124
113
|
CONFIG_MANDATORY_KEYS_CORE: List[Text] = [] + CONFIG_MANDATORY_COMMON_KEYS
|
|
125
|
-
CONFIG_MANDATORY_KEYS_NLU = [
|
|
114
|
+
CONFIG_MANDATORY_KEYS_NLU = ["language"] + CONFIG_MANDATORY_COMMON_KEYS
|
|
126
115
|
CONFIG_MANDATORY_KEYS = CONFIG_MANDATORY_KEYS_CORE + CONFIG_MANDATORY_KEYS_NLU
|
|
127
116
|
|
|
128
117
|
# Keys related to Forms (in the Domain)
|
|
@@ -319,12 +308,3 @@ SENSITIVE_DATA = [
|
|
|
319
308
|
AWS_SECRET_ACCESS_KEY_CONFIG_KEY,
|
|
320
309
|
AWS_SESSION_TOKEN_CONFIG_KEY,
|
|
321
310
|
]
|
|
322
|
-
|
|
323
|
-
# Used for key values in BotUtterance.data
|
|
324
|
-
TEXT = "text"
|
|
325
|
-
ELEMENTS = "elements"
|
|
326
|
-
QUICK_REPLIES = "quick_replies"
|
|
327
|
-
BUTTONS = "buttons"
|
|
328
|
-
ATTACHMENT = "attachment"
|
|
329
|
-
IMAGE = "image"
|
|
330
|
-
CUSTOM = "custom"
|
rasa/shared/core/events.py
CHANGED
|
@@ -2,10 +2,14 @@ import abc
|
|
|
2
2
|
import copy
|
|
3
3
|
import json
|
|
4
4
|
import logging
|
|
5
|
+
import structlog
|
|
5
6
|
import re
|
|
7
|
+
from abc import ABC
|
|
8
|
+
|
|
9
|
+
import jsonpickle
|
|
6
10
|
import time
|
|
7
11
|
import uuid
|
|
8
|
-
from
|
|
12
|
+
from dateutil import parser
|
|
9
13
|
from datetime import datetime
|
|
10
14
|
from typing import (
|
|
11
15
|
List,
|
|
@@ -20,14 +24,11 @@ from typing import (
|
|
|
20
24
|
Tuple,
|
|
21
25
|
TypeVar,
|
|
22
26
|
)
|
|
23
|
-
from typing import Union
|
|
24
|
-
|
|
25
|
-
import jsonpickle
|
|
26
|
-
import structlog
|
|
27
|
-
from dateutil import parser
|
|
28
27
|
|
|
29
28
|
import rasa.shared.utils.common
|
|
30
29
|
import rasa.shared.utils.io
|
|
30
|
+
from typing import Union
|
|
31
|
+
|
|
31
32
|
from rasa.shared.constants import DOCS_URL_TRAINING_DATA
|
|
32
33
|
from rasa.shared.core.constants import (
|
|
33
34
|
LOOP_NAME,
|
|
@@ -61,7 +62,7 @@ from rasa.shared.nlu.constants import (
|
|
|
61
62
|
ENTITY_ATTRIBUTE_END,
|
|
62
63
|
FULL_RETRIEVAL_INTENT_NAME_KEY,
|
|
63
64
|
)
|
|
64
|
-
|
|
65
|
+
|
|
65
66
|
|
|
66
67
|
if TYPE_CHECKING:
|
|
67
68
|
from typing_extensions import TypedDict
|
|
@@ -97,7 +98,6 @@ if TYPE_CHECKING:
|
|
|
97
98
|
ENTITIES: List[EntityPrediction],
|
|
98
99
|
"message_id": Optional[Text],
|
|
99
100
|
"metadata": Dict,
|
|
100
|
-
PROMPTS: Dict,
|
|
101
101
|
},
|
|
102
102
|
total=False,
|
|
103
103
|
)
|