rasa-pro 3.10.15__py3-none-any.whl → 3.11.0__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/__main__.py +31 -15
- rasa/api.py +12 -2
- rasa/cli/arguments/default_arguments.py +24 -4
- rasa/cli/arguments/run.py +15 -0
- rasa/cli/arguments/shell.py +5 -1
- rasa/cli/arguments/train.py +17 -9
- rasa/cli/evaluate.py +7 -7
- rasa/cli/inspect.py +19 -7
- rasa/cli/interactive.py +1 -0
- rasa/cli/project_templates/calm/config.yml +5 -7
- rasa/cli/project_templates/calm/endpoints.yml +15 -2
- rasa/cli/project_templates/tutorial/config.yml +8 -5
- rasa/cli/project_templates/tutorial/data/flows.yml +1 -1
- rasa/cli/project_templates/tutorial/data/patterns.yml +5 -0
- rasa/cli/project_templates/tutorial/domain.yml +14 -0
- rasa/cli/project_templates/tutorial/endpoints.yml +5 -0
- rasa/cli/run.py +7 -0
- rasa/cli/scaffold.py +4 -2
- rasa/cli/studio/upload.py +0 -15
- rasa/cli/train.py +14 -53
- rasa/cli/utils.py +14 -11
- rasa/cli/x.py +7 -7
- rasa/constants.py +3 -1
- rasa/core/actions/action.py +77 -33
- rasa/core/actions/action_hangup.py +29 -0
- rasa/core/actions/action_repeat_bot_messages.py +89 -0
- rasa/core/actions/e2e_stub_custom_action_executor.py +5 -1
- rasa/core/actions/http_custom_action_executor.py +4 -0
- rasa/core/agent.py +2 -2
- rasa/core/brokers/kafka.py +3 -1
- rasa/core/brokers/pika.py +3 -1
- rasa/core/channels/__init__.py +10 -6
- rasa/core/channels/channel.py +41 -4
- rasa/core/channels/development_inspector.py +150 -46
- rasa/core/channels/inspector/README.md +1 -1
- rasa/core/channels/inspector/dist/assets/{arc-b6e548fe.js → arc-bc141fb2.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{c4Diagram-d0fbc5ce-fa03ac9e.js → c4Diagram-d0fbc5ce-be2db283.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{classDiagram-936ed81e-ee67392a.js → classDiagram-936ed81e-55366915.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{classDiagram-v2-c3cb15f1-9b283fae.js → classDiagram-v2-c3cb15f1-bb529518.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{createText-62fc7601-8b6fcc2a.js → createText-62fc7601-b0ec81d6.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{edges-f2ad444c-22e77f4f.js → edges-f2ad444c-6166330c.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{erDiagram-9d236eb7-60ffc87f.js → erDiagram-9d236eb7-5ccc6a8e.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{flowDb-1972c806-9dd802e4.js → flowDb-1972c806-fca3bfe4.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{flowDiagram-7ea5b25a-5fa1912f.js → flowDiagram-7ea5b25a-4739080f.js} +1 -1
- rasa/core/channels/inspector/dist/assets/flowDiagram-v2-855bc5b3-736177bf.js +1 -0
- rasa/core/channels/inspector/dist/assets/{flowchart-elk-definition-abe16c3d-622a1fd2.js → flowchart-elk-definition-abe16c3d-7c1b0e0f.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{ganttDiagram-9b5ea136-e285a63a.js → ganttDiagram-9b5ea136-772fd050.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{gitGraphDiagram-99d0ae7c-f237bdca.js → gitGraphDiagram-99d0ae7c-8eae1dc9.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{index-2c4b9a3b-4b03d70e.js → index-2c4b9a3b-f55afcdf.js} +1 -1
- rasa/core/channels/inspector/dist/assets/index-e7cef9de.js +1317 -0
- rasa/core/channels/inspector/dist/assets/{infoDiagram-736b4530-72a0fa5f.js → infoDiagram-736b4530-124d4a14.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{journeyDiagram-df861f2b-82218c41.js → journeyDiagram-df861f2b-7c4fae44.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{layout-78cff630.js → layout-b9885fb6.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{line-5038b469.js → line-7c59abb6.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{linear-c4fc4098.js → linear-4776f780.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{mindmap-definition-beec6740-c33c8ea6.js → mindmap-definition-beec6740-2332c46c.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{pieDiagram-dbbf0591-a8d03059.js → pieDiagram-dbbf0591-8fb39303.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{quadrantDiagram-4d7f4fd6-6a0e56b2.js → quadrantDiagram-4d7f4fd6-3c7180a2.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{requirementDiagram-6fc4c22a-2dc7c7bd.js → requirementDiagram-6fc4c22a-e910bcb8.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{sankeyDiagram-8f13d901-2360fe39.js → sankeyDiagram-8f13d901-ead16c89.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{sequenceDiagram-b655622a-41b9f9ad.js → sequenceDiagram-b655622a-29a02a19.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{stateDiagram-59f0c015-0aad326f.js → stateDiagram-59f0c015-042b3137.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{stateDiagram-v2-2b26beab-9847d984.js → stateDiagram-v2-2b26beab-2178c0f3.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-080da4f6-564d890e.js → styles-080da4f6-23ffa4fc.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-3dcbcfbf-38957613.js → styles-3dcbcfbf-94f59763.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-9c745c82-f0fc6921.js → styles-9c745c82-78a6bebc.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{svgDrawCommon-4835440b-ef3c5a77.js → svgDrawCommon-4835440b-eae2a6f6.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{timeline-definition-5b62e21b-bf3e91c1.js → timeline-definition-5b62e21b-5c968d92.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{xychartDiagram-2b33534f-4d4026c0.js → xychartDiagram-2b33534f-fd3db0d5.js} +1 -1
- rasa/core/channels/inspector/dist/index.html +18 -15
- rasa/core/channels/inspector/index.html +17 -14
- rasa/core/channels/inspector/package.json +5 -1
- rasa/core/channels/inspector/src/App.tsx +118 -68
- rasa/core/channels/inspector/src/components/Chat.tsx +95 -0
- rasa/core/channels/inspector/src/components/DiagramFlow.tsx +11 -10
- rasa/core/channels/inspector/src/components/DialogueStack.tsx +10 -25
- rasa/core/channels/inspector/src/components/LoadingSpinner.tsx +6 -3
- rasa/core/channels/inspector/src/helpers/audiostream.ts +165 -0
- rasa/core/channels/inspector/src/helpers/formatters.test.ts +10 -0
- rasa/core/channels/inspector/src/helpers/formatters.ts +107 -41
- rasa/core/channels/inspector/src/helpers/utils.ts +92 -7
- rasa/core/channels/inspector/src/types.ts +21 -1
- rasa/core/channels/inspector/yarn.lock +94 -1
- rasa/core/channels/rest.py +51 -46
- rasa/core/channels/socketio.py +28 -1
- rasa/core/channels/telegram.py +1 -1
- rasa/core/channels/twilio.py +1 -1
- rasa/core/channels/{audiocodes.py → voice_ready/audiocodes.py} +122 -69
- rasa/core/channels/{voice_aware → voice_ready}/jambonz.py +26 -8
- rasa/core/channels/{voice_aware → voice_ready}/jambonz_protocol.py +57 -5
- rasa/core/channels/{twilio_voice.py → voice_ready/twilio_voice.py} +64 -28
- rasa/core/channels/voice_ready/utils.py +37 -0
- rasa/core/channels/voice_stream/asr/__init__.py +0 -0
- rasa/core/channels/voice_stream/asr/asr_engine.py +89 -0
- rasa/core/channels/voice_stream/asr/asr_event.py +18 -0
- rasa/core/channels/voice_stream/asr/azure.py +129 -0
- rasa/core/channels/voice_stream/asr/deepgram.py +90 -0
- rasa/core/channels/voice_stream/audio_bytes.py +8 -0
- rasa/core/channels/voice_stream/browser_audio.py +107 -0
- rasa/core/channels/voice_stream/call_state.py +23 -0
- rasa/core/channels/voice_stream/tts/__init__.py +0 -0
- rasa/core/channels/voice_stream/tts/azure.py +106 -0
- rasa/core/channels/voice_stream/tts/cartesia.py +118 -0
- rasa/core/channels/voice_stream/tts/tts_cache.py +27 -0
- rasa/core/channels/voice_stream/tts/tts_engine.py +58 -0
- rasa/core/channels/voice_stream/twilio_media_streams.py +173 -0
- rasa/core/channels/voice_stream/util.py +57 -0
- rasa/core/channels/voice_stream/voice_channel.py +427 -0
- rasa/core/information_retrieval/qdrant.py +1 -0
- rasa/core/nlg/contextual_response_rephraser.py +45 -17
- rasa/{nlu → core}/persistor.py +203 -68
- rasa/core/policies/enterprise_search_policy.py +119 -63
- rasa/core/policies/flows/flow_executor.py +15 -22
- rasa/core/policies/intentless_policy.py +83 -28
- rasa/core/processor.py +25 -0
- rasa/core/run.py +12 -2
- rasa/core/secrets_manager/constants.py +4 -0
- rasa/core/secrets_manager/factory.py +8 -0
- rasa/core/secrets_manager/vault.py +11 -1
- rasa/core/training/interactive.py +33 -34
- rasa/core/utils.py +47 -21
- rasa/dialogue_understanding/coexistence/llm_based_router.py +41 -14
- rasa/dialogue_understanding/commands/__init__.py +6 -0
- rasa/dialogue_understanding/commands/repeat_bot_messages_command.py +60 -0
- rasa/dialogue_understanding/commands/session_end_command.py +61 -0
- rasa/dialogue_understanding/commands/user_silence_command.py +59 -0
- rasa/dialogue_understanding/commands/utils.py +5 -0
- rasa/dialogue_understanding/generator/constants.py +2 -0
- rasa/dialogue_understanding/generator/flow_retrieval.py +47 -9
- rasa/dialogue_understanding/generator/llm_based_command_generator.py +38 -15
- rasa/dialogue_understanding/generator/llm_command_generator.py +1 -1
- rasa/dialogue_understanding/generator/multi_step/multi_step_llm_command_generator.py +35 -13
- rasa/dialogue_understanding/generator/single_step/command_prompt_template.jinja2 +3 -0
- rasa/dialogue_understanding/generator/single_step/single_step_llm_command_generator.py +60 -13
- rasa/dialogue_understanding/patterns/default_flows_for_patterns.yml +53 -0
- rasa/dialogue_understanding/patterns/repeat.py +37 -0
- rasa/dialogue_understanding/patterns/user_silence.py +37 -0
- rasa/dialogue_understanding/processor/command_processor.py +21 -1
- rasa/e2e_test/aggregate_test_stats_calculator.py +1 -11
- rasa/e2e_test/assertions.py +136 -61
- rasa/e2e_test/assertions_schema.yml +23 -0
- rasa/e2e_test/e2e_test_case.py +85 -6
- rasa/e2e_test/e2e_test_runner.py +2 -3
- rasa/engine/graph.py +0 -1
- rasa/engine/loader.py +12 -0
- rasa/engine/recipes/config_files/default_config.yml +0 -3
- rasa/engine/recipes/default_recipe.py +0 -1
- rasa/engine/recipes/graph_recipe.py +0 -1
- rasa/engine/runner/dask.py +2 -2
- rasa/engine/storage/local_model_storage.py +12 -42
- rasa/engine/storage/storage.py +1 -5
- rasa/engine/validation.py +527 -74
- rasa/model_manager/__init__.py +0 -0
- rasa/model_manager/config.py +40 -0
- rasa/model_manager/model_api.py +559 -0
- rasa/model_manager/runner_service.py +286 -0
- rasa/model_manager/socket_bridge.py +146 -0
- rasa/model_manager/studio_jwt_auth.py +86 -0
- rasa/model_manager/trainer_service.py +325 -0
- rasa/model_manager/utils.py +87 -0
- rasa/model_manager/warm_rasa_process.py +187 -0
- rasa/model_service.py +112 -0
- rasa/model_training.py +42 -23
- rasa/nlu/tokenizers/whitespace_tokenizer.py +3 -14
- rasa/server.py +4 -2
- rasa/shared/constants.py +60 -8
- rasa/shared/core/constants.py +13 -0
- rasa/shared/core/domain.py +107 -50
- rasa/shared/core/events.py +29 -0
- rasa/shared/core/flows/flow.py +5 -0
- rasa/shared/core/flows/flows_list.py +19 -6
- rasa/shared/core/flows/flows_yaml_schema.json +10 -0
- rasa/shared/core/flows/utils.py +39 -0
- rasa/shared/core/flows/validation.py +121 -0
- rasa/shared/core/flows/yaml_flows_io.py +15 -27
- rasa/shared/core/slots.py +5 -0
- rasa/shared/importers/importer.py +59 -41
- rasa/shared/importers/multi_project.py +23 -11
- rasa/shared/importers/rasa.py +12 -3
- rasa/shared/importers/remote_importer.py +196 -0
- rasa/shared/importers/utils.py +3 -1
- rasa/shared/nlu/training_data/formats/rasa_yaml.py +18 -3
- rasa/shared/nlu/training_data/training_data.py +18 -19
- rasa/shared/providers/_configs/litellm_router_client_config.py +220 -0
- rasa/shared/providers/_configs/model_group_config.py +167 -0
- rasa/shared/providers/_configs/openai_client_config.py +1 -1
- rasa/shared/providers/_configs/rasa_llm_client_config.py +73 -0
- rasa/shared/providers/_configs/self_hosted_llm_client_config.py +1 -0
- rasa/shared/providers/_configs/utils.py +16 -0
- rasa/shared/providers/_utils.py +79 -0
- rasa/shared/providers/embedding/_base_litellm_embedding_client.py +13 -29
- rasa/shared/providers/embedding/azure_openai_embedding_client.py +54 -21
- rasa/shared/providers/embedding/default_litellm_embedding_client.py +24 -0
- rasa/shared/providers/embedding/litellm_router_embedding_client.py +135 -0
- rasa/shared/providers/llm/_base_litellm_client.py +34 -22
- rasa/shared/providers/llm/azure_openai_llm_client.py +50 -29
- rasa/shared/providers/llm/default_litellm_llm_client.py +24 -0
- rasa/shared/providers/llm/litellm_router_llm_client.py +182 -0
- rasa/shared/providers/llm/rasa_llm_client.py +112 -0
- rasa/shared/providers/llm/self_hosted_llm_client.py +5 -29
- rasa/shared/providers/mappings.py +19 -0
- rasa/shared/providers/router/__init__.py +0 -0
- rasa/shared/providers/router/_base_litellm_router_client.py +183 -0
- rasa/shared/providers/router/router_client.py +73 -0
- rasa/shared/utils/common.py +40 -24
- rasa/shared/utils/health_check/__init__.py +0 -0
- rasa/shared/utils/health_check/embeddings_health_check_mixin.py +31 -0
- rasa/shared/utils/health_check/health_check.py +258 -0
- rasa/shared/utils/health_check/llm_health_check_mixin.py +31 -0
- rasa/shared/utils/io.py +27 -6
- rasa/shared/utils/llm.py +353 -43
- rasa/shared/utils/schemas/events.py +2 -0
- rasa/shared/utils/schemas/model_config.yml +0 -10
- rasa/shared/utils/yaml.py +181 -38
- rasa/studio/data_handler.py +3 -1
- rasa/studio/upload.py +160 -74
- rasa/telemetry.py +94 -17
- rasa/tracing/config.py +3 -1
- rasa/tracing/instrumentation/attribute_extractors.py +95 -18
- rasa/tracing/instrumentation/instrumentation.py +121 -0
- rasa/utils/common.py +5 -0
- rasa/utils/endpoints.py +27 -1
- rasa/utils/io.py +8 -16
- rasa/utils/log_utils.py +9 -2
- rasa/utils/sanic_error_handler.py +32 -0
- rasa/validator.py +110 -4
- rasa/version.py +1 -1
- {rasa_pro-3.10.15.dist-info → rasa_pro-3.11.0.dist-info}/METADATA +14 -12
- {rasa_pro-3.10.15.dist-info → rasa_pro-3.11.0.dist-info}/RECORD +234 -183
- rasa/core/channels/inspector/dist/assets/flowDiagram-v2-855bc5b3-1844e5a5.js +0 -1
- rasa/core/channels/inspector/dist/assets/index-a5d3e69d.js +0 -1040
- rasa/core/channels/voice_aware/utils.py +0 -20
- rasa/llm_fine_tuning/notebooks/unsloth_finetuning.ipynb +0 -407
- /rasa/core/channels/{voice_aware → voice_ready}/__init__.py +0 -0
- /rasa/core/channels/{voice_native → voice_stream}/__init__.py +0 -0
- {rasa_pro-3.10.15.dist-info → rasa_pro-3.11.0.dist-info}/NOTICE +0 -0
- {rasa_pro-3.10.15.dist-info → rasa_pro-3.11.0.dist-info}/WHEEL +0 -0
- {rasa_pro-3.10.15.dist-info → rasa_pro-3.11.0.dist-info}/entry_points.txt +0 -0
|
@@ -18,6 +18,7 @@ from rasa.core.constants import (
|
|
|
18
18
|
UTTER_SOURCE_METADATA_KEY,
|
|
19
19
|
)
|
|
20
20
|
from rasa.core.policies.policy import Policy, PolicyPrediction, SupportedData
|
|
21
|
+
from rasa.dialogue_understanding.patterns.chitchat import FLOW_PATTERN_CHITCHAT
|
|
21
22
|
from rasa.dialogue_understanding.stack.frames import (
|
|
22
23
|
ChitChatStackFrame,
|
|
23
24
|
DialogueStackFrame,
|
|
@@ -38,8 +39,10 @@ from rasa.shared.constants import (
|
|
|
38
39
|
PROVIDER_CONFIG_KEY,
|
|
39
40
|
OPENAI_PROVIDER,
|
|
40
41
|
TIMEOUT_CONFIG_KEY,
|
|
42
|
+
MODEL_GROUP_ID_CONFIG_KEY,
|
|
41
43
|
)
|
|
42
44
|
from rasa.shared.core.constants import ACTION_LISTEN_NAME
|
|
45
|
+
from rasa.shared.core.constants import ACTION_TRIGGER_CHITCHAT
|
|
43
46
|
from rasa.shared.core.domain import KEY_RESPONSES_TEXT, Domain
|
|
44
47
|
from rasa.shared.core.events import (
|
|
45
48
|
ActionExecuted,
|
|
@@ -57,6 +60,10 @@ from rasa.shared.providers.embedding._langchain_embedding_client_adapter import
|
|
|
57
60
|
_LangchainEmbeddingClientAdapter,
|
|
58
61
|
)
|
|
59
62
|
from rasa.shared.providers.llm.llm_client import LLMClient
|
|
63
|
+
from rasa.shared.utils.health_check.embeddings_health_check_mixin import (
|
|
64
|
+
EmbeddingsHealthCheckMixin,
|
|
65
|
+
)
|
|
66
|
+
from rasa.shared.utils.health_check.llm_health_check_mixin import LLMHealthCheckMixin
|
|
60
67
|
from rasa.shared.utils.io import deep_container_fingerprint
|
|
61
68
|
from rasa.shared.utils.llm import (
|
|
62
69
|
AI,
|
|
@@ -70,9 +77,9 @@ from rasa.shared.utils.llm import (
|
|
|
70
77
|
llm_factory,
|
|
71
78
|
sanitize_message_for_prompt,
|
|
72
79
|
tracker_as_readable_transcript,
|
|
73
|
-
|
|
74
|
-
try_instantiate_embedder,
|
|
80
|
+
resolve_model_client_config,
|
|
75
81
|
)
|
|
82
|
+
from rasa.utils.log_utils import log_llm
|
|
76
83
|
from rasa.utils.ml_utils import (
|
|
77
84
|
extract_ai_response_examples,
|
|
78
85
|
extract_participant_messages_from_transcript,
|
|
@@ -81,9 +88,6 @@ from rasa.utils.ml_utils import (
|
|
|
81
88
|
persist_faiss_vector_store,
|
|
82
89
|
response_for_template,
|
|
83
90
|
)
|
|
84
|
-
from rasa.dialogue_understanding.patterns.chitchat import FLOW_PATTERN_CHITCHAT
|
|
85
|
-
from rasa.shared.core.constants import ACTION_TRIGGER_CHITCHAT
|
|
86
|
-
from rasa.utils.log_utils import log_llm
|
|
87
91
|
|
|
88
92
|
if TYPE_CHECKING:
|
|
89
93
|
from rasa.core.featurizers.tracker_featurizers import TrackerFeaturizer
|
|
@@ -123,6 +127,7 @@ DEFAULT_INTENTLESS_PROMPT_TEMPLATE = importlib.resources.open_text(
|
|
|
123
127
|
).name
|
|
124
128
|
|
|
125
129
|
INTENTLESS_PROMPT_TEMPLATE_FILE_NAME = "intentless_policy_prompt.jinja2"
|
|
130
|
+
INTENTLESS_CONFIG_FILE_NAME = "config.json"
|
|
126
131
|
|
|
127
132
|
|
|
128
133
|
class RasaMLPolicyTrainingException(RasaCoreException):
|
|
@@ -372,7 +377,7 @@ def conversation_as_prompt(conversation: Conversation) -> str:
|
|
|
372
377
|
@DefaultV1Recipe.register(
|
|
373
378
|
DefaultV1Recipe.ComponentType.POLICY_WITH_END_TO_END_SUPPORT, is_trainable=True
|
|
374
379
|
)
|
|
375
|
-
class IntentlessPolicy(Policy):
|
|
380
|
+
class IntentlessPolicy(LLMHealthCheckMixin, EmbeddingsHealthCheckMixin, Policy):
|
|
376
381
|
"""Policy which uses a language model to generate the next action.
|
|
377
382
|
|
|
378
383
|
The policy uses the OpenAI API to generate the next action based on the
|
|
@@ -429,6 +434,16 @@ class IntentlessPolicy(Policy):
|
|
|
429
434
|
"""Constructs a new Policy object."""
|
|
430
435
|
super().__init__(config, model_storage, resource, execution_context, featurizer)
|
|
431
436
|
|
|
437
|
+
# Resolve LLM config
|
|
438
|
+
self.config[LLM_CONFIG_KEY] = resolve_model_client_config(
|
|
439
|
+
self.config.get(LLM_CONFIG_KEY), IntentlessPolicy.__name__
|
|
440
|
+
)
|
|
441
|
+
|
|
442
|
+
# Resolve embeddings config
|
|
443
|
+
self.config[EMBEDDINGS_CONFIG_KEY] = resolve_model_client_config(
|
|
444
|
+
self.config.get(EMBEDDINGS_CONFIG_KEY), IntentlessPolicy.__name__
|
|
445
|
+
)
|
|
446
|
+
|
|
432
447
|
self.nlu_abstention_threshold: float = self.config[NLU_ABSTENTION_THRESHOLD]
|
|
433
448
|
self.response_index = responses_docsearch
|
|
434
449
|
self.conversation_samples_index = samples_docsearch
|
|
@@ -445,9 +460,16 @@ class IntentlessPolicy(Policy):
|
|
|
445
460
|
Returns:
|
|
446
461
|
The embedder.
|
|
447
462
|
"""
|
|
463
|
+
# Copy the config so original config is not modified
|
|
464
|
+
config.copy()
|
|
465
|
+
# Resolve config and instantiate the embedding client
|
|
466
|
+
config[EMBEDDINGS_CONFIG_KEY] = resolve_model_client_config(
|
|
467
|
+
config.get(EMBEDDINGS_CONFIG_KEY), IntentlessPolicy.__name__
|
|
468
|
+
)
|
|
448
469
|
client = embedder_factory(
|
|
449
470
|
config.get(EMBEDDINGS_CONFIG_KEY), DEFAULT_EMBEDDINGS_CONFIG
|
|
450
471
|
)
|
|
472
|
+
# Wrap the embedding client in the adapter
|
|
451
473
|
return _LangchainEmbeddingClientAdapter(client)
|
|
452
474
|
|
|
453
475
|
def embeddings_property(self, prop: str) -> Optional[str]:
|
|
@@ -488,12 +510,8 @@ class IntentlessPolicy(Policy):
|
|
|
488
510
|
A policy must return its resource locator so that potential children nodes
|
|
489
511
|
can load the policy from the resource.
|
|
490
512
|
"""
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
DEFAULT_LLM_CONFIG,
|
|
494
|
-
"intentless_policy.train",
|
|
495
|
-
"IntentlessPolicy",
|
|
496
|
-
)
|
|
513
|
+
# Perform health checks of both LLM and embeddings client configs
|
|
514
|
+
self._perform_health_checks(self.config, "intentless_policy.train")
|
|
497
515
|
|
|
498
516
|
responses = filter_responses(responses, forms, flows or FlowsList([]))
|
|
499
517
|
telemetry.track_intentless_policy_train()
|
|
@@ -540,9 +558,13 @@ class IntentlessPolicy(Policy):
|
|
|
540
558
|
embeddings_type=self.embeddings_property(PROVIDER_CONFIG_KEY),
|
|
541
559
|
embeddings_model=self.embeddings_property(MODEL_CONFIG_KEY)
|
|
542
560
|
or self.embeddings_property(MODEL_NAME_CONFIG_KEY),
|
|
561
|
+
embeddings_model_group_id=self.embeddings_property(
|
|
562
|
+
MODEL_GROUP_ID_CONFIG_KEY
|
|
563
|
+
),
|
|
543
564
|
llm_type=self.llm_property(PROVIDER_CONFIG_KEY),
|
|
544
565
|
llm_model=self.llm_property(MODEL_CONFIG_KEY)
|
|
545
566
|
or self.llm_property(MODEL_NAME_CONFIG_KEY),
|
|
567
|
+
llm_model_group_id=self.llm_property(MODEL_GROUP_ID_CONFIG_KEY),
|
|
546
568
|
)
|
|
547
569
|
|
|
548
570
|
self.persist()
|
|
@@ -558,6 +580,9 @@ class IntentlessPolicy(Policy):
|
|
|
558
580
|
rasa.shared.utils.io.write_text_file(
|
|
559
581
|
self.prompt_template, path / INTENTLESS_PROMPT_TEMPLATE_FILE_NAME
|
|
560
582
|
)
|
|
583
|
+
rasa.shared.utils.io.dump_obj_as_json_to_file(
|
|
584
|
+
path / INTENTLESS_CONFIG_FILE_NAME, self.config
|
|
585
|
+
)
|
|
561
586
|
|
|
562
587
|
async def predict_action_probabilities(
|
|
563
588
|
self,
|
|
@@ -619,9 +644,13 @@ class IntentlessPolicy(Policy):
|
|
|
619
644
|
embeddings_type=self.embeddings_property(PROVIDER_CONFIG_KEY),
|
|
620
645
|
embeddings_model=self.embeddings_property(MODEL_CONFIG_KEY)
|
|
621
646
|
or self.embeddings_property(MODEL_NAME_CONFIG_KEY),
|
|
647
|
+
embeddings_model_group_id=self.embeddings_property(
|
|
648
|
+
MODEL_GROUP_ID_CONFIG_KEY
|
|
649
|
+
),
|
|
622
650
|
llm_type=self.llm_property(PROVIDER_CONFIG_KEY),
|
|
623
651
|
llm_model=self.llm_property(MODEL_CONFIG_KEY)
|
|
624
652
|
or self.llm_property(MODEL_NAME_CONFIG_KEY),
|
|
653
|
+
llm_model_group_id=self.llm_property(MODEL_GROUP_ID_CONFIG_KEY),
|
|
625
654
|
score=score,
|
|
626
655
|
)
|
|
627
656
|
|
|
@@ -645,7 +674,7 @@ class IntentlessPolicy(Policy):
|
|
|
645
674
|
history: str,
|
|
646
675
|
) -> Optional[str]:
|
|
647
676
|
"""Make the llm call to generate an answer."""
|
|
648
|
-
llm = llm_factory(self.config
|
|
677
|
+
llm = llm_factory(self.config.get(LLM_CONFIG_KEY), DEFAULT_LLM_CONFIG)
|
|
649
678
|
inputs = {
|
|
650
679
|
"conversations": conversation_samples,
|
|
651
680
|
"responses": response_examples,
|
|
@@ -919,18 +948,10 @@ class IntentlessPolicy(Policy):
|
|
|
919
948
|
**kwargs: Any,
|
|
920
949
|
) -> "IntentlessPolicy":
|
|
921
950
|
"""Loads a trained policy (see parent class for full docstring)."""
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
IntentlessPolicy.__name__,
|
|
927
|
-
)
|
|
928
|
-
try_instantiate_embedder(
|
|
929
|
-
config.get(EMBEDDINGS_CONFIG_KEY),
|
|
930
|
-
DEFAULT_EMBEDDINGS_CONFIG,
|
|
931
|
-
"intentless_policy.load",
|
|
932
|
-
IntentlessPolicy.__name__,
|
|
933
|
-
)
|
|
951
|
+
|
|
952
|
+
# Perform health checks of both LLM and embeddings client configs
|
|
953
|
+
cls._perform_health_checks(config, "intentless_policy.load")
|
|
954
|
+
|
|
934
955
|
responses_docsearch = None
|
|
935
956
|
samples_docsearch = None
|
|
936
957
|
prompt_template = None
|
|
@@ -951,11 +972,11 @@ class IntentlessPolicy(Policy):
|
|
|
951
972
|
prompt_template = rasa.shared.utils.io.read_file(
|
|
952
973
|
path / INTENTLESS_PROMPT_TEMPLATE_FILE_NAME
|
|
953
974
|
)
|
|
954
|
-
|
|
955
975
|
except (ValueError, FileNotFoundError, FileIOException) as e:
|
|
956
976
|
structlogger.warning(
|
|
957
977
|
"intentless_policy.load.failed", error=e, resource_name=resource.name
|
|
958
978
|
)
|
|
979
|
+
|
|
959
980
|
return cls(
|
|
960
981
|
config,
|
|
961
982
|
model_storage,
|
|
@@ -968,9 +989,43 @@ class IntentlessPolicy(Policy):
|
|
|
968
989
|
|
|
969
990
|
@classmethod
|
|
970
991
|
def fingerprint_addon(cls, config: Dict[str, Any]) -> Optional[str]:
|
|
971
|
-
"""Add a fingerprint of
|
|
992
|
+
"""Add a fingerprint of intentless policy for the graph."""
|
|
972
993
|
prompt_template = get_prompt_template(
|
|
973
994
|
config.get(PROMPT_CONFIG_KEY),
|
|
974
995
|
DEFAULT_INTENTLESS_PROMPT_TEMPLATE,
|
|
975
996
|
)
|
|
976
|
-
|
|
997
|
+
|
|
998
|
+
llm_config = resolve_model_client_config(
|
|
999
|
+
config.get(LLM_CONFIG_KEY), IntentlessPolicy.__name__
|
|
1000
|
+
)
|
|
1001
|
+
embedding_config = resolve_model_client_config(
|
|
1002
|
+
config.get(EMBEDDINGS_CONFIG_KEY), IntentlessPolicy.__name__
|
|
1003
|
+
)
|
|
1004
|
+
|
|
1005
|
+
return deep_container_fingerprint(
|
|
1006
|
+
[prompt_template, llm_config, embedding_config]
|
|
1007
|
+
)
|
|
1008
|
+
|
|
1009
|
+
@classmethod
|
|
1010
|
+
def _perform_health_checks(
|
|
1011
|
+
cls, config: Dict[Text, Any], log_source_method: str
|
|
1012
|
+
) -> None:
|
|
1013
|
+
# Perform health check of the LLM client config
|
|
1014
|
+
llm_config = resolve_model_client_config(config.get(LLM_CONFIG_KEY, {}))
|
|
1015
|
+
cls.perform_llm_health_check(
|
|
1016
|
+
llm_config,
|
|
1017
|
+
DEFAULT_LLM_CONFIG,
|
|
1018
|
+
log_source_method,
|
|
1019
|
+
IntentlessPolicy.__name__,
|
|
1020
|
+
)
|
|
1021
|
+
|
|
1022
|
+
# Perform health check of the embeddings client config
|
|
1023
|
+
embeddings_config = resolve_model_client_config(
|
|
1024
|
+
config.get(EMBEDDINGS_CONFIG_KEY, {})
|
|
1025
|
+
)
|
|
1026
|
+
cls.perform_embeddings_health_check(
|
|
1027
|
+
embeddings_config,
|
|
1028
|
+
DEFAULT_EMBEDDINGS_CONFIG,
|
|
1029
|
+
log_source_method,
|
|
1030
|
+
IntentlessPolicy.__name__,
|
|
1031
|
+
)
|
rasa/core/processor.py
CHANGED
|
@@ -46,12 +46,15 @@ from rasa.engine.runner.interface import GraphRunner
|
|
|
46
46
|
from rasa.exceptions import ActionLimitReached, ModelNotFound
|
|
47
47
|
from rasa.shared.core.constants import (
|
|
48
48
|
ACTION_CORRECT_FLOW_SLOT,
|
|
49
|
+
SLOT_CONSECUTIVE_SILENCE_TIMEOUTS,
|
|
50
|
+
SLOT_SILENCE_TIMEOUT,
|
|
49
51
|
USER_INTENT_RESTART,
|
|
50
52
|
ACTION_LISTEN_NAME,
|
|
51
53
|
ACTION_SESSION_START_NAME,
|
|
52
54
|
FOLLOWUP_ACTION,
|
|
53
55
|
SESSION_START_METADATA_SLOT,
|
|
54
56
|
ACTION_EXTRACT_SLOTS,
|
|
57
|
+
USER_INTENT_SILENCE_TIMEOUT,
|
|
55
58
|
)
|
|
56
59
|
from rasa.shared.core.events import (
|
|
57
60
|
ActionExecutionRejected,
|
|
@@ -789,6 +792,28 @@ class MessageProcessor:
|
|
|
789
792
|
)
|
|
790
793
|
|
|
791
794
|
self._check_for_unseen_features(parse_data)
|
|
795
|
+
# resetting timeouts variables whenever something that is not a timeout occurs
|
|
796
|
+
if (
|
|
797
|
+
parse_data.get(INTENT, {}).get(INTENT_NAME_KEY)
|
|
798
|
+
!= USER_INTENT_SILENCE_TIMEOUT
|
|
799
|
+
and tracker
|
|
800
|
+
):
|
|
801
|
+
if (
|
|
802
|
+
SLOT_CONSECUTIVE_SILENCE_TIMEOUTS in tracker.slots
|
|
803
|
+
and tracker.slots[SLOT_CONSECUTIVE_SILENCE_TIMEOUTS].value != 0.0
|
|
804
|
+
):
|
|
805
|
+
tracker.update(SlotSet(SLOT_CONSECUTIVE_SILENCE_TIMEOUTS, 0.0))
|
|
806
|
+
if (
|
|
807
|
+
SLOT_SILENCE_TIMEOUT in tracker.slots
|
|
808
|
+
and tracker.slots[SLOT_SILENCE_TIMEOUT].value
|
|
809
|
+
!= tracker.slots[SLOT_SILENCE_TIMEOUT].initial_value
|
|
810
|
+
):
|
|
811
|
+
tracker.update(
|
|
812
|
+
SlotSet(
|
|
813
|
+
SLOT_SILENCE_TIMEOUT,
|
|
814
|
+
tracker.slots[SLOT_SILENCE_TIMEOUT].initial_value,
|
|
815
|
+
)
|
|
816
|
+
)
|
|
792
817
|
|
|
793
818
|
return parse_data
|
|
794
819
|
|
rasa/core/run.py
CHANGED
|
@@ -19,6 +19,7 @@ from typing import (
|
|
|
19
19
|
|
|
20
20
|
from sanic import Sanic
|
|
21
21
|
from sanic.worker.loader import AppLoader
|
|
22
|
+
from rasa.core.channels.development_inspector import DevelopmentInspectProxy
|
|
22
23
|
|
|
23
24
|
import rasa.core.utils
|
|
24
25
|
import rasa.shared.utils.common
|
|
@@ -32,8 +33,8 @@ from rasa.core import agent, channels, constants
|
|
|
32
33
|
from rasa.core.agent import Agent
|
|
33
34
|
from rasa.core.channels import console
|
|
34
35
|
from rasa.core.channels.channel import InputChannel
|
|
36
|
+
from rasa.core.persistor import StorageType
|
|
35
37
|
from rasa.core.utils import AvailableEndpoints
|
|
36
|
-
from rasa.nlu.persistor import StorageType
|
|
37
38
|
from rasa.plugin import plugin_manager
|
|
38
39
|
from rasa.shared.exceptions import RasaException
|
|
39
40
|
from rasa.shared.utils.yaml import read_config_file
|
|
@@ -50,7 +51,6 @@ def create_http_input_channels(
|
|
|
50
51
|
all_credentials = read_config_file(credentials_file)
|
|
51
52
|
else:
|
|
52
53
|
all_credentials = {}
|
|
53
|
-
|
|
54
54
|
if channel:
|
|
55
55
|
if len(all_credentials) > 1:
|
|
56
56
|
logger.info(
|
|
@@ -224,6 +224,8 @@ def serve_application(
|
|
|
224
224
|
syslog_protocol: Optional[Text] = None,
|
|
225
225
|
request_timeout: Optional[int] = None,
|
|
226
226
|
server_listeners: Optional[List[Tuple[Callable, Text]]] = None,
|
|
227
|
+
inspect: Optional[bool] = False,
|
|
228
|
+
voice: Optional[bool] = False,
|
|
227
229
|
) -> None:
|
|
228
230
|
"""Run the API entrypoint."""
|
|
229
231
|
if not channel and not credentials:
|
|
@@ -231,6 +233,13 @@ def serve_application(
|
|
|
231
233
|
|
|
232
234
|
input_channels = create_http_input_channels(channel, credentials)
|
|
233
235
|
|
|
236
|
+
if inspect:
|
|
237
|
+
logger.info("Starting development inspector.")
|
|
238
|
+
input_channels = [DevelopmentInspectProxy(ic, voice) for ic in input_channels]
|
|
239
|
+
|
|
240
|
+
# the inspector needs the api to retrieve slots and flows
|
|
241
|
+
enable_api = True
|
|
242
|
+
|
|
234
243
|
app = configure_app(
|
|
235
244
|
input_channels,
|
|
236
245
|
cors,
|
|
@@ -311,6 +320,7 @@ async def load_agent_on_start(
|
|
|
311
320
|
endpoints=endpoints,
|
|
312
321
|
loop=loop,
|
|
313
322
|
)
|
|
323
|
+
|
|
314
324
|
logger.info("Rasa server is up and running.")
|
|
315
325
|
return app.ctx.agent
|
|
316
326
|
|
|
@@ -23,6 +23,7 @@ VAULT_TRANSIT_MOUNT_POINT_ENV_NAME = "VAULT_TRANSIT_MOUNT_POINT"
|
|
|
23
23
|
VAULT_NAMESPACE_ENV_NAME = "VAULT_NAMESPACE"
|
|
24
24
|
VAULT_DEFAULT_RASA_SECRETS_PATH = "rasa-secrets"
|
|
25
25
|
VAULT_SECRET_MANAGER_NAME = "vault"
|
|
26
|
+
VAULT_MOUNT_POINT_ENV_NAME = "VAULT_MOUNT_POINT"
|
|
26
27
|
|
|
27
28
|
|
|
28
29
|
VAULT_ENDPOINT_URL_LABEL = "url"
|
|
@@ -30,3 +31,6 @@ VAULT_ENDPOINT_TOKEN_LABEL = "token"
|
|
|
30
31
|
VAULT_ENDPOINT_SECRETS_PATH_LABEL = "secrets_path"
|
|
31
32
|
VAULT_ENDPOINT_TRANSIT_MOUNT_POINT_LABEL = "transit_mount_point"
|
|
32
33
|
VAULT_ENDPOINT_NAMESPACE_LABEL = "namespace"
|
|
34
|
+
VAULT_ENDPOINT_MOUNT_POINT_LABEL = "mount_point"
|
|
35
|
+
|
|
36
|
+
VAULT_MOUNT_POINT_DEFAULT_VALUE = "secret"
|
|
@@ -7,9 +7,11 @@ from rasa.utils.endpoints import EndpointConfig, read_endpoint_config
|
|
|
7
7
|
from rasa.core.secrets_manager.constants import (
|
|
8
8
|
SECRET_MANAGER_ENV_NAME,
|
|
9
9
|
VAULT_DEFAULT_RASA_SECRETS_PATH,
|
|
10
|
+
VAULT_ENDPOINT_MOUNT_POINT_LABEL,
|
|
10
11
|
VAULT_ENDPOINT_NAMESPACE_LABEL,
|
|
11
12
|
VAULT_ENDPOINT_SECRETS_PATH_LABEL,
|
|
12
13
|
VAULT_ENDPOINT_TRANSIT_MOUNT_POINT_LABEL,
|
|
14
|
+
VAULT_MOUNT_POINT_ENV_NAME,
|
|
13
15
|
VAULT_NAMESPACE_ENV_NAME,
|
|
14
16
|
VAULT_RASA_SECRETS_PATH_ENV_NAME,
|
|
15
17
|
VAULT_SECRET_MANAGER_NAME,
|
|
@@ -48,6 +50,7 @@ def create(config: SecretManagerConfig) -> Optional[SecretsManager]:
|
|
|
48
50
|
transit_mount_point=vault_config.transit_mount_point,
|
|
49
51
|
secrets_path=vault_config.secrets_path,
|
|
50
52
|
namespace=vault_config.namespace,
|
|
53
|
+
mount_point=vault_config.mount_point,
|
|
51
54
|
)
|
|
52
55
|
|
|
53
56
|
return secret_manager
|
|
@@ -79,6 +82,7 @@ def read_vault_endpoint_config(
|
|
|
79
82
|
)
|
|
80
83
|
secrets_path = endpoint_config.kwargs.get(VAULT_ENDPOINT_SECRETS_PATH_LABEL)
|
|
81
84
|
namespace = endpoint_config.kwargs.get(VAULT_ENDPOINT_NAMESPACE_LABEL)
|
|
85
|
+
mount_point = endpoint_config.kwargs.get(VAULT_ENDPOINT_MOUNT_POINT_LABEL)
|
|
82
86
|
|
|
83
87
|
return VaultSecretManagerNonStrictConfig(
|
|
84
88
|
url=url,
|
|
@@ -86,6 +90,7 @@ def read_vault_endpoint_config(
|
|
|
86
90
|
transit_mount_point=transit_mount_point,
|
|
87
91
|
secrets_path=secrets_path or VAULT_DEFAULT_RASA_SECRETS_PATH,
|
|
88
92
|
namespace=namespace,
|
|
93
|
+
mount_point=mount_point,
|
|
89
94
|
)
|
|
90
95
|
|
|
91
96
|
return None
|
|
@@ -102,6 +107,7 @@ def read_vault_env_vars() -> VaultSecretManagerNonStrictConfig:
|
|
|
102
107
|
transit_mount_point = os.getenv(VAULT_TRANSIT_MOUNT_POINT_ENV_NAME)
|
|
103
108
|
secrets_path = os.getenv(VAULT_RASA_SECRETS_PATH_ENV_NAME)
|
|
104
109
|
namespace = os.getenv(VAULT_NAMESPACE_ENV_NAME)
|
|
110
|
+
mount_point = os.getenv(VAULT_MOUNT_POINT_ENV_NAME)
|
|
105
111
|
|
|
106
112
|
return VaultSecretManagerNonStrictConfig(
|
|
107
113
|
url=url,
|
|
@@ -109,6 +115,7 @@ def read_vault_env_vars() -> VaultSecretManagerNonStrictConfig:
|
|
|
109
115
|
transit_mount_point=transit_mount_point,
|
|
110
116
|
secrets_path=secrets_path,
|
|
111
117
|
namespace=namespace,
|
|
118
|
+
mount_point=mount_point,
|
|
112
119
|
)
|
|
113
120
|
|
|
114
121
|
|
|
@@ -149,6 +156,7 @@ def read_vault_config(
|
|
|
149
156
|
f"{VAULT_RASA_SECRETS_PATH_ENV_NAME} = {env_config.secrets_path}, "
|
|
150
157
|
f"{VAULT_TRANSIT_MOUNT_POINT_ENV_NAME} = {env_config.transit_mount_point}. "
|
|
151
158
|
f"{VAULT_NAMESPACE_ENV_NAME} = {env_config.namespace}. "
|
|
159
|
+
f"{VAULT_MOUNT_POINT_ENV_NAME} = {env_config.mount_point}. "
|
|
152
160
|
)
|
|
153
161
|
|
|
154
162
|
|
|
@@ -15,6 +15,7 @@ from rasa.utils.endpoints import EndpointConfig
|
|
|
15
15
|
from rasa.core.secrets_manager.constants import (
|
|
16
16
|
TRACKER_STORE_ENDPOINT_TYPE,
|
|
17
17
|
TRANSIT_KEY_FOR_ENCRYPTION_LABEL,
|
|
18
|
+
VAULT_MOUNT_POINT_DEFAULT_VALUE,
|
|
18
19
|
VAULT_SECRET_MANAGER_NAME,
|
|
19
20
|
)
|
|
20
21
|
from rasa.core.secrets_manager.endpoints import (
|
|
@@ -181,6 +182,7 @@ class VaultSecretsManager(SecretsManager):
|
|
|
181
182
|
secrets_path: Text,
|
|
182
183
|
transit_mount_point: Optional[Text] = None,
|
|
183
184
|
namespace: Optional[Text] = None,
|
|
185
|
+
mount_point: Optional[Text] = None,
|
|
184
186
|
):
|
|
185
187
|
"""Initialise the VaultSecretsManager.
|
|
186
188
|
|
|
@@ -190,11 +192,13 @@ class VaultSecretsManager(SecretsManager):
|
|
|
190
192
|
secrets_path: The path to the secrets in the vault server.
|
|
191
193
|
transit_mount_point: The mount point of the transit engine.
|
|
192
194
|
namespace: The namespace in which secrets reside in.
|
|
195
|
+
mount_point: The mount point of the kv engine.
|
|
193
196
|
"""
|
|
194
197
|
self.host = host
|
|
195
198
|
self.transit_mount_point = transit_mount_point
|
|
196
199
|
self.token = token
|
|
197
200
|
self.secrets_path = secrets_path
|
|
201
|
+
self.mount_point = mount_point or VAULT_MOUNT_POINT_DEFAULT_VALUE
|
|
198
202
|
self.namespace = namespace
|
|
199
203
|
|
|
200
204
|
# Create client
|
|
@@ -236,7 +240,7 @@ class VaultSecretsManager(SecretsManager):
|
|
|
236
240
|
"""
|
|
237
241
|
logger.info(f"Loading secrets from vault server at {self.host}.")
|
|
238
242
|
read_response = self.client.secrets.kv.read_secret_version(
|
|
239
|
-
mount_point=
|
|
243
|
+
mount_point=self.mount_point, path=self.secrets_path
|
|
240
244
|
)
|
|
241
245
|
|
|
242
246
|
secrets = read_response["data"]["data"]
|
|
@@ -455,6 +459,7 @@ class VaultSecretManagerConfig(SecretManagerConfig):
|
|
|
455
459
|
secrets_path: Text,
|
|
456
460
|
transit_mount_point: Text = "transit",
|
|
457
461
|
namespace: Optional[Text] = None,
|
|
462
|
+
mount_point: Optional[Text] = None,
|
|
458
463
|
) -> None:
|
|
459
464
|
"""Initialise the VaultSecretManagerConfig.
|
|
460
465
|
|
|
@@ -471,6 +476,7 @@ class VaultSecretManagerConfig(SecretManagerConfig):
|
|
|
471
476
|
self.secrets_path = secrets_path
|
|
472
477
|
self.transit_mount_point = transit_mount_point
|
|
473
478
|
self.namespace = namespace
|
|
479
|
+
self.mount_point = mount_point
|
|
474
480
|
|
|
475
481
|
|
|
476
482
|
@dataclass
|
|
@@ -486,6 +492,7 @@ class VaultSecretManagerNonStrictConfig:
|
|
|
486
492
|
secrets_path: Optional[Text]
|
|
487
493
|
transit_mount_point: Optional[Text]
|
|
488
494
|
namespace: Optional[Text] = None
|
|
495
|
+
mount_point: Optional[Text] = None
|
|
489
496
|
|
|
490
497
|
def is_empty(self) -> bool:
|
|
491
498
|
"""Check if all the values are empty."""
|
|
@@ -495,6 +502,7 @@ class VaultSecretManagerNonStrictConfig:
|
|
|
495
502
|
and (self.secrets_path is None or self.secrets_path == "")
|
|
496
503
|
and (self.transit_mount_point is None or self.transit_mount_point == "")
|
|
497
504
|
and (self.namespace is None or self.namespace == "")
|
|
505
|
+
and (self.mount_point is None or self.mount_point == "")
|
|
498
506
|
)
|
|
499
507
|
|
|
500
508
|
def is_valid(self) -> bool:
|
|
@@ -516,6 +524,7 @@ class VaultSecretManagerNonStrictConfig:
|
|
|
516
524
|
and self.secrets_path != ""
|
|
517
525
|
and self._is_optional_value_valid(self.transit_mount_point)
|
|
518
526
|
and self._is_optional_value_valid(self.namespace)
|
|
527
|
+
and self._is_optional_value_valid(self.mount_point)
|
|
519
528
|
)
|
|
520
529
|
|
|
521
530
|
@staticmethod
|
|
@@ -547,6 +556,7 @@ class VaultSecretManagerNonStrictConfig:
|
|
|
547
556
|
secrets_path=self.secrets_path or other.secrets_path,
|
|
548
557
|
transit_mount_point=self.transit_mount_point or other.transit_mount_point,
|
|
549
558
|
namespace=self.namespace or other.namespace,
|
|
559
|
+
mount_point=self.mount_point or other.mount_point,
|
|
550
560
|
)
|
|
551
561
|
|
|
552
562
|
|
|
@@ -20,25 +20,41 @@ from typing import (
|
|
|
20
20
|
cast,
|
|
21
21
|
)
|
|
22
22
|
|
|
23
|
+
import numpy as np
|
|
24
|
+
import questionary
|
|
25
|
+
import terminaltables.width_and_alignment
|
|
26
|
+
from aiohttp import ClientError
|
|
27
|
+
from colorclass import Color
|
|
28
|
+
from questionary import Choice, Form, Question
|
|
23
29
|
from sanic import Sanic, response
|
|
24
30
|
from sanic.exceptions import NotFound
|
|
25
31
|
from sanic.request import Request
|
|
26
32
|
from sanic.response import HTTPResponse
|
|
27
33
|
from terminaltables import AsciiTable, SingleTable
|
|
28
|
-
import terminaltables.width_and_alignment
|
|
29
|
-
import numpy as np
|
|
30
|
-
from aiohttp import ClientError
|
|
31
|
-
from colorclass import Color
|
|
32
|
-
import questionary
|
|
33
|
-
from questionary import Choice, Form, Question
|
|
34
34
|
|
|
35
|
-
from rasa import telemetry
|
|
36
|
-
import rasa.shared.utils.cli
|
|
37
|
-
import rasa.shared.utils.io
|
|
38
35
|
import rasa.cli.utils
|
|
36
|
+
import rasa.core.train
|
|
37
|
+
import rasa.shared.core.events
|
|
39
38
|
import rasa.shared.data
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
import rasa.shared.utils.cli
|
|
40
|
+
import rasa.shared.utils.io
|
|
41
|
+
|
|
42
|
+
# WARNING: This command line UI is using an external library
|
|
43
|
+
# communicating with the shell - these functions are hard to test
|
|
44
|
+
# automatically. If you change anything in here, please make sure to
|
|
45
|
+
# run the interactive learning and check if your part of the "ui"
|
|
46
|
+
# still works.
|
|
47
|
+
import rasa.utils.io as io_utils
|
|
48
|
+
from rasa import telemetry
|
|
49
|
+
from rasa.core import run, utils
|
|
50
|
+
from rasa.core.constants import DEFAULT_SERVER_FORMAT, DEFAULT_SERVER_PORT
|
|
51
|
+
from rasa.core.utils import AvailableEndpoints
|
|
52
|
+
from rasa.shared.constants import (
|
|
53
|
+
INTENT_MESSAGE_PREFIX,
|
|
54
|
+
DEFAULT_SENDER_ID,
|
|
55
|
+
UTTER_PREFIX,
|
|
56
|
+
DOCS_URL_NLU_BASED_POLICIES,
|
|
57
|
+
)
|
|
42
58
|
from rasa.shared.core.constants import (
|
|
43
59
|
USER_INTENT_RESTART,
|
|
44
60
|
ACTION_LISTEN_NAME,
|
|
@@ -49,9 +65,6 @@ from rasa.shared.core.constants import (
|
|
|
49
65
|
LOOP_INTERRUPTED,
|
|
50
66
|
ACTION_UNLIKELY_INTENT_NAME,
|
|
51
67
|
)
|
|
52
|
-
from rasa.core import run, utils
|
|
53
|
-
import rasa.core.train
|
|
54
|
-
from rasa.core.constants import DEFAULT_SERVER_FORMAT, DEFAULT_SERVER_PORT
|
|
55
68
|
from rasa.shared.core.domain import (
|
|
56
69
|
Domain,
|
|
57
70
|
KEY_INTENTS,
|
|
@@ -60,7 +73,6 @@ from rasa.shared.core.domain import (
|
|
|
60
73
|
KEY_ACTIONS,
|
|
61
74
|
KEY_RESPONSES_TEXT,
|
|
62
75
|
)
|
|
63
|
-
import rasa.shared.core.events
|
|
64
76
|
from rasa.shared.core.events import (
|
|
65
77
|
ActionExecuted,
|
|
66
78
|
ActionReverted,
|
|
@@ -70,36 +82,23 @@ from rasa.shared.core.events import (
|
|
|
70
82
|
UserUttered,
|
|
71
83
|
UserUtteranceReverted,
|
|
72
84
|
)
|
|
73
|
-
from rasa.shared.
|
|
74
|
-
INTENT_MESSAGE_PREFIX,
|
|
75
|
-
DEFAULT_SENDER_ID,
|
|
76
|
-
UTTER_PREFIX,
|
|
77
|
-
DOCS_URL_NLU_BASED_POLICIES,
|
|
78
|
-
)
|
|
85
|
+
from rasa.shared.core.generator import TrackerWithCachedStates
|
|
79
86
|
from rasa.shared.core.trackers import EventVerbosity, DialogueStateTracker
|
|
80
87
|
from rasa.shared.core.training_data import visualization
|
|
81
88
|
from rasa.shared.core.training_data.visualization import (
|
|
82
89
|
VISUALIZATION_TEMPLATE_PATH,
|
|
83
90
|
visualize_neighborhood,
|
|
84
91
|
)
|
|
85
|
-
from rasa.core.utils import AvailableEndpoints
|
|
86
|
-
from rasa.shared.importers.rasa import TrainingDataImporter
|
|
87
|
-
from rasa.utils.common import update_sanic_log_level
|
|
88
|
-
from rasa.utils.endpoints import EndpointConfig
|
|
89
92
|
from rasa.shared.exceptions import InvalidConfigException
|
|
93
|
+
from rasa.shared.importers.rasa import TrainingDataImporter
|
|
94
|
+
from rasa.shared.nlu.constants import TEXT, INTENT_NAME_KEY
|
|
90
95
|
|
|
91
96
|
# noinspection PyProtectedMember
|
|
92
97
|
from rasa.shared.nlu.training_data import loading
|
|
98
|
+
from rasa.shared.nlu.training_data.loading import RASA, RASA_YAML
|
|
93
99
|
from rasa.shared.nlu.training_data.message import Message
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
# communicating with the shell - these functions are hard to test
|
|
97
|
-
# automatically. If you change anything in here, please make sure to
|
|
98
|
-
# run the interactive learning and check if your part of the "ui"
|
|
99
|
-
# still works.
|
|
100
|
-
import rasa.utils.io as io_utils
|
|
101
|
-
|
|
102
|
-
from rasa.shared.core.generator import TrackerWithCachedStates
|
|
100
|
+
from rasa.utils.common import update_sanic_log_level
|
|
101
|
+
from rasa.utils.endpoints import EndpointConfig
|
|
103
102
|
|
|
104
103
|
logger = logging.getLogger(__name__)
|
|
105
104
|
|