rasa-pro 3.12.22__py3-none-any.whl → 3.13.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of rasa-pro might be problematic. Click here for more details.
- rasa/__main__.py +3 -4
- rasa/api.py +1 -1
- rasa/cli/dialogue_understanding_test.py +1 -1
- rasa/cli/e2e_test.py +1 -8
- rasa/cli/evaluate.py +2 -2
- rasa/cli/export.py +5 -3
- rasa/cli/inspect.py +7 -0
- rasa/cli/llm_fine_tuning.py +1 -1
- rasa/cli/project_templates/default/config.yml +5 -32
- rasa/cli/project_templates/{calm → default}/e2e_tests/cancelations/user_cancels_during_a_correction.yml +1 -1
- rasa/cli/project_templates/{calm → default}/e2e_tests/cancelations/user_changes_mind_on_a_whim.yml +1 -1
- rasa/cli/project_templates/{calm → default}/e2e_tests/corrections/user_corrects_contact_handle.yml +1 -1
- rasa/cli/project_templates/{calm → default}/e2e_tests/corrections/user_corrects_contact_name.yml +1 -1
- rasa/cli/project_templates/{calm → default}/e2e_tests/happy_paths/user_adds_contact_to_their_list.yml +1 -1
- rasa/cli/project_templates/{calm → default}/e2e_tests/happy_paths/user_lists_contacts.yml +1 -1
- rasa/cli/project_templates/{calm → default}/e2e_tests/happy_paths/user_removes_contact.yml +1 -1
- rasa/cli/project_templates/{calm → default}/e2e_tests/happy_paths/user_removes_contact_from_list.yml +1 -1
- rasa/cli/project_templates/default/endpoints.yml +18 -2
- 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/scaffold.py +2 -3
- rasa/cli/shell.py +6 -1
- rasa/cli/studio/download.py +0 -22
- rasa/cli/studio/link.py +36 -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 +1 -5
- rasa/cli/studio/upload.py +6 -4
- rasa/cli/train.py +5 -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 +43 -29
- rasa/core/actions/action_repeat_bot_messages.py +18 -22
- rasa/core/actions/action_run_slot_rejections.py +1 -2
- rasa/core/agent.py +24 -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/__init__.py +3 -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/.eslintrc.cjs +12 -6
- rasa/core/channels/inspector/.prettierrc +5 -0
- rasa/core/channels/inspector/README.md +11 -5
- rasa/core/channels/inspector/dist/assets/{arc-9f75cc3b.js → arc-371401b1.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{blockDiagram-38ab4fdb-7f34db23.js → blockDiagram-38ab4fdb-3f126156.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{c4Diagram-3d4e48cf-948bab2c.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-53b0dd0e.js → classDiagram-70f12bd4-03b1d386.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{classDiagram-v2-f2320105-fdf789e7.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-87c4ece5.js → createText-2e5e7dd3-ca47fd38.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{edges-e0da2a9e-5a8b0749.js → edges-e0da2a9e-f837ca8a.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{erDiagram-9861fffd-66da90e2.js → erDiagram-9861fffd-8717ac54.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{flowDb-956e92f1-10044f05.js → flowDb-956e92f1-94f38b83.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{flowDiagram-66a62f08-f338f66a.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-b13140aa.js → flowchart-elk-definition-4a651766-f5d24bb8.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{ganttDiagram-c361ad54-f2b4a55a.js → ganttDiagram-c361ad54-b43ba8d9.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{gitGraphDiagram-72cf32ee-dedc298d.js → gitGraphDiagram-72cf32ee-c3aafaa5.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{graph-4ede11ff.js → graph-0d0a2c10.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{index-3862675e-65549d37.js → index-3862675e-58ea0305.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{index-3a23e736.js → index-cce6f8a1.js} +123 -123
- rasa/core/channels/inspector/dist/assets/{infoDiagram-f8f76790-65439671.js → infoDiagram-f8f76790-b8f60461.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{journeyDiagram-49397b02-56d03d98.js → journeyDiagram-49397b02-95be5545.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{layout-dd48f7f4.js → layout-da885b9b.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{line-1569ad2c.js → line-f1c817d3.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{linear-48bf4935.js → linear-d42801e6.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{mindmap-definition-fc14e90a-688504c1.js → mindmap-definition-fc14e90a-a38923a6.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{pieDiagram-8a3498a8-78b6d7e6.js → pieDiagram-8a3498a8-ca6e71e9.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{quadrantDiagram-120e2f19-048b84b3.js → quadrantDiagram-120e2f19-b290dae9.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{requirementDiagram-deff3bca-dd67f107.js → requirementDiagram-deff3bca-03f02ceb.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{sankeyDiagram-04a897e0-8128436e.js → sankeyDiagram-04a897e0-c49eee40.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{sequenceDiagram-704730f1-1a0d1461.js → sequenceDiagram-704730f1-b2cd6a3d.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{stateDiagram-587899a1-46d388ed.js → stateDiagram-587899a1-e53a2028.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{stateDiagram-v2-d93cdb3a-ea42951a.js → stateDiagram-v2-d93cdb3a-e1982a03.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-6aaf32cf-7427ed0c.js → styles-6aaf32cf-d0226ca5.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-9a916d00-ff5e5a16.js → styles-9a916d00-0e21dc00.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-c10674c1-7b3680cf.js → styles-c10674c1-9588494e.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{svgDrawCommon-08f97a94-f860f2ad.js → svgDrawCommon-08f97a94-be478d4f.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{timeline-definition-85554ec2-2eebf0c8.js → timeline-definition-85554ec2-74631749.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{xychartDiagram-e933f94c-5d7f4e96.js → xychartDiagram-e933f94c-a043552f.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/socketio.py +56 -41
- rasa/core/channels/studio_chat.py +329 -68
- rasa/core/channels/vier_cvg.py +1 -2
- rasa/core/channels/voice_ready/audiocodes.py +4 -11
- rasa/core/channels/voice_ready/jambonz.py +5 -6
- rasa/core/channels/voice_ready/twilio_voice.py +13 -12
- rasa/core/channels/voice_ready/utils.py +22 -0
- rasa/core/channels/voice_stream/audiocodes.py +13 -16
- rasa/core/channels/voice_stream/browser_audio.py +1 -1
- rasa/core/channels/voice_stream/genesys.py +37 -18
- rasa/core/channels/voice_stream/jambonz.py +232 -0
- rasa/core/channels/voice_stream/tts/__init__.py +8 -0
- rasa/core/channels/voice_stream/twilio_media_streams.py +15 -12
- rasa/core/channels/voice_stream/voice_channel.py +71 -27
- rasa/core/concurrent_lock_store.py +24 -10
- rasa/core/evaluation/marker_tracker_loader.py +1 -1
- rasa/core/exporter.py +37 -1
- 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/lock_store.py +151 -60
- rasa/core/nlg/contextual_response_rephraser.py +17 -7
- rasa/core/nlg/generator.py +5 -22
- rasa/core/nlg/interpolator.py +2 -3
- rasa/core/nlg/response.py +6 -43
- rasa/core/nlg/summarize.py +1 -1
- rasa/core/nlg/translate.py +0 -8
- rasa/core/policies/enterprise_search_policy.py +305 -189
- rasa/core/policies/enterprise_search_policy_config.py +241 -0
- rasa/core/policies/enterprise_search_prompt_with_relevancy_check_and_citation_template.jinja2 +67 -0
- rasa/core/policies/flow_policy.py +1 -1
- rasa/core/policies/flows/flow_executor.py +102 -17
- rasa/core/policies/intentless_policy.py +56 -17
- rasa/core/processor.py +70 -49
- rasa/core/run.py +33 -11
- rasa/core/tracker_stores/__init__.py +0 -0
- rasa/core/{auth_retry_tracker_store.py → tracker_stores/auth_retry_tracker_store.py} +66 -1
- rasa/core/tracker_stores/dynamo_tracker_store.py +256 -0
- rasa/core/tracker_stores/mongo_tracker_store.py +223 -0
- rasa/core/tracker_stores/redis_tracker_store.py +252 -0
- rasa/core/tracker_stores/sql_tracker_store.py +582 -0
- rasa/core/tracker_stores/tracker_store.py +839 -0
- rasa/core/training/interactive.py +1 -1
- rasa/core/utils.py +24 -95
- rasa/dialogue_understanding/coexistence/intent_based_router.py +2 -1
- rasa/dialogue_understanding/coexistence/llm_based_router.py +13 -11
- rasa/dialogue_understanding/commands/can_not_handle_command.py +2 -0
- rasa/dialogue_understanding/commands/cancel_flow_command.py +3 -1
- 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/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 +8 -4
- rasa/dialogue_understanding/commands/skip_question_command.py +3 -3
- rasa/dialogue_understanding/commands/start_flow_command.py +7 -3
- 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/llm_based_command_generator.py +1 -2
- rasa/dialogue_understanding/generator/multi_step/multi_step_llm_command_generator.py +3 -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 +26 -461
- 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 +20 -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 +42 -27
- rasa/dialogue_understanding/patterns/domain_for_patterns.py +190 -0
- rasa/dialogue_understanding/processor/command_processor.py +6 -7
- rasa/dialogue_understanding_test/command_metric_calculation.py +7 -40
- rasa/dialogue_understanding_test/command_metrics.py +38 -0
- rasa/dialogue_understanding_test/du_test_case.py +58 -25
- rasa/dialogue_understanding_test/du_test_result.py +228 -132
- rasa/dialogue_understanding_test/du_test_runner.py +11 -2
- rasa/dialogue_understanding_test/du_test_schema.yml +3 -3
- rasa/dialogue_understanding_test/io.py +35 -8
- rasa/e2e_test/constants.py +1 -1
- rasa/e2e_test/e2e_test_runner.py +1 -1
- rasa/e2e_test/e2e_test_schema.yml +3 -3
- rasa/engine/constants.py +1 -1
- rasa/engine/graph.py +2 -2
- rasa/engine/recipes/default_recipe.py +1 -1
- rasa/engine/validation.py +3 -2
- rasa/hooks.py +2 -30
- rasa/llm_fine_tuning/paraphrasing/conversation_rephraser.py +2 -6
- rasa/model_manager/model_api.py +89 -1
- rasa/model_manager/runner_service.py +20 -4
- rasa/model_manager/socket_bridge.py +0 -7
- rasa/model_manager/trainer_service.py +10 -4
- rasa/plugin.py +2 -15
- 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 +393 -0
- rasa/privacy/privacy_manager.py +594 -0
- rasa/server.py +23 -2
- rasa/shared/constants.py +17 -0
- rasa/shared/core/command_payload_reader.py +1 -5
- rasa/shared/core/constants.py +4 -3
- rasa/shared/core/domain.py +172 -11
- rasa/shared/core/events.py +100 -6
- rasa/shared/core/flows/flow.py +30 -5
- rasa/shared/core/flows/flow_step.py +19 -3
- rasa/shared/core/flows/flow_step_links.py +15 -0
- rasa/shared/core/flows/flow_step_sequence.py +6 -0
- rasa/shared/core/flows/flows_yaml_schema.json +3 -0
- rasa/shared/core/flows/nlu_trigger.py +13 -0
- rasa/shared/core/flows/steps/action.py +7 -4
- rasa/shared/core/flows/steps/call.py +11 -4
- rasa/shared/core/flows/steps/collect.py +71 -6
- rasa/shared/core/flows/steps/internal.py +6 -1
- rasa/shared/core/flows/steps/link.py +7 -4
- rasa/shared/core/flows/steps/no_operation.py +7 -4
- rasa/shared/core/flows/steps/set_slots.py +8 -4
- rasa/shared/core/flows/validation.py +25 -5
- rasa/shared/core/flows/yaml_flows_io.py +106 -5
- rasa/shared/core/slots.py +29 -1
- rasa/shared/core/trackers.py +21 -10
- rasa/shared/core/training_data/story_reader/yaml_story_reader.py +1 -4
- rasa/shared/importers/importer.py +8 -0
- rasa/shared/providers/_configs/azure_openai_client_config.py +2 -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 +1 -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/llm/default_litellm_llm_client.py +2 -2
- rasa/shared/utils/common.py +43 -1
- rasa/shared/utils/configs.py +110 -0
- rasa/shared/utils/constants.py +0 -3
- rasa/shared/utils/llm.py +245 -8
- 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 +33 -12
- rasa/studio/download.py +117 -435
- rasa/studio/link.py +211 -0
- rasa/studio/prompts.py +221 -0
- rasa/studio/pull/__init__.py +0 -0
- rasa/studio/pull/data.py +222 -0
- rasa/studio/pull/domains.py +60 -0
- rasa/studio/pull/pull.py +239 -0
- rasa/studio/push.py +138 -0
- rasa/studio/results_logger.py +6 -1
- rasa/studio/train.py +1 -1
- rasa/studio/upload.py +243 -72
- rasa/studio/utils.py +33 -0
- rasa/telemetry.py +83 -26
- rasa/tracing/config.py +4 -5
- rasa/tracing/constants.py +19 -1
- rasa/tracing/instrumentation/attribute_extractors.py +68 -16
- 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 +43 -22
- rasa/utils/endpoints.py +22 -1
- rasa/utils/licensing.py +2 -3
- rasa/utils/log_utils.py +1 -45
- rasa/validator.py +2 -8
- rasa/version.py +1 -1
- {rasa_pro-3.12.22.dist-info → rasa_pro-3.13.0.dist-info}/METADATA +11 -12
- {rasa_pro-3.12.22.dist-info → rasa_pro-3.13.0.dist-info}/RECORD +333 -309
- 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/cli/project_templates/calm/config.yml +0 -10
- rasa/cli/project_templates/calm/credentials.yml +0 -33
- rasa/cli/project_templates/calm/endpoints.yml +0 -58
- rasa/cli/project_templates/default/actions/actions.py +0 -27
- rasa/cli/project_templates/default/data/nlu.yml +0 -91
- rasa/cli/project_templates/default/data/rules.yml +0 -13
- rasa/cli/project_templates/default/data/stories.yml +0 -30
- rasa/cli/project_templates/default/domain.yml +0 -34
- rasa/cli/project_templates/default/tests/test_stories.yml +0 -91
- 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/cli/project_templates/{calm → default}/actions/action_template.py +0 -0
- /rasa/cli/project_templates/{calm → default}/actions/add_contact.py +0 -0
- /rasa/cli/project_templates/{calm → default}/actions/db.py +0 -0
- /rasa/cli/project_templates/{calm → default}/actions/list_contacts.py +0 -0
- /rasa/cli/project_templates/{calm → default}/actions/remove_contact.py +0 -0
- /rasa/cli/project_templates/{calm → default}/data/flows/add_contact.yml +0 -0
- /rasa/cli/project_templates/{calm → default}/data/flows/list_contacts.yml +0 -0
- /rasa/cli/project_templates/{calm → default}/data/flows/remove_contact.yml +0 -0
- /rasa/cli/project_templates/{calm → default}/db/contacts.json +0 -0
- /rasa/cli/project_templates/{calm → default}/domain/add_contact.yml +0 -0
- /rasa/cli/project_templates/{calm → default}/domain/list_contacts.yml +0 -0
- /rasa/cli/project_templates/{calm → default}/domain/remove_contact.yml +0 -0
- /rasa/cli/project_templates/{calm → default}/domain/shared.yml +0 -0
- /rasa/{cli/project_templates/calm/actions → core/information_retrieval/ingestion}/__init__.py +0 -0
- {rasa_pro-3.12.22.dist-info → rasa_pro-3.13.0.dist-info}/NOTICE +0 -0
- {rasa_pro-3.12.22.dist-info → rasa_pro-3.13.0.dist-info}/WHEEL +0 -0
- {rasa_pro-3.12.22.dist-info → rasa_pro-3.13.0.dist-info}/entry_points.txt +0 -0
|
@@ -5,12 +5,12 @@ mapping:
|
|
|
5
5
|
sequence:
|
|
6
6
|
- type: map
|
|
7
7
|
mapping:
|
|
8
|
-
regex;(^[a-zA-Z_]+[a-zA-Z0-9_
|
|
8
|
+
regex;(^[a-zA-Z_]+[a-zA-Z0-9_]*$):
|
|
9
9
|
type: "seq"
|
|
10
10
|
sequence:
|
|
11
11
|
- type: map
|
|
12
12
|
mapping:
|
|
13
|
-
regex;(^[a-zA-Z_]+[a-zA-Z0-9_
|
|
13
|
+
regex;(^[a-zA-Z_]+[a-zA-Z0-9_]*$):
|
|
14
14
|
type: any
|
|
15
15
|
|
|
16
16
|
metadata:
|
|
@@ -129,7 +129,7 @@ mapping:
|
|
|
129
129
|
type: "seq"
|
|
130
130
|
sequence:
|
|
131
131
|
- type: "str"
|
|
132
|
-
pattern: ^[a-zA-Z_]+[a-zA-Z0-9_
|
|
132
|
+
pattern: ^[a-zA-Z_]+[a-zA-Z0-9_]*$
|
|
133
133
|
metadata:
|
|
134
134
|
type: "str"
|
|
135
135
|
pattern: ^[a-zA-Z_]+[a-zA-Z0-9_]*$
|
|
@@ -5,7 +5,7 @@ from typing import TYPE_CHECKING, Any, Dict, List, Union
|
|
|
5
5
|
import rich
|
|
6
6
|
|
|
7
7
|
import rasa.shared.data
|
|
8
|
-
from rasa.dialogue_understanding_test.
|
|
8
|
+
from rasa.dialogue_understanding_test.command_metrics import CommandMetrics
|
|
9
9
|
from rasa.dialogue_understanding_test.constants import SCHEMA_FILE_PATH
|
|
10
10
|
from rasa.dialogue_understanding_test.du_test_case import (
|
|
11
11
|
KEY_CHOICES,
|
|
@@ -13,6 +13,9 @@ from rasa.dialogue_understanding_test.du_test_case import (
|
|
|
13
13
|
KEY_PROMPT_TOKENS,
|
|
14
14
|
)
|
|
15
15
|
from rasa.dialogue_understanding_test.du_test_result import (
|
|
16
|
+
KEY_COMMANDS_F1_MACRO,
|
|
17
|
+
KEY_COMMANDS_F1_MICRO,
|
|
18
|
+
KEY_COMMANDS_F1_WEIGHTED,
|
|
16
19
|
DialogueUnderstandingTestSuiteResult,
|
|
17
20
|
FailedTestStep,
|
|
18
21
|
)
|
|
@@ -274,6 +277,7 @@ def print_test_results(
|
|
|
274
277
|
# print failed test steps
|
|
275
278
|
print_failed_cases(test_suite_result, output_prompt=output_prompt)
|
|
276
279
|
|
|
280
|
+
print_f1_summary(test_suite_result)
|
|
277
281
|
print_command_summary(test_suite_result.command_metrics)
|
|
278
282
|
print_latency_and_token_metrics(test_suite_result)
|
|
279
283
|
print_final_line(test_suite_result)
|
|
@@ -350,11 +354,26 @@ def print_llm_output(step: FailedTestStep) -> None:
|
|
|
350
354
|
for component, component_prompts in step.prompts.items():
|
|
351
355
|
for prompt_data in component_prompts:
|
|
352
356
|
if KEY_CHOICES in prompt_data:
|
|
353
|
-
rich.print("\n[red3]--
|
|
357
|
+
rich.print(f"\n[red3]-- LLM ouptut for {component} --[/red3]")
|
|
354
358
|
rich.print(prompt_data.get(KEY_CHOICES))
|
|
355
359
|
rich.print("[red3]-------------[/red3]")
|
|
356
360
|
|
|
357
361
|
|
|
362
|
+
def print_f1_summary(result: DialogueUnderstandingTestSuiteResult) -> None:
|
|
363
|
+
"""Print the f1 summary."""
|
|
364
|
+
print()
|
|
365
|
+
rasa.shared.utils.cli.print_info(rasa.shared.utils.cli.pad("COMMANDS F1"))
|
|
366
|
+
rasa.shared.utils.cli.print_info(
|
|
367
|
+
f"macro : {result.f1_score[KEY_COMMANDS_F1_MACRO]:.8f}"
|
|
368
|
+
)
|
|
369
|
+
rasa.shared.utils.cli.print_info(
|
|
370
|
+
f"micro : {result.f1_score[KEY_COMMANDS_F1_MICRO]:.8f}"
|
|
371
|
+
)
|
|
372
|
+
rasa.shared.utils.cli.print_info(
|
|
373
|
+
f"weighted average: {result.f1_score[KEY_COMMANDS_F1_WEIGHTED]:.8f}"
|
|
374
|
+
)
|
|
375
|
+
|
|
376
|
+
|
|
358
377
|
def print_command_summary(metrics: Dict[str, CommandMetrics]) -> None:
|
|
359
378
|
"""Print the command summary.
|
|
360
379
|
|
|
@@ -390,16 +409,24 @@ def print_latency_and_token_metrics(
|
|
|
390
409
|
"""Print the latency and token metrics."""
|
|
391
410
|
print()
|
|
392
411
|
rasa.shared.utils.cli.print_info(rasa.shared.utils.cli.pad("LATENCY METRICS"))
|
|
393
|
-
for
|
|
394
|
-
rasa.shared.utils.cli.print_info(f"{
|
|
412
|
+
for component, latency_metric in result.latency_metrics.items():
|
|
413
|
+
rasa.shared.utils.cli.print_info(f"--- {component} ---")
|
|
414
|
+
for key, value in latency_metric.items():
|
|
415
|
+
rasa.shared.utils.cli.print_info(f"{key}: {value:.8f}")
|
|
416
|
+
|
|
395
417
|
rasa.shared.utils.cli.print_info(rasa.shared.utils.cli.pad("PROMPT TOKEN METRICS"))
|
|
396
|
-
for
|
|
397
|
-
rasa.shared.utils.cli.print_info(f"{
|
|
418
|
+
for component, prompt_token_metric in result.prompt_token_metrics.items():
|
|
419
|
+
rasa.shared.utils.cli.print_info(f"--- {component} ---")
|
|
420
|
+
for key, value in prompt_token_metric.items():
|
|
421
|
+
rasa.shared.utils.cli.print_info(f"{key}: {value:.2f}")
|
|
422
|
+
|
|
398
423
|
rasa.shared.utils.cli.print_info(
|
|
399
424
|
rasa.shared.utils.cli.pad("COMPLETION TOKEN METRICS")
|
|
400
425
|
)
|
|
401
|
-
for
|
|
402
|
-
rasa.shared.utils.cli.print_info(f"{
|
|
426
|
+
for component, completion_token_metric in result.completion_token_metrics.items():
|
|
427
|
+
rasa.shared.utils.cli.print_info(f"--- {component} ---")
|
|
428
|
+
for key, value in completion_token_metric.items():
|
|
429
|
+
rasa.shared.utils.cli.print_info(f"{key}: {value:.2f}")
|
|
403
430
|
|
|
404
431
|
|
|
405
432
|
def print_final_line(test_suite_result: DialogueUnderstandingTestSuiteResult) -> None:
|
rasa/e2e_test/constants.py
CHANGED
|
@@ -40,7 +40,7 @@ DEFAULT_GROUNDEDNESS_PROMPT_TEMPLATE_FILE_NAME = "groundedness_prompt_template.j
|
|
|
40
40
|
DEFAULT_ANSWER_RELEVANCE_PROMPT_TEMPLATE_FILE_NAME = (
|
|
41
41
|
"answer_relevance_prompt_template.jinja2"
|
|
42
42
|
)
|
|
43
|
-
DEFAULT_E2E_TESTING_MODEL = "gpt-
|
|
43
|
+
DEFAULT_E2E_TESTING_MODEL = "gpt-4.1-mini-2025-04-14"
|
|
44
44
|
KEY_SCORE = "score"
|
|
45
45
|
KEY_JUSTIFICATION = "justification"
|
|
46
46
|
KEY_EXTRA_PARAMETERS = "extra_parameters"
|
rasa/e2e_test/e2e_test_runner.py
CHANGED
|
@@ -13,11 +13,11 @@ import structlog
|
|
|
13
13
|
from tqdm import tqdm
|
|
14
14
|
|
|
15
15
|
import rasa.shared.utils.io
|
|
16
|
+
from rasa.core.available_endpoints import AvailableEndpoints
|
|
16
17
|
from rasa.core.channels import CollectingOutputChannel, UserMessage
|
|
17
18
|
from rasa.core.constants import ACTIVE_FLOW_METADATA_KEY, STEP_ID_METADATA_KEY
|
|
18
19
|
from rasa.core.exceptions import AgentNotReady
|
|
19
20
|
from rasa.core.persistor import StorageType
|
|
20
|
-
from rasa.core.utils import AvailableEndpoints
|
|
21
21
|
from rasa.dialogue_understanding_test.du_test_case import DialogueUnderstandingTestCase
|
|
22
22
|
from rasa.e2e_test.constants import TEST_CASE_NAME, TEST_FILE_NAME
|
|
23
23
|
from rasa.e2e_test.e2e_config import create_llm_judge_config
|
|
@@ -5,12 +5,12 @@ mapping:
|
|
|
5
5
|
sequence:
|
|
6
6
|
- type: map
|
|
7
7
|
mapping:
|
|
8
|
-
regex;(^[a-zA-Z_]+[a-zA-Z0-9_
|
|
8
|
+
regex;(^[a-zA-Z_]+[a-zA-Z0-9_]*$):
|
|
9
9
|
type: "seq"
|
|
10
10
|
sequence:
|
|
11
11
|
- type: map
|
|
12
12
|
mapping:
|
|
13
|
-
regex;(^[a-zA-Z_]+[a-zA-Z0-9_
|
|
13
|
+
regex;(^[a-zA-Z_]+[a-zA-Z0-9_]*$):
|
|
14
14
|
type: any
|
|
15
15
|
|
|
16
16
|
metadata:
|
|
@@ -129,7 +129,7 @@ mapping:
|
|
|
129
129
|
type: "seq"
|
|
130
130
|
sequence:
|
|
131
131
|
- type: "str"
|
|
132
|
-
pattern: ^[a-zA-Z_]+[a-zA-Z0-9_
|
|
132
|
+
pattern: ^[a-zA-Z_]+[a-zA-Z0-9_]*$
|
|
133
133
|
metadata:
|
|
134
134
|
type: "str"
|
|
135
135
|
pattern: ^[a-zA-Z_]+[a-zA-Z0-9_]*$
|
rasa/engine/constants.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from typing import List, Optional
|
|
2
2
|
|
|
3
|
+
from rasa.core.available_endpoints import AvailableEndpoints
|
|
3
4
|
from rasa.core.channels import UserMessage
|
|
4
|
-
from rasa.core.utils import AvailableEndpoints
|
|
5
5
|
from rasa.shared.core.trackers import DialogueStateTracker
|
|
6
6
|
from rasa.shared.importers.importer import TrainingDataImporter
|
|
7
7
|
|
rasa/engine/graph.py
CHANGED
|
@@ -500,9 +500,9 @@ class GraphNode:
|
|
|
500
500
|
structlogger.warning(
|
|
501
501
|
"graph.node.input_not_resolved",
|
|
502
502
|
node_name=self._node_name,
|
|
503
|
-
input_name=i,
|
|
503
|
+
input_name=i, # no PII
|
|
504
504
|
event_info=(
|
|
505
|
-
"Node input was not resolved, there is no
|
|
505
|
+
"Node input was not resolved, there is no output. "
|
|
506
506
|
"Another component should have provided this as an output."
|
|
507
507
|
),
|
|
508
508
|
)
|
|
@@ -770,7 +770,7 @@ class DefaultV1Recipe(Recipe):
|
|
|
770
770
|
@staticmethod
|
|
771
771
|
def _intentless_policy_used(nodes: Dict[Text, SchemaNode]) -> bool:
|
|
772
772
|
"""Checks if the intentless policy is used in the nodes."""
|
|
773
|
-
from rasa.core import IntentlessPolicy
|
|
773
|
+
from rasa.core.policies.intentless_policy import IntentlessPolicy
|
|
774
774
|
|
|
775
775
|
for schema_node in nodes.values():
|
|
776
776
|
if schema_node.matches_type(IntentlessPolicy):
|
rasa/engine/validation.py
CHANGED
|
@@ -23,9 +23,10 @@ import structlog
|
|
|
23
23
|
import typing_utils
|
|
24
24
|
|
|
25
25
|
import rasa.utils.common
|
|
26
|
-
from rasa.core import
|
|
26
|
+
from rasa.core.available_endpoints import AvailableEndpoints
|
|
27
|
+
from rasa.core.nlg.contextual_response_rephraser import ContextualResponseRephraser
|
|
28
|
+
from rasa.core.policies.intentless_policy import IntentlessPolicy
|
|
27
29
|
from rasa.core.policies.policy import PolicyPrediction
|
|
28
|
-
from rasa.core.utils import AvailableEndpoints
|
|
29
30
|
from rasa.dialogue_understanding.coexistence.constants import (
|
|
30
31
|
CALM_ENTRY,
|
|
31
32
|
NLU_ENTRY,
|
rasa/hooks.py
CHANGED
|
@@ -9,10 +9,9 @@ import pluggy
|
|
|
9
9
|
# across the codebase.
|
|
10
10
|
|
|
11
11
|
if TYPE_CHECKING:
|
|
12
|
-
from rasa.anonymization.anonymization_pipeline import AnonymizationPipeline
|
|
13
12
|
from rasa.cli import SubParsersAction
|
|
14
13
|
from rasa.core.brokers.broker import EventBroker
|
|
15
|
-
from rasa.core.tracker_store import TrackerStore
|
|
14
|
+
from rasa.core.tracker_stores.tracker_store import TrackerStore
|
|
16
15
|
from rasa.shared.core.domain import Domain
|
|
17
16
|
from rasa.utils.endpoints import EndpointConfig
|
|
18
17
|
|
|
@@ -80,7 +79,7 @@ def create_tracker_store(
|
|
|
80
79
|
domain: "Domain",
|
|
81
80
|
event_broker: Optional["EventBroker"],
|
|
82
81
|
) -> "TrackerStore":
|
|
83
|
-
from rasa.core.auth_retry_tracker_store import AuthRetryTrackerStore
|
|
82
|
+
from rasa.core.tracker_stores.auth_retry_tracker_store import AuthRetryTrackerStore
|
|
84
83
|
from rasa.utils.endpoints import EndpointConfig
|
|
85
84
|
|
|
86
85
|
if isinstance(endpoint_config, EndpointConfig):
|
|
@@ -88,30 +87,3 @@ def create_tracker_store(
|
|
|
88
87
|
endpoint_config=endpoint_config, domain=domain, event_broker=event_broker
|
|
89
88
|
)
|
|
90
89
|
return endpoint_config
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
@hookimpl # type: ignore[misc]
|
|
94
|
-
def init_anonymization_pipeline(endpoints_file: Optional[Text]) -> None:
|
|
95
|
-
"""Hook implementation for initializing the anonymization pipeline."""
|
|
96
|
-
from rasa.anonymization.anonymization_pipeline import load_anonymization_pipeline
|
|
97
|
-
|
|
98
|
-
load_anonymization_pipeline(endpoints_file)
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
@hookimpl # type: ignore[misc]
|
|
102
|
-
def get_anonymization_pipeline() -> Optional["AnonymizationPipeline"]:
|
|
103
|
-
"""Hook implementation for getting the anonymization pipeline."""
|
|
104
|
-
from rasa.anonymization.anonymization_pipeline import AnonymizationPipelineProvider
|
|
105
|
-
|
|
106
|
-
return AnonymizationPipelineProvider().get_anonymization_pipeline()
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
@hookimpl # type: ignore[misc]
|
|
110
|
-
def after_server_stop() -> None:
|
|
111
|
-
"""Hook implementation for stopping the anonymization pipeline."""
|
|
112
|
-
from rasa.anonymization.anonymization_pipeline import AnonymizationPipelineProvider
|
|
113
|
-
|
|
114
|
-
anon_pipeline = AnonymizationPipelineProvider().get_anonymization_pipeline()
|
|
115
|
-
|
|
116
|
-
if anon_pipeline is not None:
|
|
117
|
-
anon_pipeline.stop()
|
|
@@ -22,11 +22,7 @@ from rasa.shared.constants import (
|
|
|
22
22
|
from rasa.shared.exceptions import ProviderClientAPIException
|
|
23
23
|
from rasa.shared.providers.mappings import OPENAI_PROVIDER
|
|
24
24
|
from rasa.shared.utils.constants import LOG_COMPONENT_SOURCE_METHOD_INIT
|
|
25
|
-
from rasa.shared.utils.llm import
|
|
26
|
-
USER,
|
|
27
|
-
get_prompt_template,
|
|
28
|
-
llm_factory,
|
|
29
|
-
)
|
|
25
|
+
from rasa.shared.utils.llm import USER, get_prompt_template, llm_factory
|
|
30
26
|
|
|
31
27
|
SEPARATOR = "\n\n"
|
|
32
28
|
BACKUP_SEPARATOR = "\nUSER:"
|
|
@@ -39,7 +35,7 @@ DEFAULT_REPHRASING_PROMPT_TEMPLATE = importlib.resources.read_text(
|
|
|
39
35
|
|
|
40
36
|
DEFAULT_LLM_CONFIG = {
|
|
41
37
|
PROVIDER_CONFIG_KEY: OPENAI_PROVIDER,
|
|
42
|
-
MODEL_CONFIG_KEY: "gpt-
|
|
38
|
+
MODEL_CONFIG_KEY: "gpt-4.1-mini-2025-04-14",
|
|
43
39
|
TIMEOUT_CONFIG_KEY: 7,
|
|
44
40
|
TEMPERATURE_CONFIG_KEY: 0.0,
|
|
45
41
|
MAX_COMPLETION_TOKENS_CONFIG_KEY: 4096,
|
rasa/model_manager/model_api.py
CHANGED
|
@@ -7,12 +7,16 @@ from typing import Any, Callable, Dict, Optional, Union
|
|
|
7
7
|
import dotenv
|
|
8
8
|
import psutil
|
|
9
9
|
import structlog
|
|
10
|
+
from ruamel.yaml import YAMLError
|
|
10
11
|
from sanic import Blueprint, Sanic, response
|
|
11
12
|
from sanic.exceptions import NotFound
|
|
12
13
|
from sanic.request import Request
|
|
13
14
|
from sanic.response import json
|
|
14
15
|
from socketio import AsyncServer
|
|
15
16
|
|
|
17
|
+
import rasa
|
|
18
|
+
from rasa.cli.project_templates.defaults import get_rasa_defaults
|
|
19
|
+
from rasa.cli.scaffold import ProjectTemplateName, scaffold_path
|
|
16
20
|
from rasa.constants import MODEL_ARCHIVE_EXTENSION
|
|
17
21
|
from rasa.exceptions import ModelNotFound
|
|
18
22
|
from rasa.model_manager import config
|
|
@@ -45,6 +49,10 @@ from rasa.model_manager.warm_rasa_process import (
|
|
|
45
49
|
initialize_warm_rasa_process,
|
|
46
50
|
shutdown_warm_rasa_processes,
|
|
47
51
|
)
|
|
52
|
+
from rasa.server import ErrorResponse
|
|
53
|
+
from rasa.shared.exceptions import InvalidConfigException
|
|
54
|
+
from rasa.shared.utils.yaml import dump_obj_as_yaml_to_string
|
|
55
|
+
from rasa.studio.upload import build_calm_import_parts
|
|
48
56
|
|
|
49
57
|
dotenv.load_dotenv()
|
|
50
58
|
|
|
@@ -476,6 +484,86 @@ def internal_blueprint() -> Blueprint:
|
|
|
476
484
|
except ModelNotFound:
|
|
477
485
|
return response.raw(b"", status=404)
|
|
478
486
|
|
|
487
|
+
@bp.post("/defaults")
|
|
488
|
+
async def get_defaults(request: Request) -> response.HTTPResponse:
|
|
489
|
+
"""Returns the system defaults like prompts, patterns, etc."""
|
|
490
|
+
body = request.json or {}
|
|
491
|
+
config_yaml = body.get("config")
|
|
492
|
+
if config_yaml is None:
|
|
493
|
+
exc = ErrorResponse(
|
|
494
|
+
HTTPStatus.BAD_REQUEST,
|
|
495
|
+
"BadRequest",
|
|
496
|
+
"Missing `config` key in request body.",
|
|
497
|
+
)
|
|
498
|
+
return response.json(exc.error_info, status=exc.status)
|
|
499
|
+
|
|
500
|
+
endpoints_yaml = body.get("endpoints")
|
|
501
|
+
if endpoints_yaml is None:
|
|
502
|
+
exc = ErrorResponse(
|
|
503
|
+
HTTPStatus.BAD_REQUEST,
|
|
504
|
+
"BadRequest",
|
|
505
|
+
"Missing `endpoints` key in request body.",
|
|
506
|
+
)
|
|
507
|
+
return response.json(exc.error_info, status=exc.status)
|
|
508
|
+
|
|
509
|
+
try:
|
|
510
|
+
defaults = get_rasa_defaults(config_yaml, endpoints_yaml)
|
|
511
|
+
except (YAMLError, InvalidConfigException) as e:
|
|
512
|
+
exc = ErrorResponse(
|
|
513
|
+
HTTPStatus.INTERNAL_SERVER_ERROR,
|
|
514
|
+
"InitDataError",
|
|
515
|
+
f"Failed to load defaults. Error: {e!s}",
|
|
516
|
+
)
|
|
517
|
+
return response.json(exc.error_info, status=exc.status)
|
|
518
|
+
return response.json(defaults.model_dump(exclude_none=True))
|
|
519
|
+
|
|
520
|
+
@bp.get("/project_template")
|
|
521
|
+
async def get_project_template(request: Request) -> response.HTTPResponse:
|
|
522
|
+
"""Return initial project template data."""
|
|
523
|
+
template = request.args.get("template", ProjectTemplateName.DEFAULT.value)
|
|
524
|
+
|
|
525
|
+
try:
|
|
526
|
+
template_enum = ProjectTemplateName(template)
|
|
527
|
+
except ValueError:
|
|
528
|
+
valid_templates = ", ".join([t.value for t in ProjectTemplateName])
|
|
529
|
+
exc = ErrorResponse(
|
|
530
|
+
HTTPStatus.BAD_REQUEST,
|
|
531
|
+
"BadRequest",
|
|
532
|
+
f"Unknown template '{template}'. Valid templates: "
|
|
533
|
+
f"{valid_templates}",
|
|
534
|
+
)
|
|
535
|
+
return response.json(exc.error_info, status=exc.status)
|
|
536
|
+
|
|
537
|
+
template_dir = scaffold_path(template_enum)
|
|
538
|
+
if not os.path.isdir(template_dir):
|
|
539
|
+
exc = ErrorResponse(
|
|
540
|
+
HTTPStatus.INTERNAL_SERVER_ERROR,
|
|
541
|
+
"InitDataError",
|
|
542
|
+
f"Template directory '{template_dir}' not found.",
|
|
543
|
+
)
|
|
544
|
+
return response.json(exc.error_info, status=exc.status)
|
|
545
|
+
|
|
546
|
+
assistant_name, parts = build_calm_import_parts(
|
|
547
|
+
data_path=f"{template_dir}/data",
|
|
548
|
+
domain_path=f"{template_dir}/domain",
|
|
549
|
+
config_path=f"{template_dir}/config.yml",
|
|
550
|
+
endpoints_path=f"{template_dir}/endpoints.yml",
|
|
551
|
+
assistant_name=template_enum.value,
|
|
552
|
+
)
|
|
553
|
+
|
|
554
|
+
defaults = get_rasa_defaults(
|
|
555
|
+
config_yaml=dump_obj_as_yaml_to_string(parts.config),
|
|
556
|
+
endpoints_yaml=dump_obj_as_yaml_to_string(parts.endpoints),
|
|
557
|
+
)
|
|
558
|
+
return response.json(
|
|
559
|
+
{
|
|
560
|
+
**parts.model_dump(exclude_none=True),
|
|
561
|
+
"assistantName": assistant_name,
|
|
562
|
+
"defaults": defaults.model_dump(exclude_none=True),
|
|
563
|
+
"version": rasa.__version__,
|
|
564
|
+
}
|
|
565
|
+
)
|
|
566
|
+
|
|
479
567
|
return bp
|
|
480
568
|
|
|
481
569
|
|
|
@@ -483,7 +571,7 @@ def external_blueprint() -> Blueprint:
|
|
|
483
571
|
"""Create a blueprint for the model manager API."""
|
|
484
572
|
from rasa.core.channels.socketio import SocketBlueprint
|
|
485
573
|
|
|
486
|
-
sio = AsyncServer(async_mode="sanic", cors_allowed_origins=
|
|
574
|
+
sio = AsyncServer(async_mode="sanic", cors_allowed_origins=[])
|
|
487
575
|
bp = SocketBlueprint(sio, "", "model_api_external")
|
|
488
576
|
|
|
489
577
|
create_bridge_server(sio, running_bots)
|
|
@@ -2,7 +2,8 @@ import os
|
|
|
2
2
|
import shutil
|
|
3
3
|
import subprocess
|
|
4
4
|
from enum import Enum
|
|
5
|
-
from
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
from typing import Dict, Optional, Union
|
|
6
7
|
|
|
7
8
|
import aiohttp
|
|
8
9
|
import structlog
|
|
@@ -18,6 +19,7 @@ from rasa.model_manager.utils import (
|
|
|
18
19
|
write_encoded_data_to_file,
|
|
19
20
|
)
|
|
20
21
|
from rasa.model_manager.warm_rasa_process import start_rasa_process
|
|
22
|
+
from rasa.studio.prompts import handle_prompts
|
|
21
23
|
|
|
22
24
|
structlogger = structlog.get_logger()
|
|
23
25
|
|
|
@@ -121,11 +123,25 @@ def get_open_port() -> int:
|
|
|
121
123
|
|
|
122
124
|
|
|
123
125
|
def write_encoded_config_data_to_files(
|
|
124
|
-
encoded_configs: Dict[str, bytes], base_path: str
|
|
126
|
+
encoded_configs: Dict[str, Union[bytes, Dict[str, str]]], base_path: str
|
|
125
127
|
) -> None:
|
|
126
128
|
"""Write the encoded config data to files."""
|
|
127
|
-
|
|
128
|
-
|
|
129
|
+
endpoints_encoded = encoded_configs.get("endpoints")
|
|
130
|
+
if endpoints_encoded:
|
|
131
|
+
write_encoded_data_to_file(
|
|
132
|
+
endpoints_encoded, subpath(base_path, "endpoints.yml")
|
|
133
|
+
)
|
|
134
|
+
config_encoded = encoded_configs.get("config")
|
|
135
|
+
if config_encoded:
|
|
136
|
+
write_encoded_data_to_file(config_encoded, subpath(base_path, "config.yml"))
|
|
137
|
+
credentials_encoded = encoded_configs.get("credentials")
|
|
138
|
+
if credentials_encoded:
|
|
139
|
+
write_encoded_data_to_file(
|
|
140
|
+
credentials_encoded, subpath(base_path, "credentials.yml")
|
|
141
|
+
)
|
|
142
|
+
|
|
143
|
+
if prompts := encoded_configs.get("prompts"):
|
|
144
|
+
handle_prompts(prompts, Path(base_path))
|
|
129
145
|
|
|
130
146
|
|
|
131
147
|
def prepare_bot_directory(
|
|
@@ -131,13 +131,6 @@ async def create_bridge_client(
|
|
|
131
131
|
structlogger.debug("model_runner.bot_message", deployment_id=deployment_id)
|
|
132
132
|
await sio.emit("bot_message", data, room=sid)
|
|
133
133
|
|
|
134
|
-
@client.event # type: ignore[misc]
|
|
135
|
-
async def error(data: Dict[str, Any]) -> None:
|
|
136
|
-
structlogger.debug(
|
|
137
|
-
"model_runner.bot_error", deployment_id=deployment_id, data=data
|
|
138
|
-
)
|
|
139
|
-
await sio.emit("error", data, room=sid)
|
|
140
|
-
|
|
141
134
|
@client.event # type: ignore[misc]
|
|
142
135
|
async def tracker(data: Dict[str, Any]) -> None:
|
|
143
136
|
await sio.emit("tracker", json.loads(data), room=sid)
|
|
@@ -2,12 +2,13 @@ import os
|
|
|
2
2
|
import shutil
|
|
3
3
|
import subprocess
|
|
4
4
|
from enum import Enum
|
|
5
|
+
from pathlib import Path
|
|
5
6
|
from typing import Any, Dict, Optional
|
|
6
7
|
|
|
7
8
|
import structlog
|
|
8
9
|
from pydantic import BaseModel, ConfigDict
|
|
9
10
|
|
|
10
|
-
from rasa.constants import MODEL_ARCHIVE_EXTENSION
|
|
11
|
+
from rasa.constants import MODEL_ARCHIVE_EXTENSION, RASA_DIR_NAME
|
|
11
12
|
from rasa.model_manager import config
|
|
12
13
|
from rasa.model_manager.utils import (
|
|
13
14
|
ensure_base_directory_exists,
|
|
@@ -20,6 +21,7 @@ from rasa.model_manager.warm_rasa_process import (
|
|
|
20
21
|
start_rasa_process,
|
|
21
22
|
)
|
|
22
23
|
from rasa.model_training import generate_random_model_name
|
|
24
|
+
from rasa.studio.prompts import handle_prompts
|
|
23
25
|
|
|
24
26
|
structlogger = structlog.get_logger()
|
|
25
27
|
|
|
@@ -171,7 +173,7 @@ def seed_training_directory_with_rasa_cache(
|
|
|
171
173
|
training_base_path=training_base_path,
|
|
172
174
|
)
|
|
173
175
|
# copy the cache to the training directory
|
|
174
|
-
shutil.copytree(src=cache_path, dst=subpath(training_base_path,
|
|
176
|
+
shutil.copytree(src=cache_path, dst=subpath(training_base_path, RASA_DIR_NAME))
|
|
175
177
|
|
|
176
178
|
|
|
177
179
|
def persist_rasa_cache(assistant_id: str, training_base_path: str) -> None:
|
|
@@ -184,12 +186,12 @@ def persist_rasa_cache(assistant_id: str, training_base_path: str) -> None:
|
|
|
184
186
|
cache_path = cache_for_assistant_path(assistant_id)
|
|
185
187
|
|
|
186
188
|
# if the training failed and didn't create a cache, skip this step
|
|
187
|
-
if not os.path.exists(subpath(training_base_path,
|
|
189
|
+
if not os.path.exists(subpath(training_base_path, RASA_DIR_NAME)):
|
|
188
190
|
return
|
|
189
191
|
|
|
190
192
|
# clean up the cache directory first
|
|
191
193
|
shutil.rmtree(cache_path, ignore_errors=True)
|
|
192
|
-
shutil.copytree(src=subpath(training_base_path,
|
|
194
|
+
shutil.copytree(src=subpath(training_base_path, RASA_DIR_NAME), dst=cache_path)
|
|
193
195
|
|
|
194
196
|
|
|
195
197
|
def write_training_data_to_files(
|
|
@@ -208,6 +210,7 @@ def write_training_data_to_files(
|
|
|
208
210
|
"stories": "base64 encoded stories.yml",
|
|
209
211
|
"rules": "base64 encoded rules.yml",
|
|
210
212
|
"nlu": "base64 encoded nlu.yml"
|
|
213
|
+
"prompts": "dictionary with the prompts",
|
|
211
214
|
}
|
|
212
215
|
```
|
|
213
216
|
"""
|
|
@@ -230,6 +233,9 @@ def write_training_data_to_files(
|
|
|
230
233
|
subpath(training_base_path + "/" + parent_path, file_name),
|
|
231
234
|
)
|
|
232
235
|
|
|
236
|
+
if prompts := encoded_training_data.get("prompts"):
|
|
237
|
+
handle_prompts(prompts, Path(training_base_path))
|
|
238
|
+
|
|
233
239
|
|
|
234
240
|
def prepare_training_directory(
|
|
235
241
|
training_base_path: str, assistant_id: str, encoded_training_data: Dict[str, Any]
|
rasa/plugin.py
CHANGED
|
@@ -3,7 +3,7 @@ from __future__ import annotations
|
|
|
3
3
|
import argparse
|
|
4
4
|
import functools
|
|
5
5
|
import sys
|
|
6
|
-
from typing import TYPE_CHECKING,
|
|
6
|
+
from typing import TYPE_CHECKING, List, Optional, Text, Union
|
|
7
7
|
|
|
8
8
|
import pluggy
|
|
9
9
|
|
|
@@ -11,7 +11,7 @@ from rasa.cli import SubParsersAction
|
|
|
11
11
|
|
|
12
12
|
if TYPE_CHECKING:
|
|
13
13
|
from rasa.core.brokers.broker import EventBroker
|
|
14
|
-
from rasa.core.tracker_store import TrackerStore
|
|
14
|
+
from rasa.core.tracker_stores.tracker_store import TrackerStore
|
|
15
15
|
from rasa.shared.core.domain import Domain
|
|
16
16
|
from rasa.shared.core.trackers import DialogueStateTracker
|
|
17
17
|
from rasa.utils.endpoints import EndpointConfig
|
|
@@ -32,11 +32,8 @@ def plugin_manager() -> pluggy.PluginManager:
|
|
|
32
32
|
|
|
33
33
|
def init_hooks(manager: pluggy.PluginManager) -> None:
|
|
34
34
|
"""Initialise hooks into rasa."""
|
|
35
|
-
import rasa.utils.licensing
|
|
36
35
|
from rasa import hooks
|
|
37
36
|
|
|
38
|
-
rasa.utils.licensing.validate_license_from_env()
|
|
39
|
-
|
|
40
37
|
manager.register(hooks)
|
|
41
38
|
|
|
42
39
|
|
|
@@ -72,16 +69,6 @@ def create_tracker_store( # type: ignore[empty-body]
|
|
|
72
69
|
"""Hook specification for wrapping with AuthRetryTrackerStore."""
|
|
73
70
|
|
|
74
71
|
|
|
75
|
-
@hookspec(firstresult=True) # type: ignore[misc]
|
|
76
|
-
def init_anonymization_pipeline(endpoints_file: Optional[Text]) -> None:
|
|
77
|
-
"""Hook specification for initialising the anonymization pipeline."""
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
@hookspec(firstresult=True) # type: ignore[misc]
|
|
81
|
-
def get_anonymization_pipeline() -> Optional[Any]:
|
|
82
|
-
"""Hook specification for getting the anonymization pipeline."""
|
|
83
|
-
|
|
84
|
-
|
|
85
72
|
@hookspec # type: ignore[misc]
|
|
86
73
|
def after_server_stop() -> None:
|
|
87
74
|
"""Hook specification for stopping the server.
|
rasa/privacy/__init__.py
ADDED
|
File without changes
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
PRIVACY_CONFIG_SCHEMA = "privacy/privacy_config_schema.json"
|
|
2
|
+
REDACTION_CHAR_KEY = "redaction_char"
|
|
3
|
+
KEEP_LEFT_KEY = "keep_left"
|
|
4
|
+
KEEP_RIGHT_KEY = "keep_right"
|
|
5
|
+
DELETION_KEY = "deletion"
|
|
6
|
+
ANONYMIZATION_KEY = "anonymization"
|
|
7
|
+
TRACKER_STORE_SETTINGS = "tracker_store_settings"
|
|
8
|
+
SLOT_KEY = "slot"
|
|
9
|
+
TEXT_KEY = "text"
|
|
10
|
+
ENTITIES_KEY = "entities"
|
|
11
|
+
VALUE_KEY = "value"
|
|
12
|
+
ENTITY_LABEL_KEY = "label"
|
|
13
|
+
|
|
14
|
+
USER_CHAT_INACTIVITY_IN_MINUTES_ENV_VAR_NAME = "USER_CHAT_INACTIVITY_IN_MINUTES"
|
|
15
|
+
GLINER_MODEL_PATH_ENV_VAR_NAME = "GLINER_MODEL_PATH"
|
|
16
|
+
HUGGINGFACE_CACHE_DIR_ENV_VAR_NAME = "HUGGINGFACE_HUB_CACHE_DIR"
|
|
17
|
+
|
|
18
|
+
DEFAULT_PII_MODEL = "urchade/gliner_multi_pii-v1"
|
|
19
|
+
GLINER_LABELS = [
|
|
20
|
+
"person",
|
|
21
|
+
"organization",
|
|
22
|
+
"company",
|
|
23
|
+
"phone number",
|
|
24
|
+
"address",
|
|
25
|
+
"full address",
|
|
26
|
+
"postcode",
|
|
27
|
+
"zip code",
|
|
28
|
+
"passport number",
|
|
29
|
+
"email",
|
|
30
|
+
"credit card number",
|
|
31
|
+
"social security number",
|
|
32
|
+
"health insurance id number",
|
|
33
|
+
"date of birth",
|
|
34
|
+
"mobile phone number",
|
|
35
|
+
"bank account number",
|
|
36
|
+
"medication",
|
|
37
|
+
"cpf",
|
|
38
|
+
"driver's license number",
|
|
39
|
+
"tax identification number",
|
|
40
|
+
"medical condition",
|
|
41
|
+
"identity card number",
|
|
42
|
+
"national id number",
|
|
43
|
+
"ip address",
|
|
44
|
+
"email address",
|
|
45
|
+
"iban",
|
|
46
|
+
"credit card expiration date",
|
|
47
|
+
"username",
|
|
48
|
+
"health insurance number",
|
|
49
|
+
"registration number",
|
|
50
|
+
"student id number",
|
|
51
|
+
"insurance number",
|
|
52
|
+
"membership number",
|
|
53
|
+
"booking number",
|
|
54
|
+
"landline phone number",
|
|
55
|
+
"blood type",
|
|
56
|
+
"cvv",
|
|
57
|
+
"reservation number",
|
|
58
|
+
"digital signature",
|
|
59
|
+
"social media handle",
|
|
60
|
+
"license plate number",
|
|
61
|
+
"cnpj",
|
|
62
|
+
"postal code",
|
|
63
|
+
"passport_number",
|
|
64
|
+
"serial number",
|
|
65
|
+
"vehicle registration number",
|
|
66
|
+
"fax number",
|
|
67
|
+
"visa number",
|
|
68
|
+
"insurance company",
|
|
69
|
+
"identity document number",
|
|
70
|
+
"transaction number",
|
|
71
|
+
"national health insurance number",
|
|
72
|
+
"cvc",
|
|
73
|
+
"birth certificate number",
|
|
74
|
+
"train ticket number",
|
|
75
|
+
"passport expiration date",
|
|
76
|
+
"social_security_number",
|
|
77
|
+
"personally identifiable information",
|
|
78
|
+
"banking routing number",
|
|
79
|
+
"sort code",
|
|
80
|
+
"routing number",
|
|
81
|
+
"tax number",
|
|
82
|
+
"swift code",
|
|
83
|
+
]
|