rasa-pro 3.9.18__py3-none-any.whl → 3.10.16__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 +0 -374
- rasa/__init__.py +1 -2
- rasa/__main__.py +5 -0
- rasa/anonymization/anonymization_rule_executor.py +2 -2
- rasa/api.py +27 -23
- rasa/cli/arguments/data.py +27 -2
- rasa/cli/arguments/default_arguments.py +25 -3
- rasa/cli/arguments/run.py +9 -9
- rasa/cli/arguments/train.py +11 -3
- rasa/cli/data.py +70 -8
- rasa/cli/e2e_test.py +104 -431
- rasa/cli/evaluate.py +1 -1
- rasa/cli/interactive.py +1 -0
- rasa/cli/llm_fine_tuning.py +398 -0
- rasa/cli/project_templates/calm/endpoints.yml +1 -1
- rasa/cli/project_templates/tutorial/endpoints.yml +1 -1
- rasa/cli/run.py +15 -14
- rasa/cli/scaffold.py +10 -8
- rasa/cli/studio/studio.py +35 -5
- rasa/cli/train.py +56 -8
- rasa/cli/utils.py +22 -5
- rasa/cli/x.py +1 -1
- rasa/constants.py +7 -1
- rasa/core/actions/action.py +98 -49
- rasa/core/actions/action_run_slot_rejections.py +4 -1
- rasa/core/actions/custom_action_executor.py +9 -6
- rasa/core/actions/direct_custom_actions_executor.py +80 -0
- rasa/core/actions/e2e_stub_custom_action_executor.py +68 -0
- rasa/core/actions/grpc_custom_action_executor.py +2 -2
- rasa/core/actions/http_custom_action_executor.py +6 -5
- rasa/core/agent.py +21 -17
- rasa/core/channels/__init__.py +2 -0
- rasa/core/channels/audiocodes.py +1 -16
- rasa/core/channels/voice_aware/__init__.py +0 -0
- rasa/core/channels/voice_aware/jambonz.py +103 -0
- rasa/core/channels/voice_aware/jambonz_protocol.py +344 -0
- rasa/core/channels/voice_aware/utils.py +20 -0
- rasa/core/channels/voice_native/__init__.py +0 -0
- rasa/core/constants.py +6 -1
- rasa/core/information_retrieval/faiss.py +7 -4
- rasa/core/information_retrieval/information_retrieval.py +8 -0
- rasa/core/information_retrieval/milvus.py +9 -2
- rasa/core/information_retrieval/qdrant.py +1 -1
- rasa/core/nlg/contextual_response_rephraser.py +32 -10
- rasa/core/nlg/summarize.py +4 -3
- rasa/core/policies/enterprise_search_policy.py +113 -45
- rasa/core/policies/flows/flow_executor.py +122 -76
- rasa/core/policies/intentless_policy.py +83 -29
- rasa/core/processor.py +72 -54
- rasa/core/run.py +5 -4
- rasa/core/tracker_store.py +8 -4
- rasa/core/training/interactive.py +1 -1
- rasa/core/utils.py +56 -57
- rasa/dialogue_understanding/coexistence/llm_based_router.py +53 -13
- rasa/dialogue_understanding/commands/__init__.py +6 -0
- rasa/dialogue_understanding/commands/restart_command.py +58 -0
- rasa/dialogue_understanding/commands/session_start_command.py +59 -0
- rasa/dialogue_understanding/commands/utils.py +40 -0
- rasa/dialogue_understanding/generator/constants.py +10 -3
- rasa/dialogue_understanding/generator/flow_retrieval.py +21 -5
- rasa/dialogue_understanding/generator/llm_based_command_generator.py +13 -3
- rasa/dialogue_understanding/generator/multi_step/multi_step_llm_command_generator.py +134 -90
- rasa/dialogue_understanding/generator/nlu_command_adapter.py +47 -7
- rasa/dialogue_understanding/generator/single_step/single_step_llm_command_generator.py +127 -41
- rasa/dialogue_understanding/patterns/restart.py +37 -0
- rasa/dialogue_understanding/patterns/session_start.py +37 -0
- rasa/dialogue_understanding/processor/command_processor.py +16 -3
- rasa/dialogue_understanding/processor/command_processor_component.py +6 -2
- rasa/e2e_test/aggregate_test_stats_calculator.py +134 -0
- rasa/e2e_test/assertions.py +1223 -0
- rasa/e2e_test/assertions_schema.yml +106 -0
- rasa/e2e_test/constants.py +20 -0
- rasa/e2e_test/e2e_config.py +220 -0
- rasa/e2e_test/e2e_config_schema.yml +26 -0
- rasa/e2e_test/e2e_test_case.py +131 -8
- rasa/e2e_test/e2e_test_converter.py +363 -0
- rasa/e2e_test/e2e_test_converter_prompt.jinja2 +70 -0
- rasa/e2e_test/e2e_test_coverage_report.py +364 -0
- rasa/e2e_test/e2e_test_result.py +26 -6
- rasa/e2e_test/e2e_test_runner.py +493 -71
- rasa/e2e_test/e2e_test_schema.yml +96 -0
- rasa/e2e_test/pykwalify_extensions.py +39 -0
- rasa/e2e_test/stub_custom_action.py +70 -0
- rasa/e2e_test/utils/__init__.py +0 -0
- rasa/e2e_test/utils/e2e_yaml_utils.py +55 -0
- rasa/e2e_test/utils/io.py +598 -0
- rasa/e2e_test/utils/validation.py +80 -0
- rasa/engine/graph.py +9 -3
- rasa/engine/recipes/default_components.py +0 -2
- rasa/engine/recipes/default_recipe.py +10 -2
- rasa/engine/storage/local_model_storage.py +40 -12
- rasa/engine/validation.py +78 -1
- rasa/env.py +9 -0
- rasa/graph_components/providers/story_graph_provider.py +59 -6
- rasa/llm_fine_tuning/__init__.py +0 -0
- rasa/llm_fine_tuning/annotation_module.py +241 -0
- rasa/llm_fine_tuning/conversations.py +144 -0
- rasa/llm_fine_tuning/llm_data_preparation_module.py +178 -0
- rasa/llm_fine_tuning/notebooks/unsloth_finetuning.ipynb +407 -0
- rasa/llm_fine_tuning/paraphrasing/__init__.py +0 -0
- rasa/llm_fine_tuning/paraphrasing/conversation_rephraser.py +281 -0
- rasa/llm_fine_tuning/paraphrasing/default_rephrase_prompt_template.jina2 +44 -0
- rasa/llm_fine_tuning/paraphrasing/rephrase_validator.py +121 -0
- rasa/llm_fine_tuning/paraphrasing/rephrased_user_message.py +10 -0
- rasa/llm_fine_tuning/paraphrasing_module.py +128 -0
- rasa/llm_fine_tuning/storage.py +174 -0
- rasa/llm_fine_tuning/train_test_split_module.py +441 -0
- rasa/model_training.py +56 -16
- rasa/nlu/persistor.py +157 -36
- rasa/server.py +45 -10
- rasa/shared/constants.py +76 -16
- rasa/shared/core/domain.py +27 -19
- rasa/shared/core/events.py +28 -2
- rasa/shared/core/flows/flow.py +208 -13
- rasa/shared/core/flows/flow_path.py +84 -0
- rasa/shared/core/flows/flows_list.py +33 -11
- rasa/shared/core/flows/flows_yaml_schema.json +269 -193
- rasa/shared/core/flows/validation.py +112 -25
- rasa/shared/core/flows/yaml_flows_io.py +149 -10
- rasa/shared/core/trackers.py +6 -0
- rasa/shared/core/training_data/structures.py +20 -0
- rasa/shared/core/training_data/visualization.html +2 -2
- rasa/shared/exceptions.py +4 -0
- rasa/shared/importers/importer.py +64 -16
- rasa/shared/nlu/constants.py +2 -0
- rasa/shared/providers/_configs/__init__.py +0 -0
- rasa/shared/providers/_configs/azure_openai_client_config.py +183 -0
- rasa/shared/providers/_configs/client_config.py +57 -0
- rasa/shared/providers/_configs/default_litellm_client_config.py +130 -0
- rasa/shared/providers/_configs/huggingface_local_embedding_client_config.py +234 -0
- rasa/shared/providers/_configs/openai_client_config.py +175 -0
- rasa/shared/providers/_configs/self_hosted_llm_client_config.py +176 -0
- rasa/shared/providers/_configs/utils.py +101 -0
- rasa/shared/providers/_ssl_verification_utils.py +124 -0
- rasa/shared/providers/embedding/__init__.py +0 -0
- rasa/shared/providers/embedding/_base_litellm_embedding_client.py +259 -0
- rasa/shared/providers/embedding/_langchain_embedding_client_adapter.py +74 -0
- rasa/shared/providers/embedding/azure_openai_embedding_client.py +277 -0
- rasa/shared/providers/embedding/default_litellm_embedding_client.py +102 -0
- rasa/shared/providers/embedding/embedding_client.py +90 -0
- rasa/shared/providers/embedding/embedding_response.py +41 -0
- rasa/shared/providers/embedding/huggingface_local_embedding_client.py +191 -0
- rasa/shared/providers/embedding/openai_embedding_client.py +172 -0
- rasa/shared/providers/llm/__init__.py +0 -0
- rasa/shared/providers/llm/_base_litellm_client.py +251 -0
- rasa/shared/providers/llm/azure_openai_llm_client.py +338 -0
- rasa/shared/providers/llm/default_litellm_llm_client.py +84 -0
- rasa/shared/providers/llm/llm_client.py +76 -0
- rasa/shared/providers/llm/llm_response.py +50 -0
- rasa/shared/providers/llm/openai_llm_client.py +155 -0
- rasa/shared/providers/llm/self_hosted_llm_client.py +293 -0
- rasa/shared/providers/mappings.py +75 -0
- rasa/shared/utils/cli.py +30 -0
- rasa/shared/utils/io.py +65 -2
- rasa/shared/utils/llm.py +246 -200
- rasa/shared/utils/yaml.py +121 -15
- rasa/studio/auth.py +6 -4
- rasa/studio/config.py +13 -4
- rasa/studio/constants.py +1 -0
- rasa/studio/data_handler.py +10 -3
- rasa/studio/download.py +19 -13
- rasa/studio/train.py +2 -3
- rasa/studio/upload.py +19 -11
- rasa/telemetry.py +113 -58
- rasa/tracing/instrumentation/attribute_extractors.py +32 -17
- rasa/utils/common.py +18 -19
- rasa/utils/endpoints.py +7 -4
- rasa/utils/json_utils.py +60 -0
- rasa/utils/licensing.py +9 -1
- rasa/utils/ml_utils.py +4 -2
- rasa/validator.py +213 -3
- rasa/version.py +1 -1
- rasa_pro-3.10.16.dist-info/METADATA +196 -0
- {rasa_pro-3.9.18.dist-info → rasa_pro-3.10.16.dist-info}/RECORD +179 -113
- rasa/nlu/classifiers/llm_intent_classifier.py +0 -519
- rasa/shared/providers/openai/clients.py +0 -43
- rasa/shared/providers/openai/session_handler.py +0 -110
- rasa_pro-3.9.18.dist-info/METADATA +0 -563
- /rasa/{shared/providers/openai → cli/project_templates/tutorial/actions}/__init__.py +0 -0
- /rasa/cli/project_templates/tutorial/{actions.py → actions/actions.py} +0 -0
- {rasa_pro-3.9.18.dist-info → rasa_pro-3.10.16.dist-info}/NOTICE +0 -0
- {rasa_pro-3.9.18.dist-info → rasa_pro-3.10.16.dist-info}/WHEEL +0 -0
- {rasa_pro-3.9.18.dist-info → rasa_pro-3.10.16.dist-info}/entry_points.txt +0 -0
rasa/cli/arguments/train.py
CHANGED
|
@@ -3,11 +3,12 @@ from typing import Union
|
|
|
3
3
|
|
|
4
4
|
from rasa.cli.arguments.default_arguments import (
|
|
5
5
|
add_config_param,
|
|
6
|
-
add_stories_param,
|
|
7
|
-
add_nlu_data_param,
|
|
8
|
-
add_out_param,
|
|
9
6
|
add_domain_param,
|
|
10
7
|
add_endpoint_param,
|
|
8
|
+
add_nlu_data_param,
|
|
9
|
+
add_out_param,
|
|
10
|
+
add_remote_storage_param,
|
|
11
|
+
add_stories_param,
|
|
11
12
|
)
|
|
12
13
|
from rasa.graph_components.providers.training_tracker_provider import (
|
|
13
14
|
TrainingTrackerProvider,
|
|
@@ -38,6 +39,13 @@ def set_train_arguments(parser: argparse.ArgumentParser) -> None:
|
|
|
38
39
|
add_endpoint_param(
|
|
39
40
|
parser, help_text="Configuration file for the connectors as a yml file."
|
|
40
41
|
)
|
|
42
|
+
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
|
+
)
|
|
41
49
|
|
|
42
50
|
|
|
43
51
|
def set_train_core_arguments(parser: argparse.ArgumentParser) -> None:
|
rasa/cli/data.py
CHANGED
|
@@ -3,28 +3,36 @@ import logging
|
|
|
3
3
|
import pathlib
|
|
4
4
|
from typing import List
|
|
5
5
|
|
|
6
|
+
import rasa.cli.utils
|
|
6
7
|
import rasa.shared.core.domain
|
|
8
|
+
import rasa.shared.data
|
|
9
|
+
import rasa.shared.nlu.training_data.loading
|
|
10
|
+
import rasa.shared.nlu.training_data.util
|
|
11
|
+
import rasa.shared.utils.cli
|
|
12
|
+
import rasa.shared.utils.io
|
|
13
|
+
import rasa.utils.common
|
|
7
14
|
from rasa import telemetry
|
|
8
15
|
from rasa.cli import SubParsersAction
|
|
9
16
|
from rasa.cli.arguments import data as arguments
|
|
10
17
|
from rasa.cli.arguments import default_arguments
|
|
11
|
-
|
|
18
|
+
from rasa.e2e_test.e2e_config import create_llm_e2e_test_converter_config
|
|
19
|
+
from rasa.e2e_test.e2e_test_converter import E2ETestConverter
|
|
20
|
+
from rasa.e2e_test.utils.e2e_yaml_utils import E2ETestYAMLWriter
|
|
12
21
|
from rasa.shared.constants import (
|
|
13
22
|
DEFAULT_DATA_PATH,
|
|
14
23
|
DEFAULT_CONFIG_PATH,
|
|
15
24
|
DEFAULT_DOMAIN_PATHS,
|
|
16
25
|
)
|
|
17
|
-
|
|
26
|
+
from rasa.shared.exceptions import RasaException
|
|
18
27
|
from rasa.shared.importers.importer import TrainingDataImporter
|
|
19
|
-
|
|
20
|
-
import rasa.shared.nlu.training_data.util
|
|
21
|
-
import rasa.shared.utils.cli
|
|
22
|
-
import rasa.utils.common
|
|
23
|
-
import rasa.shared.utils.io
|
|
28
|
+
from rasa.shared.utils.common import minimal_kwargs
|
|
24
29
|
from rasa.shared.utils.yaml import read_yaml_file, write_yaml
|
|
30
|
+
from rasa.utils.beta import ensure_beta_feature_is_enabled
|
|
25
31
|
|
|
26
32
|
logger = logging.getLogger(__name__)
|
|
27
33
|
|
|
34
|
+
RASA_PRO_BETA_E2E_CONVERSION_ENV_VAR_NAME = "RASA_PRO_BETA_E2E_CONVERSION"
|
|
35
|
+
|
|
28
36
|
|
|
29
37
|
def add_subparser(
|
|
30
38
|
subparsers: SubParsersAction, parents: List[argparse.ArgumentParser]
|
|
@@ -71,7 +79,16 @@ def _add_data_convert_parsers(
|
|
|
71
79
|
help="Converts NLU data between formats.",
|
|
72
80
|
)
|
|
73
81
|
convert_nlu_parser.set_defaults(func=_convert_nlu_data)
|
|
74
|
-
arguments.
|
|
82
|
+
arguments.set_convert_nlu_arguments(convert_nlu_parser, data_type="Rasa NLU")
|
|
83
|
+
|
|
84
|
+
convert_e2e_parser = convert_subparsers.add_parser(
|
|
85
|
+
"e2e",
|
|
86
|
+
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
|
|
87
|
+
parents=parents,
|
|
88
|
+
help="Convert input sample conversations into E2E test cases.",
|
|
89
|
+
)
|
|
90
|
+
convert_e2e_parser.set_defaults(func=convert_data_to_e2e_tests)
|
|
91
|
+
arguments.set_convert_e2e_arguments(convert_e2e_parser)
|
|
75
92
|
|
|
76
93
|
|
|
77
94
|
def _add_data_split_parsers(
|
|
@@ -290,3 +307,48 @@ def _migrate_domain(args: argparse.Namespace) -> None:
|
|
|
290
307
|
import rasa.core.migrate
|
|
291
308
|
|
|
292
309
|
rasa.core.migrate.migrate_domain_format(args.domain, args.out)
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
def validate_e2e_test_conversion_output_path(output_path: str) -> None:
|
|
313
|
+
"""Validates that the provided output path is within the project directory.
|
|
314
|
+
|
|
315
|
+
Args:
|
|
316
|
+
output_path (str): The output path to be validated.
|
|
317
|
+
|
|
318
|
+
Raises:
|
|
319
|
+
RasaException: If the provided output path is an absolute path.
|
|
320
|
+
"""
|
|
321
|
+
if pathlib.Path(output_path).is_absolute():
|
|
322
|
+
raise RasaException(
|
|
323
|
+
"Please provide a relative output path within the assistant "
|
|
324
|
+
"project directory in which the command is running."
|
|
325
|
+
)
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
def convert_data_to_e2e_tests(args: argparse.Namespace) -> None:
|
|
329
|
+
"""Converts sample conversation data into E2E test cases
|
|
330
|
+
and stores them in the output YAML file.
|
|
331
|
+
|
|
332
|
+
Args:
|
|
333
|
+
args: The arguments passed in from the CLI.
|
|
334
|
+
"""
|
|
335
|
+
try:
|
|
336
|
+
ensure_beta_feature_is_enabled(
|
|
337
|
+
"conversion of sample conversations into end-to-end tests",
|
|
338
|
+
RASA_PRO_BETA_E2E_CONVERSION_ENV_VAR_NAME,
|
|
339
|
+
)
|
|
340
|
+
validate_e2e_test_conversion_output_path(args.output)
|
|
341
|
+
|
|
342
|
+
config_path = pathlib.Path(args.output)
|
|
343
|
+
llm_config = create_llm_e2e_test_converter_config(config_path)
|
|
344
|
+
|
|
345
|
+
kwargs = minimal_kwargs(vars(args), E2ETestConverter)
|
|
346
|
+
converter = E2ETestConverter(llm_config=llm_config, **kwargs)
|
|
347
|
+
yaml_tests_string = converter.run()
|
|
348
|
+
|
|
349
|
+
writer = E2ETestYAMLWriter(output_path=args.output)
|
|
350
|
+
writer.write_to_file(yaml_tests_string)
|
|
351
|
+
except RasaException as exc:
|
|
352
|
+
rasa.shared.utils.cli.print_error_and_exit(
|
|
353
|
+
f"Failed to convert the data into E2E tests. Error: {exc}"
|
|
354
|
+
)
|