rasa-pro 3.13.0.dev5__py3-none-any.whl → 3.13.0.dev8__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 +5 -1
- rasa/cli/arguments/default_arguments.py +13 -1
- rasa/cli/arguments/train.py +2 -0
- rasa/cli/dialogue_understanding_test.py +1 -1
- rasa/cli/e2e_test.py +1 -1
- rasa/cli/evaluate.py +2 -2
- rasa/cli/export.py +3 -3
- rasa/cli/llm_fine_tuning.py +12 -11
- rasa/cli/project_templates/defaults.py +133 -0
- rasa/cli/run.py +1 -1
- rasa/cli/studio/link.py +53 -0
- rasa/cli/studio/pull.py +78 -0
- rasa/cli/studio/push.py +78 -0
- rasa/cli/studio/studio.py +12 -0
- rasa/cli/studio/upload.py +8 -0
- rasa/cli/train.py +2 -1
- rasa/cli/utils.py +1 -1
- rasa/cli/x.py +1 -1
- rasa/constants.py +4 -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 +18 -3
- rasa/core/available_endpoints.py +146 -0
- rasa/core/brokers/kafka.py +4 -0
- rasa/core/brokers/pika.py +5 -2
- rasa/core/brokers/sql.py +1 -1
- rasa/core/channels/botframework.py +2 -2
- rasa/core/channels/channel.py +2 -2
- rasa/core/channels/hangouts.py +8 -5
- rasa/core/channels/inspector/.eslintrc.cjs +12 -6
- rasa/core/channels/inspector/.prettierrc +5 -0
- rasa/core/channels/inspector/README.md +10 -4
- rasa/core/channels/inspector/dist/assets/{arc-9f75cc3b.js → arc-c4b064fc.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{blockDiagram-38ab4fdb-7f34db23.js → blockDiagram-38ab4fdb-215b5026.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{c4Diagram-3d4e48cf-948bab2c.js → c4Diagram-3d4e48cf-2b54a0a3.js} +1 -1
- rasa/core/channels/inspector/dist/assets/channel-3730f5fd.js +1 -0
- rasa/core/channels/inspector/dist/assets/{classDiagram-70f12bd4-53b0dd0e.js → classDiagram-70f12bd4-daacea5f.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{classDiagram-v2-f2320105-fdf789e7.js → classDiagram-v2-f2320105-930d4dc2.js} +1 -1
- rasa/core/channels/inspector/dist/assets/clone-e847561e.js +1 -0
- rasa/core/channels/inspector/dist/assets/{createText-2e5e7dd3-87c4ece5.js → createText-2e5e7dd3-83c206ba.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{edges-e0da2a9e-5a8b0749.js → edges-e0da2a9e-b0eb01d0.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{erDiagram-9861fffd-66da90e2.js → erDiagram-9861fffd-17586500.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{flowDb-956e92f1-10044f05.js → flowDb-956e92f1-be2a1776.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{flowDiagram-66a62f08-f338f66a.js → flowDiagram-66a62f08-c2120ebd.js} +1 -1
- rasa/core/channels/inspector/dist/assets/flowDiagram-v2-96b9c2cf-efbbfe00.js +1 -0
- rasa/core/channels/inspector/dist/assets/{flowchart-elk-definition-4a651766-b13140aa.js → flowchart-elk-definition-4a651766-a6ab5c48.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{ganttDiagram-c361ad54-f2b4a55a.js → ganttDiagram-c361ad54-ef613457.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{gitGraphDiagram-72cf32ee-dedc298d.js → gitGraphDiagram-72cf32ee-d59185b3.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{graph-4ede11ff.js → graph-0f155405.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{index-3862675e-65549d37.js → index-3862675e-d5f1d1b7.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{index-3a23e736.js → index-47737d3a.js} +123 -123
- rasa/core/channels/inspector/dist/assets/{infoDiagram-f8f76790-65439671.js → infoDiagram-f8f76790-b07d141f.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{journeyDiagram-49397b02-56d03d98.js → journeyDiagram-49397b02-1936d429.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{layout-dd48f7f4.js → layout-dde8d0f3.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{line-1569ad2c.js → line-0c2c7ee0.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{linear-48bf4935.js → linear-35dd89a4.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{mindmap-definition-fc14e90a-688504c1.js → mindmap-definition-fc14e90a-56192851.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{pieDiagram-8a3498a8-78b6d7e6.js → pieDiagram-8a3498a8-fc21ed78.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{quadrantDiagram-120e2f19-048b84b3.js → quadrantDiagram-120e2f19-25e98518.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{requirementDiagram-deff3bca-dd67f107.js → requirementDiagram-deff3bca-546ff1f5.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{sankeyDiagram-04a897e0-8128436e.js → sankeyDiagram-04a897e0-02d8b82d.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{sequenceDiagram-704730f1-1a0d1461.js → sequenceDiagram-704730f1-3ca5a92e.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{stateDiagram-587899a1-46d388ed.js → stateDiagram-587899a1-128ea07c.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{stateDiagram-v2-d93cdb3a-ea42951a.js → stateDiagram-v2-d93cdb3a-95f290af.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-6aaf32cf-7427ed0c.js → styles-6aaf32cf-4984898a.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-9a916d00-ff5e5a16.js → styles-9a916d00-1bf266ba.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-c10674c1-7b3680cf.js → styles-c10674c1-60521c63.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{svgDrawCommon-08f97a94-f860f2ad.js → svgDrawCommon-08f97a94-a25b6e12.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{timeline-definition-85554ec2-2eebf0c8.js → timeline-definition-85554ec2-0fc086bf.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{xychartDiagram-e933f94c-5d7f4e96.js → xychartDiagram-e933f94c-44ee592e.js} +1 -1
- rasa/core/channels/inspector/dist/index.html +1 -1
- rasa/core/channels/inspector/package.json +3 -1
- rasa/core/channels/inspector/src/App.tsx +91 -90
- rasa/core/channels/inspector/src/components/Chat.tsx +45 -41
- rasa/core/channels/inspector/src/components/DiagramFlow.tsx +40 -40
- rasa/core/channels/inspector/src/components/DialogueInformation.tsx +57 -57
- rasa/core/channels/inspector/src/components/DialogueStack.tsx +36 -27
- rasa/core/channels/inspector/src/components/ExpandIcon.tsx +4 -4
- rasa/core/channels/inspector/src/components/FullscreenButton.tsx +7 -7
- rasa/core/channels/inspector/src/components/LoadingSpinner.tsx +28 -12
- rasa/core/channels/inspector/src/components/NoActiveFlow.tsx +9 -9
- rasa/core/channels/inspector/src/components/RasaLogo.tsx +5 -5
- rasa/core/channels/inspector/src/components/RecruitmentPanel.tsx +55 -60
- rasa/core/channels/inspector/src/components/SaraDiagrams.tsx +5 -5
- rasa/core/channels/inspector/src/components/Slots.tsx +22 -22
- rasa/core/channels/inspector/src/components/Welcome.tsx +28 -31
- rasa/core/channels/inspector/src/helpers/audio/audiostream.ts +245 -0
- rasa/core/channels/inspector/src/helpers/audio/microphone-processor.js +12 -0
- rasa/core/channels/inspector/src/helpers/audio/playback-processor.js +36 -0
- rasa/core/channels/inspector/src/helpers/conversation.ts +7 -7
- rasa/core/channels/inspector/src/helpers/formatters.test.ts +181 -181
- rasa/core/channels/inspector/src/helpers/formatters.ts +111 -111
- rasa/core/channels/inspector/src/helpers/utils.ts +78 -61
- rasa/core/channels/inspector/src/main.tsx +8 -8
- rasa/core/channels/inspector/src/theme/Button/Button.ts +8 -8
- rasa/core/channels/inspector/src/theme/Heading/Heading.ts +7 -7
- rasa/core/channels/inspector/src/theme/Input/Input.ts +9 -9
- rasa/core/channels/inspector/src/theme/Link/Link.ts +6 -6
- rasa/core/channels/inspector/src/theme/Modal/Modal.ts +13 -13
- rasa/core/channels/inspector/src/theme/Table/Table.tsx +10 -10
- rasa/core/channels/inspector/src/theme/Tooltip/Tooltip.ts +5 -5
- rasa/core/channels/inspector/src/theme/base/breakpoints.ts +7 -7
- rasa/core/channels/inspector/src/theme/base/colors.ts +64 -64
- rasa/core/channels/inspector/src/theme/base/fonts/fontFaces.css +21 -18
- rasa/core/channels/inspector/src/theme/base/radii.ts +8 -8
- rasa/core/channels/inspector/src/theme/base/shadows.ts +5 -5
- rasa/core/channels/inspector/src/theme/base/sizes.ts +5 -5
- rasa/core/channels/inspector/src/theme/base/space.ts +12 -12
- rasa/core/channels/inspector/src/theme/base/styles.ts +5 -5
- rasa/core/channels/inspector/src/theme/base/typography.ts +12 -12
- rasa/core/channels/inspector/src/theme/base/zIndices.ts +3 -3
- rasa/core/channels/inspector/src/theme/index.ts +38 -38
- rasa/core/channels/inspector/src/types.ts +56 -50
- rasa/core/channels/inspector/yarn.lock +5 -0
- 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/studio_chat.py +3 -2
- rasa/core/channels/vier_cvg.py +1 -2
- rasa/core/channels/voice_ready/audiocodes.py +35 -25
- rasa/core/channels/voice_stream/audiocodes.py +7 -4
- rasa/core/channels/voice_stream/genesys.py +2 -2
- rasa/core/channels/voice_stream/twilio_media_streams.py +10 -5
- rasa/core/channels/voice_stream/voice_channel.py +33 -22
- rasa/core/evaluation/marker_tracker_loader.py +1 -1
- rasa/core/exporter.py +1 -1
- rasa/core/http_interpreter.py +3 -7
- rasa/core/jobs.py +2 -1
- rasa/core/nlg/contextual_response_rephraser.py +38 -11
- rasa/core/nlg/generator.py +0 -1
- rasa/core/nlg/interpolator.py +2 -3
- rasa/core/nlg/summarize.py +40 -6
- rasa/core/persistor.py +55 -20
- rasa/core/policies/enterprise_search_policy.py +290 -66
- rasa/core/policies/enterprise_search_prompt_with_relevancy_check_and_citation_template.jinja2 +63 -0
- rasa/core/policies/flow_policy.py +1 -1
- rasa/core/policies/flows/flow_executor.py +96 -17
- rasa/core/policies/intentless_policy.py +24 -16
- rasa/core/processor.py +106 -53
- rasa/core/run.py +40 -13
- rasa/core/tracker_stores/__init__.py +0 -0
- rasa/core/{auth_retry_tracker_store.py → tracker_stores/auth_retry_tracker_store.py} +5 -1
- rasa/core/tracker_stores/dynamo_tracker_store.py +218 -0
- rasa/core/tracker_stores/mongo_tracker_store.py +206 -0
- rasa/core/tracker_stores/redis_tracker_store.py +219 -0
- rasa/core/tracker_stores/sql_tracker_store.py +555 -0
- rasa/core/tracker_stores/tracker_store.py +805 -0
- rasa/core/training/interactive.py +1 -1
- rasa/core/utils.py +24 -91
- rasa/dialogue_understanding/coexistence/intent_based_router.py +2 -1
- rasa/dialogue_understanding/coexistence/llm_based_router.py +8 -3
- rasa/dialogue_understanding/commands/can_not_handle_command.py +2 -0
- rasa/dialogue_understanding/commands/cancel_flow_command.py +2 -0
- rasa/dialogue_understanding/commands/chit_chat_answer_command.py +2 -0
- rasa/dialogue_understanding/commands/clarify_command.py +6 -2
- rasa/dialogue_understanding/commands/command_syntax_manager.py +1 -0
- rasa/dialogue_understanding/commands/human_handoff_command.py +2 -0
- 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 +11 -1
- rasa/dialogue_understanding/commands/skip_question_command.py +2 -0
- rasa/dialogue_understanding/commands/start_flow_command.py +4 -0
- rasa/dialogue_understanding/commands/utils.py +26 -2
- rasa/dialogue_understanding/generator/__init__.py +7 -1
- rasa/dialogue_understanding/generator/command_generator.py +4 -2
- 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/llm_based_command_generator.py +1 -1
- rasa/dialogue_understanding/generator/prompt_templates/command_prompt_v3_gpt_4o_2024_11_20_template.jinja2 +78 -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 +477 -0
- rasa/dialogue_understanding/generator/single_step/single_step_llm_command_generator.py +8 -58
- 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 +3 -3
- rasa/dialogue_understanding/processor/command_processor_component.py +3 -3
- rasa/dialogue_understanding/stack/frames/flow_stack_frame.py +17 -4
- 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_runner.py +1 -1
- rasa/engine/constants.py +1 -1
- rasa/engine/recipes/default_recipe.py +26 -2
- rasa/engine/validation.py +3 -2
- rasa/hooks.py +2 -30
- rasa/keys +1 -0
- 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 +4 -2
- 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/config.py +3 -1
- rasa/model_manager/model_api.py +89 -2
- rasa/model_manager/runner_service.py +8 -4
- rasa/model_manager/trainer_service.py +5 -4
- rasa/model_training.py +12 -3
- rasa/nlu/extractors/crf_entity_extractor.py +66 -16
- rasa/plugin.py +2 -12
- 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 +29 -4
- rasa/shared/constants.py +6 -0
- rasa/shared/core/constants.py +4 -3
- rasa/shared/core/domain.py +7 -0
- rasa/shared/core/events.py +99 -3
- rasa/shared/core/flows/flow.py +1 -2
- rasa/shared/core/flows/flows_yaml_schema.json +3 -0
- rasa/shared/core/flows/steps/collect.py +46 -2
- rasa/shared/core/slots.py +28 -0
- rasa/shared/exceptions.py +4 -0
- rasa/shared/providers/_configs/azure_openai_client_config.py +4 -0
- rasa/shared/providers/_configs/openai_client_config.py +4 -0
- rasa/shared/providers/embedding/_base_litellm_embedding_client.py +3 -0
- rasa/shared/providers/llm/_base_litellm_client.py +5 -2
- rasa/shared/utils/llm.py +161 -6
- rasa/shared/utils/yaml.py +32 -0
- rasa/studio/data_handler.py +3 -3
- rasa/studio/download/download.py +37 -60
- rasa/studio/download/flows.py +23 -31
- rasa/studio/link.py +200 -0
- rasa/studio/pull.py +94 -0
- rasa/studio/push.py +131 -0
- rasa/studio/upload.py +117 -67
- rasa/telemetry.py +84 -27
- rasa/tracing/config.py +4 -5
- rasa/tracing/constants.py +19 -1
- rasa/tracing/instrumentation/attribute_extractors.py +11 -3
- rasa/tracing/instrumentation/instrumentation.py +54 -3
- rasa/tracing/instrumentation/metrics.py +98 -15
- rasa/tracing/metric_instrument_provider.py +75 -3
- rasa/utils/common.py +1 -27
- rasa/utils/licensing.py +1 -2
- rasa/utils/log_utils.py +1 -45
- rasa/validator.py +2 -8
- rasa/version.py +1 -1
- {rasa_pro-3.13.0.dev5.dist-info → rasa_pro-3.13.0.dev8.dist-info}/METADATA +8 -9
- {rasa_pro-3.13.0.dev5.dist-info → rasa_pro-3.13.0.dev8.dist-info}/RECORD +254 -231
- 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-dfa68278.js +0 -1
- rasa/core/channels/inspector/dist/assets/clone-edb7f119.js +0 -1
- rasa/core/channels/inspector/dist/assets/flowDiagram-v2-96b9c2cf-65e7c670.js +0 -1
- rasa/core/channels/inspector/src/helpers/audiostream.ts +0 -191
- rasa/core/tracker_store.py +0 -1792
- {rasa_pro-3.13.0.dev5.dist-info → rasa_pro-3.13.0.dev8.dist-info}/NOTICE +0 -0
- {rasa_pro-3.13.0.dev5.dist-info → rasa_pro-3.13.0.dev8.dist-info}/WHEEL +0 -0
- {rasa_pro-3.13.0.dev5.dist-info → rasa_pro-3.13.0.dev8.dist-info}/entry_points.txt +0 -0
rasa/core/actions/action.py
CHANGED
|
@@ -1152,7 +1152,11 @@ class ActionSendText(Action):
|
|
|
1152
1152
|
fallback = {"text": ""}
|
|
1153
1153
|
metadata_copy = copy.deepcopy(metadata) if metadata else {}
|
|
1154
1154
|
message = metadata_copy.get("message", fallback)
|
|
1155
|
-
|
|
1155
|
+
|
|
1156
|
+
should_send_text = metadata_copy.get("should_send_text", True)
|
|
1157
|
+
if should_send_text:
|
|
1158
|
+
return [create_bot_utterance(message, tracker.current_language)]
|
|
1159
|
+
return []
|
|
1156
1160
|
|
|
1157
1161
|
|
|
1158
1162
|
class ActionExtractSlots(Action):
|
|
@@ -25,7 +25,7 @@ class ActionRepeatBotMessages(Action):
|
|
|
25
25
|
"""Return the name of the action."""
|
|
26
26
|
return ACTION_REPEAT_BOT_MESSAGES
|
|
27
27
|
|
|
28
|
-
def _get_last_bot_events(self, tracker: DialogueStateTracker) -> List[
|
|
28
|
+
def _get_last_bot_events(self, tracker: DialogueStateTracker) -> List[BotUttered]:
|
|
29
29
|
"""Get the last consecutive bot events before the most recent user message.
|
|
30
30
|
|
|
31
31
|
This function scans the dialogue history in reverse to find the last sequence of
|
|
@@ -48,33 +48,21 @@ class ActionRepeatBotMessages(Action):
|
|
|
48
48
|
The elif condition doesn't break when it sees User3 event.
|
|
49
49
|
But it does at User2 event.
|
|
50
50
|
"""
|
|
51
|
-
# Skip action if we are in a collect information step whose
|
|
52
|
-
# default behavior is to repeat anyways
|
|
53
|
-
top_frame = tracker.stack.top(
|
|
54
|
-
lambda frame: isinstance(frame, RepeatBotMessagesPatternFlowStackFrame)
|
|
55
|
-
or isinstance(frame, UserSilencePatternFlowStackFrame)
|
|
56
|
-
)
|
|
57
|
-
if isinstance(top_frame, CollectInformationPatternFlowStackFrame):
|
|
58
|
-
return []
|
|
59
51
|
# filter user and bot events
|
|
60
|
-
|
|
52
|
+
user_and_bot_events = [
|
|
61
53
|
e for e in tracker.events if isinstance(e, (BotUttered, UserUttered))
|
|
62
54
|
]
|
|
63
|
-
|
|
55
|
+
last_bot_events: List[BotUttered] = []
|
|
64
56
|
|
|
65
57
|
# find the last BotUttered events
|
|
66
|
-
for e in reversed(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
bot_events.insert(0, e)
|
|
70
|
-
|
|
71
|
-
# stop if a UserUttered event is found
|
|
72
|
-
# only if we have collected some bot events already
|
|
73
|
-
# this condition skips the first N UserUttered events
|
|
74
|
-
elif bot_events:
|
|
58
|
+
for e in reversed(user_and_bot_events):
|
|
59
|
+
# stop when seeing a user event after having seen bot events already
|
|
60
|
+
if isinstance(e, UserUttered) and len(last_bot_events) > 0:
|
|
75
61
|
break
|
|
62
|
+
elif isinstance(e, BotUttered):
|
|
63
|
+
last_bot_events.append(e)
|
|
76
64
|
|
|
77
|
-
return
|
|
65
|
+
return list(reversed(last_bot_events))
|
|
78
66
|
|
|
79
67
|
async def run(
|
|
80
68
|
self,
|
|
@@ -85,5 +73,13 @@ class ActionRepeatBotMessages(Action):
|
|
|
85
73
|
metadata: Optional[Dict[str, Any]] = None,
|
|
86
74
|
) -> List[Event]:
|
|
87
75
|
"""Send the last bot messages to the channel again"""
|
|
88
|
-
|
|
76
|
+
top_frame = tracker.stack.top(
|
|
77
|
+
lambda frame: isinstance(frame, RepeatBotMessagesPatternFlowStackFrame)
|
|
78
|
+
or isinstance(frame, UserSilencePatternFlowStackFrame)
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
bot_events: List[Event] = list(self._get_last_bot_events(tracker))
|
|
82
|
+
# drop the last bot event in a collect step as that part will be repeated anyway
|
|
83
|
+
if isinstance(top_frame, CollectInformationPatternFlowStackFrame):
|
|
84
|
+
bot_events = bot_events[:-1]
|
|
89
85
|
return bot_events
|
rasa/core/agent.py
CHANGED
|
@@ -13,6 +13,7 @@ from aiohttp import ClientError
|
|
|
13
13
|
|
|
14
14
|
import rasa.shared.utils.io
|
|
15
15
|
from rasa.core import jobs
|
|
16
|
+
from rasa.core.available_endpoints import AvailableEndpoints
|
|
16
17
|
from rasa.core.channels.channel import OutputChannel, UserMessage
|
|
17
18
|
from rasa.core.constants import DEFAULT_REQUEST_TIMEOUT
|
|
18
19
|
from rasa.core.exceptions import AgentNotReady
|
|
@@ -22,18 +23,19 @@ from rasa.core.nlg import NaturalLanguageGenerator, TemplatedNaturalLanguageGene
|
|
|
22
23
|
from rasa.core.persistor import StorageType
|
|
23
24
|
from rasa.core.policies.policy import PolicyPrediction
|
|
24
25
|
from rasa.core.processor import MessageProcessor
|
|
25
|
-
from rasa.core.tracker_store import (
|
|
26
|
+
from rasa.core.tracker_stores.tracker_store import (
|
|
26
27
|
FailSafeTrackerStore,
|
|
27
28
|
InMemoryTrackerStore,
|
|
28
29
|
TrackerStore,
|
|
29
30
|
)
|
|
30
|
-
from rasa.core.utils import AvailableEndpoints
|
|
31
31
|
from rasa.exceptions import ModelNotFound
|
|
32
32
|
from rasa.nlu.utils import is_url
|
|
33
|
+
from rasa.privacy.privacy_manager import BackgroundPrivacyManager
|
|
33
34
|
from rasa.shared.constants import DEFAULT_SENDER_ID
|
|
34
35
|
from rasa.shared.core.domain import Domain
|
|
35
36
|
from rasa.shared.core.trackers import DialogueStateTracker, EventVerbosity
|
|
36
37
|
from rasa.shared.exceptions import RasaException
|
|
38
|
+
from rasa.telemetry import track_privacy_enabled
|
|
37
39
|
from rasa.utils.common import TempDirectoryPath, get_temp_dir_name
|
|
38
40
|
from rasa.utils.endpoints import EndpointConfig
|
|
39
41
|
|
|
@@ -215,13 +217,14 @@ async def load_agent(
|
|
|
215
217
|
The instantiated `Agent` or `None`.
|
|
216
218
|
"""
|
|
217
219
|
from rasa.core.brokers.broker import EventBroker
|
|
218
|
-
from rasa.core.tracker_store import TrackerStore
|
|
220
|
+
from rasa.core.tracker_stores.tracker_store import TrackerStore
|
|
219
221
|
|
|
220
222
|
tracker_store = None
|
|
221
223
|
lock_store = None
|
|
222
224
|
generator = None
|
|
223
225
|
action_endpoint = None
|
|
224
226
|
http_interpreter = None
|
|
227
|
+
privacy_manager = None
|
|
225
228
|
|
|
226
229
|
if endpoints:
|
|
227
230
|
broker = await EventBroker.create(endpoints.event_broker, loop=loop)
|
|
@@ -234,6 +237,12 @@ async def load_agent(
|
|
|
234
237
|
model_server = endpoints.model if endpoints.model else model_server
|
|
235
238
|
if endpoints.nlu:
|
|
236
239
|
http_interpreter = RasaNLUHttpInterpreter(endpoints.nlu)
|
|
240
|
+
if endpoints.privacy:
|
|
241
|
+
privacy_manager = await BackgroundPrivacyManager.create_instance(
|
|
242
|
+
endpoints=endpoints,
|
|
243
|
+
event_loop=loop,
|
|
244
|
+
)
|
|
245
|
+
track_privacy_enabled(privacy_manager.config, broker)
|
|
237
246
|
|
|
238
247
|
agent = Agent(
|
|
239
248
|
generator=generator,
|
|
@@ -244,6 +253,7 @@ async def load_agent(
|
|
|
244
253
|
remote_storage=remote_storage,
|
|
245
254
|
http_interpreter=http_interpreter,
|
|
246
255
|
endpoints=endpoints,
|
|
256
|
+
privacy_manager=privacy_manager,
|
|
247
257
|
)
|
|
248
258
|
|
|
249
259
|
try:
|
|
@@ -306,6 +316,7 @@ class Agent:
|
|
|
306
316
|
remote_storage: Optional[StorageType] = None,
|
|
307
317
|
http_interpreter: Optional[RasaNLUHttpInterpreter] = None,
|
|
308
318
|
endpoints: Optional[AvailableEndpoints] = None,
|
|
319
|
+
privacy_manager: Optional[BackgroundPrivacyManager] = None,
|
|
309
320
|
):
|
|
310
321
|
"""Initializes an `Agent`."""
|
|
311
322
|
self.domain = domain
|
|
@@ -321,6 +332,7 @@ class Agent:
|
|
|
321
332
|
self._set_fingerprint(fingerprint)
|
|
322
333
|
self.model_server = model_server
|
|
323
334
|
self.remote_storage = remote_storage
|
|
335
|
+
self.privacy_manager = privacy_manager
|
|
324
336
|
|
|
325
337
|
@classmethod
|
|
326
338
|
def load(
|
|
@@ -336,6 +348,7 @@ class Agent:
|
|
|
336
348
|
remote_storage: Optional[StorageType] = None,
|
|
337
349
|
http_interpreter: Optional[RasaNLUHttpInterpreter] = None,
|
|
338
350
|
endpoints: Optional[AvailableEndpoints] = None,
|
|
351
|
+
privacy_manager: Optional[BackgroundPrivacyManager] = None,
|
|
339
352
|
) -> Agent:
|
|
340
353
|
"""Constructs a new agent and loads the processor and model."""
|
|
341
354
|
agent = Agent(
|
|
@@ -349,6 +362,7 @@ class Agent:
|
|
|
349
362
|
remote_storage=remote_storage,
|
|
350
363
|
http_interpreter=http_interpreter,
|
|
351
364
|
endpoints=endpoints,
|
|
365
|
+
privacy_manager=privacy_manager,
|
|
352
366
|
)
|
|
353
367
|
agent.load_model(model_path=model_path, fingerprint=fingerprint)
|
|
354
368
|
return agent
|
|
@@ -365,6 +379,7 @@ class Agent:
|
|
|
365
379
|
generator=self.nlg,
|
|
366
380
|
http_interpreter=self.http_interpreter,
|
|
367
381
|
endpoints=self.endpoints,
|
|
382
|
+
privacy_manager=self.privacy_manager,
|
|
368
383
|
)
|
|
369
384
|
self.domain = self.processor.domain
|
|
370
385
|
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import dataclasses
|
|
4
|
+
from typing import Any, Dict, List, Optional, Union
|
|
5
|
+
|
|
6
|
+
from rasa.shared.constants import DEFAULT_ENDPOINTS_PATH
|
|
7
|
+
from rasa.shared.core.constants import (
|
|
8
|
+
GLOBAL_SILENCE_TIMEOUT_DEFAULT_VALUE,
|
|
9
|
+
GLOBAL_SILENCE_TIMEOUT_KEY,
|
|
10
|
+
)
|
|
11
|
+
from rasa.shared.exceptions import RasaException
|
|
12
|
+
from rasa.utils.endpoints import (
|
|
13
|
+
EndpointConfig,
|
|
14
|
+
read_endpoint_config,
|
|
15
|
+
read_property_config_from_endpoints_file,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@dataclasses.dataclass
|
|
20
|
+
class InteractionHandlingConfig:
|
|
21
|
+
"""Configuration for interaction handling."""
|
|
22
|
+
|
|
23
|
+
global_silence_timeout: Union[float, int] = GLOBAL_SILENCE_TIMEOUT_DEFAULT_VALUE
|
|
24
|
+
|
|
25
|
+
def __post_init__(self) -> None:
|
|
26
|
+
# Validate the type of `global_silence_timeout`.
|
|
27
|
+
if isinstance(self.global_silence_timeout, str):
|
|
28
|
+
try:
|
|
29
|
+
self.global_silence_timeout = float(self.global_silence_timeout)
|
|
30
|
+
except ValueError:
|
|
31
|
+
raise RasaException(
|
|
32
|
+
f"Type for {GLOBAL_SILENCE_TIMEOUT_KEY} is wrong, expected number. "
|
|
33
|
+
f"Got: '{self.global_silence_timeout}'. "
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
if not isinstance(self.global_silence_timeout, (float, int)):
|
|
37
|
+
raise RasaException(
|
|
38
|
+
f"Type for {GLOBAL_SILENCE_TIMEOUT_KEY} is wrong, expected number. "
|
|
39
|
+
f"Got: '{type(self.global_silence_timeout)}'. "
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
if self.global_silence_timeout <= 0:
|
|
43
|
+
raise RasaException(
|
|
44
|
+
f"Value for {GLOBAL_SILENCE_TIMEOUT_KEY} must be a positive number. "
|
|
45
|
+
f"Got: '{self.global_silence_timeout}'. "
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
@classmethod
|
|
49
|
+
def from_dict(cls, data: Optional[Dict[str, Any]]) -> InteractionHandlingConfig:
|
|
50
|
+
"""Create a InteractionHandlingConfig instance from a dictionary."""
|
|
51
|
+
return cls(
|
|
52
|
+
global_silence_timeout=data.get(
|
|
53
|
+
GLOBAL_SILENCE_TIMEOUT_KEY, GLOBAL_SILENCE_TIMEOUT_DEFAULT_VALUE
|
|
54
|
+
)
|
|
55
|
+
if data is not None
|
|
56
|
+
else GLOBAL_SILENCE_TIMEOUT_DEFAULT_VALUE
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
class AvailableEndpoints:
|
|
61
|
+
"""Collection of configured endpoints."""
|
|
62
|
+
|
|
63
|
+
_instance = None
|
|
64
|
+
|
|
65
|
+
@classmethod
|
|
66
|
+
def read_endpoints(cls, endpoint_file: str) -> AvailableEndpoints:
|
|
67
|
+
"""Read the different endpoints from a yaml file."""
|
|
68
|
+
nlg = read_endpoint_config(endpoint_file, endpoint_type="nlg")
|
|
69
|
+
nlu = read_endpoint_config(endpoint_file, endpoint_type="nlu")
|
|
70
|
+
action = read_endpoint_config(endpoint_file, endpoint_type="action_endpoint")
|
|
71
|
+
model = read_endpoint_config(endpoint_file, endpoint_type="models")
|
|
72
|
+
tracker_store = read_endpoint_config(
|
|
73
|
+
endpoint_file, endpoint_type="tracker_store"
|
|
74
|
+
)
|
|
75
|
+
lock_store = read_endpoint_config(endpoint_file, endpoint_type="lock_store")
|
|
76
|
+
event_broker = read_endpoint_config(endpoint_file, endpoint_type="event_broker")
|
|
77
|
+
vector_store = read_endpoint_config(endpoint_file, endpoint_type="vector_store")
|
|
78
|
+
model_groups = read_property_config_from_endpoints_file(
|
|
79
|
+
endpoint_file, property_name="model_groups"
|
|
80
|
+
)
|
|
81
|
+
privacy = read_property_config_from_endpoints_file(
|
|
82
|
+
endpoint_file, property_name="privacy"
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
interaction_handling = InteractionHandlingConfig.from_dict(
|
|
86
|
+
read_property_config_from_endpoints_file(
|
|
87
|
+
endpoint_file, property_name="interaction_handling"
|
|
88
|
+
)
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
return cls(
|
|
92
|
+
nlg,
|
|
93
|
+
nlu,
|
|
94
|
+
action,
|
|
95
|
+
model,
|
|
96
|
+
tracker_store,
|
|
97
|
+
lock_store,
|
|
98
|
+
event_broker,
|
|
99
|
+
vector_store,
|
|
100
|
+
model_groups,
|
|
101
|
+
privacy,
|
|
102
|
+
interaction_handling,
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
def __init__(
|
|
106
|
+
self,
|
|
107
|
+
nlg: Optional[EndpointConfig] = None,
|
|
108
|
+
nlu: Optional[EndpointConfig] = None,
|
|
109
|
+
action: Optional[EndpointConfig] = None,
|
|
110
|
+
model: Optional[EndpointConfig] = None,
|
|
111
|
+
tracker_store: Optional[EndpointConfig] = None,
|
|
112
|
+
lock_store: Optional[EndpointConfig] = None,
|
|
113
|
+
event_broker: Optional[EndpointConfig] = None,
|
|
114
|
+
vector_store: Optional[EndpointConfig] = None,
|
|
115
|
+
model_groups: Optional[List[Dict[str, Any]]] = None,
|
|
116
|
+
privacy: Optional[Dict[str, Any]] = None,
|
|
117
|
+
interaction_handling: InteractionHandlingConfig = InteractionHandlingConfig(
|
|
118
|
+
global_silence_timeout=GLOBAL_SILENCE_TIMEOUT_DEFAULT_VALUE
|
|
119
|
+
),
|
|
120
|
+
) -> None:
|
|
121
|
+
"""Create an `AvailableEndpoints` object."""
|
|
122
|
+
self.model = model
|
|
123
|
+
self.action = action
|
|
124
|
+
self.nlu = nlu
|
|
125
|
+
self.nlg = nlg
|
|
126
|
+
self.tracker_store = tracker_store
|
|
127
|
+
self.lock_store = lock_store
|
|
128
|
+
self.event_broker = event_broker
|
|
129
|
+
self.vector_store = vector_store
|
|
130
|
+
self.model_groups = model_groups
|
|
131
|
+
self.privacy = privacy
|
|
132
|
+
self.interaction_handling = interaction_handling
|
|
133
|
+
|
|
134
|
+
@classmethod
|
|
135
|
+
def get_instance(
|
|
136
|
+
cls, endpoint_file: Optional[str] = DEFAULT_ENDPOINTS_PATH
|
|
137
|
+
) -> AvailableEndpoints:
|
|
138
|
+
"""Get the singleton instance of AvailableEndpoints."""
|
|
139
|
+
# Ensure that the instance is initialized only once.
|
|
140
|
+
if cls._instance is None:
|
|
141
|
+
cls._instance = cls.read_endpoints(endpoint_file)
|
|
142
|
+
return cls._instance
|
|
143
|
+
|
|
144
|
+
@classmethod
|
|
145
|
+
def reset_instance(cls) -> None:
|
|
146
|
+
cls._instance = None
|
rasa/core/brokers/kafka.py
CHANGED
|
@@ -94,6 +94,10 @@ class KafkaEventBroker(EventBroker):
|
|
|
94
94
|
self.queue_size = kwargs.get("queue_size")
|
|
95
95
|
self.ssl_check_hostname = "https" if ssl_check_hostname else None
|
|
96
96
|
|
|
97
|
+
# PII management attributes
|
|
98
|
+
self.stream_pii = kwargs.get("stream_pii", True)
|
|
99
|
+
self.anonymization_topics = kwargs.get("anonymization_topics", [])
|
|
100
|
+
|
|
97
101
|
# Async producer implementation followed from confluent-kafka asyncio example:
|
|
98
102
|
# https://github.com/confluentinc/confluent-kafka-python/blob/master/examples/asyncio_example.py#L88 # noqa: E501
|
|
99
103
|
self._loop = asyncio.get_event_loop()
|
rasa/core/brokers/pika.py
CHANGED
|
@@ -93,6 +93,10 @@ class PikaEventBroker(EventBroker):
|
|
|
93
93
|
self._connection: Optional[aio_pika.abc.AbstractRobustConnection] = None
|
|
94
94
|
self._exchange: Optional[aio_pika.RobustExchange] = None
|
|
95
95
|
|
|
96
|
+
# PII related attributes
|
|
97
|
+
self.stream_pii = kwargs.get("stream_pii", True)
|
|
98
|
+
self.anonymization_queues = kwargs.get("anonymization_queues", [])
|
|
99
|
+
|
|
96
100
|
@staticmethod
|
|
97
101
|
def _get_queues_from_args(
|
|
98
102
|
queues_arg: Union[List[Text], Tuple[Text, ...], Text, None],
|
|
@@ -312,9 +316,8 @@ class PikaEventBroker(EventBroker):
|
|
|
312
316
|
except Exception as e:
|
|
313
317
|
structlogger.error(
|
|
314
318
|
"pika.events.publish.failed",
|
|
315
|
-
event_info="
|
|
319
|
+
event_info=f"Failed to publish Pika event. Error: {e}",
|
|
316
320
|
host=self.host,
|
|
317
|
-
rasa_event=reduced_event,
|
|
318
321
|
)
|
|
319
322
|
if self.should_keep_unpublished_messages:
|
|
320
323
|
self._unpublished_events.append(event)
|
rasa/core/brokers/sql.py
CHANGED
|
@@ -46,7 +46,7 @@ class SQLEventBroker(EventBroker):
|
|
|
46
46
|
"""Initializes `SQLBrokerEvent`."""
|
|
47
47
|
import sqlalchemy.orm
|
|
48
48
|
|
|
49
|
-
from rasa.core.
|
|
49
|
+
from rasa.core.tracker_stores.sql_tracker_store import SQLTrackerStore
|
|
50
50
|
|
|
51
51
|
engine_url = SQLTrackerStore.get_db_url(
|
|
52
52
|
dialect, host, port, db, username, password
|
|
@@ -115,8 +115,8 @@ class BotFramework(OutputChannel):
|
|
|
115
115
|
|
|
116
116
|
if not send_response.ok:
|
|
117
117
|
logger.error(
|
|
118
|
-
"Error trying to send botframework messge.
|
|
119
|
-
send_response.
|
|
118
|
+
"Error trying to send botframework messge. "
|
|
119
|
+
f"Error: {send_response.reason}"
|
|
120
120
|
)
|
|
121
121
|
|
|
122
122
|
async def send_text_message(
|
rasa/core/channels/channel.py
CHANGED
|
@@ -103,7 +103,7 @@ class UserMessage:
|
|
|
103
103
|
|
|
104
104
|
|
|
105
105
|
def register(
|
|
106
|
-
input_channels: List[
|
|
106
|
+
input_channels: List[InputChannel], app: Sanic, route: Optional[Text]
|
|
107
107
|
) -> None:
|
|
108
108
|
"""Registers input channel blueprints with Sanic."""
|
|
109
109
|
|
|
@@ -129,7 +129,7 @@ class InputChannel:
|
|
|
129
129
|
return cls.__name__
|
|
130
130
|
|
|
131
131
|
@classmethod
|
|
132
|
-
def from_credentials(cls, credentials: Optional[Dict[Text, Any]]) ->
|
|
132
|
+
def from_credentials(cls, credentials: Optional[Dict[Text, Any]]) -> InputChannel:
|
|
133
133
|
return cls()
|
|
134
134
|
|
|
135
135
|
def url_prefix(self) -> Text:
|
rasa/core/channels/hangouts.py
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import copy
|
|
2
1
|
import logging
|
|
3
2
|
from asyncio import CancelledError
|
|
4
3
|
from typing import Any, Awaitable, Callable, Dict, Iterable, List, Optional, Text, Union
|
|
@@ -314,13 +313,17 @@ class HangoutsInput(InputChannel):
|
|
|
314
313
|
metadata={"room": room_name},
|
|
315
314
|
)
|
|
316
315
|
)
|
|
317
|
-
except CancelledError:
|
|
316
|
+
except CancelledError as e:
|
|
318
317
|
structlogger.error(
|
|
319
|
-
"hangouts.message.blueprint.timeout",
|
|
318
|
+
"hangouts.message.blueprint.timeout",
|
|
319
|
+
event_info=f"Message processing was cancelled. Error: {e}",
|
|
320
320
|
)
|
|
321
|
-
except Exception:
|
|
321
|
+
except Exception as e:
|
|
322
322
|
structlogger.exception(
|
|
323
|
-
"hangouts.message.blueprint.failure",
|
|
323
|
+
"hangouts.message.blueprint.failure",
|
|
324
|
+
event_info=(
|
|
325
|
+
f"An error occurred while processing the message. Error: {e}",
|
|
326
|
+
),
|
|
324
327
|
)
|
|
325
328
|
|
|
326
329
|
return response.json(collector.messages)
|
|
@@ -5,6 +5,7 @@ module.exports = {
|
|
|
5
5
|
"eslint:recommended",
|
|
6
6
|
"plugin:@typescript-eslint/recommended",
|
|
7
7
|
"plugin:react-hooks/recommended",
|
|
8
|
+
"plugin:prettier/recommended",
|
|
8
9
|
],
|
|
9
10
|
ignorePatterns: [
|
|
10
11
|
"dist",
|
|
@@ -16,10 +17,15 @@ module.exports = {
|
|
|
16
17
|
],
|
|
17
18
|
parser: "@typescript-eslint/parser",
|
|
18
19
|
plugins: ["react-refresh"],
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
overrides: [
|
|
21
|
+
{
|
|
22
|
+
files: ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
|
23
|
+
rules: {
|
|
24
|
+
"react-refresh/only-export-components": [
|
|
25
|
+
"warn",
|
|
26
|
+
{ allowConstantExport: true },
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
],
|
|
25
31
|
};
|
|
@@ -6,7 +6,9 @@ A rapid prototyping tool for enterprise developer personas working in Rasa Pro b
|
|
|
6
6
|
|
|
7
7
|
### Prerequisites
|
|
8
8
|
|
|
9
|
-
- Node
|
|
9
|
+
- **Node.js**: Version **greater than 18.x.x and less than 20.x.x**.
|
|
10
|
+
- [How to install Node.js](https://nodejs.org/en/learn/getting-started/how-to-install-nodejs)
|
|
11
|
+
- Recommended: Use [nvm](https://github.com/nvm-sh/nvm) for version management.
|
|
10
12
|
- `yarn` version 1.x - Check how to install `yarn` [here](https://classic.yarnpkg.com/lang/en/docs/install/).
|
|
11
13
|
- a running version of `rasa-plus`
|
|
12
14
|
- a running action server (optional)
|
|
@@ -27,6 +29,7 @@ A rapid prototyping tool for enterprise developer personas working in Rasa Pro b
|
|
|
27
29
|
|
|
28
30
|
The project can be built using the `yarn build` command. It will compile the code in the `/dist` folder.
|
|
29
31
|
It is important to know that _without_ it, the page that will be served can:
|
|
32
|
+
|
|
30
33
|
- return a 500 if the project has never been compiled before
|
|
31
34
|
- show an outdated version if the project has been compiled before the changes we want to introduce
|
|
32
35
|
|
|
@@ -39,16 +42,19 @@ This is because the code within the [rasa-private](https://github.com/RasaHQ/ras
|
|
|
39
42
|
### Step-by-Step Guide
|
|
40
43
|
|
|
41
44
|
1. **Make updates in [rasa-x](https://github.com/RasaHQ/rasa-x) repository:**
|
|
45
|
+
|
|
42
46
|
- Make the necessary code changes.
|
|
43
47
|
- Update the **npm** package version. This is done in the [src/rasa-chat/package.json](https://github.com/RasaHQ/rasa-x/blob/main/src/rasa-chat/package.json) file.
|
|
44
48
|
- Merge the changes to the lastest version branch or to the `main` branch.
|
|
45
49
|
|
|
46
|
-
|
|
50
|
+
2. **Trigger the release GitHub action:**
|
|
51
|
+
|
|
47
52
|
- Navigate to the [publish-rasa-chat](https://github.com/RasaHQ/rasa-x/blob/main/.github/workflows/publish-rasa-chat.yml) GitHub action within the [rasa-x](https://github.com/RasaHQ/rasa-x) repo and initiate the workflow.
|
|
48
53
|
|
|
49
|
-
|
|
54
|
+
3. **Monitor Deployment to npm:**
|
|
55
|
+
|
|
50
56
|
- After the GitHub action successfully runs, the updated package will be deployed to npm. Confirm the deployment by visiting the package page on npm at [@rasahq/rasa-chat](https://www.npmjs.com/package/@rasahq/rasa-chat/).
|
|
51
57
|
|
|
52
|
-
|
|
58
|
+
4. **Update the [rasa-private](https://github.com/RasaHQ/rasa-private) Repository:**
|
|
53
59
|
- Download or copy the minified JavaScript from the `widget.js` file in the newly published npm package.
|
|
54
60
|
- Replace the content in the [rasa-chat.js](https://github.com/RasaHQ/rasa-private/blob/main/rasa/core/channels/inspector/assets/rasa-chat.js) file with this new code to incorporate the updates.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{w as ln,c as H}from"./path-53f90ab3.js";import{aw as an,ax as V,ay as D,az as rn,aA as y,V as on,aB as K,aC as _,aD as un,aE as t,aF as sn,aG as tn,aH as fn}from"./index-
|
|
1
|
+
import{w as ln,c as H}from"./path-53f90ab3.js";import{aw as an,ax as V,ay as D,az as rn,aA as y,V as on,aB as K,aC as _,aD as un,aE as t,aF as sn,aG as tn,aH as fn}from"./index-47737d3a.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function mn(l){return l.endAngle}function pn(l){return l&&l.padAngle}function xn(l,h,z,E,v,A,I,a){var B=z-l,i=E-h,n=I-v,m=a-A,r=m*B-n*i;if(!(r*r<y))return r=(n*(h-A)-m*(l-v))/r,[l+r*B,h+r*i]}function W(l,h,z,E,v,A,I){var a=l-z,B=h-E,i=(I?A:-A)/K(a*a+B*B),n=i*B,m=-i*a,r=l+n,s=h+m,f=z+n,c=E+m,O=(r+f)/2,o=(s+c)/2,p=f-r,g=c-s,R=p*p+g*g,T=v-A,w=r*c-f*s,C=(g<0?-1:1)*K(fn(0,T*T*R-w*w)),F=(w*g-p*C)/R,G=(-w*p-g*C)/R,P=(w*g+p*C)/R,x=(-w*p+g*C)/R,d=F-O,e=G-o,u=P-O,S=x-o;return d*d+e*e>u*u+S*S&&(F=P,G=x),{cx:F,cy:G,x01:-n,y01:-m,x11:F*(v/T-1),y11:G*(v/T-1)}}function vn(){var l=cn,h=yn,z=H(0),E=null,v=gn,A=mn,I=pn,a=null,B=ln(i);function i(){var n,m,r=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-rn,c=A.apply(this,arguments)-rn,O=un(c-f),o=c>f;if(a||(a=n=B()),s<r&&(m=s,s=r,r=m),!(s>y))a.moveTo(0,0);else if(O>on-y)a.moveTo(s*V(f),s*D(f)),a.arc(0,0,s,f,c,!o),r>y&&(a.moveTo(r*V(c),r*D(c)),a.arc(0,0,r,c,f,o));else{var p=f,g=c,R=f,T=c,w=O,C=O,F=I.apply(this,arguments)/2,G=F>y&&(E?+E.apply(this,arguments):K(r*r+s*s)),P=_(un(s-r)/2,+z.apply(this,arguments)),x=P,d=P,e,u;if(G>y){var S=sn(G/r*D(F)),L=sn(G/s*D(F));(w-=S*2)>y?(S*=o?1:-1,R+=S,T-=S):(w=0,R=T=(f+c)/2),(C-=L*2)>y?(L*=o?1:-1,p+=L,g-=L):(C=0,p=g=(f+c)/2)}var j=s*V(p),J=s*D(p),M=r*V(T),N=r*D(T);if(P>y){var Q=s*V(g),U=s*D(g),X=r*V(R),Y=r*D(R),q;if(O<an)if(q=xn(j,J,X,Y,Q,U,M,N)){var Z=j-q[0],$=J-q[1],k=Q-q[0],b=U-q[1],nn=1/D(tn((Z*k+$*b)/(K(Z*Z+$*$)*K(k*k+b*b)))/2),en=K(q[0]*q[0]+q[1]*q[1]);x=_(P,(r-en)/(nn-1)),d=_(P,(s-en)/(nn+1))}else x=d=0}C>y?d>y?(e=W(X,Y,j,J,s,d,o),u=W(Q,U,M,N,s,d,o),a.moveTo(e.cx+e.x01,e.cy+e.y01),d<P?a.arc(e.cx,e.cy,d,t(e.y01,e.x01),t(u.y01,u.x01),!o):(a.arc(e.cx,e.cy,d,t(e.y01,e.x01),t(e.y11,e.x11),!o),a.arc(0,0,s,t(e.cy+e.y11,e.cx+e.x11),t(u.cy+u.y11,u.cx+u.x11),!o),a.arc(u.cx,u.cy,d,t(u.y11,u.x11),t(u.y01,u.x01),!o))):(a.moveTo(j,J),a.arc(0,0,s,p,g,!o)):a.moveTo(j,J),!(r>y)||!(w>y)?a.lineTo(M,N):x>y?(e=W(M,N,Q,U,r,-x,o),u=W(j,J,X,Y,r,-x,o),a.lineTo(e.cx+e.x01,e.cy+e.y01),x<P?a.arc(e.cx,e.cy,x,t(e.y01,e.x01),t(u.y01,u.x01),!o):(a.arc(e.cx,e.cy,x,t(e.y01,e.x01),t(e.y11,e.x11),!o),a.arc(0,0,r,t(e.cy+e.y11,e.cx+e.x11),t(u.cy+u.y11,u.cx+u.x11),o),a.arc(u.cx,u.cy,x,t(u.y11,u.x11),t(u.y01,u.x01),!o))):a.arc(0,0,r,T,R,o)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,m=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[V(m)*n,D(m)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:H(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:H(+n),i):h},i.cornerRadius=function(n){return arguments.length?(z=typeof n=="function"?n:H(+n),i):z},i.padRadius=function(n){return arguments.length?(E=n==null?null:typeof n=="function"?n:H(+n),i):E},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:H(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:H(+n),i):A},i.padAngle=function(n){return arguments.length?(I=typeof n=="function"?n:H(+n),i):I},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{vn as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as he,_ as se,h as H,i as Ee,l as S,E as ye,B as we,j as De,o as ve}from"./index-
|
|
1
|
+
import{c as he,_ as se,h as H,i as Ee,l as S,E as ye,B as we,j as De,o as ve}from"./index-47737d3a.js";import{c as Ne}from"./clone-e847561e.js";import{i as ke,c as Ie,b as Oe,d as Te,a as ge,p as ze}from"./edges-e0da2a9e-b0eb01d0.js";import{G as Ce}from"./graph-0f155405.js";import{o as Ae}from"./ordinal-ba9b4969.js";import{s as Re}from"./Tableau10-1b767f5e.js";import{c as Be}from"./channel-3730f5fd.js";import"./createText-2e5e7dd3-83c206ba.js";import"./line-0c2c7ee0.js";import"./array-9f3ba611.js";import"./path-53f90ab3.js";import"./init-77b53fdd.js";var le,oe,ee=function(){var e=function(D,o,s,i){for(s=s||{},i=D.length;i--;s[D[i]]=o);return s},a=[1,7],d=[1,13],c=[1,14],n=[1,15],g=[1,19],l=[1,16],f=[1,17],b=[1,18],p=[8,30],x=[8,21,28,29,30,31,32,40,44,47],E=[1,23],T=[1,24],v=[8,15,16,21,28,29,30,31,32,40,44,47],N=[8,15,16,21,27,28,29,30,31,32,40,44,47],y=[1,49],L={trace:function(){},yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,block:31,NODE_ID:32,nodeShapeNLabel:33,dirList:34,DIR:35,NODE_DSTART:36,NODE_DEND:37,BLOCK_ARROW_START:38,BLOCK_ARROW_END:39,classDef:40,CLASSDEF_ID:41,CLASSDEF_STYLEOPTS:42,DEFAULT:43,class:44,CLASSENTITY_IDS:45,STYLECLASS:46,style:47,STYLE_ENTITY_IDS:48,STYLE_DEFINITION_DATA:49,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"block",32:"NODE_ID",35:"DIR",36:"NODE_DSTART",37:"NODE_DEND",38:"BLOCK_ARROW_START",39:"BLOCK_ARROW_END",40:"classDef",41:"CLASSDEF_ID",42:"CLASSDEF_STYLEOPTS",43:"DEFAULT",44:"class",45:"CLASSENTITY_IDS",46:"STYLECLASS",47:"style",48:"STYLE_ENTITY_IDS",49:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[34,1],[34,2],[33,3],[33,4],[23,3],[23,3],[24,3],[25,3]],performAction:function(o,s,i,u,h,t,m){var r=t.length-1;switch(h){case 4:u.getLogger().debug("Rule: separator (NL) ");break;case 5:u.getLogger().debug("Rule: separator (Space) ");break;case 6:u.getLogger().debug("Rule: separator (EOF) ");break;case 7:u.getLogger().debug("Rule: hierarchy: ",t[r-1]),u.setHierarchy(t[r-1]);break;case 8:u.getLogger().debug("Stop NL ");break;case 9:u.getLogger().debug("Stop EOF ");break;case 10:u.getLogger().debug("Stop NL2 ");break;case 11:u.getLogger().debug("Stop EOF2 ");break;case 12:u.getLogger().debug("Rule: statement: ",t[r]),typeof t[r].length=="number"?this.$=t[r]:this.$=[t[r]];break;case 13:u.getLogger().debug("Rule: statement #2: ",t[r-1]),this.$=[t[r-1]].concat(t[r]);break;case 14:u.getLogger().debug("Rule: link: ",t[r],o),this.$={edgeTypeStr:t[r],label:""};break;case 15:u.getLogger().debug("Rule: LABEL link: ",t[r-3],t[r-1],t[r]),this.$={edgeTypeStr:t[r],label:t[r-1]};break;case 18:const R=parseInt(t[r]),Y=u.generateId();this.$={id:Y,type:"space",label:"",width:R,children:[]};break;case 23:u.getLogger().debug("Rule: (nodeStatement link node) ",t[r-2],t[r-1],t[r]," typestr: ",t[r-1].edgeTypeStr);const F=u.edgeStrToEdgeData(t[r-1].edgeTypeStr);this.$=[{id:t[r-2].id,label:t[r-2].label,type:t[r-2].type,directions:t[r-2].directions},{id:t[r-2].id+"-"+t[r].id,start:t[r-2].id,end:t[r].id,label:t[r-1].label,type:"edge",directions:t[r].directions,arrowTypeEnd:F,arrowTypeStart:"arrow_open"},{id:t[r].id,label:t[r].label,type:u.typeStr2Type(t[r].typeStr),directions:t[r].directions}];break;case 24:u.getLogger().debug("Rule: nodeStatement (abc88 node size) ",t[r-1],t[r]),this.$={id:t[r-1].id,label:t[r-1].label,type:u.typeStr2Type(t[r-1].typeStr),directions:t[r-1].directions,widthInColumns:parseInt(t[r],10)};break;case 25:u.getLogger().debug("Rule: nodeStatement (node) ",t[r]),this.$={id:t[r].id,label:t[r].label,type:u.typeStr2Type(t[r].typeStr),directions:t[r].directions,widthInColumns:1};break;case 26:u.getLogger().debug("APA123",this?this:"na"),u.getLogger().debug("COLUMNS: ",t[r]),this.$={type:"column-setting",columns:t[r]==="auto"?-1:parseInt(t[r])};break;case 27:u.getLogger().debug("Rule: id-block statement : ",t[r-2],t[r-1]),u.generateId(),this.$={...t[r-2],type:"composite",children:t[r-1]};break;case 28:u.getLogger().debug("Rule: blockStatement : ",t[r-2],t[r-1],t[r]);const C=u.generateId();this.$={id:C,type:"composite",label:"",children:t[r-1]};break;case 29:u.getLogger().debug("Rule: node (NODE_ID separator): ",t[r]),this.$={id:t[r]};break;case 30:u.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",t[r-1],t[r]),this.$={id:t[r-1],label:t[r].label,typeStr:t[r].typeStr,directions:t[r].directions};break;case 31:u.getLogger().debug("Rule: dirList: ",t[r]),this.$=[t[r]];break;case 32:u.getLogger().debug("Rule: dirList: ",t[r-1],t[r]),this.$=[t[r-1]].concat(t[r]);break;case 33:u.getLogger().debug("Rule: nodeShapeNLabel: ",t[r-2],t[r-1],t[r]),this.$={typeStr:t[r-2]+t[r],label:t[r-1]};break;case 34:u.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",t[r-3],t[r-2]," #3:",t[r-1],t[r]),this.$={typeStr:t[r-3]+t[r],label:t[r-2],directions:t[r-1]};break;case 35:case 36:this.$={type:"classDef",id:t[r-1].trim(),css:t[r].trim()};break;case 37:this.$={type:"applyClass",id:t[r-1].trim(),styleClass:t[r].trim()};break;case 38:this.$={type:"applyStyles",id:t[r-1].trim(),stylesStr:t[r].trim()};break}},table:[{9:1,10:[1,2]},{1:[3]},{11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:d,29:c,31:n,32:g,40:l,44:f,47:b},{8:[1,20]},e(p,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,21:a,28:d,29:c,31:n,32:g,40:l,44:f,47:b}),e(x,[2,16],{14:22,15:E,16:T}),e(x,[2,17]),e(x,[2,18]),e(x,[2,19]),e(x,[2,20]),e(x,[2,21]),e(x,[2,22]),e(v,[2,25],{27:[1,25]}),e(x,[2,26]),{19:26,26:12,32:g},{11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:d,29:c,31:n,32:g,40:l,44:f,47:b},{41:[1,28],43:[1,29]},{45:[1,30]},{48:[1,31]},e(N,[2,29],{33:32,36:[1,33],38:[1,34]}),{1:[2,7]},e(p,[2,13]),{26:35,32:g},{32:[2,14]},{17:[1,36]},e(v,[2,24]),{11:37,13:4,14:22,15:E,16:T,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:d,29:c,31:n,32:g,40:l,44:f,47:b},{30:[1,38]},{42:[1,39]},{42:[1,40]},{46:[1,41]},{49:[1,42]},e(N,[2,30]),{18:[1,43]},{18:[1,44]},e(v,[2,23]),{18:[1,45]},{30:[1,46]},e(x,[2,28]),e(x,[2,35]),e(x,[2,36]),e(x,[2,37]),e(x,[2,38]),{37:[1,47]},{34:48,35:y},{15:[1,50]},e(x,[2,27]),e(N,[2,33]),{39:[1,51]},{34:52,35:y,39:[2,31]},{32:[2,15]},e(N,[2,34]),{39:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:function(o,s){if(s.recoverable)this.trace(o);else{var i=new Error(o);throw i.hash=s,i}},parse:function(o){var s=this,i=[0],u=[],h=[null],t=[],m=this.table,r="",R=0,Y=0,F=2,C=1,Le=t.slice.call(arguments,1),w=Object.create(this.lexer),K={yy:{}};for(var Z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Z)&&(K.yy[Z]=this.yy[Z]);w.setInput(o,K.yy),K.yy.lexer=w,K.yy.parser=this,typeof w.yylloc>"u"&&(w.yylloc={});var J=w.yylloc;t.push(J);var me=w.options&&w.options.ranges;typeof K.yy.parseError=="function"?this.parseError=K.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function _e(){var P;return P=u.pop()||w.lex()||C,typeof P!="number"&&(P instanceof Array&&(u=P,P=u.pop()),P=s.symbols_[P]||P),P}for(var I,M,z,Q,W={},X,B,ae,G;;){if(M=i[i.length-1],this.defaultActions[M]?z=this.defaultActions[M]:((I===null||typeof I>"u")&&(I=_e()),z=m[M]&&m[M][I]),typeof z>"u"||!z.length||!z[0]){var $="";G=[];for(X in m[M])this.terminals_[X]&&X>F&&G.push("'"+this.terminals_[X]+"'");w.showPosition?$="Parse error on line "+(R+1)+`:
|
|
2
2
|
`+w.showPosition()+`
|
|
3
3
|
Expecting `+G.join(", ")+", got '"+(this.terminals_[I]||I)+"'":$="Parse error on line "+(R+1)+": Unexpected "+(I==C?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError($,{text:w.match,token:this.terminals_[I]||I,line:w.yylineno,loc:J,expected:G})}if(z[0]instanceof Array&&z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+M+", token: "+I);switch(z[0]){case 1:i.push(I),h.push(w.yytext),t.push(w.yylloc),i.push(z[1]),I=null,Y=w.yyleng,r=w.yytext,R=w.yylineno,J=w.yylloc;break;case 2:if(B=this.productions_[z[1]][1],W.$=h[h.length-B],W._$={first_line:t[t.length-(B||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(B||1)].first_column,last_column:t[t.length-1].last_column},me&&(W._$.range=[t[t.length-(B||1)].range[0],t[t.length-1].range[1]]),Q=this.performAction.apply(W,[r,Y,R,K.yy,z[1],h,t].concat(Le)),typeof Q<"u")return Q;B&&(i=i.slice(0,-1*B*2),h=h.slice(0,-1*B),t=t.slice(0,-1*B)),i.push(this.productions_[z[1]][0]),h.push(W.$),t.push(W._$),ae=m[i[i.length-2]][i[i.length-1]],i.push(ae);break;case 3:return!0}}return!0}},A=function(){var D={EOF:1,parseError:function(s,i){if(this.yy.parser)this.yy.parser.parseError(s,i);else throw new Error(s)},setInput:function(o,s){return this.yy=s||this.yy||{},this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var s=o.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},unput:function(o){var s=o.length,i=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var u=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var h=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===u.length?this.yylloc.first_column:0)+u[u.length-i.length].length-i[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[h[0],h[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(o){this.unput(this.match.slice(o))},pastInput:function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var o=this.pastInput(),s=new Array(o.length+1).join("-");return o+this.upcomingInput()+`
|