rasa-pro 3.8.17__py3-none-any.whl → 3.9.14__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of rasa-pro might be problematic. Click here for more details.
- README.md +5 -5
- rasa/__main__.py +14 -9
- rasa/anonymization/anonymization_pipeline.py +0 -1
- rasa/anonymization/anonymization_rule_executor.py +3 -3
- rasa/anonymization/utils.py +4 -3
- rasa/api.py +2 -2
- rasa/cli/arguments/default_arguments.py +1 -1
- rasa/cli/arguments/run.py +2 -2
- rasa/cli/arguments/test.py +1 -1
- rasa/cli/arguments/train.py +10 -10
- rasa/cli/e2e_test.py +27 -7
- rasa/cli/export.py +0 -1
- rasa/cli/license.py +3 -3
- rasa/cli/project_templates/calm/actions/action_template.py +1 -1
- rasa/cli/project_templates/calm/config.yml +1 -1
- rasa/cli/project_templates/calm/credentials.yml +1 -1
- rasa/cli/project_templates/calm/data/flows/add_contact.yml +1 -1
- rasa/cli/project_templates/calm/data/flows/remove_contact.yml +1 -1
- rasa/cli/project_templates/calm/domain/add_contact.yml +8 -2
- rasa/cli/project_templates/calm/domain/list_contacts.yml +3 -0
- rasa/cli/project_templates/calm/domain/remove_contact.yml +9 -2
- rasa/cli/project_templates/calm/domain/shared.yml +5 -0
- rasa/cli/project_templates/calm/endpoints.yml +4 -4
- rasa/cli/project_templates/default/actions/actions.py +1 -1
- rasa/cli/project_templates/default/config.yml +5 -5
- rasa/cli/project_templates/default/credentials.yml +1 -1
- rasa/cli/project_templates/default/endpoints.yml +4 -4
- rasa/cli/project_templates/default/tests/test_stories.yml +1 -1
- rasa/cli/project_templates/tutorial/config.yml +1 -1
- rasa/cli/project_templates/tutorial/credentials.yml +1 -1
- rasa/cli/project_templates/tutorial/data/patterns.yml +6 -0
- rasa/cli/project_templates/tutorial/domain.yml +4 -0
- rasa/cli/project_templates/tutorial/endpoints.yml +6 -6
- rasa/cli/run.py +0 -1
- rasa/cli/scaffold.py +3 -2
- rasa/cli/studio/download.py +11 -0
- rasa/cli/studio/studio.py +180 -24
- rasa/cli/studio/upload.py +0 -8
- rasa/cli/telemetry.py +18 -6
- rasa/cli/utils.py +21 -10
- rasa/cli/x.py +3 -2
- rasa/core/actions/action.py +90 -315
- rasa/core/actions/action_exceptions.py +24 -0
- rasa/core/actions/constants.py +3 -0
- rasa/core/actions/custom_action_executor.py +188 -0
- rasa/core/actions/forms.py +11 -7
- rasa/core/actions/grpc_custom_action_executor.py +251 -0
- rasa/core/actions/http_custom_action_executor.py +140 -0
- rasa/core/actions/loops.py +3 -0
- rasa/core/actions/two_stage_fallback.py +1 -1
- rasa/core/agent.py +2 -4
- rasa/core/brokers/pika.py +1 -2
- rasa/core/channels/audiocodes.py +1 -1
- rasa/core/channels/botframework.py +0 -1
- rasa/core/channels/callback.py +0 -1
- rasa/core/channels/console.py +6 -8
- rasa/core/channels/development_inspector.py +1 -1
- rasa/core/channels/facebook.py +0 -3
- rasa/core/channels/hangouts.py +0 -6
- rasa/core/channels/inspector/dist/assets/{arc-5623b6dc.js → arc-b6e548fe.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{c4Diagram-d0fbc5ce-685c106a.js → c4Diagram-d0fbc5ce-fa03ac9e.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{classDiagram-936ed81e-8cbed007.js → classDiagram-936ed81e-ee67392a.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{classDiagram-v2-c3cb15f1-5889cf12.js → classDiagram-v2-c3cb15f1-9b283fae.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{createText-62fc7601-24c249d7.js → createText-62fc7601-8b6fcc2a.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{edges-f2ad444c-7dd06a75.js → edges-f2ad444c-22e77f4f.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{erDiagram-9d236eb7-62c1e54c.js → erDiagram-9d236eb7-60ffc87f.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{flowDb-1972c806-ce49b86f.js → flowDb-1972c806-9dd802e4.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{flowDiagram-7ea5b25a-4067e48f.js → flowDiagram-7ea5b25a-5fa1912f.js} +1 -1
- rasa/core/channels/inspector/dist/assets/flowDiagram-v2-855bc5b3-1844e5a5.js +1 -0
- rasa/core/channels/inspector/dist/assets/{flowchart-elk-definition-abe16c3d-59fe4051.js → flowchart-elk-definition-abe16c3d-622a1fd2.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{ganttDiagram-9b5ea136-47e3a43b.js → ganttDiagram-9b5ea136-e285a63a.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{gitGraphDiagram-99d0ae7c-5a2ac0d9.js → gitGraphDiagram-99d0ae7c-f237bdca.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{index-2c4b9a3b-dfb8efc4.js → index-2c4b9a3b-4b03d70e.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{index-268a75c0.js → index-a5d3e69d.js} +4 -4
- rasa/core/channels/inspector/dist/assets/{infoDiagram-736b4530-b0c470f2.js → infoDiagram-736b4530-72a0fa5f.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{journeyDiagram-df861f2b-2edb829a.js → journeyDiagram-df861f2b-82218c41.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{layout-b6873d69.js → layout-78cff630.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{line-1efc5781.js → line-5038b469.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{linear-661e9b94.js → linear-c4fc4098.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{mindmap-definition-beec6740-2d2e727f.js → mindmap-definition-beec6740-c33c8ea6.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{pieDiagram-dbbf0591-9d3ea93d.js → pieDiagram-dbbf0591-a8d03059.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{quadrantDiagram-4d7f4fd6-06a178a2.js → quadrantDiagram-4d7f4fd6-6a0e56b2.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{requirementDiagram-6fc4c22a-0bfedffc.js → requirementDiagram-6fc4c22a-2dc7c7bd.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{sankeyDiagram-8f13d901-d76d0a04.js → sankeyDiagram-8f13d901-2360fe39.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{sequenceDiagram-b655622a-37bb4341.js → sequenceDiagram-b655622a-41b9f9ad.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{stateDiagram-59f0c015-f52f7f57.js → stateDiagram-59f0c015-0aad326f.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{stateDiagram-v2-2b26beab-4a986a20.js → stateDiagram-v2-2b26beab-9847d984.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-080da4f6-7dd9ae12.js → styles-080da4f6-564d890e.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-3dcbcfbf-46e1ca14.js → styles-3dcbcfbf-38957613.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-9c745c82-4a97439a.js → styles-9c745c82-f0fc6921.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{svgDrawCommon-4835440b-823917a3.js → svgDrawCommon-4835440b-ef3c5a77.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{timeline-definition-5b62e21b-9ea72896.js → timeline-definition-5b62e21b-bf3e91c1.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{xychartDiagram-2b33534f-b631a8b6.js → xychartDiagram-2b33534f-4d4026c0.js} +1 -1
- rasa/core/channels/inspector/dist/index.html +1 -1
- rasa/core/channels/inspector/src/components/DiagramFlow.tsx +10 -0
- rasa/core/channels/inspector/src/helpers/formatters.test.ts +4 -7
- rasa/core/channels/inspector/src/helpers/formatters.ts +3 -2
- rasa/core/channels/rest.py +36 -21
- rasa/core/channels/rocketchat.py +0 -1
- rasa/core/channels/socketio.py +1 -1
- rasa/core/channels/telegram.py +3 -3
- rasa/core/channels/webexteams.py +0 -1
- rasa/core/concurrent_lock_store.py +1 -1
- rasa/core/evaluation/marker_base.py +1 -3
- rasa/core/evaluation/marker_stats.py +1 -2
- rasa/core/featurizers/single_state_featurizer.py +2 -4
- rasa/core/featurizers/tracker_featurizers.py +0 -7
- rasa/core/information_retrieval/__init__.py +7 -0
- rasa/core/information_retrieval/faiss.py +9 -4
- rasa/core/information_retrieval/information_retrieval.py +64 -7
- rasa/core/information_retrieval/milvus.py +7 -14
- rasa/core/information_retrieval/qdrant.py +8 -15
- rasa/core/lock_store.py +0 -1
- rasa/core/migrate.py +1 -2
- rasa/core/nlg/callback.py +3 -4
- rasa/core/policies/enterprise_search_policy.py +86 -22
- rasa/core/policies/enterprise_search_prompt_template.jinja2 +4 -41
- rasa/core/policies/enterprise_search_prompt_with_citation_template.jinja2 +60 -0
- rasa/core/policies/flows/flow_executor.py +104 -2
- rasa/core/policies/intentless_policy.py +7 -9
- rasa/core/policies/memoization.py +3 -3
- rasa/core/policies/policy.py +18 -9
- rasa/core/policies/rule_policy.py +8 -11
- rasa/core/policies/ted_policy.py +28 -30
- rasa/core/policies/unexpected_intent_policy.py +1 -2
- rasa/core/processor.py +136 -47
- rasa/core/run.py +41 -25
- rasa/core/secrets_manager/endpoints.py +2 -2
- rasa/core/secrets_manager/vault.py +6 -8
- rasa/core/test.py +3 -5
- rasa/core/tracker_store.py +49 -14
- rasa/core/train.py +1 -3
- rasa/core/training/interactive.py +9 -6
- rasa/core/utils.py +5 -10
- rasa/dialogue_understanding/coexistence/intent_based_router.py +11 -4
- rasa/dialogue_understanding/coexistence/llm_based_router.py +2 -3
- rasa/dialogue_understanding/commands/__init__.py +4 -0
- rasa/dialogue_understanding/commands/can_not_handle_command.py +9 -0
- rasa/dialogue_understanding/commands/cancel_flow_command.py +9 -0
- rasa/dialogue_understanding/commands/change_flow_command.py +38 -0
- rasa/dialogue_understanding/commands/chit_chat_answer_command.py +9 -0
- rasa/dialogue_understanding/commands/clarify_command.py +9 -0
- rasa/dialogue_understanding/commands/correct_slots_command.py +9 -0
- rasa/dialogue_understanding/commands/error_command.py +12 -0
- rasa/dialogue_understanding/commands/handle_code_change_command.py +9 -0
- rasa/dialogue_understanding/commands/human_handoff_command.py +9 -0
- rasa/dialogue_understanding/commands/knowledge_answer_command.py +9 -0
- rasa/dialogue_understanding/commands/noop_command.py +9 -0
- rasa/dialogue_understanding/commands/set_slot_command.py +34 -3
- rasa/dialogue_understanding/commands/skip_question_command.py +9 -0
- rasa/dialogue_understanding/commands/start_flow_command.py +9 -0
- rasa/dialogue_understanding/generator/__init__.py +16 -1
- rasa/dialogue_understanding/generator/command_generator.py +92 -6
- rasa/dialogue_understanding/generator/constants.py +18 -0
- rasa/dialogue_understanding/generator/flow_retrieval.py +7 -5
- rasa/dialogue_understanding/generator/llm_based_command_generator.py +467 -0
- rasa/dialogue_understanding/generator/llm_command_generator.py +39 -609
- rasa/dialogue_understanding/generator/multi_step/__init__.py +0 -0
- rasa/dialogue_understanding/generator/multi_step/fill_slots_prompt.jinja2 +62 -0
- rasa/dialogue_understanding/generator/multi_step/handle_flows_prompt.jinja2 +38 -0
- rasa/dialogue_understanding/generator/multi_step/multi_step_llm_command_generator.py +827 -0
- rasa/dialogue_understanding/generator/nlu_command_adapter.py +69 -8
- rasa/dialogue_understanding/generator/single_step/__init__.py +0 -0
- rasa/dialogue_understanding/generator/single_step/single_step_llm_command_generator.py +345 -0
- rasa/dialogue_understanding/patterns/default_flows_for_patterns.yml +44 -39
- rasa/dialogue_understanding/processor/command_processor.py +111 -3
- rasa/e2e_test/constants.py +1 -0
- rasa/e2e_test/e2e_test_case.py +44 -0
- rasa/e2e_test/e2e_test_runner.py +114 -11
- rasa/e2e_test/e2e_test_schema.yml +18 -0
- rasa/engine/caching.py +0 -1
- rasa/engine/graph.py +18 -6
- rasa/engine/recipes/config_files/default_config.yml +3 -3
- rasa/engine/recipes/default_components.py +1 -1
- rasa/engine/recipes/default_recipe.py +4 -5
- rasa/engine/recipes/recipe.py +1 -1
- rasa/engine/runner/dask.py +3 -9
- rasa/engine/storage/local_model_storage.py +0 -2
- rasa/engine/validation.py +179 -145
- rasa/exceptions.py +2 -2
- rasa/graph_components/validators/default_recipe_validator.py +3 -5
- rasa/hooks.py +0 -1
- rasa/model.py +1 -1
- rasa/model_training.py +1 -0
- rasa/nlu/classifiers/diet_classifier.py +8 -14
- rasa/nlu/extractors/crf_entity_extractor.py +4 -4
- rasa/nlu/extractors/duckling_entity_extractor.py +1 -1
- rasa/nlu/featurizers/dense_featurizer/convert_featurizer.py +1 -5
- rasa/nlu/featurizers/dense_featurizer/lm_featurizer.py +0 -4
- rasa/nlu/featurizers/featurizer.py +1 -1
- rasa/nlu/featurizers/sparse_featurizer/count_vectors_featurizer.py +2 -4
- rasa/nlu/featurizers/sparse_featurizer/lexical_syntactic_featurizer.py +9 -12
- rasa/nlu/persistor.py +68 -26
- rasa/nlu/selectors/response_selector.py +7 -10
- rasa/nlu/test.py +0 -3
- rasa/nlu/utils/hugging_face/registry.py +1 -1
- rasa/nlu/utils/spacy_utils.py +1 -3
- rasa/server.py +22 -7
- rasa/shared/constants.py +12 -1
- rasa/shared/core/command_payload_reader.py +109 -0
- rasa/shared/core/constants.py +4 -5
- rasa/shared/core/domain.py +57 -56
- rasa/shared/core/events.py +4 -7
- rasa/shared/core/flows/flow.py +9 -0
- rasa/shared/core/flows/flows_list.py +12 -0
- rasa/shared/core/flows/steps/action.py +7 -2
- rasa/shared/core/generator.py +12 -11
- rasa/shared/core/slot_mappings.py +315 -24
- rasa/shared/core/slots.py +4 -2
- rasa/shared/core/trackers.py +32 -14
- rasa/shared/core/training_data/loading.py +0 -1
- rasa/shared/core/training_data/story_reader/story_reader.py +3 -3
- rasa/shared/core/training_data/story_reader/yaml_story_reader.py +11 -11
- rasa/shared/core/training_data/story_writer/yaml_story_writer.py +5 -3
- rasa/shared/core/training_data/structures.py +1 -1
- rasa/shared/core/training_data/visualization.py +1 -1
- rasa/shared/data.py +58 -1
- rasa/shared/exceptions.py +36 -2
- rasa/shared/importers/importer.py +1 -2
- rasa/shared/importers/rasa.py +0 -1
- rasa/shared/nlu/constants.py +2 -0
- rasa/shared/nlu/training_data/entities_parser.py +1 -2
- rasa/shared/nlu/training_data/formats/dialogflow.py +3 -2
- rasa/shared/nlu/training_data/formats/rasa_yaml.py +3 -5
- rasa/shared/nlu/training_data/formats/readerwriter.py +0 -1
- rasa/shared/nlu/training_data/message.py +13 -0
- rasa/shared/nlu/training_data/training_data.py +0 -2
- rasa/shared/providers/openai/session_handler.py +2 -2
- rasa/shared/utils/constants.py +3 -0
- rasa/shared/utils/io.py +11 -0
- rasa/shared/utils/llm.py +1 -2
- rasa/shared/utils/pykwalify_extensions.py +1 -0
- rasa/shared/utils/schemas/domain.yml +3 -0
- rasa/shared/utils/yaml.py +44 -35
- rasa/studio/auth.py +26 -10
- rasa/studio/constants.py +2 -0
- rasa/studio/data_handler.py +114 -107
- rasa/studio/download.py +160 -27
- rasa/studio/results_logger.py +137 -0
- rasa/studio/train.py +6 -7
- rasa/studio/upload.py +159 -134
- rasa/telemetry.py +188 -34
- rasa/tracing/config.py +18 -3
- rasa/tracing/constants.py +26 -2
- rasa/tracing/instrumentation/attribute_extractors.py +50 -41
- rasa/tracing/instrumentation/instrumentation.py +290 -44
- rasa/tracing/instrumentation/intentless_policy_instrumentation.py +7 -5
- rasa/tracing/instrumentation/metrics.py +109 -21
- rasa/tracing/metric_instrument_provider.py +83 -3
- rasa/utils/cli.py +2 -1
- rasa/utils/common.py +1 -1
- rasa/utils/endpoints.py +1 -2
- rasa/utils/io.py +6 -6
- rasa/utils/licensing.py +246 -31
- rasa/utils/ml_utils.py +1 -1
- rasa/utils/tensorflow/data_generator.py +1 -1
- rasa/utils/tensorflow/environment.py +1 -1
- rasa/utils/tensorflow/model_data.py +9 -11
- rasa/utils/tensorflow/model_data_utils.py +499 -500
- rasa/utils/tensorflow/models.py +5 -6
- rasa/utils/tensorflow/rasa_layers.py +15 -15
- rasa/utils/train_utils.py +1 -1
- rasa/utils/url_tools.py +53 -0
- rasa/validator.py +305 -3
- rasa/version.py +1 -1
- {rasa_pro-3.8.17.dist-info → rasa_pro-3.9.14.dist-info}/METADATA +22 -22
- {rasa_pro-3.8.17.dist-info → rasa_pro-3.9.14.dist-info}/RECORD +271 -253
- rasa/core/channels/inspector/dist/assets/flowDiagram-v2-855bc5b3-85583a23.js +0 -1
- /rasa/dialogue_understanding/generator/{command_prompt_template.jinja2 → single_step/command_prompt_template.jinja2} +0 -0
- {rasa_pro-3.8.17.dist-info → rasa_pro-3.9.14.dist-info}/NOTICE +0 -0
- {rasa_pro-3.8.17.dist-info → rasa_pro-3.9.14.dist-info}/WHEEL +0 -0
- {rasa_pro-3.8.17.dist-info → rasa_pro-3.9.14.dist-info}/entry_points.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# This file contains the credentials for the voice & chat platforms
|
|
2
2
|
# which your bot is using.
|
|
3
|
-
# https://rasa.com/docs/rasa/messaging-and-voice-channels
|
|
3
|
+
# https://rasa.com/docs/rasa-pro/connectors/messaging-and-voice-channels/
|
|
4
4
|
|
|
5
5
|
rest:
|
|
6
6
|
# # you don't need to provide anything here - this channel doesn't
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
flows:
|
|
2
|
+
pattern_chitchat:
|
|
3
|
+
description: Conversation repair flow for off-topic interactions that won't disrupt the main conversation. should not respond to greetings or anything else for which there is a flow defined
|
|
4
|
+
name: pattern chitchat
|
|
5
|
+
steps:
|
|
6
|
+
- action: utter_free_chitchat_response
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
# This file contains the different endpoints your bot can use.
|
|
2
2
|
|
|
3
3
|
# Server where the models are pulled from.
|
|
4
|
-
# https://rasa.com/docs/rasa/model-storage#fetching-models-from-a-server
|
|
4
|
+
# https://rasa.com/docs/rasa-pro/production/model-storage#fetching-models-from-a-server
|
|
5
5
|
|
|
6
6
|
#models:
|
|
7
7
|
# url: http://my-server.com/models/default_core@latest
|
|
8
8
|
# wait_time_between_pulls: 10 # [optional](default: 100)
|
|
9
9
|
|
|
10
10
|
# Server which runs your custom actions.
|
|
11
|
-
# https://rasa.com/docs/rasa/custom-actions
|
|
11
|
+
# https://rasa.com/docs/rasa-pro/concepts/custom-actions
|
|
12
12
|
|
|
13
13
|
action_endpoint:
|
|
14
14
|
url: "http://localhost:5055/webhook"
|
|
15
15
|
|
|
16
16
|
# Tracker store which is used to store the conversations.
|
|
17
17
|
# By default the conversations are stored in memory.
|
|
18
|
-
# https://rasa.com/docs/rasa/tracker-stores
|
|
18
|
+
# https://rasa.com/docs/rasa-pro/production/tracker-stores
|
|
19
19
|
|
|
20
20
|
#tracker_store:
|
|
21
21
|
# type: redis
|
|
@@ -33,7 +33,7 @@ action_endpoint:
|
|
|
33
33
|
# password: <password used for authentication>
|
|
34
34
|
|
|
35
35
|
# Event broker which all conversation events should be streamed to.
|
|
36
|
-
# https://rasa.com/docs/rasa/event-brokers
|
|
36
|
+
# https://rasa.com/docs/rasa-pro/production/event-brokers
|
|
37
37
|
|
|
38
38
|
#event_broker:
|
|
39
39
|
# url: localhost
|
|
@@ -41,5 +41,5 @@ action_endpoint:
|
|
|
41
41
|
# password: password
|
|
42
42
|
# queue: queue
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
nlg:
|
|
45
|
+
type: rephrase
|
rasa/cli/run.py
CHANGED
|
@@ -58,7 +58,6 @@ def run_actions(args: argparse.Namespace) -> None:
|
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
def _validate_model_path(model_path: Text, parameter: Text, default: Text) -> Text:
|
|
61
|
-
|
|
62
61
|
if model_path is not None and not os.path.exists(model_path):
|
|
63
62
|
reason_str = f"'{model_path}' not found."
|
|
64
63
|
if model_path is None:
|
rasa/cli/scaffold.py
CHANGED
|
@@ -213,8 +213,9 @@ def run(args: argparse.Namespace) -> None:
|
|
|
213
213
|
print_success("Welcome to Rasa! 🤖\n")
|
|
214
214
|
print(
|
|
215
215
|
"By installing and using this software, you agree to be bound by the terms "
|
|
216
|
-
"and conditions of the
|
|
217
|
-
"https://rasa.com/
|
|
216
|
+
"and conditions of the Developer Terms available at "
|
|
217
|
+
"https://rasa.com/developer-terms. "
|
|
218
|
+
"Please review the Developer Terms carefully before proceeding.\n"
|
|
218
219
|
)
|
|
219
220
|
if args.no_prompt:
|
|
220
221
|
print(
|
rasa/cli/studio/download.py
CHANGED
|
@@ -2,7 +2,12 @@ import argparse
|
|
|
2
2
|
from typing import List
|
|
3
3
|
|
|
4
4
|
from rasa.cli import SubParsersAction
|
|
5
|
+
from rasa.cli.arguments.default_arguments import (
|
|
6
|
+
add_config_param,
|
|
7
|
+
add_endpoint_param,
|
|
8
|
+
)
|
|
5
9
|
from rasa.cli.arguments.train import add_data_param, add_domain_param
|
|
10
|
+
from rasa.shared.constants import DEFAULT_ENDPOINTS_PATH, DEFAULT_CONFIG_PATH
|
|
6
11
|
|
|
7
12
|
from rasa.studio.download import handle_download
|
|
8
13
|
|
|
@@ -35,6 +40,12 @@ def set_studio_download_arguments(parser: argparse.ArgumentParser) -> None:
|
|
|
35
40
|
"""Add arguments for running `rasa studio download`."""
|
|
36
41
|
add_domain_param(parser)
|
|
37
42
|
add_data_param(parser)
|
|
43
|
+
add_config_param(parser, default=DEFAULT_CONFIG_PATH)
|
|
44
|
+
add_endpoint_param(
|
|
45
|
+
parser,
|
|
46
|
+
"Configuration file for the model endpoints.",
|
|
47
|
+
default=DEFAULT_ENDPOINTS_PATH,
|
|
48
|
+
)
|
|
38
49
|
|
|
39
50
|
parser.add_argument(
|
|
40
51
|
"assistant_name",
|
rasa/cli/studio/studio.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import argparse
|
|
2
|
-
from typing import List
|
|
2
|
+
from typing import List, Optional
|
|
3
|
+
from urllib.parse import ParseResult, urlparse
|
|
3
4
|
|
|
4
5
|
import questionary
|
|
5
6
|
from rasa.cli import SubParsersAction
|
|
@@ -11,6 +12,11 @@ from rasa.studio.auth import StudioAuth
|
|
|
11
12
|
from rasa.studio.config import StudioConfig
|
|
12
13
|
|
|
13
14
|
|
|
15
|
+
DEFAULT_REALM_NAME = "rasa-studio"
|
|
16
|
+
|
|
17
|
+
DEFAULT_CLIENT_ID = "admin-cli"
|
|
18
|
+
|
|
19
|
+
|
|
14
20
|
def add_subparser(
|
|
15
21
|
subparsers: SubParsersAction, parents: List[argparse.ArgumentParser]
|
|
16
22
|
) -> None:
|
|
@@ -34,13 +40,24 @@ def add_subparser(
|
|
|
34
40
|
def _add_config_subparser(
|
|
35
41
|
studio_sub_parsers: SubParsersAction, parents: List[argparse.ArgumentParser]
|
|
36
42
|
) -> None:
|
|
37
|
-
studio_sub_parsers.add_parser(
|
|
43
|
+
studio_config_parser = studio_sub_parsers.add_parser(
|
|
38
44
|
"config",
|
|
39
45
|
parents=parents,
|
|
40
46
|
conflict_handler="resolve",
|
|
41
47
|
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
|
|
42
48
|
help="Configure communication parameters for Rasa Studio",
|
|
43
|
-
)
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
studio_config_parser.set_defaults(func=create_and_store_studio_config)
|
|
52
|
+
|
|
53
|
+
# add advanced configuration flag to trigger
|
|
54
|
+
# advanced configuration setup for authentication settings
|
|
55
|
+
studio_config_parser.add_argument(
|
|
56
|
+
"--advanced",
|
|
57
|
+
action="store_true",
|
|
58
|
+
default=False,
|
|
59
|
+
help="Configure additional authentication parameters for Rasa Studio",
|
|
60
|
+
)
|
|
44
61
|
|
|
45
62
|
|
|
46
63
|
def _add_login_subparser(
|
|
@@ -74,37 +91,176 @@ def _studio_login(args: argparse.Namespace) -> None:
|
|
|
74
91
|
Args:
|
|
75
92
|
args: Commandline arguments
|
|
76
93
|
"""
|
|
77
|
-
username = args.username
|
|
78
|
-
password = args.password
|
|
79
|
-
|
|
80
94
|
studio_config = StudioConfig.read_config()
|
|
81
95
|
studio_auth = StudioAuth(studio_config)
|
|
82
|
-
studio_auth.login(username, password)
|
|
83
96
|
|
|
97
|
+
# show the user the studio url they are logging into
|
|
98
|
+
# urlparse will always return parseresult if a string is passed in as url
|
|
99
|
+
parsed_url: ParseResult = urlparse(studio_config.studio_url) # type: ignore[assignment]
|
|
100
|
+
studio_url = f"{parsed_url.scheme}://{parsed_url.netloc}"
|
|
101
|
+
|
|
102
|
+
rasa.shared.utils.cli.print_info(
|
|
103
|
+
f"Trying to log in to Rasa Studio at {studio_url} ..."
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
try:
|
|
107
|
+
username = args.username
|
|
108
|
+
password = args.password
|
|
109
|
+
|
|
110
|
+
if not username:
|
|
111
|
+
username = questionary.text("Please enter your username").unsafe_ask()
|
|
112
|
+
|
|
113
|
+
if not password:
|
|
114
|
+
password = questionary.password("Please enter your password").unsafe_ask()
|
|
115
|
+
|
|
116
|
+
studio_auth.login(username, password)
|
|
117
|
+
except KeyboardInterrupt:
|
|
118
|
+
rasa.shared.utils.cli.print_error("Login to Rasa Studio aborted.")
|
|
119
|
+
except Exception as e:
|
|
120
|
+
rasa.shared.utils.cli.print_error(f"Failed to login to Rasa Studio. {e}")
|
|
84
121
|
|
|
85
|
-
def _create_studio_config(_: argparse.Namespace) -> None:
|
|
86
|
-
authentication_server_url = questionary.text(
|
|
87
|
-
"Please enter an URL path to the Authentication Server",
|
|
88
|
-
default="https://auth.rasa.com",
|
|
89
|
-
).ask()
|
|
90
122
|
|
|
123
|
+
def _configure_studio_url() -> Optional[str]:
|
|
124
|
+
"""Configure the Rasa Studio URL.
|
|
125
|
+
|
|
126
|
+
Returns:
|
|
127
|
+
The configured Rasa Studio URL
|
|
128
|
+
"""
|
|
91
129
|
studio_url = questionary.text(
|
|
92
|
-
"Please
|
|
93
|
-
|
|
94
|
-
|
|
130
|
+
"Please provide the Rasa Studio URL",
|
|
131
|
+
).unsafe_ask()
|
|
132
|
+
|
|
133
|
+
if not studio_url.endswith("/"):
|
|
134
|
+
studio_url += "/"
|
|
135
|
+
|
|
136
|
+
# prepend with https if no protocol is provided
|
|
137
|
+
if not studio_url.startswith("http"):
|
|
138
|
+
return "https://" + studio_url
|
|
139
|
+
return studio_url
|
|
95
140
|
|
|
96
|
-
|
|
141
|
+
|
|
142
|
+
def _get_advanced_config(studio_url: str) -> tuple:
|
|
143
|
+
"""Get the advanced configuration values for Rasa Studio."""
|
|
144
|
+
keycloak_url = questionary.text(
|
|
145
|
+
"Please provide your Rasa Studio Keycloak URL",
|
|
146
|
+
default=studio_url + "auth/",
|
|
147
|
+
).unsafe_ask()
|
|
148
|
+
|
|
149
|
+
realm_name = questionary.text(
|
|
150
|
+
"Please enter Realm Name", default=DEFAULT_REALM_NAME
|
|
151
|
+
).unsafe_ask()
|
|
97
152
|
|
|
98
153
|
client_id = questionary.text(
|
|
99
|
-
"Please enter client ID",
|
|
100
|
-
).
|
|
154
|
+
"Please enter client ID", default=DEFAULT_CLIENT_ID
|
|
155
|
+
).unsafe_ask()
|
|
156
|
+
|
|
157
|
+
return keycloak_url, realm_name, client_id
|
|
101
158
|
|
|
102
|
-
if not authentication_server_url.endswith("/"):
|
|
103
|
-
authentication_server_url += "/"
|
|
104
159
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
160
|
+
def _get_default_config(studio_url: str) -> tuple:
|
|
161
|
+
"""Get the default configuration values for Rasa Studio."""
|
|
162
|
+
keycloak_url = studio_url + "auth/"
|
|
163
|
+
realm_name = DEFAULT_REALM_NAME
|
|
164
|
+
client_id = DEFAULT_CLIENT_ID
|
|
165
|
+
|
|
166
|
+
rasa.shared.utils.cli.print_info(
|
|
167
|
+
f"Using default values for "
|
|
168
|
+
f"Keycloak URL: {keycloak_url}, "
|
|
169
|
+
f"Realm Name: '{realm_name}', "
|
|
170
|
+
f"Client ID: '{client_id}'. "
|
|
171
|
+
f"You can use '--advanced' to configure these settings."
|
|
172
|
+
)
|
|
173
|
+
|
|
174
|
+
return keycloak_url, realm_name, client_id
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
def _create_studio_config(
|
|
178
|
+
studio_url: str, keycloak_url: str, realm_name: str, client_id: str
|
|
179
|
+
) -> StudioConfig:
|
|
180
|
+
"""Create a StudioConfig object with the provided parameters."""
|
|
181
|
+
return StudioConfig(
|
|
182
|
+
authentication_server_url=keycloak_url,
|
|
183
|
+
studio_url=studio_url + "api/graphql/",
|
|
108
184
|
client_id=client_id,
|
|
109
185
|
realm_name=realm_name,
|
|
110
|
-
)
|
|
186
|
+
)
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
def _check_studio_auth(studio_auth: StudioAuth) -> bool:
|
|
190
|
+
"""Check if the Rasa Studio authentication server is reachable."""
|
|
191
|
+
if studio_auth.health_check():
|
|
192
|
+
rasa.shared.utils.cli.print_info(
|
|
193
|
+
"Tried configuration and successfully reached Rasa Studio."
|
|
194
|
+
)
|
|
195
|
+
return True
|
|
196
|
+
return False
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
def _prompt_store_config_anyways() -> bool:
|
|
200
|
+
"""Prompt the user to store the configuration."""
|
|
201
|
+
should_store_config = questionary.confirm(
|
|
202
|
+
"Do you want to store the configuration anyway?"
|
|
203
|
+
).unsafe_ask()
|
|
204
|
+
|
|
205
|
+
return should_store_config
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
def _configure_studio_config(args: argparse.Namespace) -> StudioConfig:
|
|
209
|
+
"""Configure the Rasa Studio connection settings."""
|
|
210
|
+
studio_url = _configure_studio_url()
|
|
211
|
+
|
|
212
|
+
# check if the user wants to configure advanced authentication settings
|
|
213
|
+
if args.advanced:
|
|
214
|
+
keycloak_url, realm_name, client_id = _get_advanced_config(studio_url)
|
|
215
|
+
else:
|
|
216
|
+
keycloak_url, realm_name, client_id = _get_default_config(studio_url)
|
|
217
|
+
|
|
218
|
+
# create a configuration and auth object to try to reach the studio
|
|
219
|
+
studio_config = _create_studio_config(
|
|
220
|
+
studio_url, keycloak_url, realm_name, client_id
|
|
221
|
+
)
|
|
222
|
+
studio_auth = StudioAuth(studio_config)
|
|
223
|
+
|
|
224
|
+
if _check_studio_auth(studio_auth):
|
|
225
|
+
return studio_config
|
|
226
|
+
|
|
227
|
+
rasa.shared.utils.cli.print_error(
|
|
228
|
+
f"Failed to reach Rasa Studio authentication server at "
|
|
229
|
+
f"{studio_config.authentication_server_url}."
|
|
230
|
+
)
|
|
231
|
+
|
|
232
|
+
if _prompt_store_config_anyways():
|
|
233
|
+
return studio_config
|
|
234
|
+
|
|
235
|
+
rasa.shared.utils.cli.print_info(
|
|
236
|
+
"The config was not stored, you can change the values "
|
|
237
|
+
"again or abort with Ctrl-C."
|
|
238
|
+
)
|
|
239
|
+
|
|
240
|
+
return _configure_studio_config(args)
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
def create_and_store_studio_config(args: argparse.Namespace) -> None:
|
|
244
|
+
"""Create and store the Rasa Studio configuration.
|
|
245
|
+
|
|
246
|
+
Args:
|
|
247
|
+
args: Commandline arguments
|
|
248
|
+
"""
|
|
249
|
+
try:
|
|
250
|
+
rasa.shared.utils.cli.print_info(
|
|
251
|
+
"Configuring Rasa Studio connection settings ..."
|
|
252
|
+
)
|
|
253
|
+
studio_config = _configure_studio_config(args)
|
|
254
|
+
|
|
255
|
+
if studio_config:
|
|
256
|
+
studio_config.write_config()
|
|
257
|
+
|
|
258
|
+
rasa.shared.utils.cli.print_success(
|
|
259
|
+
"Successfully configured Rasa Pro to connect to Studio."
|
|
260
|
+
)
|
|
261
|
+
else:
|
|
262
|
+
rasa.shared.utils.cli.print_error(
|
|
263
|
+
"Failed to configure Rasa Pro to connect to Studio."
|
|
264
|
+
)
|
|
265
|
+
except KeyboardInterrupt:
|
|
266
|
+
rasa.shared.utils.cli.print_error("Configuration of Rasa Studio aborted.")
|
rasa/cli/studio/upload.py
CHANGED
|
@@ -54,14 +54,6 @@ def set_upload_arguments(parser: argparse.ArgumentParser) -> None:
|
|
|
54
54
|
add_config_param(parser)
|
|
55
55
|
add_endpoint_param(parser, help_text="Path to the endpoints file.")
|
|
56
56
|
|
|
57
|
-
parser.add_argument(
|
|
58
|
-
"assistant_name",
|
|
59
|
-
default=None,
|
|
60
|
-
nargs=1,
|
|
61
|
-
type=str,
|
|
62
|
-
help="Name of the assistant on Rasa Studio",
|
|
63
|
-
)
|
|
64
|
-
|
|
65
57
|
parser.add_argument(
|
|
66
58
|
"--entities",
|
|
67
59
|
default=None,
|
rasa/cli/telemetry.py
CHANGED
|
@@ -7,6 +7,7 @@ from rasa.cli import SubParsersAction
|
|
|
7
7
|
import rasa.cli.utils
|
|
8
8
|
from rasa.shared.constants import DOCS_URL_TELEMETRY
|
|
9
9
|
import rasa.shared.utils.cli
|
|
10
|
+
from rasa.utils import licensing
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
def add_subparser(
|
|
@@ -21,7 +22,7 @@ def add_subparser(
|
|
|
21
22
|
telemetry_parser = subparsers.add_parser(
|
|
22
23
|
"telemetry",
|
|
23
24
|
parents=parents,
|
|
24
|
-
help="Configuration of Rasa
|
|
25
|
+
help="Configuration of Rasa Pro telemetry reporting.",
|
|
25
26
|
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
|
|
26
27
|
)
|
|
27
28
|
|
|
@@ -30,7 +31,7 @@ def add_subparser(
|
|
|
30
31
|
"disable",
|
|
31
32
|
parents=parents,
|
|
32
33
|
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
|
|
33
|
-
help="Disable Rasa
|
|
34
|
+
help="Disable Rasa Pro Telemetry reporting.",
|
|
34
35
|
)
|
|
35
36
|
telemetry_disable_parser.set_defaults(func=disable_telemetry)
|
|
36
37
|
|
|
@@ -38,7 +39,7 @@ def add_subparser(
|
|
|
38
39
|
"enable",
|
|
39
40
|
parents=parents,
|
|
40
41
|
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
|
|
41
|
-
help="Enable Rasa
|
|
42
|
+
help="Enable Rasa Pro Telemetry reporting.",
|
|
42
43
|
)
|
|
43
44
|
telemetry_enable_parser.set_defaults(func=enable_telemetry)
|
|
44
45
|
telemetry_parser.set_defaults(func=inform_about_telemetry)
|
|
@@ -60,11 +61,15 @@ def inform_about_telemetry(_: argparse.Namespace) -> None:
|
|
|
60
61
|
textwrap.dedent(
|
|
61
62
|
"""
|
|
62
63
|
Rasa uses telemetry to report anonymous usage information. This information
|
|
63
|
-
is essential to help improve Rasa
|
|
64
|
+
is essential to help improve Rasa Pro for all users."""
|
|
64
65
|
)
|
|
65
66
|
)
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
if licensing.is_champion_server_license():
|
|
68
|
+
print(
|
|
69
|
+
"\nYou are using a developer license, which requires telemetry "
|
|
70
|
+
"reporting to be enabled."
|
|
71
|
+
)
|
|
72
|
+
elif not is_enabled:
|
|
68
73
|
print("\nYou can enable telemetry reporting using")
|
|
69
74
|
rasa.shared.utils.cli.print_info("\n\trasa telemetry enable")
|
|
70
75
|
else:
|
|
@@ -79,6 +84,13 @@ def inform_about_telemetry(_: argparse.Namespace) -> None:
|
|
|
79
84
|
|
|
80
85
|
def disable_telemetry(_: argparse.Namespace) -> None:
|
|
81
86
|
"""Disable telemetry tracking."""
|
|
87
|
+
if licensing.is_champion_server_license():
|
|
88
|
+
rasa.shared.utils.cli.print_error(
|
|
89
|
+
"You are using a developer license, which requires telemetry "
|
|
90
|
+
"reporting to be enabled."
|
|
91
|
+
)
|
|
92
|
+
return
|
|
93
|
+
|
|
82
94
|
telemetry.track_telemetry_disabled()
|
|
83
95
|
telemetry.toggle_telemetry_reporting(is_enabled=False)
|
|
84
96
|
rasa.shared.utils.cli.print_success("Disabled telemetry reporting.")
|
rasa/cli/utils.py
CHANGED
|
@@ -23,7 +23,6 @@ from rasa.shared.utils.yaml import read_config_file
|
|
|
23
23
|
from rasa.utils.io import write_yaml
|
|
24
24
|
|
|
25
25
|
if TYPE_CHECKING:
|
|
26
|
-
|
|
27
26
|
from questionary import Question
|
|
28
27
|
from typing_extensions import Literal
|
|
29
28
|
from rasa.validator import Validator
|
|
@@ -39,8 +38,7 @@ def get_validated_path(
|
|
|
39
38
|
parameter: Text,
|
|
40
39
|
default: Optional[Union[Path, Text, List[Text]]] = ...,
|
|
41
40
|
none_is_valid: "Literal[False]" = ...,
|
|
42
|
-
) -> Union[Path, Text]:
|
|
43
|
-
...
|
|
41
|
+
) -> Union[Path, Text]: ...
|
|
44
42
|
|
|
45
43
|
|
|
46
44
|
@overload
|
|
@@ -49,8 +47,7 @@ def get_validated_path(
|
|
|
49
47
|
parameter: Text,
|
|
50
48
|
default: Optional[Union[Path, Text, List[Text]]] = ...,
|
|
51
49
|
none_is_valid: "Literal[True]" = ...,
|
|
52
|
-
) -> Optional[Union[Path, Text]]:
|
|
53
|
-
...
|
|
50
|
+
) -> Optional[Union[Path, Text]]: ...
|
|
54
51
|
|
|
55
52
|
|
|
56
53
|
def get_validated_path(
|
|
@@ -158,9 +155,9 @@ def validate_assistant_id_in_config(config_file: Union["Path", Text]) -> None:
|
|
|
158
155
|
|
|
159
156
|
# add random value for assistant id, overwrite config file
|
|
160
157
|
time_format = "%Y%m%d-%H%M%S"
|
|
161
|
-
config_data[
|
|
162
|
-
|
|
163
|
-
|
|
158
|
+
config_data[ASSISTANT_ID_KEY] = (
|
|
159
|
+
f"{time.strftime(time_format)}-{randomname.get_name()}"
|
|
160
|
+
)
|
|
164
161
|
|
|
165
162
|
write_yaml(data=config_data, target=config_file, should_preserve_key_order=True)
|
|
166
163
|
|
|
@@ -281,8 +278,15 @@ def validate_files(
|
|
|
281
278
|
validator, max_history, fail_on_warnings
|
|
282
279
|
)
|
|
283
280
|
valid_flows = validator.verify_flows()
|
|
284
|
-
|
|
285
|
-
|
|
281
|
+
valid_CALM_slot_mappings = validator.validate_CALM_slot_mappings()
|
|
282
|
+
|
|
283
|
+
all_good = (
|
|
284
|
+
valid_domain
|
|
285
|
+
and valid_nlu
|
|
286
|
+
and valid_stories
|
|
287
|
+
and valid_flows
|
|
288
|
+
and valid_CALM_slot_mappings
|
|
289
|
+
)
|
|
286
290
|
|
|
287
291
|
validator.warn_if_config_mandatory_keys_are_not_set()
|
|
288
292
|
|
|
@@ -302,6 +306,7 @@ def _validate_domain(validator: "Validator") -> bool:
|
|
|
302
306
|
valid_form_slots = validator.verify_form_slots()
|
|
303
307
|
valid_slot_mappings = validator.verify_slot_mappings()
|
|
304
308
|
valid_responses = validator.check_for_no_empty_paranthesis_in_responses()
|
|
309
|
+
valid_buttons = validator.validate_button_payloads()
|
|
305
310
|
return (
|
|
306
311
|
valid_domain_validity
|
|
307
312
|
and valid_actions_in_stories_rules
|
|
@@ -309,6 +314,7 @@ def _validate_domain(validator: "Validator") -> bool:
|
|
|
309
314
|
and valid_form_slots
|
|
310
315
|
and valid_slot_mappings
|
|
311
316
|
and valid_responses
|
|
317
|
+
and valid_buttons
|
|
312
318
|
)
|
|
313
319
|
|
|
314
320
|
|
|
@@ -451,3 +457,8 @@ def warn_if_rasa_plus_package_installed() -> None:
|
|
|
451
457
|
f"for using Rasa Pro. Please uninstall it.",
|
|
452
458
|
UserWarning,
|
|
453
459
|
)
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
def check_if_studio_command() -> bool:
|
|
463
|
+
"""Checks if the command is a Rasa Studio command."""
|
|
464
|
+
return len(sys.argv) >= 2 and sys.argv[1] == "studio"
|
rasa/cli/x.py
CHANGED
|
@@ -166,8 +166,9 @@ async def _pull_runtime_config_from_server(
|
|
|
166
166
|
attempts -= 1
|
|
167
167
|
|
|
168
168
|
rasa.shared.utils.cli.print_error_and_exit(
|
|
169
|
-
"Could not fetch runtime config from server at '{}'. "
|
|
170
|
-
|
|
169
|
+
"Could not fetch runtime config from server at '{}'. Exiting.".format(
|
|
170
|
+
config_endpoint
|
|
171
|
+
)
|
|
171
172
|
)
|
|
172
173
|
|
|
173
174
|
|