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
rasa/studio/upload.py
CHANGED
|
@@ -15,11 +15,18 @@ from rasa.shared.constants import (
|
|
|
15
15
|
DEFAULT_DOMAIN_PATHS,
|
|
16
16
|
DEFAULT_CONFIG_PATH,
|
|
17
17
|
)
|
|
18
|
-
from rasa.shared.core.
|
|
18
|
+
from rasa.shared.core.domain import Domain
|
|
19
|
+
from rasa.shared.core.flows.yaml_flows_io import YAMLFlowsReader, YamlFlowsWriter
|
|
19
20
|
from rasa.shared.exceptions import RasaException
|
|
20
21
|
from rasa.shared.importers.importer import TrainingDataImporter, FlowSyncImporter
|
|
21
|
-
from rasa.shared.nlu.training_data.formats.rasa_yaml import
|
|
22
|
-
|
|
22
|
+
from rasa.shared.nlu.training_data.formats.rasa_yaml import (
|
|
23
|
+
RasaYAMLReader,
|
|
24
|
+
RasaYAMLWriter,
|
|
25
|
+
)
|
|
26
|
+
from rasa.shared.utils.yaml import (
|
|
27
|
+
dump_obj_as_yaml_to_string,
|
|
28
|
+
read_yaml_file,
|
|
29
|
+
)
|
|
23
30
|
from rasa.studio import results_logger
|
|
24
31
|
from rasa.studio.auth import KeycloakTokenReader
|
|
25
32
|
from rasa.studio.config import StudioConfig
|
|
@@ -27,6 +34,27 @@ from rasa.studio.results_logger import StudioResult, with_studio_error_handler
|
|
|
27
34
|
|
|
28
35
|
structlogger = structlog.get_logger()
|
|
29
36
|
|
|
37
|
+
CONFIG_KEYS = [
|
|
38
|
+
"recipe",
|
|
39
|
+
"language",
|
|
40
|
+
"pipeline",
|
|
41
|
+
"llm",
|
|
42
|
+
"policies",
|
|
43
|
+
"model_name",
|
|
44
|
+
"assistant_id",
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
DOMAIN_KEYS = [
|
|
48
|
+
"version",
|
|
49
|
+
"actions",
|
|
50
|
+
"responses",
|
|
51
|
+
"slots",
|
|
52
|
+
"intents",
|
|
53
|
+
"entities",
|
|
54
|
+
"forms",
|
|
55
|
+
"session_config",
|
|
56
|
+
]
|
|
57
|
+
|
|
30
58
|
|
|
31
59
|
def _get_selected_entities_and_intents(
|
|
32
60
|
args: argparse.Namespace,
|
|
@@ -54,6 +82,44 @@ def _get_selected_entities_and_intents(
|
|
|
54
82
|
return list(entities), list(intents)
|
|
55
83
|
|
|
56
84
|
|
|
85
|
+
def run_validation(args: argparse.Namespace) -> None:
|
|
86
|
+
"""Run the validation before uploading to Studio.
|
|
87
|
+
|
|
88
|
+
This is to avoid uploading invalid assistant data
|
|
89
|
+
that would raise errors during Rasa Pro training in Studio.
|
|
90
|
+
|
|
91
|
+
The validation checks that were selected to be run before uploading
|
|
92
|
+
maintain parity with the features that are supported in Studio.
|
|
93
|
+
"""
|
|
94
|
+
from rasa.validator import Validator
|
|
95
|
+
|
|
96
|
+
training_data_importer = TrainingDataImporter.load_from_dict(
|
|
97
|
+
domain_path=args.domain,
|
|
98
|
+
training_data_paths=args.data,
|
|
99
|
+
config_path=args.config,
|
|
100
|
+
expand_env_vars=False,
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
structlogger.info(
|
|
104
|
+
"rasa.studio.upload.validating_data",
|
|
105
|
+
event_info="Validating domain and training data...",
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
validator = Validator.from_importer(training_data_importer)
|
|
109
|
+
|
|
110
|
+
if not validator.verify_studio_supported_validations():
|
|
111
|
+
structlogger.error(
|
|
112
|
+
"rasa.studio.upload.validate_files.project_validation_error",
|
|
113
|
+
event_info="Project validation completed with errors.",
|
|
114
|
+
)
|
|
115
|
+
sys.exit(1)
|
|
116
|
+
|
|
117
|
+
structlogger.info(
|
|
118
|
+
"rasa.studio.upload.validate_files.success",
|
|
119
|
+
event_info="Project validation completed successfully.",
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
|
|
57
123
|
def handle_upload(args: argparse.Namespace) -> None:
|
|
58
124
|
"""Uploads primitives to rasa studio."""
|
|
59
125
|
studio_config = StudioConfig.read_config()
|
|
@@ -64,35 +130,33 @@ def handle_upload(args: argparse.Namespace) -> None:
|
|
|
64
130
|
rasa.shared.utils.cli.print_error_and_exit(
|
|
65
131
|
"No GraphQL endpoint found in config. Please run `rasa studio config`."
|
|
66
132
|
)
|
|
67
|
-
|
|
68
|
-
structlogger.info(
|
|
69
|
-
"rasa.studio.upload.loading_data", event_info="Loading data..."
|
|
70
|
-
)
|
|
133
|
+
return
|
|
71
134
|
|
|
72
|
-
|
|
73
|
-
|
|
135
|
+
if not is_auth_working(endpoint, verify):
|
|
136
|
+
rasa.shared.utils.cli.print_error_and_exit(
|
|
137
|
+
"Authentication is invalid or expired. Please run `rasa studio login`."
|
|
74
138
|
)
|
|
139
|
+
return
|
|
75
140
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
141
|
+
structlogger.info("rasa.studio.upload.loading_data", event_info="Loading data...")
|
|
142
|
+
|
|
143
|
+
args.domain = rasa.cli.utils.get_validated_path(
|
|
144
|
+
args.domain, "domain", DEFAULT_DOMAIN_PATHS
|
|
145
|
+
)
|
|
79
146
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
else:
|
|
84
|
-
upload_nlu_assistant(args, endpoint, verify=verify)
|
|
147
|
+
args.config = rasa.cli.utils.get_validated_path(
|
|
148
|
+
args.config, "config", DEFAULT_CONFIG_PATH
|
|
149
|
+
)
|
|
85
150
|
|
|
151
|
+
Domain.expand_env_vars = False
|
|
152
|
+
RasaYAMLReader.expand_env_vars = False
|
|
153
|
+
YAMLFlowsReader.expand_env_vars = False
|
|
86
154
|
|
|
87
|
-
|
|
88
|
-
"
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
"policies",
|
|
93
|
-
"model_name",
|
|
94
|
-
"assistant_id",
|
|
95
|
-
]
|
|
155
|
+
# check safely if args.calm is set and not fail if not
|
|
156
|
+
if hasattr(args, "calm") and args.calm:
|
|
157
|
+
upload_calm_assistant(args, endpoint, verify=verify)
|
|
158
|
+
else:
|
|
159
|
+
upload_nlu_assistant(args, endpoint, verify=verify)
|
|
96
160
|
|
|
97
161
|
|
|
98
162
|
def extract_values(data: Dict, keys: List[Text]) -> Dict:
|
|
@@ -124,7 +188,11 @@ def _get_assistant_name(config: Dict[Text, Any]) -> str:
|
|
|
124
188
|
),
|
|
125
189
|
)
|
|
126
190
|
|
|
127
|
-
structlogger.info(
|
|
191
|
+
structlogger.info(
|
|
192
|
+
"rasa.studio.upload.name_selected",
|
|
193
|
+
event_info=f"Uploading assistant with the name '{assistant_name}'.",
|
|
194
|
+
assistant_name=assistant_name,
|
|
195
|
+
)
|
|
128
196
|
return assistant_name
|
|
129
197
|
|
|
130
198
|
|
|
@@ -132,7 +200,7 @@ def _get_assistant_name(config: Dict[Text, Any]) -> str:
|
|
|
132
200
|
def upload_calm_assistant(
|
|
133
201
|
args: argparse.Namespace, endpoint: str, verify: bool = True
|
|
134
202
|
) -> StudioResult:
|
|
135
|
-
"""
|
|
203
|
+
"""Validates and uploads the CALM assistant data to Rasa Studio.
|
|
136
204
|
|
|
137
205
|
Args:
|
|
138
206
|
args: The command line arguments
|
|
@@ -145,6 +213,8 @@ def upload_calm_assistant(
|
|
|
145
213
|
Returns:
|
|
146
214
|
None
|
|
147
215
|
"""
|
|
216
|
+
run_validation(args)
|
|
217
|
+
|
|
148
218
|
structlogger.info(
|
|
149
219
|
"rasa.studio.upload.loading_data", event_info="Parsing CALM assistant data..."
|
|
150
220
|
)
|
|
@@ -152,64 +222,37 @@ def upload_calm_assistant(
|
|
|
152
222
|
importer = TrainingDataImporter.load_from_dict(
|
|
153
223
|
domain_path=args.domain,
|
|
154
224
|
config_path=args.config,
|
|
225
|
+
expand_env_vars=False,
|
|
155
226
|
)
|
|
156
227
|
|
|
157
228
|
# Prepare config and domain
|
|
158
229
|
config = importer.get_config()
|
|
159
230
|
domain_from_files = importer.get_user_domain().as_dict()
|
|
160
|
-
endpoints_from_files = read_yaml_file(args.endpoints)
|
|
161
|
-
config_from_files = read_yaml_file(args.config)
|
|
231
|
+
endpoints_from_files = read_yaml_file(args.endpoints, expand_env_vars=False)
|
|
232
|
+
config_from_files = read_yaml_file(args.config, expand_env_vars=False)
|
|
162
233
|
|
|
163
234
|
# Extract domain and config values
|
|
164
|
-
|
|
165
|
-
"version",
|
|
166
|
-
"actions",
|
|
167
|
-
"responses",
|
|
168
|
-
"slots",
|
|
169
|
-
"intents",
|
|
170
|
-
"entities",
|
|
171
|
-
"forms",
|
|
172
|
-
"session_config",
|
|
173
|
-
]
|
|
174
|
-
|
|
175
|
-
domain = extract_values(domain_from_files, domain_keys)
|
|
176
|
-
|
|
177
|
-
assistant_name = _get_assistant_name(config)
|
|
178
|
-
|
|
179
|
-
training_data_paths = args.data
|
|
180
|
-
|
|
181
|
-
if isinstance(training_data_paths, list):
|
|
182
|
-
training_data_paths.append(args.flows)
|
|
183
|
-
elif isinstance(training_data_paths, str):
|
|
184
|
-
if isinstance(args.flows, list):
|
|
185
|
-
training_data_paths = [training_data_paths] + args.flows
|
|
186
|
-
elif isinstance(args.flows, str):
|
|
187
|
-
training_data_paths = [training_data_paths, args.flows]
|
|
188
|
-
else:
|
|
189
|
-
raise RasaException("Invalid flows path")
|
|
235
|
+
domain = extract_values(domain_from_files, DOMAIN_KEYS)
|
|
190
236
|
|
|
191
237
|
# Prepare flows
|
|
192
238
|
flow_importer = FlowSyncImporter.load_from_dict(
|
|
193
|
-
training_data_paths=
|
|
239
|
+
training_data_paths=args.data, expand_env_vars=False
|
|
194
240
|
)
|
|
195
|
-
|
|
196
241
|
flows = list(flow_importer.get_user_flows())
|
|
197
242
|
|
|
198
243
|
# We instantiate the TrainingDataImporter again on purpose to avoid
|
|
199
244
|
# adding patterns to domain's actions. More info https://t.ly/W8uuc
|
|
200
245
|
nlu_importer = TrainingDataImporter.load_from_dict(
|
|
201
|
-
|
|
246
|
+
training_data_paths=args.data, expand_env_vars=False
|
|
202
247
|
)
|
|
203
248
|
nlu_data = nlu_importer.get_nlu_data()
|
|
204
|
-
|
|
205
|
-
intents_from_files = nlu_data.intents
|
|
206
|
-
|
|
207
249
|
nlu_examples = nlu_data.filter_training_examples(
|
|
208
|
-
lambda ex: ex.get("intent") in
|
|
250
|
+
lambda ex: ex.get("intent") in nlu_data.intents
|
|
209
251
|
)
|
|
210
|
-
|
|
211
252
|
nlu_examples_yaml = RasaYAMLWriter().dumps(nlu_examples)
|
|
212
253
|
|
|
254
|
+
assistant_name = _get_assistant_name(config)
|
|
255
|
+
|
|
213
256
|
# Build GraphQL request
|
|
214
257
|
graphql_req = build_import_request(
|
|
215
258
|
assistant_name,
|
|
@@ -220,7 +263,9 @@ def upload_calm_assistant(
|
|
|
220
263
|
nlu_yaml=nlu_examples_yaml,
|
|
221
264
|
)
|
|
222
265
|
|
|
223
|
-
structlogger.info(
|
|
266
|
+
structlogger.info(
|
|
267
|
+
"rasa.studio.upload.calm", event_info="Uploading to Rasa Studio..."
|
|
268
|
+
)
|
|
224
269
|
return make_request(endpoint, graphql_req, verify)
|
|
225
270
|
|
|
226
271
|
|
|
@@ -237,27 +282,37 @@ def upload_nlu_assistant(
|
|
|
237
282
|
- intents: The intents to upload
|
|
238
283
|
- entities: The entities to upload
|
|
239
284
|
endpoint: The studio endpoint
|
|
285
|
+
verify: Whether to verify SSL
|
|
240
286
|
Returns:
|
|
241
287
|
None
|
|
242
288
|
"""
|
|
243
|
-
structlogger.info(
|
|
289
|
+
structlogger.info(
|
|
290
|
+
"rasa.studio.upload.nlu_data_read",
|
|
291
|
+
event_info="Found DM1 assistant data, parsing...",
|
|
292
|
+
)
|
|
244
293
|
importer = TrainingDataImporter.load_from_dict(
|
|
245
|
-
domain_path=args.domain,
|
|
294
|
+
domain_path=args.domain,
|
|
295
|
+
training_data_paths=args.data,
|
|
296
|
+
config_path=args.config,
|
|
297
|
+
expand_env_vars=False,
|
|
246
298
|
)
|
|
247
299
|
|
|
248
300
|
intents_from_files = importer.get_nlu_data().intents
|
|
249
|
-
entities_from_files = importer.get_domain().entities
|
|
250
301
|
|
|
302
|
+
domain_from_files = importer.get_domain()
|
|
303
|
+
entities_from_files = domain_from_files.entities
|
|
251
304
|
entities, intents = _get_selected_entities_and_intents(
|
|
252
305
|
args, intents_from_files, entities_from_files
|
|
253
306
|
)
|
|
254
307
|
|
|
255
308
|
config_from_files = importer.get_config()
|
|
256
|
-
config = extract_values(config_from_files,
|
|
309
|
+
config = extract_values(config_from_files, CONFIG_KEYS)
|
|
257
310
|
|
|
258
311
|
assistant_name = _get_assistant_name(config)
|
|
259
312
|
|
|
260
|
-
structlogger.info(
|
|
313
|
+
structlogger.info(
|
|
314
|
+
"rasa.studio.upload.nlu_data_validate", event_info="Validating data..."
|
|
315
|
+
)
|
|
261
316
|
_check_for_missing_primitives(
|
|
262
317
|
intents, entities, intents_from_files, entities_from_files
|
|
263
318
|
)
|
|
@@ -269,15 +324,39 @@ def upload_nlu_assistant(
|
|
|
269
324
|
all_entities = _add_missing_entities(nlu_examples.entities, entities)
|
|
270
325
|
nlu_examples_yaml = RasaYAMLWriter().dumps(nlu_examples)
|
|
271
326
|
|
|
272
|
-
domain = _filter_domain(all_entities, intents,
|
|
327
|
+
domain = _filter_domain(all_entities, intents, domain_from_files.as_dict())
|
|
273
328
|
domain_yaml = dump_obj_as_yaml_to_string(domain)
|
|
274
329
|
|
|
275
330
|
graphql_req = build_request(assistant_name, nlu_examples_yaml, domain_yaml)
|
|
276
331
|
|
|
277
|
-
structlogger.info(
|
|
332
|
+
structlogger.info(
|
|
333
|
+
"rasa.studio.upload.nlu", event_info="Uploading to Rasa Studio..."
|
|
334
|
+
)
|
|
278
335
|
return make_request(endpoint, graphql_req, verify)
|
|
279
336
|
|
|
280
337
|
|
|
338
|
+
def is_auth_working(endpoint: str, verify: bool = True) -> bool:
|
|
339
|
+
"""Send a test request to Studio to check if auth is working."""
|
|
340
|
+
result = make_request(
|
|
341
|
+
endpoint,
|
|
342
|
+
{
|
|
343
|
+
"operationName": "LicenseDetails",
|
|
344
|
+
"query": (
|
|
345
|
+
"query LicenseDetails {\n"
|
|
346
|
+
" licenseDetails {\n"
|
|
347
|
+
" valid\n"
|
|
348
|
+
" scopes\n"
|
|
349
|
+
" __typename\n"
|
|
350
|
+
" }\n"
|
|
351
|
+
"}"
|
|
352
|
+
),
|
|
353
|
+
"variables": {},
|
|
354
|
+
},
|
|
355
|
+
verify,
|
|
356
|
+
)
|
|
357
|
+
return result.was_successful
|
|
358
|
+
|
|
359
|
+
|
|
281
360
|
def make_request(endpoint: str, graphql_req: Dict, verify: bool = True) -> StudioResult:
|
|
282
361
|
"""Makes a request to the studio endpoint to upload data.
|
|
283
362
|
|
|
@@ -310,7 +389,12 @@ def _add_missing_entities(
|
|
|
310
389
|
for entity in entities_from_intents:
|
|
311
390
|
if entity not in entities:
|
|
312
391
|
structlogger.warning(
|
|
313
|
-
|
|
392
|
+
"rasa.studio.upload.adding_missing_entity",
|
|
393
|
+
event_info=(
|
|
394
|
+
f"Adding entity '{entity}' to upload "
|
|
395
|
+
"since it is used in an intent."
|
|
396
|
+
),
|
|
397
|
+
entity=entity,
|
|
314
398
|
)
|
|
315
399
|
all_entities.append(entity)
|
|
316
400
|
return all_entities
|
|
@@ -378,7 +462,9 @@ def build_request(
|
|
|
378
462
|
|
|
379
463
|
|
|
380
464
|
def _filter_domain(
|
|
381
|
-
entities: List[Union[str, Dict]],
|
|
465
|
+
entities: List[Union[str, Dict]],
|
|
466
|
+
intents: List[str],
|
|
467
|
+
domain_from_files: Dict[str, Any],
|
|
382
468
|
) -> Dict:
|
|
383
469
|
"""Filters the domain to only include the selected entities and intents."""
|
|
384
470
|
selected_entities = _remove_not_selected_entities(
|
rasa/telemetry.py
CHANGED
|
@@ -32,7 +32,13 @@ from rasa.constants import (
|
|
|
32
32
|
CONFIG_TELEMETRY_ENABLED,
|
|
33
33
|
CONFIG_TELEMETRY_ID,
|
|
34
34
|
)
|
|
35
|
-
from rasa.shared.constants import
|
|
35
|
+
from rasa.shared.constants import (
|
|
36
|
+
PROMPT_CONFIG_KEY,
|
|
37
|
+
PROMPT_TEMPLATE_CONFIG_KEY,
|
|
38
|
+
LLM_API_HEALTH_CHECK_ENV_VAR,
|
|
39
|
+
LLM_API_HEALTH_CHECK_DEFAULT_VALUE,
|
|
40
|
+
MODEL_GROUP_CONFIG_KEY,
|
|
41
|
+
)
|
|
36
42
|
from rasa.engine.storage.local_model_storage import LocalModelStorage
|
|
37
43
|
from rasa.shared.constants import DOCS_URL_TELEMETRY, UTTER_ASK_PREFIX
|
|
38
44
|
from rasa.shared.core.flows import Flow
|
|
@@ -106,6 +112,7 @@ TELEMETRY_INTERACTIVE_LEARNING_STARTED_EVENT = "Interactive Learning Started"
|
|
|
106
112
|
TELEMETRY_SERVER_STARTED_EVENT = "Server Started"
|
|
107
113
|
TELEMETRY_PROJECT_CREATED_EVENT = "Project Created"
|
|
108
114
|
TELEMETRY_SHELL_STARTED_EVENT = "Shell Started"
|
|
115
|
+
TELEMETRY_INSPECT_STARTED_EVENT = "Inspect Started"
|
|
109
116
|
TELEMETRY_VISUALIZATION_STARTED_EVENT = "Story Visualization Started"
|
|
110
117
|
TELEMETRY_TEST_CORE_EVENT = "Model Core Tested"
|
|
111
118
|
TELEMETRY_TEST_NLU_EVENT = "Model NLU Tested"
|
|
@@ -157,6 +164,7 @@ NUM_LINK_STEPS = "num_link_steps"
|
|
|
157
164
|
NUM_CALL_STEPS = "num_call_steps"
|
|
158
165
|
NUM_SHARED_SLOTS_BETWEEN_FLOWS = "num_shared_slots_between_flows"
|
|
159
166
|
LLM_COMMAND_GENERATOR_MODEL_NAME = "llm_command_generator_model_name"
|
|
167
|
+
LLM_COMMAND_GENERATOR_MODEL_GROUP_ID = "llm_command_generator_model_group_id"
|
|
160
168
|
LLM_COMMAND_GENERATOR_CUSTOM_PROMPT_USED = "llm_command_generator_custom_prompt_used"
|
|
161
169
|
MULTI_STEP_LLM_COMMAND_GENERATOR_HANDLE_FLOWS_PROMPT_USED = (
|
|
162
170
|
"multi_step_llm_command_generator_custom_handle_flows_prompt_used"
|
|
@@ -166,6 +174,7 @@ MULTI_STEP_LLM_COMMAND_GENERATOR_FILL_SLOTS_PROMPT_USED = (
|
|
|
166
174
|
)
|
|
167
175
|
FLOW_RETRIEVAL_ENABLED = "flow_retrieval_enabled"
|
|
168
176
|
FLOW_RETRIEVAL_EMBEDDING_MODEL_NAME = "flow_retrieval_embedding_model_name"
|
|
177
|
+
FLOW_RETRIEVAL_EMBEDDING_MODEL_GROUP_ID = "flow_retrieval_embedding_model_group_id"
|
|
169
178
|
TRACING_BACKEND = "tracing_backend"
|
|
170
179
|
METRICS_BACKEND = "metrics_backend"
|
|
171
180
|
VERSION = "version"
|
|
@@ -960,6 +969,13 @@ def track_model_training(
|
|
|
960
969
|
"policies": config.get("policies"),
|
|
961
970
|
"train_schema": config.get("train_schema"),
|
|
962
971
|
"predict_schema": config.get("predict_schema"),
|
|
972
|
+
"model_groups": rasa.core.utils.AvailableEndpoints.get_instance().model_groups,
|
|
973
|
+
"api_health_check_enabled": (
|
|
974
|
+
os.getenv(
|
|
975
|
+
LLM_API_HEALTH_CHECK_ENV_VAR, LLM_API_HEALTH_CHECK_DEFAULT_VALUE
|
|
976
|
+
).lower()
|
|
977
|
+
== "true"
|
|
978
|
+
),
|
|
963
979
|
"num_intent_examples": len(nlu_data.intent_examples),
|
|
964
980
|
"num_entity_examples": len(nlu_data.entity_examples),
|
|
965
981
|
"num_actions": len(domain.action_names_or_texts),
|
|
@@ -1114,46 +1130,78 @@ def _get_llm_command_generator_config(config: Dict[str, Any]) -> Optional[Dict]:
|
|
|
1114
1130
|
return component
|
|
1115
1131
|
return None
|
|
1116
1132
|
|
|
1117
|
-
def
|
|
1118
|
-
"""Extracts
|
|
1133
|
+
def extract_llm_command_generator_llm_client_settings(component: Dict) -> Dict:
|
|
1134
|
+
"""Extracts settings related to LLM command generator."""
|
|
1119
1135
|
llm_config = component.get(LLM_CONFIG_KEY, {})
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1136
|
+
# Config at this stage is not yet resolved, so read from `model_group`
|
|
1137
|
+
llm_model_group_id = llm_config.get(MODEL_GROUP_CONFIG_KEY)
|
|
1138
|
+
llm_model_name = llm_config.get(MODEL_CONFIG_KEY) or llm_config.get(
|
|
1139
|
+
MODEL_NAME_CONFIG_KEY
|
|
1124
1140
|
)
|
|
1141
|
+
if llm_model_group_id is None and llm_model_name is None:
|
|
1142
|
+
llm_model_name = DEFAULT_LLM_CONFIG[MODEL_CONFIG_KEY]
|
|
1143
|
+
|
|
1144
|
+
custom_prompt_used = (
|
|
1145
|
+
PROMPT_CONFIG_KEY in component or PROMPT_TEMPLATE_CONFIG_KEY in component
|
|
1146
|
+
)
|
|
1147
|
+
return {
|
|
1148
|
+
LLM_COMMAND_GENERATOR_MODEL_NAME: llm_model_name,
|
|
1149
|
+
LLM_COMMAND_GENERATOR_MODEL_GROUP_ID: llm_model_group_id,
|
|
1150
|
+
LLM_COMMAND_GENERATOR_CUSTOM_PROMPT_USED: custom_prompt_used,
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
def extract_multistep_command_generator_prompt_settings(component: Dict) -> Dict:
|
|
1154
|
+
"""Extracts settings related to multistep command generator."""
|
|
1155
|
+
prompt_templates = component.get("prompt_templates", {})
|
|
1156
|
+
handle_flows_prompt_used = HANDLE_FLOWS_KEY in prompt_templates
|
|
1157
|
+
fill_slots_prompt_used = FILL_SLOTS_KEY in prompt_templates
|
|
1158
|
+
return {
|
|
1159
|
+
MULTI_STEP_LLM_COMMAND_GENERATOR_HANDLE_FLOWS_PROMPT_USED: handle_flows_prompt_used, # noqa: E501
|
|
1160
|
+
MULTI_STEP_LLM_COMMAND_GENERATOR_FILL_SLOTS_PROMPT_USED: fill_slots_prompt_used, # noqa: E501
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
def extract_flow_retrieval_settings(component: Dict) -> Dict:
|
|
1164
|
+
"""Extracts settings related to flow retrieval."""
|
|
1125
1165
|
flow_retrieval_config = component.get(FLOW_RETRIEVAL_KEY, {})
|
|
1126
1166
|
flow_retrieval_enabled = flow_retrieval_config.get("active", True)
|
|
1127
|
-
|
|
1167
|
+
embeddings_config = flow_retrieval_config.get(
|
|
1128
1168
|
EMBEDDINGS_CONFIG_KEY, DEFAULT_EMBEDDINGS_CONFIG
|
|
1129
1169
|
)
|
|
1130
1170
|
flow_retrieval_embedding_model_name = (
|
|
1131
1171
|
(
|
|
1132
|
-
|
|
1133
|
-
or
|
|
1172
|
+
embeddings_config.get(MODEL_NAME_CONFIG_KEY)
|
|
1173
|
+
or embeddings_config.get(MODEL_CONFIG_KEY)
|
|
1134
1174
|
)
|
|
1135
1175
|
if flow_retrieval_enabled
|
|
1136
1176
|
else None
|
|
1137
1177
|
)
|
|
1178
|
+
# Config at this stage is not yet resolved, so read from `model_group`
|
|
1179
|
+
flow_retrieval_embedding_model_group_id = embeddings_config.get(
|
|
1180
|
+
MODEL_GROUP_CONFIG_KEY
|
|
1181
|
+
)
|
|
1138
1182
|
return {
|
|
1139
|
-
LLM_COMMAND_GENERATOR_MODEL_NAME: llm_model_name,
|
|
1140
|
-
LLM_COMMAND_GENERATOR_CUSTOM_PROMPT_USED: PROMPT_CONFIG_KEY in component
|
|
1141
|
-
or PROMPT_TEMPLATE_CONFIG_KEY in component,
|
|
1142
|
-
MULTI_STEP_LLM_COMMAND_GENERATOR_HANDLE_FLOWS_PROMPT_USED: HANDLE_FLOWS_KEY
|
|
1143
|
-
in component.get("prompt_templates", {}),
|
|
1144
|
-
MULTI_STEP_LLM_COMMAND_GENERATOR_FILL_SLOTS_PROMPT_USED: FILL_SLOTS_KEY
|
|
1145
|
-
in component.get("prompt_templates", {}),
|
|
1146
1183
|
FLOW_RETRIEVAL_ENABLED: flow_retrieval_enabled,
|
|
1147
1184
|
FLOW_RETRIEVAL_EMBEDDING_MODEL_NAME: flow_retrieval_embedding_model_name,
|
|
1185
|
+
FLOW_RETRIEVAL_EMBEDDING_MODEL_GROUP_ID: flow_retrieval_embedding_model_group_id, # noqa: E501
|
|
1148
1186
|
}
|
|
1149
1187
|
|
|
1188
|
+
def extract_settings(component: Dict) -> Dict:
|
|
1189
|
+
"""Extracts the settings from the command generator component."""
|
|
1190
|
+
settings = {}
|
|
1191
|
+
settings.update(extract_llm_command_generator_llm_client_settings(component))
|
|
1192
|
+
settings.update(extract_multistep_command_generator_prompt_settings(component))
|
|
1193
|
+
settings.update(extract_flow_retrieval_settings(component))
|
|
1194
|
+
return settings
|
|
1195
|
+
|
|
1150
1196
|
command_generator_config = {
|
|
1151
1197
|
LLM_COMMAND_GENERATOR_MODEL_NAME: None,
|
|
1198
|
+
LLM_COMMAND_GENERATOR_MODEL_GROUP_ID: None,
|
|
1152
1199
|
LLM_COMMAND_GENERATOR_CUSTOM_PROMPT_USED: None,
|
|
1153
1200
|
MULTI_STEP_LLM_COMMAND_GENERATOR_HANDLE_FLOWS_PROMPT_USED: None,
|
|
1154
1201
|
MULTI_STEP_LLM_COMMAND_GENERATOR_FILL_SLOTS_PROMPT_USED: None,
|
|
1155
1202
|
FLOW_RETRIEVAL_ENABLED: None,
|
|
1156
1203
|
FLOW_RETRIEVAL_EMBEDDING_MODEL_NAME: None,
|
|
1204
|
+
FLOW_RETRIEVAL_EMBEDDING_MODEL_GROUP_ID: None,
|
|
1157
1205
|
}
|
|
1158
1206
|
|
|
1159
1207
|
pipeline = config.get("pipeline", [])
|
|
@@ -1333,6 +1381,17 @@ def track_shell_started(model_type: Text) -> None:
|
|
|
1333
1381
|
_track(TELEMETRY_SHELL_STARTED_EVENT, {"type": model_type})
|
|
1334
1382
|
|
|
1335
1383
|
|
|
1384
|
+
@ensure_telemetry_enabled
|
|
1385
|
+
def track_inspect_started(model_type: Text) -> None:
|
|
1386
|
+
"""Track when a user starts a bot using rasa inspect.
|
|
1387
|
+
|
|
1388
|
+
Args:
|
|
1389
|
+
channel: Channel name `socketio` (used for chat assistants)
|
|
1390
|
+
or `browser_audio` (used for voice).
|
|
1391
|
+
"""
|
|
1392
|
+
_track(TELEMETRY_INSPECT_STARTED_EVENT, {"type": model_type})
|
|
1393
|
+
|
|
1394
|
+
|
|
1336
1395
|
@ensure_telemetry_enabled
|
|
1337
1396
|
def track_visualization() -> None:
|
|
1338
1397
|
"""Track when a user runs the visualization."""
|
|
@@ -1553,6 +1612,7 @@ def track_response_rephrase(
|
|
|
1553
1612
|
custom_prompt_template: Optional[str],
|
|
1554
1613
|
llm_type: Optional[str],
|
|
1555
1614
|
llm_model: Optional[str],
|
|
1615
|
+
llm_model_group_id: Optional[str],
|
|
1556
1616
|
) -> None:
|
|
1557
1617
|
"""Track when a user rephrases a response."""
|
|
1558
1618
|
_track(
|
|
@@ -1562,6 +1622,7 @@ def track_response_rephrase(
|
|
|
1562
1622
|
"custom_prompt_template": custom_prompt_template,
|
|
1563
1623
|
"llm_type": llm_type,
|
|
1564
1624
|
"llm_model": llm_model,
|
|
1625
|
+
"llm_model_group_id": llm_model_group_id,
|
|
1565
1626
|
},
|
|
1566
1627
|
)
|
|
1567
1628
|
|
|
@@ -1576,8 +1637,10 @@ def track_intentless_policy_train() -> None:
|
|
|
1576
1637
|
def track_intentless_policy_train_completed(
|
|
1577
1638
|
embeddings_type: Optional[str],
|
|
1578
1639
|
embeddings_model: Optional[str],
|
|
1640
|
+
embeddings_model_group_id: Optional[str],
|
|
1579
1641
|
llm_type: Optional[str],
|
|
1580
1642
|
llm_model: Optional[str],
|
|
1643
|
+
llm_model_group_id: Optional[str],
|
|
1581
1644
|
) -> None:
|
|
1582
1645
|
"""Track when a user trains a policy."""
|
|
1583
1646
|
_track(
|
|
@@ -1585,8 +1648,10 @@ def track_intentless_policy_train_completed(
|
|
|
1585
1648
|
{
|
|
1586
1649
|
"embeddings_type": embeddings_type,
|
|
1587
1650
|
"embeddings_model": embeddings_model,
|
|
1651
|
+
"embeddings_model_group_id": embeddings_model_group_id,
|
|
1588
1652
|
"llm_type": llm_type,
|
|
1589
1653
|
"llm_model": llm_model,
|
|
1654
|
+
"llm_model_group_id": llm_model_group_id,
|
|
1590
1655
|
},
|
|
1591
1656
|
)
|
|
1592
1657
|
|
|
@@ -1595,8 +1660,10 @@ def track_intentless_policy_train_completed(
|
|
|
1595
1660
|
def track_intentless_policy_predict(
|
|
1596
1661
|
embeddings_type: Optional[str],
|
|
1597
1662
|
embeddings_model: Optional[str],
|
|
1663
|
+
embeddings_model_group_id: Optional[str],
|
|
1598
1664
|
llm_type: Optional[str],
|
|
1599
1665
|
llm_model: Optional[str],
|
|
1666
|
+
llm_model_group_id: Optional[str],
|
|
1600
1667
|
score: float,
|
|
1601
1668
|
) -> None:
|
|
1602
1669
|
"""Track when a user trains a policy."""
|
|
@@ -1605,8 +1672,10 @@ def track_intentless_policy_predict(
|
|
|
1605
1672
|
{
|
|
1606
1673
|
"embeddings_type": embeddings_type,
|
|
1607
1674
|
"embeddings_model": embeddings_model,
|
|
1675
|
+
"embeddings_model_group_id": embeddings_model_group_id,
|
|
1608
1676
|
"llm_type": llm_type,
|
|
1609
1677
|
"llm_model": llm_model,
|
|
1678
|
+
"llm_model_group_id": llm_model_group_id,
|
|
1610
1679
|
"score": score,
|
|
1611
1680
|
},
|
|
1612
1681
|
)
|
|
@@ -1696,8 +1765,10 @@ def track_enterprise_search_policy_train_completed(
|
|
|
1696
1765
|
vector_store_type: Optional[str],
|
|
1697
1766
|
embeddings_type: Optional[str],
|
|
1698
1767
|
embeddings_model: Optional[str],
|
|
1768
|
+
embeddings_model_group_id: Optional[str],
|
|
1699
1769
|
llm_type: Optional[str],
|
|
1700
1770
|
llm_model: Optional[str],
|
|
1771
|
+
llm_model_group_id: Optional[str],
|
|
1701
1772
|
citation_enabled: Optional[bool],
|
|
1702
1773
|
) -> None:
|
|
1703
1774
|
"""Track when a user completes training Enterprise Search policy."""
|
|
@@ -1707,8 +1778,10 @@ def track_enterprise_search_policy_train_completed(
|
|
|
1707
1778
|
"vector_store_type": vector_store_type,
|
|
1708
1779
|
"embeddings_type": embeddings_type,
|
|
1709
1780
|
"embeddings_model": embeddings_model,
|
|
1781
|
+
"embeddings_model_group_id": embeddings_model_group_id,
|
|
1710
1782
|
"llm_type": llm_type,
|
|
1711
1783
|
"llm_model": llm_model,
|
|
1784
|
+
"llm_model_group_id": llm_model_group_id,
|
|
1712
1785
|
"citation_enabled": citation_enabled,
|
|
1713
1786
|
},
|
|
1714
1787
|
)
|
|
@@ -1719,8 +1792,10 @@ def track_enterprise_search_policy_predict(
|
|
|
1719
1792
|
vector_store_type: Optional[str],
|
|
1720
1793
|
embeddings_type: Optional[str],
|
|
1721
1794
|
embeddings_model: Optional[str],
|
|
1795
|
+
embeddings_model_group_id: Optional[str],
|
|
1722
1796
|
llm_type: Optional[str],
|
|
1723
1797
|
llm_model: Optional[str],
|
|
1798
|
+
llm_model_group_id: Optional[str],
|
|
1724
1799
|
citation_enabled: Optional[bool],
|
|
1725
1800
|
) -> None:
|
|
1726
1801
|
"""Track when a user predicts the next action using Enterprise Search policy."""
|
|
@@ -1730,8 +1805,10 @@ def track_enterprise_search_policy_predict(
|
|
|
1730
1805
|
"vector_store_type": vector_store_type,
|
|
1731
1806
|
"embeddings_type": embeddings_type,
|
|
1732
1807
|
"embeddings_model": embeddings_model,
|
|
1808
|
+
"embeddings_model_group_id": embeddings_model_group_id,
|
|
1733
1809
|
"llm_type": llm_type,
|
|
1734
1810
|
"llm_model": llm_model,
|
|
1811
|
+
"llm_model_group_id": llm_model_group_id,
|
|
1735
1812
|
"citation_enabled": citation_enabled,
|
|
1736
1813
|
},
|
|
1737
1814
|
)
|
rasa/tracing/config.py
CHANGED
|
@@ -33,6 +33,7 @@ from rasa.dialogue_understanding.generator import (
|
|
|
33
33
|
SingleStepLLMCommandGenerator,
|
|
34
34
|
MultiStepLLMCommandGenerator,
|
|
35
35
|
)
|
|
36
|
+
from rasa.dialogue_understanding.generator.flow_retrieval import FlowRetrieval
|
|
36
37
|
from rasa.dialogue_understanding.generator.nlu_command_adapter import NLUCommandAdapter
|
|
37
38
|
from rasa.engine.graph import GraphNode
|
|
38
39
|
from rasa.engine.training.graph_trainer import GraphTrainer
|
|
@@ -111,6 +112,7 @@ def configure_tracing(tracer_provider: Optional[TracerProvider]) -> None:
|
|
|
111
112
|
single_step_llm_command_generator_class=SingleStepLLMCommandGenerator,
|
|
112
113
|
multi_step_llm_command_generator_class=MultiStepLLMCommandGenerator,
|
|
113
114
|
custom_action_executor_subclasses=custom_action_executor_subclasses,
|
|
115
|
+
flow_retrieval_class=FlowRetrieval,
|
|
114
116
|
)
|
|
115
117
|
|
|
116
118
|
|
|
@@ -129,7 +131,7 @@ def get_tracer_provider(endpoints_file: Text) -> Optional[TracerProvider]:
|
|
|
129
131
|
|
|
130
132
|
if not cfg:
|
|
131
133
|
logger.info(
|
|
132
|
-
f"No endpoint for tracing type available in {endpoints_file},"
|
|
134
|
+
f"No endpoint for tracing type available in {endpoints_file}, "
|
|
133
135
|
f"tracing will not be configured."
|
|
134
136
|
)
|
|
135
137
|
return None
|