rasa-pro 3.10.16__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/llm_fine_tuning.py +11 -14
- 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 -17
- rasa/core/channels/inspector/index.html +17 -16
- 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/e2e_test/utils/e2e_yaml_utils.py +1 -1
- rasa/engine/graph.py +3 -10
- 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 +354 -44
- 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 -16
- rasa/version.py +1 -1
- {rasa_pro-3.10.16.dist-info → rasa_pro-3.11.0.dist-info}/METADATA +16 -14
- {rasa_pro-3.10.16.dist-info → rasa_pro-3.11.0.dist-info}/RECORD +236 -185
- 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.16.dist-info → rasa_pro-3.11.0.dist-info}/NOTICE +0 -0
- {rasa_pro-3.10.16.dist-info → rasa_pro-3.11.0.dist-info}/WHEEL +0 -0
- {rasa_pro-3.10.16.dist-info → rasa_pro-3.11.0.dist-info}/entry_points.txt +0 -0
rasa/__main__.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import argparse
|
|
2
|
-
import
|
|
2
|
+
from typing import Optional, List
|
|
3
|
+
import structlog
|
|
3
4
|
import os
|
|
4
5
|
import platform
|
|
5
6
|
import sys
|
|
@@ -35,10 +36,9 @@ from rasa.cli.utils import (
|
|
|
35
36
|
)
|
|
36
37
|
from rasa.plugin import plugin_manager
|
|
37
38
|
from rasa.shared.exceptions import RasaException
|
|
38
|
-
from rasa.shared.utils.cli import print_error
|
|
39
39
|
from rasa.utils.common import configure_logging_and_warnings
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
structlogger = structlog.get_logger()
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
def create_argument_parser() -> argparse.ArgumentParser:
|
|
@@ -89,7 +89,7 @@ def print_version() -> None:
|
|
|
89
89
|
"""Prints version information of rasa tooling and python."""
|
|
90
90
|
from rasa.utils.licensing import get_license_expiration_date
|
|
91
91
|
|
|
92
|
-
print(f"Rasa Version
|
|
92
|
+
print(f"Rasa Pro Version : {version.__version__}")
|
|
93
93
|
print(f"Minimum Compatible Version: {MINIMUM_COMPATIBLE_VERSION}")
|
|
94
94
|
print(f"Rasa SDK Version : {rasa_sdk_version}")
|
|
95
95
|
print(f"Python Version : {platform.python_version()}")
|
|
@@ -98,18 +98,27 @@ def print_version() -> None:
|
|
|
98
98
|
print(f"License Expires : {get_license_expiration_date()}")
|
|
99
99
|
|
|
100
100
|
|
|
101
|
-
def main() -> None:
|
|
102
|
-
"""Run as standalone python application.
|
|
101
|
+
def main(raw_arguments: Optional[List[str]] = None) -> None:
|
|
102
|
+
"""Run as standalone python application.
|
|
103
|
+
|
|
104
|
+
Args:
|
|
105
|
+
raw_arguments: Arguments to parse. If not provided,
|
|
106
|
+
arguments will be taken from the command line.
|
|
107
|
+
"""
|
|
103
108
|
warn_if_rasa_plus_package_installed()
|
|
104
109
|
parse_last_positional_argument_as_model_path()
|
|
105
110
|
arg_parser = create_argument_parser()
|
|
106
|
-
cmdline_arguments = arg_parser.parse_args()
|
|
111
|
+
cmdline_arguments = arg_parser.parse_args(raw_arguments)
|
|
107
112
|
|
|
108
113
|
log_level = getattr(cmdline_arguments, "loglevel", None)
|
|
109
114
|
logging_config_file = getattr(cmdline_arguments, "logging_config_file", None)
|
|
110
115
|
configure_logging_and_warnings(
|
|
111
116
|
log_level, logging_config_file, warn_only_once=True, filter_repeated_logs=True
|
|
112
117
|
)
|
|
118
|
+
# TODO: we shouldn't configure colored logging, since we are using structlog
|
|
119
|
+
# for logging - should be removed as part of logs cleanup
|
|
120
|
+
rasa.utils.io.configure_colored_logging(log_level)
|
|
121
|
+
configure_structlog(log_level)
|
|
113
122
|
|
|
114
123
|
tf_env.setup_tf_environment()
|
|
115
124
|
tf_env.check_deterministic_ops()
|
|
@@ -119,8 +128,6 @@ def main() -> None:
|
|
|
119
128
|
|
|
120
129
|
try:
|
|
121
130
|
if hasattr(cmdline_arguments, "func"):
|
|
122
|
-
rasa.utils.io.configure_colored_logging(log_level)
|
|
123
|
-
|
|
124
131
|
is_studio_command = check_if_studio_command()
|
|
125
132
|
|
|
126
133
|
if not is_studio_command:
|
|
@@ -137,23 +144,32 @@ def main() -> None:
|
|
|
137
144
|
plugin_manager().hook.init_anonymization_pipeline(
|
|
138
145
|
endpoints_file=endpoints_file
|
|
139
146
|
)
|
|
140
|
-
# configure structlog
|
|
141
|
-
configure_structlog(log_level)
|
|
142
147
|
|
|
143
148
|
cmdline_arguments.func(cmdline_arguments)
|
|
144
149
|
elif hasattr(cmdline_arguments, "version"):
|
|
145
150
|
print_version()
|
|
146
151
|
else:
|
|
147
152
|
# user has not provided a subcommand, let's print the help
|
|
148
|
-
|
|
153
|
+
structlogger.error("cli.no_command", event_info="No command specified.")
|
|
149
154
|
arg_parser.print_help()
|
|
150
155
|
sys.exit(1)
|
|
151
|
-
except RasaException as
|
|
156
|
+
except RasaException as exc:
|
|
152
157
|
# these are exceptions we expect to happen (e.g. invalid training data format)
|
|
153
158
|
# it doesn't make sense to print a stacktrace for these if we are not in
|
|
154
159
|
# debug mode
|
|
155
|
-
|
|
156
|
-
|
|
160
|
+
structlogger.debug(
|
|
161
|
+
"cli.exception.details",
|
|
162
|
+
event_info="Failed to run CLI command due to an exception.",
|
|
163
|
+
exc_info=exc,
|
|
164
|
+
)
|
|
165
|
+
structlogger.error("cli.exception.rasa_exception", event_info=f"{exc}")
|
|
166
|
+
sys.exit(1)
|
|
167
|
+
except Exception as exc:
|
|
168
|
+
structlogger.error(
|
|
169
|
+
"cli.exception.general_exception",
|
|
170
|
+
event_info=f"{exc.__class__.__name__}: {exc}",
|
|
171
|
+
exc_info=exc,
|
|
172
|
+
)
|
|
157
173
|
sys.exit(1)
|
|
158
174
|
|
|
159
175
|
|
rasa/api.py
CHANGED
|
@@ -2,7 +2,7 @@ import asyncio
|
|
|
2
2
|
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Text, Union
|
|
3
3
|
|
|
4
4
|
import rasa.shared.constants
|
|
5
|
-
from rasa.
|
|
5
|
+
from rasa.core.persistor import StorageType
|
|
6
6
|
|
|
7
7
|
# WARNING: Be careful about adding any top level imports at this place!
|
|
8
8
|
# These functions are imported in `rasa.__init__` and any top level import
|
|
@@ -14,6 +14,7 @@ from rasa.nlu.persistor import StorageType
|
|
|
14
14
|
|
|
15
15
|
if TYPE_CHECKING:
|
|
16
16
|
from rasa.model_training import TrainingResult
|
|
17
|
+
from rasa.shared.importers.importer import TrainingDataImporter
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
def run(
|
|
@@ -78,6 +79,8 @@ def train(
|
|
|
78
79
|
model_to_finetune: Optional[Text] = None,
|
|
79
80
|
finetuning_epoch_fraction: float = 1.0,
|
|
80
81
|
remote_storage: Optional[StorageType] = None,
|
|
82
|
+
file_importer: Optional["TrainingDataImporter"] = None,
|
|
83
|
+
keep_local_model_copy: bool = False,
|
|
81
84
|
) -> "TrainingResult":
|
|
82
85
|
"""Runs Rasa Core and NLU training in `async` loop.
|
|
83
86
|
|
|
@@ -99,7 +102,12 @@ def train(
|
|
|
99
102
|
a directory in case the latest trained model should be used.
|
|
100
103
|
finetuning_epoch_fraction: The fraction currently specified training epochs
|
|
101
104
|
in the model configuration which should be used for finetuning.
|
|
102
|
-
remote_storage:
|
|
105
|
+
remote_storage: Optional name of the remote storage to
|
|
106
|
+
use for storing the model.
|
|
107
|
+
file_importer: Instance of `TrainingDataImporter` to use for training.
|
|
108
|
+
If it is not provided, a new instance will be created.
|
|
109
|
+
keep_local_model_copy: If `True` the model will be stored locally even if
|
|
110
|
+
remote storage is configured.
|
|
103
111
|
|
|
104
112
|
Returns:
|
|
105
113
|
An instance of `TrainingResult`.
|
|
@@ -121,6 +129,8 @@ def train(
|
|
|
121
129
|
model_to_finetune=model_to_finetune,
|
|
122
130
|
finetuning_epoch_fraction=finetuning_epoch_fraction,
|
|
123
131
|
remote_storage=remote_storage,
|
|
132
|
+
file_importer=file_importer,
|
|
133
|
+
keep_local_model_copy=keep_local_model_copy,
|
|
124
134
|
)
|
|
125
135
|
)
|
|
126
136
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import argparse
|
|
2
2
|
import logging
|
|
3
|
-
from
|
|
3
|
+
from enum import Enum
|
|
4
|
+
from typing import List, Optional, Text, Union
|
|
4
5
|
|
|
5
|
-
from rasa.
|
|
6
|
+
from rasa.core.persistor import RemoteStorageType, StorageType, parse_remote_storage
|
|
6
7
|
from rasa.shared.constants import (
|
|
7
8
|
DEFAULT_CONFIG_PATH,
|
|
8
9
|
DEFAULT_DATA_PATH,
|
|
9
|
-
DEFAULT_DOMAIN_PATH,
|
|
10
10
|
DEFAULT_ENDPOINTS_PATH,
|
|
11
11
|
DEFAULT_MODELS_PATH,
|
|
12
12
|
)
|
|
@@ -52,7 +52,7 @@ def add_nlu_data_param(
|
|
|
52
52
|
|
|
53
53
|
def add_domain_param(
|
|
54
54
|
parser: Union[argparse.ArgumentParser, argparse._ActionsContainer],
|
|
55
|
-
default: Optional[Text] =
|
|
55
|
+
default: Optional[Text] = None,
|
|
56
56
|
) -> None:
|
|
57
57
|
parser.add_argument(
|
|
58
58
|
"-d",
|
|
@@ -185,3 +185,23 @@ def parse_remote_storage_arg(value: str) -> StorageType:
|
|
|
185
185
|
return parse_remote_storage(value)
|
|
186
186
|
except ValueError as e:
|
|
187
187
|
raise argparse.ArgumentTypeError(str(e))
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
class SkipYamlValidation(Enum):
|
|
191
|
+
DOMAIN = "domain"
|
|
192
|
+
|
|
193
|
+
@classmethod
|
|
194
|
+
def list(cls) -> List[str]:
|
|
195
|
+
return [e.value for e in SkipYamlValidation]
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
def add_skip_validation_flag(
|
|
199
|
+
parser: Union[argparse.ArgumentParser, argparse._ActionsContainer],
|
|
200
|
+
) -> None:
|
|
201
|
+
parser.add_argument(
|
|
202
|
+
"--skip-yaml-validation",
|
|
203
|
+
default=[],
|
|
204
|
+
choices=SkipYamlValidation.list(),
|
|
205
|
+
action="append",
|
|
206
|
+
help="Skip YAML validation for selected parts of the training data.",
|
|
207
|
+
)
|
rasa/cli/arguments/run.py
CHANGED
|
@@ -5,6 +5,7 @@ from typing import Union
|
|
|
5
5
|
from rasa.cli.arguments.default_arguments import (
|
|
6
6
|
add_endpoint_param,
|
|
7
7
|
add_model_param,
|
|
8
|
+
add_skip_validation_flag,
|
|
8
9
|
add_remote_storage_param,
|
|
9
10
|
)
|
|
10
11
|
from rasa.core import constants
|
|
@@ -21,6 +22,8 @@ def set_run_arguments(parser: argparse.ArgumentParser) -> None:
|
|
|
21
22
|
"""Arguments for running Rasa directly using `rasa run`."""
|
|
22
23
|
add_model_param(parser)
|
|
23
24
|
add_server_arguments(parser)
|
|
25
|
+
add_inspect_argument(parser)
|
|
26
|
+
add_skip_validation_flag(parser)
|
|
24
27
|
|
|
25
28
|
|
|
26
29
|
def set_run_action_arguments(parser: argparse.ArgumentParser) -> None:
|
|
@@ -57,6 +60,18 @@ def add_port_argument(
|
|
|
57
60
|
)
|
|
58
61
|
|
|
59
62
|
|
|
63
|
+
# noinspection PyProtectedMember
|
|
64
|
+
def add_inspect_argument(
|
|
65
|
+
parser: Union[argparse.ArgumentParser, argparse._ArgumentGroup],
|
|
66
|
+
) -> None:
|
|
67
|
+
"""Add an argument for port."""
|
|
68
|
+
parser.add_argument(
|
|
69
|
+
"--inspect",
|
|
70
|
+
action="store_true",
|
|
71
|
+
help="Run development inspector alongside the assistant.",
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
|
|
60
75
|
def add_server_arguments(parser: argparse.ArgumentParser) -> None:
|
|
61
76
|
"""Add arguments for running API endpoint."""
|
|
62
77
|
parser.add_argument(
|
rasa/cli/arguments/shell.py
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import argparse
|
|
2
2
|
|
|
3
|
-
from rasa.cli.arguments.default_arguments import
|
|
3
|
+
from rasa.cli.arguments.default_arguments import (
|
|
4
|
+
add_model_param,
|
|
5
|
+
add_skip_validation_flag,
|
|
6
|
+
)
|
|
4
7
|
from rasa.cli.arguments.run import add_server_arguments
|
|
5
8
|
|
|
6
9
|
|
|
7
10
|
def set_shell_arguments(parser: argparse.ArgumentParser) -> None:
|
|
8
11
|
add_model_param(parser)
|
|
9
12
|
add_server_arguments(parser)
|
|
13
|
+
add_skip_validation_flag(parser)
|
|
10
14
|
|
|
11
15
|
|
|
12
16
|
def set_shell_nlu_arguments(parser: argparse.ArgumentParser) -> None:
|
rasa/cli/arguments/train.py
CHANGED
|
@@ -3,12 +3,12 @@ from typing import Union
|
|
|
3
3
|
|
|
4
4
|
from rasa.cli.arguments.default_arguments import (
|
|
5
5
|
add_config_param,
|
|
6
|
-
|
|
7
|
-
add_endpoint_param,
|
|
6
|
+
add_stories_param,
|
|
8
7
|
add_nlu_data_param,
|
|
9
8
|
add_out_param,
|
|
9
|
+
add_domain_param,
|
|
10
|
+
add_endpoint_param,
|
|
10
11
|
add_remote_storage_param,
|
|
11
|
-
add_stories_param,
|
|
12
12
|
)
|
|
13
13
|
from rasa.graph_components.providers.training_tracker_provider import (
|
|
14
14
|
TrainingTrackerProvider,
|
|
@@ -34,18 +34,13 @@ def set_train_arguments(parser: argparse.ArgumentParser) -> None:
|
|
|
34
34
|
|
|
35
35
|
_add_model_name_param(parser)
|
|
36
36
|
add_persist_nlu_data_param(parser)
|
|
37
|
+
add_keep_local_model_copy_param(parser)
|
|
37
38
|
add_force_param(parser)
|
|
38
39
|
add_finetune_params(parser)
|
|
39
40
|
add_endpoint_param(
|
|
40
41
|
parser, help_text="Configuration file for the connectors as a yml file."
|
|
41
42
|
)
|
|
42
43
|
add_remote_storage_param(parser)
|
|
43
|
-
parser.add_argument(
|
|
44
|
-
"--remote-bot-config-path",
|
|
45
|
-
help="Path to the bot configuration file in the remote storage.",
|
|
46
|
-
required=False,
|
|
47
|
-
type=str,
|
|
48
|
-
)
|
|
49
44
|
|
|
50
45
|
|
|
51
46
|
def set_train_core_arguments(parser: argparse.ArgumentParser) -> None:
|
|
@@ -247,6 +242,19 @@ def add_persist_nlu_data_param(
|
|
|
247
242
|
)
|
|
248
243
|
|
|
249
244
|
|
|
245
|
+
def add_keep_local_model_copy_param(
|
|
246
|
+
parser: Union[argparse.ArgumentParser, argparse._ActionsContainer],
|
|
247
|
+
) -> None:
|
|
248
|
+
"""Adds parameters for keeping a local copy of the model."""
|
|
249
|
+
parser.add_argument(
|
|
250
|
+
"--keep-local-model-copy",
|
|
251
|
+
action="store_true",
|
|
252
|
+
help="Keep a copy of the model in the model directory if remote "
|
|
253
|
+
"model upload is configured. Defaults to `false`, which "
|
|
254
|
+
"deletes the local copy of the model after upload.",
|
|
255
|
+
)
|
|
256
|
+
|
|
257
|
+
|
|
250
258
|
def add_finetune_params(
|
|
251
259
|
parser: Union[argparse.ArgumentParser, argparse._ActionsContainer],
|
|
252
260
|
) -> None:
|
rasa/cli/evaluate.py
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import argparse
|
|
2
|
-
from typing import List, Text, Optional
|
|
3
2
|
from pathlib import Path
|
|
3
|
+
from typing import List, Text, Optional
|
|
4
4
|
|
|
5
|
+
import rasa.cli.arguments.evaluate as arguments
|
|
6
|
+
import rasa.shared.utils.cli
|
|
5
7
|
from rasa import telemetry
|
|
6
|
-
from rasa.
|
|
7
|
-
from rasa.core.tracker_store import TrackerStore
|
|
8
|
-
from rasa.core.evaluation.marker_tracker_loader import MarkerTrackerLoader
|
|
8
|
+
from rasa.cli import SubParsersAction
|
|
9
9
|
from rasa.core.evaluation.marker_base import Marker, OperatorMarker
|
|
10
|
+
from rasa.core.evaluation.marker_tracker_loader import MarkerTrackerLoader
|
|
11
|
+
from rasa.core.tracker_store import TrackerStore
|
|
12
|
+
from rasa.core.utils import AvailableEndpoints
|
|
10
13
|
from rasa.shared.core.domain import Domain
|
|
11
|
-
from rasa.cli import SubParsersAction
|
|
12
|
-
import rasa.cli.arguments.evaluate as arguments
|
|
13
|
-
import rasa.shared.utils.cli
|
|
14
14
|
|
|
15
15
|
STATS_OVERALL_SUFFIX = "-overall.csv"
|
|
16
16
|
STATS_SESSION_SUFFIX = "-per-session.csv"
|
rasa/cli/inspect.py
CHANGED
|
@@ -3,11 +3,12 @@ import webbrowser
|
|
|
3
3
|
from asyncio import AbstractEventLoop
|
|
4
4
|
from typing import List, Text
|
|
5
5
|
|
|
6
|
+
from sanic import Sanic
|
|
7
|
+
|
|
8
|
+
from rasa import telemetry
|
|
6
9
|
from rasa.cli import SubParsersAction
|
|
7
10
|
from rasa.cli.arguments import shell as arguments
|
|
8
11
|
from rasa.core import constants
|
|
9
|
-
from sanic import Sanic
|
|
10
|
-
|
|
11
12
|
from rasa.utils.cli import remove_argument_from_parser
|
|
12
13
|
|
|
13
14
|
|
|
@@ -31,8 +32,13 @@ def add_subparser(
|
|
|
31
32
|
),
|
|
32
33
|
)
|
|
33
34
|
inspect_parser.set_defaults(func=inspect)
|
|
34
|
-
|
|
35
35
|
arguments.set_shell_arguments(inspect_parser)
|
|
36
|
+
|
|
37
|
+
# additional argument for voice
|
|
38
|
+
inspect_parser.add_argument(
|
|
39
|
+
"--voice", help="Enable voice", action="store_true", default=False
|
|
40
|
+
)
|
|
41
|
+
|
|
36
42
|
# it'd be confusing to expose those arguments to the user,
|
|
37
43
|
# so we remove them
|
|
38
44
|
remove_argument_from_parser(inspect_parser, "--credentials")
|
|
@@ -40,9 +46,10 @@ def add_subparser(
|
|
|
40
46
|
remove_argument_from_parser(inspect_parser, "--enable-api")
|
|
41
47
|
|
|
42
48
|
|
|
43
|
-
async def open_inspector_in_browser(server_url: Text) -> None:
|
|
49
|
+
async def open_inspector_in_browser(server_url: Text, voice: bool = False) -> None:
|
|
44
50
|
"""Opens the rasa inspector in the default browser."""
|
|
45
|
-
|
|
51
|
+
channel = "socketio" if not voice else "browser_audio"
|
|
52
|
+
webbrowser.open(f"{server_url}/webhooks/{channel}/inspect.html")
|
|
46
53
|
|
|
47
54
|
|
|
48
55
|
def inspect(args: argparse.Namespace) -> None:
|
|
@@ -52,12 +59,17 @@ def inspect(args: argparse.Namespace) -> None:
|
|
|
52
59
|
async def after_start_hook_open_inspector(_: Sanic, __: AbstractEventLoop) -> None:
|
|
53
60
|
"""Hook to open the browser on server start."""
|
|
54
61
|
server_url = constants.DEFAULT_SERVER_FORMAT.format("http", args.port)
|
|
55
|
-
await open_inspector_in_browser(server_url)
|
|
62
|
+
await open_inspector_in_browser(server_url, args.voice)
|
|
56
63
|
|
|
57
64
|
# the following arguments are not exposed to the user
|
|
58
|
-
args.
|
|
65
|
+
if args.voice:
|
|
66
|
+
args.connector = "browser_audio"
|
|
67
|
+
else:
|
|
68
|
+
args.connector = "rasa.core.channels.socketio.SocketIOInput"
|
|
59
69
|
args.enable_api = True
|
|
70
|
+
args.inspect = True
|
|
60
71
|
args.credentials = None
|
|
61
72
|
args.server_listeners = [(after_start_hook_open_inspector, "after_server_start")]
|
|
62
73
|
|
|
74
|
+
telemetry.track_inspect_started(args.connector)
|
|
63
75
|
rasa.cli.run.run(args)
|
rasa/cli/interactive.py
CHANGED
|
@@ -109,6 +109,7 @@ def _set_not_required_args(args: argparse.Namespace) -> None:
|
|
|
109
109
|
args.fail_on_validation_warnings = False
|
|
110
110
|
args.validation_max_history = None
|
|
111
111
|
args.remote_storage = None
|
|
112
|
+
args.keep_local_model_copy = False
|
|
112
113
|
|
|
113
114
|
|
|
114
115
|
def perform_interactive_learning(
|
rasa/cli/llm_fine_tuning.py
CHANGED
|
@@ -22,7 +22,6 @@ from rasa.cli.e2e_test import (
|
|
|
22
22
|
)
|
|
23
23
|
from rasa.core.exceptions import AgentNotReady
|
|
24
24
|
from rasa.core.utils import AvailableEndpoints
|
|
25
|
-
from rasa.dialogue_understanding.generator import SingleStepLLMCommandGenerator
|
|
26
25
|
from rasa.e2e_test.e2e_test_runner import E2ETestRunner
|
|
27
26
|
from rasa.llm_fine_tuning.annotation_module import annotate_e2e_tests
|
|
28
27
|
from rasa.llm_fine_tuning.llm_data_preparation_module import convert_to_fine_tuning_data
|
|
@@ -45,9 +44,6 @@ from rasa.shared.constants import (
|
|
|
45
44
|
DEFAULT_MODELS_PATH,
|
|
46
45
|
LLM_CONFIG_KEY,
|
|
47
46
|
)
|
|
48
|
-
from rasa.shared.utils.llm import (
|
|
49
|
-
combine_custom_and_default_config,
|
|
50
|
-
)
|
|
51
47
|
from rasa.shared.utils.yaml import read_config_file
|
|
52
48
|
from rasa.utils.beta import ensure_beta_feature_is_enabled
|
|
53
49
|
|
|
@@ -279,19 +275,20 @@ def _get_llm_command_generator_config(e2e_test_runner: E2ETestRunner) -> Dict[st
|
|
|
279
275
|
|
|
280
276
|
train_schema = e2e_test_runner.agent.processor.model_metadata.train_schema # type: ignore
|
|
281
277
|
|
|
282
|
-
for
|
|
283
|
-
if
|
|
284
|
-
return
|
|
285
|
-
|
|
286
|
-
|
|
278
|
+
for node in train_schema.nodes:
|
|
279
|
+
if "SingleStepLLMCommandGenerator" in node:
|
|
280
|
+
return {
|
|
281
|
+
**DEFAULT_LLM_CONFIG,
|
|
282
|
+
**train_schema.nodes[node].config.get(LLM_CONFIG_KEY),
|
|
283
|
+
}
|
|
287
284
|
|
|
288
285
|
rasa.shared.utils.cli.print_error(
|
|
289
|
-
"The provided model
|
|
290
|
-
"
|
|
291
|
-
"
|
|
292
|
-
"
|
|
286
|
+
"The provided model was not trained with the 'SingleStepLLMCommandGenerator'."
|
|
287
|
+
"Without the 'SingleStepLLMCommandGenerator' no data for fine-tuning can be "
|
|
288
|
+
"created. Please add the 'SingleStepLLMCommandGenerator' to your config and"
|
|
289
|
+
"train your model."
|
|
293
290
|
)
|
|
294
|
-
sys.exit(
|
|
291
|
+
sys.exit(0)
|
|
295
292
|
|
|
296
293
|
|
|
297
294
|
def log_start_of_module(module_name: str) -> None:
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
recipe: default.v1
|
|
2
2
|
language: en
|
|
3
3
|
pipeline:
|
|
4
|
-
- name: SingleStepLLMCommandGenerator
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
request_timeout: 7
|
|
8
|
-
max_tokens: 256
|
|
4
|
+
- name: SingleStepLLMCommandGenerator
|
|
5
|
+
llm:
|
|
6
|
+
model_group: openai-gpt-4
|
|
9
7
|
|
|
10
8
|
policies:
|
|
11
|
-
- name: FlowPolicy
|
|
12
|
-
- name: IntentlessPolicy
|
|
9
|
+
- name: FlowPolicy
|
|
10
|
+
- name: IntentlessPolicy
|
|
@@ -41,5 +41,18 @@ action_endpoint:
|
|
|
41
41
|
# password: password
|
|
42
42
|
# queue: queue
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
# The lines below activate contextual rephrasing, using the default OpenAI language model.
|
|
45
|
+
# Ensure the OPENAI_API_KEY is set to prevent any missing API key errors.
|
|
46
|
+
# For more details, refer to the documentation:
|
|
47
|
+
# https://rasa.com/docs/rasa-pro/concepts/contextual-response-rephraser
|
|
48
|
+
# To enable the rephraser, remove the comment symbols in the lines below.
|
|
49
|
+
#nlg:
|
|
50
|
+
# type: rephrase
|
|
51
|
+
|
|
52
|
+
model_groups:
|
|
53
|
+
- id: openai-gpt-4
|
|
54
|
+
models:
|
|
55
|
+
- provider: openai
|
|
56
|
+
model: openai/gpt-4
|
|
57
|
+
request_timeout: 7
|
|
58
|
+
max_tokens: 256
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
recipe: default.v1
|
|
2
2
|
language: en
|
|
3
3
|
pipeline:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
- name: SingleStepLLMCommandGenerator
|
|
5
|
+
llm:
|
|
6
|
+
provider: rasa
|
|
7
|
+
model: rasa/cmd_gen_codellama_13b_calm_demo
|
|
8
|
+
api_base: "https://tutorial-llm.rasa.ai"
|
|
9
|
+
flow_retrieval:
|
|
10
|
+
active: false
|
|
7
11
|
|
|
8
12
|
policies:
|
|
9
13
|
- name: FlowPolicy
|
|
10
|
-
# - name: EnterpriseSearchPolicy
|
|
11
|
-
# - name: RulePolicy
|
|
14
|
+
# - name: EnterpriseSearchPolicy
|
|
@@ -19,3 +19,17 @@ responses:
|
|
|
19
19
|
|
|
20
20
|
utter_transfer_complete:
|
|
21
21
|
- text: "All done. {amount} has been sent to {recipient}."
|
|
22
|
+
|
|
23
|
+
utter_free_chitchat_response:
|
|
24
|
+
- text: "placeholder"
|
|
25
|
+
metadata:
|
|
26
|
+
rephrase: True
|
|
27
|
+
rephrase_prompt: |
|
|
28
|
+
The following is a conversation with an AI assistant built with Rasa.
|
|
29
|
+
The assistant can help the user transfer money.
|
|
30
|
+
The assistant is helpful, creative, clever, and very friendly.
|
|
31
|
+
The user is making small talk, and the assistant should respond, keeping things light.
|
|
32
|
+
Context / previous conversation with the user:
|
|
33
|
+
{{history}}
|
|
34
|
+
{{current_input}}
|
|
35
|
+
Suggested AI Response:
|
|
@@ -41,5 +41,10 @@ action_endpoint:
|
|
|
41
41
|
# password: password
|
|
42
42
|
# queue: queue
|
|
43
43
|
|
|
44
|
+
# Allow rephrasing of responses using a Rasa-hosted model
|
|
44
45
|
nlg:
|
|
45
46
|
type: rephrase
|
|
47
|
+
llm:
|
|
48
|
+
provider: rasa
|
|
49
|
+
model: rasa/cmd_gen_codellama_13b_calm_demo
|
|
50
|
+
api_base: "https://tutorial-llm.rasa.ai"
|
rasa/cli/run.py
CHANGED
|
@@ -6,6 +6,7 @@ from typing import List, Text
|
|
|
6
6
|
from rasa.api import run as rasa_run
|
|
7
7
|
from rasa.cli import SubParsersAction
|
|
8
8
|
from rasa.cli.arguments import run as arguments
|
|
9
|
+
from rasa.cli.arguments.default_arguments import SkipYamlValidation
|
|
9
10
|
from rasa.cli.utils import get_validated_path
|
|
10
11
|
from rasa.exceptions import ModelNotFound
|
|
11
12
|
from rasa.shared.constants import (
|
|
@@ -15,6 +16,7 @@ from rasa.shared.constants import (
|
|
|
15
16
|
DEFAULT_MODELS_PATH,
|
|
16
17
|
DOCS_BASE_URL,
|
|
17
18
|
)
|
|
19
|
+
from rasa.shared.core.domain import Domain
|
|
18
20
|
from rasa.shared.utils.cli import print_error
|
|
19
21
|
|
|
20
22
|
logger = logging.getLogger(__name__)
|
|
@@ -87,6 +89,11 @@ def run(args: argparse.Namespace) -> None:
|
|
|
87
89
|
args.credentials, "credentials", DEFAULT_CREDENTIALS_PATH, True
|
|
88
90
|
)
|
|
89
91
|
|
|
92
|
+
if SkipYamlValidation.DOMAIN.value in args.skip_yaml_validation:
|
|
93
|
+
Domain.validate_yaml = False
|
|
94
|
+
else:
|
|
95
|
+
Domain.validate_yaml = True
|
|
96
|
+
|
|
90
97
|
if args.enable_api:
|
|
91
98
|
if not args.remote_storage:
|
|
92
99
|
args.model = _validate_model_path(args.model, "model", DEFAULT_MODELS_PATH)
|
rasa/cli/scaffold.py
CHANGED
|
@@ -128,20 +128,22 @@ def print_run_or_instructions(args: argparse.Namespace) -> None:
|
|
|
128
128
|
setattr(args, a, None)
|
|
129
129
|
|
|
130
130
|
args.port = constants.DEFAULT_SERVER_PORT
|
|
131
|
+
args.voice = False
|
|
132
|
+
args.skip_yaml_validation = ["domain"]
|
|
131
133
|
|
|
132
134
|
inspect(args)
|
|
133
135
|
else:
|
|
134
136
|
if args.no_prompt:
|
|
135
137
|
print(
|
|
136
138
|
"If you want to speak to the assistant, "
|
|
137
|
-
"run 'rasa
|
|
139
|
+
"run 'rasa inspect' at any time inside "
|
|
138
140
|
"the project directory."
|
|
139
141
|
)
|
|
140
142
|
else:
|
|
141
143
|
print_success(
|
|
142
144
|
"Ok 👍🏼. "
|
|
143
145
|
"If you want to speak to the assistant, "
|
|
144
|
-
"run 'rasa
|
|
146
|
+
"run 'rasa inspect' at any time inside "
|
|
145
147
|
"the project directory."
|
|
146
148
|
)
|
|
147
149
|
|
rasa/cli/studio/upload.py
CHANGED
|
@@ -32,25 +32,10 @@ def add_subparser(
|
|
|
32
32
|
set_upload_arguments(upload_parser)
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
def add_flows_param(
|
|
36
|
-
parser: argparse.ArgumentParser,
|
|
37
|
-
help_text: str = "Name of flows file to upload to Rasa Studio. Works with --calm",
|
|
38
|
-
default_path: str = "flows.yml",
|
|
39
|
-
) -> None:
|
|
40
|
-
parser.add_argument(
|
|
41
|
-
"--flows",
|
|
42
|
-
default=default_path,
|
|
43
|
-
nargs="+",
|
|
44
|
-
type=str,
|
|
45
|
-
help=help_text,
|
|
46
|
-
)
|
|
47
|
-
|
|
48
|
-
|
|
49
35
|
def set_upload_arguments(parser: argparse.ArgumentParser) -> None:
|
|
50
36
|
"""Add arguments for running `rasa upload`."""
|
|
51
37
|
add_data_param(parser, data_type="training")
|
|
52
38
|
add_domain_param(parser)
|
|
53
|
-
add_flows_param(parser)
|
|
54
39
|
add_config_param(parser)
|
|
55
40
|
add_endpoint_param(parser, help_text="Path to the endpoints file.")
|
|
56
41
|
|