rasa-pro 3.13.0.dev20250612__py3-none-any.whl → 3.13.0rc1__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 +0 -3
- rasa/api.py +1 -1
- rasa/cli/dialogue_understanding_test.py +1 -1
- rasa/cli/e2e_test.py +1 -8
- rasa/cli/evaluate.py +1 -1
- rasa/cli/export.py +3 -1
- rasa/cli/llm_fine_tuning.py +12 -11
- rasa/cli/project_templates/defaults.py +133 -0
- rasa/cli/project_templates/tutorial/config.yml +1 -1
- rasa/cli/project_templates/tutorial/endpoints.yml +1 -1
- rasa/cli/run.py +1 -1
- rasa/cli/studio/download.py +1 -23
- rasa/cli/studio/link.py +52 -0
- rasa/cli/studio/pull.py +79 -0
- rasa/cli/studio/push.py +78 -0
- rasa/cli/studio/studio.py +12 -0
- rasa/cli/studio/train.py +0 -1
- rasa/cli/studio/upload.py +8 -0
- rasa/cli/train.py +1 -1
- rasa/cli/utils.py +1 -1
- rasa/cli/x.py +1 -1
- rasa/constants.py +2 -0
- rasa/core/__init__.py +0 -16
- rasa/core/actions/action.py +5 -1
- rasa/core/actions/action_repeat_bot_messages.py +18 -22
- rasa/core/actions/action_run_slot_rejections.py +0 -1
- rasa/core/agent.py +16 -1
- rasa/core/available_endpoints.py +146 -0
- rasa/core/brokers/pika.py +1 -2
- rasa/core/channels/__init__.py +2 -0
- rasa/core/channels/botframework.py +2 -2
- rasa/core/channels/channel.py +2 -2
- rasa/core/channels/development_inspector.py +1 -1
- rasa/core/channels/facebook.py +1 -4
- rasa/core/channels/hangouts.py +8 -5
- rasa/core/channels/inspector/README.md +3 -3
- rasa/core/channels/inspector/dist/assets/{arc-c4b064fc.js → arc-371401b1.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{blockDiagram-38ab4fdb-215b5026.js → blockDiagram-38ab4fdb-3f126156.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{c4Diagram-3d4e48cf-2b54a0a3.js → c4Diagram-3d4e48cf-12f22eb7.js} +1 -1
- rasa/core/channels/inspector/dist/assets/channel-f1efda17.js +1 -0
- rasa/core/channels/inspector/dist/assets/{classDiagram-70f12bd4-daacea5f.js → classDiagram-70f12bd4-03b1d386.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{classDiagram-v2-f2320105-930d4dc2.js → classDiagram-v2-f2320105-84f69d63.js} +1 -1
- rasa/core/channels/inspector/dist/assets/clone-fdf164e2.js +1 -0
- rasa/core/channels/inspector/dist/assets/{createText-2e5e7dd3-83c206ba.js → createText-2e5e7dd3-ca47fd38.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{edges-e0da2a9e-b0eb01d0.js → edges-e0da2a9e-f837ca8a.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{erDiagram-9861fffd-17586500.js → erDiagram-9861fffd-8717ac54.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{flowDb-956e92f1-be2a1776.js → flowDb-956e92f1-94f38b83.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{flowDiagram-66a62f08-c2120ebd.js → flowDiagram-66a62f08-b616f9fb.js} +1 -1
- rasa/core/channels/inspector/dist/assets/flowDiagram-v2-96b9c2cf-7d7a1629.js +1 -0
- rasa/core/channels/inspector/dist/assets/{flowchart-elk-definition-4a651766-a6ab5c48.js → flowchart-elk-definition-4a651766-f5d24bb8.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{ganttDiagram-c361ad54-ef613457.js → ganttDiagram-c361ad54-b43ba8d9.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{gitGraphDiagram-72cf32ee-d59185b3.js → gitGraphDiagram-72cf32ee-c3aafaa5.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{graph-0f155405.js → graph-0d0a2c10.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{index-3862675e-d5f1d1b7.js → index-3862675e-58ea0305.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{index-47737d3a.js → index-cce6f8a1.js} +3 -3
- rasa/core/channels/inspector/dist/assets/{infoDiagram-f8f76790-b07d141f.js → infoDiagram-f8f76790-b8f60461.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{journeyDiagram-49397b02-1936d429.js → journeyDiagram-49397b02-95be5545.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{layout-dde8d0f3.js → layout-da885b9b.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{line-0c2c7ee0.js → line-f1c817d3.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{linear-35dd89a4.js → linear-d42801e6.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{mindmap-definition-fc14e90a-56192851.js → mindmap-definition-fc14e90a-a38923a6.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{pieDiagram-8a3498a8-fc21ed78.js → pieDiagram-8a3498a8-ca6e71e9.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{quadrantDiagram-120e2f19-25e98518.js → quadrantDiagram-120e2f19-b290dae9.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{requirementDiagram-deff3bca-546ff1f5.js → requirementDiagram-deff3bca-03f02ceb.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{sankeyDiagram-04a897e0-02d8b82d.js → sankeyDiagram-04a897e0-c49eee40.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{sequenceDiagram-704730f1-3ca5a92e.js → sequenceDiagram-704730f1-b2cd6a3d.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{stateDiagram-587899a1-128ea07c.js → stateDiagram-587899a1-e53a2028.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{stateDiagram-v2-d93cdb3a-95f290af.js → stateDiagram-v2-d93cdb3a-e1982a03.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-6aaf32cf-4984898a.js → styles-6aaf32cf-d0226ca5.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-9a916d00-1bf266ba.js → styles-9a916d00-0e21dc00.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-c10674c1-60521c63.js → styles-c10674c1-9588494e.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{svgDrawCommon-08f97a94-a25b6e12.js → svgDrawCommon-08f97a94-be478d4f.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{timeline-definition-85554ec2-0fc086bf.js → timeline-definition-85554ec2-74631749.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{xychartDiagram-e933f94c-44ee592e.js → xychartDiagram-e933f94c-a043552f.js} +1 -1
- rasa/core/channels/inspector/dist/index.html +1 -1
- rasa/core/channels/inspector/src/components/RecruitmentPanel.tsx +1 -1
- rasa/core/channels/mattermost.py +1 -1
- rasa/core/channels/rasa_chat.py +2 -4
- rasa/core/channels/rest.py +5 -4
- rasa/core/channels/socketio.py +56 -41
- rasa/core/channels/studio_chat.py +314 -10
- rasa/core/channels/vier_cvg.py +1 -2
- rasa/core/channels/voice_ready/audiocodes.py +2 -9
- rasa/core/channels/voice_stream/asr/azure.py +9 -0
- rasa/core/channels/voice_stream/audiocodes.py +8 -5
- rasa/core/channels/voice_stream/browser_audio.py +1 -1
- rasa/core/channels/voice_stream/genesys.py +2 -2
- rasa/core/channels/voice_stream/jambonz.py +166 -0
- rasa/core/channels/voice_stream/tts/__init__.py +8 -0
- rasa/core/channels/voice_stream/twilio_media_streams.py +17 -5
- rasa/core/channels/voice_stream/voice_channel.py +44 -24
- rasa/core/exporter.py +36 -0
- rasa/core/http_interpreter.py +3 -7
- rasa/core/information_retrieval/faiss.py +18 -11
- rasa/core/information_retrieval/ingestion/faq_parser.py +158 -0
- rasa/core/jobs.py +2 -1
- rasa/core/nlg/contextual_response_rephraser.py +48 -12
- rasa/core/nlg/generator.py +0 -1
- rasa/core/nlg/interpolator.py +2 -3
- rasa/core/nlg/summarize.py +39 -5
- rasa/core/policies/enterprise_search_policy.py +298 -184
- rasa/core/policies/enterprise_search_policy_config.py +241 -0
- rasa/core/policies/enterprise_search_prompt_with_relevancy_check_and_citation_template.jinja2 +64 -0
- rasa/core/policies/flow_policy.py +1 -1
- rasa/core/policies/flows/flow_executor.py +96 -17
- rasa/core/policies/intentless_policy.py +71 -26
- rasa/core/processor.py +104 -51
- rasa/core/run.py +33 -11
- rasa/core/tracker_stores/tracker_store.py +1 -1
- rasa/core/training/interactive.py +1 -1
- rasa/core/utils.py +35 -99
- rasa/dialogue_understanding/coexistence/intent_based_router.py +2 -1
- rasa/dialogue_understanding/coexistence/llm_based_router.py +13 -17
- rasa/dialogue_understanding/commands/__init__.py +4 -0
- rasa/dialogue_understanding/commands/can_not_handle_command.py +2 -0
- rasa/dialogue_understanding/commands/cancel_flow_command.py +6 -2
- rasa/dialogue_understanding/commands/chit_chat_answer_command.py +2 -0
- rasa/dialogue_understanding/commands/clarify_command.py +7 -3
- rasa/dialogue_understanding/commands/command_syntax_manager.py +1 -0
- rasa/dialogue_understanding/commands/correct_slots_command.py +5 -6
- rasa/dialogue_understanding/commands/error_command.py +1 -1
- rasa/dialogue_understanding/commands/human_handoff_command.py +3 -3
- rasa/dialogue_understanding/commands/knowledge_answer_command.py +2 -0
- rasa/dialogue_understanding/commands/repeat_bot_messages_command.py +2 -0
- rasa/dialogue_understanding/commands/set_slot_command.py +15 -5
- rasa/dialogue_understanding/commands/skip_question_command.py +3 -3
- rasa/dialogue_understanding/commands/start_flow_command.py +7 -3
- rasa/dialogue_understanding/commands/utils.py +26 -2
- rasa/dialogue_understanding/generator/__init__.py +7 -1
- rasa/dialogue_understanding/generator/command_generator.py +15 -3
- rasa/dialogue_understanding/generator/command_parser.py +2 -2
- rasa/dialogue_understanding/generator/command_parser_validator.py +63 -0
- rasa/dialogue_understanding/generator/constants.py +2 -2
- rasa/dialogue_understanding/generator/nlu_command_adapter.py +2 -2
- rasa/dialogue_understanding/generator/prompt_templates/command_prompt_template.jinja2 +0 -2
- rasa/dialogue_understanding/generator/prompt_templates/command_prompt_v2_claude_3_5_sonnet_20240620_template.jinja2 +1 -0
- rasa/dialogue_understanding/generator/prompt_templates/command_prompt_v2_gpt_4o_2024_11_20_template.jinja2 +1 -0
- rasa/dialogue_understanding/generator/prompt_templates/command_prompt_v3_claude_3_5_sonnet_20240620_template.jinja2 +79 -0
- rasa/dialogue_understanding/generator/prompt_templates/command_prompt_v3_gpt_4o_2024_11_20_template.jinja2 +79 -0
- rasa/dialogue_understanding/generator/single_step/compact_llm_command_generator.py +28 -463
- rasa/dialogue_understanding/generator/single_step/search_ready_llm_command_generator.py +147 -0
- rasa/dialogue_understanding/generator/single_step/single_step_based_llm_command_generator.py +461 -0
- rasa/dialogue_understanding/generator/single_step/single_step_llm_command_generator.py +11 -64
- rasa/dialogue_understanding/patterns/cancel.py +1 -2
- rasa/dialogue_understanding/patterns/clarify.py +1 -1
- rasa/dialogue_understanding/patterns/correction.py +2 -2
- rasa/dialogue_understanding/patterns/default_flows_for_patterns.yml +37 -25
- rasa/dialogue_understanding/patterns/domain_for_patterns.py +190 -0
- rasa/dialogue_understanding/processor/command_processor.py +11 -12
- rasa/dialogue_understanding/processor/command_processor_component.py +3 -3
- rasa/dialogue_understanding/stack/frames/flow_stack_frame.py +17 -4
- rasa/dialogue_understanding/stack/utils.py +3 -1
- rasa/dialogue_understanding/utils.py +68 -12
- rasa/dialogue_understanding_test/du_test_case.py +1 -1
- rasa/dialogue_understanding_test/du_test_runner.py +4 -22
- rasa/dialogue_understanding_test/test_case_simulation/test_case_tracker_simulator.py +2 -6
- rasa/e2e_test/e2e_test_coverage_report.py +1 -1
- rasa/e2e_test/e2e_test_runner.py +1 -1
- rasa/engine/constants.py +1 -1
- rasa/engine/graph.py +2 -2
- rasa/engine/recipes/default_recipe.py +26 -2
- rasa/engine/validation.py +3 -2
- rasa/hooks.py +0 -28
- rasa/llm_fine_tuning/annotation_module.py +39 -9
- rasa/llm_fine_tuning/conversations.py +3 -0
- rasa/llm_fine_tuning/llm_data_preparation_module.py +66 -49
- rasa/llm_fine_tuning/paraphrasing/conversation_rephraser.py +5 -7
- rasa/llm_fine_tuning/paraphrasing/rephrase_validator.py +52 -44
- rasa/llm_fine_tuning/paraphrasing_module.py +10 -12
- rasa/llm_fine_tuning/storage.py +4 -4
- rasa/llm_fine_tuning/utils.py +63 -1
- rasa/model_manager/model_api.py +88 -0
- rasa/model_manager/trainer_service.py +4 -4
- rasa/plugin.py +1 -11
- rasa/privacy/__init__.py +0 -0
- rasa/privacy/constants.py +83 -0
- rasa/privacy/event_broker_utils.py +77 -0
- rasa/privacy/privacy_config.py +281 -0
- rasa/privacy/privacy_config_schema.json +86 -0
- rasa/privacy/privacy_filter.py +340 -0
- rasa/privacy/privacy_manager.py +576 -0
- rasa/server.py +23 -2
- rasa/shared/constants.py +18 -0
- rasa/shared/core/command_payload_reader.py +1 -5
- rasa/shared/core/constants.py +4 -3
- rasa/shared/core/domain.py +7 -0
- rasa/shared/core/events.py +38 -10
- rasa/shared/core/flows/constants.py +2 -0
- rasa/shared/core/flows/flow.py +127 -14
- rasa/shared/core/flows/flows_list.py +18 -1
- rasa/shared/core/flows/flows_yaml_schema.json +3 -0
- rasa/shared/core/flows/steps/collect.py +46 -2
- rasa/shared/core/flows/steps/link.py +7 -2
- rasa/shared/core/flows/validation.py +25 -5
- rasa/shared/core/slots.py +28 -0
- rasa/shared/core/training_data/story_reader/yaml_story_reader.py +1 -4
- rasa/shared/exceptions.py +4 -0
- rasa/shared/providers/_configs/azure_openai_client_config.py +6 -2
- rasa/shared/providers/_configs/default_litellm_client_config.py +1 -1
- rasa/shared/providers/_configs/huggingface_local_embedding_client_config.py +1 -1
- rasa/shared/providers/_configs/openai_client_config.py +5 -1
- rasa/shared/providers/_configs/rasa_llm_client_config.py +1 -1
- rasa/shared/providers/_configs/self_hosted_llm_client_config.py +1 -1
- rasa/shared/providers/_configs/utils.py +0 -99
- rasa/shared/providers/embedding/_base_litellm_embedding_client.py +3 -0
- rasa/shared/providers/llm/_base_litellm_client.py +5 -2
- rasa/shared/utils/common.py +1 -1
- rasa/shared/utils/configs.py +110 -0
- rasa/shared/utils/constants.py +0 -3
- rasa/shared/utils/llm.py +195 -9
- rasa/shared/utils/pykwalify_extensions.py +0 -9
- rasa/shared/utils/yaml.py +32 -0
- rasa/studio/constants.py +1 -0
- rasa/studio/data_handler.py +11 -4
- rasa/studio/download.py +167 -0
- rasa/studio/link.py +200 -0
- rasa/studio/prompts.py +223 -0
- rasa/studio/pull/__init__.py +0 -0
- rasa/studio/{download/flows.py → pull/data.py} +23 -160
- rasa/studio/{download → pull}/domains.py +1 -1
- rasa/studio/pull/pull.py +235 -0
- rasa/studio/push.py +136 -0
- rasa/studio/train.py +1 -1
- rasa/studio/upload.py +117 -67
- rasa/telemetry.py +82 -25
- rasa/tracing/config.py +3 -4
- rasa/tracing/constants.py +19 -1
- rasa/tracing/instrumentation/attribute_extractors.py +30 -8
- rasa/tracing/instrumentation/instrumentation.py +53 -2
- rasa/tracing/instrumentation/metrics.py +98 -15
- rasa/tracing/metric_instrument_provider.py +75 -3
- rasa/utils/common.py +7 -22
- rasa/utils/log_utils.py +1 -45
- rasa/validator.py +2 -8
- rasa/version.py +1 -1
- {rasa_pro-3.13.0.dev20250612.dist-info → rasa_pro-3.13.0rc1.dist-info}/METADATA +8 -9
- {rasa_pro-3.13.0.dev20250612.dist-info → rasa_pro-3.13.0rc1.dist-info}/RECORD +241 -220
- rasa/anonymization/__init__.py +0 -2
- rasa/anonymization/anonymisation_rule_yaml_reader.py +0 -91
- rasa/anonymization/anonymization_pipeline.py +0 -286
- rasa/anonymization/anonymization_rule_executor.py +0 -266
- rasa/anonymization/anonymization_rule_orchestrator.py +0 -119
- rasa/anonymization/schemas/config.yml +0 -47
- rasa/anonymization/utils.py +0 -118
- rasa/core/channels/inspector/dist/assets/channel-3730f5fd.js +0 -1
- rasa/core/channels/inspector/dist/assets/clone-e847561e.js +0 -1
- rasa/core/channels/inspector/dist/assets/flowDiagram-v2-96b9c2cf-efbbfe00.js +0 -1
- rasa/studio/download/download.py +0 -439
- /rasa/{studio/download → core/information_retrieval/ingestion}/__init__.py +0 -0
- {rasa_pro-3.13.0.dev20250612.dist-info → rasa_pro-3.13.0rc1.dist-info}/NOTICE +0 -0
- {rasa_pro-3.13.0.dev20250612.dist-info → rasa_pro-3.13.0rc1.dist-info}/WHEEL +0 -0
- {rasa_pro-3.13.0.dev20250612.dist-info → rasa_pro-3.13.0rc1.dist-info}/entry_points.txt +0 -0
|
@@ -8,6 +8,7 @@ from typing import List, Optional, Set, Text
|
|
|
8
8
|
|
|
9
9
|
from rasa.shared.constants import (
|
|
10
10
|
RASA_DEFAULT_FLOW_PATTERN_PREFIX,
|
|
11
|
+
RASA_PATTERN_CHITCHAT,
|
|
11
12
|
RASA_PATTERN_HUMAN_HANDOFF,
|
|
12
13
|
RASA_PATTERN_INTERNAL_ERROR,
|
|
13
14
|
)
|
|
@@ -186,8 +187,10 @@ class ReferenceToPatternException(RasaException):
|
|
|
186
187
|
return message + "Patterns can not be used as a target for a call step."
|
|
187
188
|
else:
|
|
188
189
|
return message + (
|
|
189
|
-
"
|
|
190
|
-
"
|
|
190
|
+
"Patterns cannot be used as a target in link steps, except for "
|
|
191
|
+
"'pattern_human_handoff', which may be linked from both user-defined "
|
|
192
|
+
"flows and other patterns. 'pattern_chitchat' may only be linked "
|
|
193
|
+
"from other patterns."
|
|
191
194
|
)
|
|
192
195
|
|
|
193
196
|
|
|
@@ -578,11 +581,18 @@ def validate_linked_flows_exists(flows: "FlowsList") -> None:
|
|
|
578
581
|
continue
|
|
579
582
|
|
|
580
583
|
# It might be that the flows do not contain the default rasa patterns, but
|
|
581
|
-
# only the user flows. Manually check for `pattern_human_handoff`
|
|
582
|
-
#
|
|
584
|
+
# only the user flows. Manually check for `pattern_human_handoff` and
|
|
585
|
+
# 'pattern_chitchat' as these patterns can be linked to and are part of the
|
|
586
|
+
# default patterns of rasa.
|
|
583
587
|
if (
|
|
584
588
|
flows.flow_by_id(step.link) is None
|
|
589
|
+
# Allow linking to human-handoff from both patterns
|
|
590
|
+
# and user-defined flows
|
|
585
591
|
and step.link != RASA_PATTERN_HUMAN_HANDOFF
|
|
592
|
+
# Allow linking to 'pattern_chitchat' only from other patterns
|
|
593
|
+
and not (
|
|
594
|
+
flow.is_rasa_default_flow and step.link == RASA_PATTERN_CHITCHAT
|
|
595
|
+
)
|
|
586
596
|
):
|
|
587
597
|
raise UnresolvedFlowException(step.link, flow.id, step.id)
|
|
588
598
|
|
|
@@ -597,7 +607,13 @@ def validate_patterns_are_not_called_or_linked(flows: "FlowsList") -> None:
|
|
|
597
607
|
if (
|
|
598
608
|
isinstance(step, LinkFlowStep)
|
|
599
609
|
and step.link.startswith(RASA_DEFAULT_FLOW_PATTERN_PREFIX)
|
|
610
|
+
# Allow linking to human-handoff from both patterns
|
|
611
|
+
# and user-defined flows
|
|
600
612
|
and step.link != RASA_PATTERN_HUMAN_HANDOFF
|
|
613
|
+
# Allow linking to 'pattern_chitchat' only from other patterns
|
|
614
|
+
and not (
|
|
615
|
+
flow.is_rasa_default_flow and step.link == RASA_PATTERN_CHITCHAT
|
|
616
|
+
)
|
|
601
617
|
):
|
|
602
618
|
raise ReferenceToPatternException(
|
|
603
619
|
step.link, flow.id, step.id, call_step=False
|
|
@@ -617,7 +633,8 @@ def validate_patterns_are_not_calling_or_linking_other_flows(
|
|
|
617
633
|
"""Validates that patterns do not contain call or link steps.
|
|
618
634
|
|
|
619
635
|
Link steps to user flows are allowed for all patterns but 'pattern_internal_error'.
|
|
620
|
-
Link steps to other patterns, except for 'pattern_human_handoff'
|
|
636
|
+
Link steps to other patterns, except for 'pattern_human_handoff' and
|
|
637
|
+
'pattern_chitchat' are forbidden.
|
|
621
638
|
"""
|
|
622
639
|
for flow in flows.underlying_flows:
|
|
623
640
|
if not flow.is_rasa_default_flow:
|
|
@@ -627,6 +644,9 @@ def validate_patterns_are_not_calling_or_linking_other_flows(
|
|
|
627
644
|
if step.link == RASA_PATTERN_HUMAN_HANDOFF:
|
|
628
645
|
# links to 'pattern_human_handoff' are allowed
|
|
629
646
|
continue
|
|
647
|
+
if step.link == RASA_PATTERN_CHITCHAT:
|
|
648
|
+
# links to 'pattern_chitchat' are allowed
|
|
649
|
+
continue
|
|
630
650
|
if step.link.startswith(RASA_DEFAULT_FLOW_PATTERN_PREFIX):
|
|
631
651
|
# all other patterns are allowed to link to user flows, but not
|
|
632
652
|
# to other patterns
|
rasa/shared/core/slots.py
CHANGED
|
@@ -311,6 +311,34 @@ class Slot(ABC):
|
|
|
311
311
|
"""Indicates if the slot requires validation."""
|
|
312
312
|
return True if self.validation else False
|
|
313
313
|
|
|
314
|
+
def to_dict(
|
|
315
|
+
self,
|
|
316
|
+
*,
|
|
317
|
+
include_private: bool = False,
|
|
318
|
+
) -> Dict[str, Any]:
|
|
319
|
+
"""Return a dictionary with attributes of this slot instance.
|
|
320
|
+
|
|
321
|
+
Args:
|
|
322
|
+
include_private: If `True`, private attributes are included.
|
|
323
|
+
|
|
324
|
+
Returns:
|
|
325
|
+
A plain `dict` that can be JSON-serialised.
|
|
326
|
+
"""
|
|
327
|
+
result: Dict[str, Any] = {}
|
|
328
|
+
|
|
329
|
+
for attr, value in vars(self).items():
|
|
330
|
+
if not include_private and attr.startswith("_"):
|
|
331
|
+
continue
|
|
332
|
+
|
|
333
|
+
if attr == "mappings":
|
|
334
|
+
result[attr] = [mapping.as_dict() for mapping in value]
|
|
335
|
+
continue
|
|
336
|
+
|
|
337
|
+
result[attr] = value
|
|
338
|
+
|
|
339
|
+
result.setdefault("type", self.type_name)
|
|
340
|
+
return result
|
|
341
|
+
|
|
314
342
|
|
|
315
343
|
class FloatSlot(Slot):
|
|
316
344
|
"""A slot storing a float value."""
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import copy
|
|
2
1
|
import functools
|
|
3
2
|
import json
|
|
4
3
|
import logging
|
|
@@ -648,9 +647,7 @@ class YAMLStoryReader(StoryReader):
|
|
|
648
647
|
# message text did start with the special prefix -- however, a user might
|
|
649
648
|
# just have decided to start their text this way.
|
|
650
649
|
if not match:
|
|
651
|
-
structlogger.warning(
|
|
652
|
-
"message.parsing.failed", user_text=copy.deepcopy(user_text)
|
|
653
|
-
)
|
|
650
|
+
structlogger.warning("message.parsing.failed")
|
|
654
651
|
return message
|
|
655
652
|
|
|
656
653
|
# Extract attributes from the match - and validate it via the domain.
|
rasa/shared/exceptions.py
CHANGED
|
@@ -165,3 +165,7 @@ class ProviderClientAPIException(RasaException):
|
|
|
165
165
|
|
|
166
166
|
class ProviderClientValidationError(RasaException):
|
|
167
167
|
"""Raised for errors that occur during validation of the API client."""
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
class FinetuningDataPreparationException(RasaException):
|
|
171
|
+
"""Raised when there is an error in data preparation for fine-tuning."""
|
|
@@ -23,6 +23,8 @@ from rasa.shared.constants import (
|
|
|
23
23
|
DEPLOYMENT_NAME_CONFIG_KEY,
|
|
24
24
|
ENGINE_CONFIG_KEY,
|
|
25
25
|
LANGCHAIN_TYPE_CONFIG_KEY,
|
|
26
|
+
MAX_COMPLETION_TOKENS_CONFIG_KEY,
|
|
27
|
+
MAX_TOKENS_CONFIG_KEY,
|
|
26
28
|
MODEL_CONFIG_KEY,
|
|
27
29
|
MODEL_NAME_CONFIG_KEY,
|
|
28
30
|
N_REPHRASES_CONFIG_KEY,
|
|
@@ -44,13 +46,13 @@ from rasa.shared.providers._configs.oauth_config import (
|
|
|
44
46
|
OAUTH_TYPE_FIELD,
|
|
45
47
|
OAuth,
|
|
46
48
|
)
|
|
47
|
-
from rasa.shared.
|
|
49
|
+
from rasa.shared.utils.common import class_from_module_path
|
|
50
|
+
from rasa.shared.utils.configs import (
|
|
48
51
|
raise_deprecation_warnings,
|
|
49
52
|
resolve_aliases,
|
|
50
53
|
validate_forbidden_keys,
|
|
51
54
|
validate_required_keys,
|
|
52
55
|
)
|
|
53
|
-
from rasa.shared.utils.common import class_from_module_path
|
|
54
56
|
|
|
55
57
|
structlogger = structlog.get_logger()
|
|
56
58
|
|
|
@@ -71,6 +73,8 @@ DEPRECATED_ALIASES_TO_STANDARD_KEY_MAPPING = {
|
|
|
71
73
|
MODEL_NAME_CONFIG_KEY: MODEL_CONFIG_KEY,
|
|
72
74
|
# Timeout aliases
|
|
73
75
|
REQUEST_TIMEOUT_CONFIG_KEY: TIMEOUT_CONFIG_KEY,
|
|
76
|
+
# Max tokens aliases
|
|
77
|
+
MAX_TOKENS_CONFIG_KEY: MAX_COMPLETION_TOKENS_CONFIG_KEY,
|
|
74
78
|
}
|
|
75
79
|
|
|
76
80
|
REQUIRED_KEYS = [DEPLOYMENT_CONFIG_KEY]
|
|
@@ -15,7 +15,7 @@ from rasa.shared.constants import (
|
|
|
15
15
|
STREAM_CONFIG_KEY,
|
|
16
16
|
TIMEOUT_CONFIG_KEY,
|
|
17
17
|
)
|
|
18
|
-
from rasa.shared.
|
|
18
|
+
from rasa.shared.utils.configs import (
|
|
19
19
|
raise_deprecation_warnings,
|
|
20
20
|
resolve_aliases,
|
|
21
21
|
validate_forbidden_keys,
|
|
@@ -21,7 +21,7 @@ from rasa.shared.constants import (
|
|
|
21
21
|
REQUEST_TIMEOUT_CONFIG_KEY,
|
|
22
22
|
TIMEOUT_CONFIG_KEY,
|
|
23
23
|
)
|
|
24
|
-
from rasa.shared.
|
|
24
|
+
from rasa.shared.utils.configs import (
|
|
25
25
|
raise_deprecation_warnings,
|
|
26
26
|
resolve_aliases,
|
|
27
27
|
validate_required_keys,
|
|
@@ -10,6 +10,8 @@ from rasa.shared.constants import (
|
|
|
10
10
|
API_TYPE_CONFIG_KEY,
|
|
11
11
|
API_VERSION_CONFIG_KEY,
|
|
12
12
|
LANGCHAIN_TYPE_CONFIG_KEY,
|
|
13
|
+
MAX_COMPLETION_TOKENS_CONFIG_KEY,
|
|
14
|
+
MAX_TOKENS_CONFIG_KEY,
|
|
13
15
|
MODEL_CONFIG_KEY,
|
|
14
16
|
MODEL_NAME_CONFIG_KEY,
|
|
15
17
|
N_REPHRASES_CONFIG_KEY,
|
|
@@ -24,7 +26,7 @@ from rasa.shared.constants import (
|
|
|
24
26
|
STREAM_CONFIG_KEY,
|
|
25
27
|
TIMEOUT_CONFIG_KEY,
|
|
26
28
|
)
|
|
27
|
-
from rasa.shared.
|
|
29
|
+
from rasa.shared.utils.configs import (
|
|
28
30
|
raise_deprecation_warnings,
|
|
29
31
|
resolve_aliases,
|
|
30
32
|
validate_forbidden_keys,
|
|
@@ -48,6 +50,8 @@ DEPRECATED_ALIASES_TO_STANDARD_KEY_MAPPING = {
|
|
|
48
50
|
OPENAI_API_VERSION_CONFIG_KEY: API_VERSION_CONFIG_KEY,
|
|
49
51
|
# Timeout aliases
|
|
50
52
|
REQUEST_TIMEOUT_CONFIG_KEY: TIMEOUT_CONFIG_KEY,
|
|
53
|
+
# Max tokens aliases
|
|
54
|
+
MAX_TOKENS_CONFIG_KEY: MAX_COMPLETION_TOKENS_CONFIG_KEY,
|
|
51
55
|
}
|
|
52
56
|
|
|
53
57
|
REQUIRED_KEYS = [MODEL_CONFIG_KEY]
|
|
@@ -25,7 +25,7 @@ from rasa.shared.constants import (
|
|
|
25
25
|
TIMEOUT_CONFIG_KEY,
|
|
26
26
|
USE_CHAT_COMPLETIONS_ENDPOINT_CONFIG_KEY,
|
|
27
27
|
)
|
|
28
|
-
from rasa.shared.
|
|
28
|
+
from rasa.shared.utils.configs import (
|
|
29
29
|
raise_deprecation_warnings,
|
|
30
30
|
resolve_aliases,
|
|
31
31
|
validate_forbidden_keys,
|
|
@@ -1,107 +1,8 @@
|
|
|
1
1
|
import structlog
|
|
2
2
|
|
|
3
|
-
from rasa.shared.utils.io import raise_deprecation_warning
|
|
4
|
-
|
|
5
3
|
structlogger = structlog.get_logger()
|
|
6
4
|
|
|
7
5
|
|
|
8
|
-
def resolve_aliases(config: dict, deprecated_alias_mapping: dict) -> dict:
|
|
9
|
-
"""
|
|
10
|
-
Resolve aliases in the configuration to standard keys.
|
|
11
|
-
|
|
12
|
-
Args:
|
|
13
|
-
config: Dictionary containing the configuration.
|
|
14
|
-
deprecated_alias_mapping: Dictionary mapping aliases to
|
|
15
|
-
their standard keys.
|
|
16
|
-
|
|
17
|
-
Returns:
|
|
18
|
-
New dictionary containing the processed configuration.
|
|
19
|
-
"""
|
|
20
|
-
config = config.copy()
|
|
21
|
-
|
|
22
|
-
for alias, standard_key in deprecated_alias_mapping.items():
|
|
23
|
-
# We check for the alias instead of the standard key because our goal is to
|
|
24
|
-
# update the standard key when the alias is found. Since the standard key is
|
|
25
|
-
# always included in the default component configurations, we overwrite it
|
|
26
|
-
# with the alias value if the alias exists.
|
|
27
|
-
if alias in config:
|
|
28
|
-
config[standard_key] = config.pop(alias)
|
|
29
|
-
|
|
30
|
-
return config
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
def raise_deprecation_warnings(config: dict, deprecated_alias_mapping: dict) -> None:
|
|
34
|
-
"""
|
|
35
|
-
Raises warnings for deprecated keys in the configuration.
|
|
36
|
-
|
|
37
|
-
Args:
|
|
38
|
-
config: Dictionary containing the configuration.
|
|
39
|
-
deprecated_alias_mapping: Dictionary mapping deprecated keys to
|
|
40
|
-
their standard keys.
|
|
41
|
-
|
|
42
|
-
Raises:
|
|
43
|
-
DeprecationWarning: If any deprecated key is found in the config.
|
|
44
|
-
"""
|
|
45
|
-
for alias, standard_key in deprecated_alias_mapping.items():
|
|
46
|
-
if alias in config:
|
|
47
|
-
raise_deprecation_warning(
|
|
48
|
-
message=(
|
|
49
|
-
f"'{alias}' is deprecated and will be removed in "
|
|
50
|
-
f"4.0.0. Use '{standard_key}' instead."
|
|
51
|
-
)
|
|
52
|
-
)
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
def validate_required_keys(config: dict, required_keys: list) -> None:
|
|
56
|
-
"""
|
|
57
|
-
Validates that the passed config contains all the required keys.
|
|
58
|
-
|
|
59
|
-
Args:
|
|
60
|
-
config: Dictionary containing the configuration.
|
|
61
|
-
required_keys: List of keys that must be present in the config.
|
|
62
|
-
|
|
63
|
-
Raises:
|
|
64
|
-
ValueError: If any required key is missing.
|
|
65
|
-
"""
|
|
66
|
-
missing_keys = [key for key in required_keys if key not in config]
|
|
67
|
-
if missing_keys:
|
|
68
|
-
message = f"Missing required keys '{missing_keys}' for configuration."
|
|
69
|
-
structlogger.error(
|
|
70
|
-
"validate_required_keys",
|
|
71
|
-
message=message,
|
|
72
|
-
missing_keys=missing_keys,
|
|
73
|
-
config=config,
|
|
74
|
-
)
|
|
75
|
-
raise ValueError(message)
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
def validate_forbidden_keys(config: dict, forbidden_keys: list) -> None:
|
|
79
|
-
"""
|
|
80
|
-
Validates that the passed config doesn't contain any forbidden keys.
|
|
81
|
-
|
|
82
|
-
Args:
|
|
83
|
-
config: Dictionary containing the configuration.
|
|
84
|
-
forbidden_keys: List of keys that are forbidden in the config.
|
|
85
|
-
|
|
86
|
-
Raises:
|
|
87
|
-
ValueError: If any forbidden key is present.
|
|
88
|
-
"""
|
|
89
|
-
forbidden_keys_in_config = set(config.keys()).intersection(set(forbidden_keys))
|
|
90
|
-
|
|
91
|
-
if forbidden_keys_in_config:
|
|
92
|
-
message = (
|
|
93
|
-
f"Forbidden keys '{forbidden_keys_in_config}' present "
|
|
94
|
-
f"in the configuration."
|
|
95
|
-
)
|
|
96
|
-
structlogger.error(
|
|
97
|
-
"validate_forbidden_keys",
|
|
98
|
-
message=message,
|
|
99
|
-
forbidden_keys=forbidden_keys_in_config,
|
|
100
|
-
config=config,
|
|
101
|
-
)
|
|
102
|
-
raise ValueError(message)
|
|
103
|
-
|
|
104
|
-
|
|
105
6
|
def get_provider_prefixed_model_name(provider: str, model: str) -> str:
|
|
106
7
|
"""
|
|
107
8
|
Returns the model name with the provider prefixed.
|
|
@@ -70,7 +70,10 @@ class _BaseLiteLLMEmbeddingClient:
|
|
|
70
70
|
def _embedding_fn_args(self) -> Dict[str, Any]:
|
|
71
71
|
"""Returns the arguments to be passed to the embedding function."""
|
|
72
72
|
return {
|
|
73
|
+
# Parameters set through config, can override drop_params
|
|
73
74
|
**self._litellm_extra_parameters,
|
|
75
|
+
# Model name is constructed in the LiteLLM format from the provided config
|
|
76
|
+
# Non-overridable to ensure consistency
|
|
74
77
|
"model": self._litellm_model_name,
|
|
75
78
|
}
|
|
76
79
|
|
|
@@ -84,12 +84,15 @@ class _BaseLiteLLMClient:
|
|
|
84
84
|
@property
|
|
85
85
|
def _completion_fn_args(self) -> dict:
|
|
86
86
|
return {
|
|
87
|
-
**self._litellm_extra_parameters,
|
|
88
|
-
"model": self._litellm_model_name,
|
|
89
87
|
# Since all providers covered by LiteLLM use the OpenAI format, but
|
|
90
88
|
# not all support every OpenAI parameter, raise an exception if
|
|
91
89
|
# provider/model uses unsupported parameter
|
|
92
90
|
"drop_params": False,
|
|
91
|
+
# All other parameters set through config, can override drop_params
|
|
92
|
+
**self._litellm_extra_parameters,
|
|
93
|
+
# Model name is constructed in the LiteLLM format from the provided config
|
|
94
|
+
# Non-overridable to ensure consistency
|
|
95
|
+
"model": self._litellm_model_name,
|
|
93
96
|
}
|
|
94
97
|
|
|
95
98
|
def validate_client_setup(self) -> None:
|
rasa/shared/utils/common.py
CHANGED
|
@@ -384,7 +384,7 @@ def display_research_study_prompt() -> None:
|
|
|
384
384
|
{separator}
|
|
385
385
|
Want to help shape the future of Rasa Pro?
|
|
386
386
|
Share your feedback in a short conversation with our team.
|
|
387
|
-
Sign up at: https://
|
|
387
|
+
Sign up at: https://feedback.rasa.com
|
|
388
388
|
{separator}
|
|
389
389
|
"""
|
|
390
390
|
print_success(message)
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
import structlog
|
|
4
|
+
|
|
5
|
+
from rasa.shared.utils.io import raise_deprecation_warning
|
|
6
|
+
|
|
7
|
+
structlogger = structlog.get_logger()
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def resolve_aliases(config: dict, deprecated_alias_mapping: dict) -> dict:
|
|
11
|
+
"""
|
|
12
|
+
Resolve aliases in the configuration to standard keys.
|
|
13
|
+
|
|
14
|
+
Args:
|
|
15
|
+
config: Dictionary containing the configuration.
|
|
16
|
+
deprecated_alias_mapping: Dictionary mapping aliases to
|
|
17
|
+
their standard keys.
|
|
18
|
+
|
|
19
|
+
Returns:
|
|
20
|
+
New dictionary containing the processed configuration.
|
|
21
|
+
"""
|
|
22
|
+
config = config.copy()
|
|
23
|
+
|
|
24
|
+
for alias, standard_key in deprecated_alias_mapping.items():
|
|
25
|
+
# We check for the alias instead of the standard key because our goal is to
|
|
26
|
+
# update the standard key when the alias is found. Since the standard key is
|
|
27
|
+
# always included in the default component configurations, we overwrite it
|
|
28
|
+
# with the alias value if the alias exists.
|
|
29
|
+
if alias in config:
|
|
30
|
+
config[standard_key] = config.pop(alias)
|
|
31
|
+
|
|
32
|
+
return config
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def raise_deprecation_warnings(
|
|
36
|
+
config: dict,
|
|
37
|
+
deprecated_alias_mapping: dict,
|
|
38
|
+
source: Optional[str] = None,
|
|
39
|
+
) -> None:
|
|
40
|
+
"""
|
|
41
|
+
Raises warnings for deprecated keys in the configuration.
|
|
42
|
+
|
|
43
|
+
Args:
|
|
44
|
+
config: Dictionary containing the configuration.
|
|
45
|
+
deprecated_alias_mapping: Dictionary mapping deprecated keys to
|
|
46
|
+
their standard keys.
|
|
47
|
+
|
|
48
|
+
Raises:
|
|
49
|
+
DeprecationWarning: If any deprecated key is found in the config.
|
|
50
|
+
"""
|
|
51
|
+
for alias, standard_key in deprecated_alias_mapping.items():
|
|
52
|
+
if alias in config:
|
|
53
|
+
source = f"{source}: " or ""
|
|
54
|
+
raise_deprecation_warning(
|
|
55
|
+
message=(
|
|
56
|
+
f"{source}"
|
|
57
|
+
f"'{alias}' is deprecated and will be removed in "
|
|
58
|
+
f"4.0.0. Use '{standard_key}' instead."
|
|
59
|
+
)
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def validate_required_keys(config: dict, required_keys: list) -> None:
|
|
64
|
+
"""
|
|
65
|
+
Validates that the passed config contains all the required keys.
|
|
66
|
+
|
|
67
|
+
Args:
|
|
68
|
+
config: Dictionary containing the configuration.
|
|
69
|
+
required_keys: List of keys that must be present in the config.
|
|
70
|
+
|
|
71
|
+
Raises:
|
|
72
|
+
ValueError: If any required key is missing.
|
|
73
|
+
"""
|
|
74
|
+
missing_keys = [key for key in required_keys if key not in config]
|
|
75
|
+
if missing_keys:
|
|
76
|
+
message = f"Missing required keys '{missing_keys}' for configuration."
|
|
77
|
+
structlogger.error(
|
|
78
|
+
"validate_required_keys",
|
|
79
|
+
message=message,
|
|
80
|
+
missing_keys=missing_keys,
|
|
81
|
+
config=config,
|
|
82
|
+
)
|
|
83
|
+
raise ValueError(message)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def validate_forbidden_keys(config: dict, forbidden_keys: list) -> None:
|
|
87
|
+
"""
|
|
88
|
+
Validates that the passed config doesn't contain any forbidden keys.
|
|
89
|
+
|
|
90
|
+
Args:
|
|
91
|
+
config: Dictionary containing the configuration.
|
|
92
|
+
forbidden_keys: List of keys that are forbidden in the config.
|
|
93
|
+
|
|
94
|
+
Raises:
|
|
95
|
+
ValueError: If any forbidden key is present.
|
|
96
|
+
"""
|
|
97
|
+
forbidden_keys_in_config = set(config.keys()).intersection(set(forbidden_keys))
|
|
98
|
+
|
|
99
|
+
if forbidden_keys_in_config:
|
|
100
|
+
message = (
|
|
101
|
+
f"Forbidden keys '{forbidden_keys_in_config}' present "
|
|
102
|
+
f"in the configuration."
|
|
103
|
+
)
|
|
104
|
+
structlogger.error(
|
|
105
|
+
"validate_forbidden_keys",
|
|
106
|
+
message=message,
|
|
107
|
+
forbidden_keys=forbidden_keys_in_config,
|
|
108
|
+
config=config,
|
|
109
|
+
)
|
|
110
|
+
raise ValueError(message)
|
rasa/shared/utils/constants.py
CHANGED
|
@@ -2,9 +2,6 @@ DEFAULT_ENCODING = "utf-8"
|
|
|
2
2
|
|
|
3
3
|
READ_YAML_FILE_CACHE_MAXSIZE_ENV_VAR = "READ_YAML_FILE_CACHE_MAXSIZE"
|
|
4
4
|
DEFAULT_READ_YAML_FILE_CACHE_MAXSIZE = 256
|
|
5
|
-
RASA_PRO_BETA_PREDICATES_IN_RESPONSE_CONDITIONS_ENV_VAR_NAME = (
|
|
6
|
-
"RASA_PRO_BETA_PREDICATES_IN_RESPONSE_CONDITIONS"
|
|
7
|
-
)
|
|
8
5
|
|
|
9
6
|
LOG_COMPONENT_SOURCE_METHOD_INIT = "init"
|
|
10
7
|
LOG_COMPONENT_SOURCE_METHOD_FINGERPRINT_ADDON = "fingerprint_addon"
|