rasa-pro 3.12.18__py3-none-any.whl → 3.13.0a1.dev1__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/builder/create_openai_vector_store.py +69 -0
- rasa/builder/llm-helper-schema.json +69 -0
- rasa/builder/prompt_to_bot.py +645 -0
- rasa/builder/scrape_rasa_docs.py +97 -0
- rasa/builder/skill_to_bot_prompt.jinja +158 -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 +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/run.py +1 -1
- rasa/cli/scaffold.py +2 -3
- rasa/cli/studio/download.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 +5 -3
- rasa/cli/train.py +1 -1
- rasa/cli/utils.py +1 -1
- rasa/cli/x.py +1 -1
- rasa/constants.py +2 -0
- rasa/core/__init__.py +0 -16
- rasa/core/actions/action.py +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 +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/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-02053cc1.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{blockDiagram-38ab4fdb-7f34db23.js → blockDiagram-38ab4fdb-008b6289.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{c4Diagram-3d4e48cf-948bab2c.js → c4Diagram-3d4e48cf-fb2597be.js} +1 -1
- rasa/core/channels/inspector/dist/assets/channel-078dada8.js +1 -0
- rasa/core/channels/inspector/dist/assets/{classDiagram-70f12bd4-53b0dd0e.js → classDiagram-70f12bd4-7f847e00.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{classDiagram-v2-f2320105-fdf789e7.js → classDiagram-v2-f2320105-ba1d689b.js} +1 -1
- rasa/core/channels/inspector/dist/assets/clone-5b4516de.js +1 -0
- rasa/core/channels/inspector/dist/assets/{createText-2e5e7dd3-87c4ece5.js → createText-2e5e7dd3-dd8e67c4.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{edges-e0da2a9e-5a8b0749.js → edges-e0da2a9e-10784939.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{erDiagram-9861fffd-66da90e2.js → erDiagram-9861fffd-24947ae6.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{flowDb-956e92f1-10044f05.js → flowDb-956e92f1-a9ced505.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{flowDiagram-66a62f08-f338f66a.js → flowDiagram-66a62f08-afda9c7c.js} +1 -1
- rasa/core/channels/inspector/dist/assets/flowDiagram-v2-96b9c2cf-f9613071.js +1 -0
- rasa/core/channels/inspector/dist/assets/{flowchart-elk-definition-4a651766-b13140aa.js → flowchart-elk-definition-4a651766-6ef530b8.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{ganttDiagram-c361ad54-f2b4a55a.js → ganttDiagram-c361ad54-0c7dd39a.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{gitGraphDiagram-72cf32ee-dedc298d.js → gitGraphDiagram-72cf32ee-b57239d6.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{graph-4ede11ff.js → graph-9ed57cec.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{index-3862675e-65549d37.js → index-3862675e-233090de.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{index-3a23e736.js → index-72184470.js} +123 -123
- rasa/core/channels/inspector/dist/assets/{infoDiagram-f8f76790-65439671.js → infoDiagram-f8f76790-aa116649.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{journeyDiagram-49397b02-56d03d98.js → journeyDiagram-49397b02-e51877cc.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{layout-dd48f7f4.js → layout-3ca3798c.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{line-1569ad2c.js → line-26ee10d3.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{linear-48bf4935.js → linear-aedded32.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{mindmap-definition-fc14e90a-688504c1.js → mindmap-definition-fc14e90a-d8957261.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{pieDiagram-8a3498a8-78b6d7e6.js → pieDiagram-8a3498a8-d771f885.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{quadrantDiagram-120e2f19-048b84b3.js → quadrantDiagram-120e2f19-09fdf50c.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{requirementDiagram-deff3bca-dd67f107.js → requirementDiagram-deff3bca-9f0af02e.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{sankeyDiagram-04a897e0-8128436e.js → sankeyDiagram-04a897e0-84415b37.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{sequenceDiagram-704730f1-1a0d1461.js → sequenceDiagram-704730f1-8dec4055.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{stateDiagram-587899a1-46d388ed.js → stateDiagram-587899a1-c5431d07.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{stateDiagram-v2-d93cdb3a-ea42951a.js → stateDiagram-v2-d93cdb3a-274e77d9.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-6aaf32cf-7427ed0c.js → styles-6aaf32cf-e364a1d7.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-9a916d00-ff5e5a16.js → styles-9a916d00-0dae36f6.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-c10674c1-7b3680cf.js → styles-c10674c1-c4641675.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{svgDrawCommon-08f97a94-f860f2ad.js → svgDrawCommon-08f97a94-831fe9a1.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{timeline-definition-85554ec2-2eebf0c8.js → timeline-definition-85554ec2-c3304b3a.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{xychartDiagram-e933f94c-5d7f4e96.js → xychartDiagram-e933f94c-da799369.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 +337 -71
- rasa/core/channels/vier_cvg.py +1 -2
- rasa/core/channels/voice_ready/audiocodes.py +4 -11
- rasa/core/channels/voice_stream/audiocodes.py +8 -5
- rasa/core/channels/voice_stream/browser_audio.py +1 -1
- rasa/core/channels/voice_stream/genesys.py +2 -2
- rasa/core/channels/voice_stream/tts/__init__.py +8 -0
- rasa/core/channels/voice_stream/twilio_media_streams.py +10 -5
- rasa/core/channels/voice_stream/voice_channel.py +65 -23
- rasa/core/concurrent_lock_store.py +24 -10
- rasa/core/evaluation/marker_tracker_loader.py +1 -1
- rasa/core/exporter.py +1 -1
- rasa/core/http_interpreter.py +3 -7
- rasa/core/information_retrieval/faiss.py +18 -11
- rasa/core/information_retrieval/ingestion/__init__.py +0 -0
- 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 +262 -62
- 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 +56 -17
- rasa/core/processor.py +64 -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} +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 -95
- rasa/dialogue_understanding/coexistence/intent_based_router.py +2 -1
- rasa/dialogue_understanding/coexistence/llm_based_router.py +9 -6
- rasa/dialogue_understanding/commands/can_not_handle_command.py +2 -0
- rasa/dialogue_understanding/commands/cancel_flow_command.py +5 -1
- rasa/dialogue_understanding/commands/chit_chat_answer_command.py +2 -0
- rasa/dialogue_understanding/commands/clarify_command.py +4 -0
- rasa/dialogue_understanding/commands/command_syntax_manager.py +1 -0
- rasa/dialogue_understanding/commands/correct_slots_command.py +1 -3
- 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 +4 -0
- rasa/dialogue_understanding/commands/skip_question_command.py +2 -0
- rasa/dialogue_understanding/commands/start_flow_command.py +4 -0
- 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/nlu_command_adapter.py +2 -2
- 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 +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 +477 -0
- rasa/dialogue_understanding/generator/single_step/single_step_llm_command_generator.py +11 -64
- rasa/dialogue_understanding/patterns/cancel.py +1 -2
- rasa/dialogue_understanding/patterns/clarify.py +1 -1
- rasa/dialogue_understanding/patterns/correction.py +2 -2
- rasa/dialogue_understanding/patterns/default_flows_for_patterns.yml +37 -25
- rasa/dialogue_understanding/patterns/domain_for_patterns.py +190 -0
- rasa/dialogue_understanding/processor/command_processor.py +6 -7
- rasa/dialogue_understanding/stack/utils.py +3 -1
- 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/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 +1 -5
- rasa/model_manager/model_api.py +90 -2
- rasa/model_manager/socket_bridge.py +0 -7
- rasa/model_manager/trainer_service.py +15 -12
- 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 +340 -0
- rasa/privacy/privacy_manager.py +576 -0
- rasa/server.py +23 -2
- rasa/shared/constants.py +14 -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 +35 -8
- rasa/shared/core/flows/flow_step.py +26 -4
- 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 +16 -3
- rasa/shared/core/flows/yaml_flows_io.py +106 -5
- rasa/shared/core/slots.py +33 -1
- rasa/shared/core/trackers.py +4 -10
- rasa/shared/core/training_data/story_reader/yaml_story_reader.py +1 -4
- rasa/shared/importers/importer.py +14 -0
- rasa/shared/importers/static.py +63 -0
- rasa/shared/providers/llm/default_litellm_llm_client.py +2 -2
- rasa/shared/utils/common.py +43 -1
- rasa/shared/utils/llm.py +155 -3
- rasa/shared/utils/yaml.py +32 -0
- rasa/studio/data_handler.py +3 -3
- rasa/studio/download/__init__.py +0 -0
- rasa/studio/download/domains.py +49 -0
- rasa/studio/download/download.py +416 -0
- rasa/studio/download/flows.py +351 -0
- rasa/studio/link.py +200 -0
- rasa/studio/pull.py +94 -0
- rasa/studio/push.py +131 -0
- rasa/studio/results_logger.py +6 -1
- rasa/studio/upload.py +185 -71
- rasa/telemetry.py +83 -26
- rasa/tracing/config.py +4 -5
- rasa/tracing/constants.py +19 -1
- rasa/tracing/instrumentation/attribute_extractors.py +47 -9
- 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 +37 -27
- rasa/utils/endpoints.py +22 -1
- rasa/utils/licensing.py +2 -3
- rasa/utils/log_utils.py +1 -45
- rasa/validator.py +9 -11
- rasa/version.py +1 -1
- {rasa_pro-3.12.18.dist-info → rasa_pro-3.13.0a1.dev1.dist-info}/METADATA +12 -13
- {rasa_pro-3.12.18.dist-info → rasa_pro-3.13.0a1.dev1.dist-info}/RECORD +308 -283
- 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/studio/download.py +0 -489
- /rasa/{cli/project_templates/calm/actions → builder}/__init__.py +0 -0
- /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_pro-3.12.18.dist-info → rasa_pro-3.13.0a1.dev1.dist-info}/NOTICE +0 -0
- {rasa_pro-3.12.18.dist-info → rasa_pro-3.13.0a1.dev1.dist-info}/WHEEL +0 -0
- {rasa_pro-3.12.18.dist-info → rasa_pro-3.13.0a1.dev1.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import os
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
from urllib.parse import urljoin, urlparse
|
|
5
|
+
|
|
6
|
+
import requests
|
|
7
|
+
from bs4 import BeautifulSoup
|
|
8
|
+
|
|
9
|
+
BASE_URL = "https://rasa.com"
|
|
10
|
+
DOCS_ROOT = "https://rasa.com/docs"
|
|
11
|
+
OUTPUT_DIR = "rasa_docs_md"
|
|
12
|
+
MAX_PAGES = 100 # Optional limit for safety
|
|
13
|
+
|
|
14
|
+
visited = set()
|
|
15
|
+
to_visit = [DOCS_ROOT]
|
|
16
|
+
|
|
17
|
+
os.makedirs(OUTPUT_DIR, exist_ok=True)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def is_valid_doc_url(url):
|
|
21
|
+
return url.startswith(DOCS_ROOT) and not any(
|
|
22
|
+
[url.endswith(".pdf"), "#" in url, "mailto:" in url]
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def slugify_url(url):
|
|
27
|
+
path = urlparse(url).path.strip("/").replace("/", "_")
|
|
28
|
+
return path if path else "index"
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def clean_text(html):
|
|
32
|
+
soup = BeautifulSoup(html, "html.parser")
|
|
33
|
+
|
|
34
|
+
# Remove navs, footers, and code tabs (customize if needed)
|
|
35
|
+
for tag in soup(["nav", "footer", "script", "style", "form", "button"]):
|
|
36
|
+
tag.decompose()
|
|
37
|
+
|
|
38
|
+
main = soup.find("main") or soup.body
|
|
39
|
+
if not main:
|
|
40
|
+
return ""
|
|
41
|
+
|
|
42
|
+
# Replace <code> with backticks
|
|
43
|
+
for code in main.find_all("code"):
|
|
44
|
+
code.string = f"`{code.get_text(strip=True)}`"
|
|
45
|
+
|
|
46
|
+
text = main.get_text(separator="\n", strip=True)
|
|
47
|
+
return text
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def save_as_markdown(text) -> str:
|
|
51
|
+
slug = slugify_url(url)
|
|
52
|
+
file_name = f"{slug}.md"
|
|
53
|
+
md_path = Path(OUTPUT_DIR) / file_name
|
|
54
|
+
with open(md_path, "w", encoding="utf-8") as f:
|
|
55
|
+
f.write(text)
|
|
56
|
+
|
|
57
|
+
print(f"✅ Saved: {md_path}")
|
|
58
|
+
return file_name
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
pages_scraped = 0
|
|
62
|
+
markdown_to_url = {}
|
|
63
|
+
|
|
64
|
+
while to_visit and pages_scraped < MAX_PAGES:
|
|
65
|
+
url = to_visit.pop(0)
|
|
66
|
+
if url in visited:
|
|
67
|
+
continue
|
|
68
|
+
|
|
69
|
+
try:
|
|
70
|
+
print(f"Scraping: {url}")
|
|
71
|
+
response = requests.get(url)
|
|
72
|
+
response.raise_for_status()
|
|
73
|
+
|
|
74
|
+
html = response.text
|
|
75
|
+
text = clean_text(html)
|
|
76
|
+
if len(text) < 200: # skip very short pages
|
|
77
|
+
print("⏭️ Skipped (too short)")
|
|
78
|
+
continue
|
|
79
|
+
|
|
80
|
+
file_name = save_as_markdown(text)
|
|
81
|
+
markdown_to_url[file_name] = url
|
|
82
|
+
pages_scraped += 1
|
|
83
|
+
|
|
84
|
+
soup = BeautifulSoup(html, "html.parser")
|
|
85
|
+
for link_tag in soup.find_all("a", href=True):
|
|
86
|
+
link = urljoin(url, link_tag["href"])
|
|
87
|
+
if is_valid_doc_url(link) and link not in visited:
|
|
88
|
+
to_visit.append(link)
|
|
89
|
+
|
|
90
|
+
visited.add(url)
|
|
91
|
+
|
|
92
|
+
except Exception as e:
|
|
93
|
+
print(f"⚠️ Failed to scrape {url}: {e}")
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
with open("markdown_to_url.json", "w") as f:
|
|
97
|
+
json.dump(markdown_to_url, f, indent=2)
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# Rasa CALM Flow and Domain YAML Generator
|
|
2
|
+
|
|
3
|
+
You are an expert in creating Rasa CALM flows and domain JSON configurations. Your task is to generate these JSON files based on a user's description of a conversational skill. The user may not be familiar with Rasa, so it's crucial to interpret their requirements accurately and create a well-structured, functional Rasa configuration.
|
|
4
|
+
|
|
5
|
+
## Input
|
|
6
|
+
You will receive a description of a conversational skill. This description will be inserted where you see [USER_SKILL_DESCRIPTION] in this prompt.
|
|
7
|
+
|
|
8
|
+
## Output
|
|
9
|
+
Generate a JSON configurations that includes:
|
|
10
|
+
1. A Rasa CALM flow JSON
|
|
11
|
+
2. A corresponding Rasa domain JSON
|
|
12
|
+
|
|
13
|
+
Ensure that both parts of the JSONs are complete, well-structured, and compatible with each other.
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
Here's an example of a skill description and the corresponding JSON outputs and custom action code
|
|
17
|
+
|
|
18
|
+
Skill Description: "Create a skill for transferring money. It should ask for the recipient and amount, check the user has enough balance, and then confirm with the user before finalizing the transfer."
|
|
19
|
+
|
|
20
|
+
CALM BOT JSON:
|
|
21
|
+
```json
|
|
22
|
+
{
|
|
23
|
+
"flows": {
|
|
24
|
+
"transfer_money": {
|
|
25
|
+
"description": "This flow lets users send money to friends and family.",
|
|
26
|
+
"steps": [
|
|
27
|
+
{
|
|
28
|
+
"collect": "recipient"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"collect": "amount",
|
|
32
|
+
"description": "the number of US dollars to send"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"action": "action_check_sufficient_funds",
|
|
36
|
+
"next": [
|
|
37
|
+
{
|
|
38
|
+
"if": "not slots.has_sufficient_funds",
|
|
39
|
+
"then": [
|
|
40
|
+
{
|
|
41
|
+
"action": "utter_insufficient_funds",
|
|
42
|
+
"next": "END"
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"else": "final_confirmation"
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"collect": "final_confirmation",
|
|
53
|
+
"id": "final_confirmation",
|
|
54
|
+
"next": [
|
|
55
|
+
{
|
|
56
|
+
"if": "not slots.final_confirmation",
|
|
57
|
+
"then": [
|
|
58
|
+
{
|
|
59
|
+
"action": "utter_transfer_cancelled",
|
|
60
|
+
"next": "END"
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"else": "transfer_successful"
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"action": "utter_transfer_complete",
|
|
71
|
+
"id": "transfer_successful"
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"domain": {
|
|
77
|
+
"actions": [
|
|
78
|
+
"action_check_sufficient_funds"
|
|
79
|
+
],
|
|
80
|
+
"slots": {
|
|
81
|
+
"recipient": {
|
|
82
|
+
"type": "Text",
|
|
83
|
+
"mappings": [
|
|
84
|
+
{
|
|
85
|
+
"type": "from_llm"
|
|
86
|
+
}
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
"has_sufficient_funds": {
|
|
90
|
+
"type": "bool",
|
|
91
|
+
"mappings": [
|
|
92
|
+
{
|
|
93
|
+
"type": "custom"
|
|
94
|
+
}
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"responses": {
|
|
99
|
+
"utter_ask_recipient": [
|
|
100
|
+
{
|
|
101
|
+
"text": "Who would you like to send money to?"
|
|
102
|
+
}
|
|
103
|
+
],
|
|
104
|
+
"utter_ask_final_confirmation": [
|
|
105
|
+
{
|
|
106
|
+
"text": "Please confirm: you want to transfer {amount} to {recipient}?"
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
"utter_transfer_cancelled": [
|
|
110
|
+
{
|
|
111
|
+
"text": "Your transfer has been cancelled."
|
|
112
|
+
}
|
|
113
|
+
],
|
|
114
|
+
"utter_insufficient_funds": [
|
|
115
|
+
{
|
|
116
|
+
"text": "You do not have enough funds to make this transaction."
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Guidelines for CALM Flow JSON:
|
|
125
|
+
- Start a `flow` with the name of the flow as the key in `flows`
|
|
126
|
+
- Include a `description` for the skill
|
|
127
|
+
- Use `steps` to outline the conversation flow
|
|
128
|
+
- Implement `collect` steps for gathering information
|
|
129
|
+
- `collect` steps should reference an existing slot
|
|
130
|
+
- For a collect step referencing a slot `A`, there should be a corresponding `utter_ask_A`
|
|
131
|
+
utterance that is used in the collect step to ask for the information to be stored in `A`
|
|
132
|
+
- Use `action` steps for custom actions
|
|
133
|
+
- Implement conditional logic with `if`, `then`, and `else` where appropriate
|
|
134
|
+
- Use `next` to define the flow between steps. If the flow should end after a step, add next: END.
|
|
135
|
+
- The content after `then` or `else` can be: the id of another step defined in the flow, a list of steps, or an END
|
|
136
|
+
- End the flow with an appropriate action or message
|
|
137
|
+
|
|
138
|
+
## Guidelines for Domain JSON:
|
|
139
|
+
- Include all necessary `actions`
|
|
140
|
+
- Define all required `slots` with appropriate types. Type should be one of 'float', 'bool', 'text', or 'categorical'
|
|
141
|
+
- Slots filled by a 'collect' step should have mapping 'from_llm' and slots set by custom actions should have a 'custom' mapping
|
|
142
|
+
- Provide `responses` for all bot turns
|
|
143
|
+
|
|
144
|
+
## Guidelines for Custom Actions
|
|
145
|
+
- Ensure all actions mentioned in the flow are properly defined in the domains list of actions.
|
|
146
|
+
|
|
147
|
+
## Important Notes:
|
|
148
|
+
- Ensure that the flow logic is coherent and follows a natural conversation pattern
|
|
149
|
+
- All custom actions in the flow should be listed in the domain's `actions` section
|
|
150
|
+
- All slots collected in the flow should be defined in the domain's `slots` section
|
|
151
|
+
- Provide appropriate `utter_` responses for each user interaction
|
|
152
|
+
- Use realistic and appropriate names for actions, slots, and responses
|
|
153
|
+
- Consider error handling and alternative conversation paths
|
|
154
|
+
- Aim for a balance between simplicity and functionality
|
|
155
|
+
|
|
156
|
+
Now, please generate Rasa CALM flow and domain JSON configuration for the following skill description:
|
|
157
|
+
|
|
158
|
+
${skillDescription}
|
|
@@ -16,9 +16,9 @@ from rasa.cli.arguments.default_arguments import (
|
|
|
16
16
|
add_remote_storage_param,
|
|
17
17
|
)
|
|
18
18
|
from rasa.core.agent import Agent
|
|
19
|
+
from rasa.core.available_endpoints import AvailableEndpoints
|
|
19
20
|
from rasa.core.exceptions import AgentNotReady
|
|
20
21
|
from rasa.core.processor import MessageProcessor
|
|
21
|
-
from rasa.core.utils import AvailableEndpoints
|
|
22
22
|
from rasa.dialogue_understanding.commands import Command
|
|
23
23
|
from rasa.dialogue_understanding.generator import LLMBasedCommandGenerator
|
|
24
24
|
from rasa.dialogue_understanding.generator.command_parser import DEFAULT_COMMANDS
|
rasa/cli/e2e_test.py
CHANGED
|
@@ -18,8 +18,8 @@ from rasa.cli.arguments.default_arguments import (
|
|
|
18
18
|
add_model_param,
|
|
19
19
|
add_remote_storage_param,
|
|
20
20
|
)
|
|
21
|
+
from rasa.core.available_endpoints import AvailableEndpoints
|
|
21
22
|
from rasa.core.exceptions import AgentNotReady
|
|
22
|
-
from rasa.core.utils import AvailableEndpoints
|
|
23
23
|
from rasa.e2e_test.aggregate_test_stats_calculator import (
|
|
24
24
|
AggregateTestStatsCalculator,
|
|
25
25
|
)
|
rasa/cli/evaluate.py
CHANGED
|
@@ -6,10 +6,10 @@ import rasa.cli.arguments.evaluate as arguments
|
|
|
6
6
|
import rasa.shared.utils.cli
|
|
7
7
|
from rasa import telemetry
|
|
8
8
|
from rasa.cli import SubParsersAction
|
|
9
|
+
from rasa.core.available_endpoints import AvailableEndpoints
|
|
9
10
|
from rasa.core.evaluation.marker_base import Marker, OperatorMarker
|
|
10
11
|
from rasa.core.evaluation.marker_tracker_loader import MarkerTrackerLoader
|
|
11
|
-
from rasa.core.tracker_store import TrackerStore
|
|
12
|
-
from rasa.core.utils import AvailableEndpoints
|
|
12
|
+
from rasa.core.tracker_stores.tracker_store import TrackerStore
|
|
13
13
|
from rasa.shared.core.domain import Domain
|
|
14
14
|
|
|
15
15
|
STATS_OVERALL_SUFFIX = "-overall.csv"
|
rasa/cli/export.py
CHANGED
|
@@ -16,10 +16,10 @@ from rasa.shared.constants import DOCS_URL_EVENT_BROKERS, DOCS_URL_TRACKER_STORE
|
|
|
16
16
|
from rasa.shared.exceptions import RasaException
|
|
17
17
|
|
|
18
18
|
if typing.TYPE_CHECKING:
|
|
19
|
+
from rasa.core.available_endpoints import AvailableEndpoints
|
|
19
20
|
from rasa.core.brokers.broker import EventBroker
|
|
20
21
|
from rasa.core.exporter import Exporter
|
|
21
|
-
from rasa.core.tracker_store import TrackerStore
|
|
22
|
-
from rasa.core.utils import AvailableEndpoints
|
|
22
|
+
from rasa.core.tracker_stores.tracker_store import TrackerStore
|
|
23
23
|
|
|
24
24
|
logger = logging.getLogger(__name__)
|
|
25
25
|
|
|
@@ -67,7 +67,7 @@ def _get_tracker_store(endpoints: "AvailableEndpoints") -> "TrackerStore":
|
|
|
67
67
|
f"Exiting. "
|
|
68
68
|
)
|
|
69
69
|
|
|
70
|
-
from rasa.core.tracker_store import TrackerStore
|
|
70
|
+
from rasa.core.tracker_stores.tracker_store import TrackerStore
|
|
71
71
|
|
|
72
72
|
return TrackerStore.create(endpoints.tracker_store)
|
|
73
73
|
|
rasa/cli/llm_fine_tuning.py
CHANGED
|
@@ -20,8 +20,8 @@ from rasa.cli.e2e_test import (
|
|
|
20
20
|
read_test_cases,
|
|
21
21
|
validate_model_path,
|
|
22
22
|
)
|
|
23
|
+
from rasa.core.available_endpoints import AvailableEndpoints
|
|
23
24
|
from rasa.core.exceptions import AgentNotReady
|
|
24
|
-
from rasa.core.utils import AvailableEndpoints
|
|
25
25
|
from rasa.dialogue_understanding.generator.llm_based_command_generator import (
|
|
26
26
|
LLMBasedCommandGenerator,
|
|
27
27
|
)
|
|
@@ -1,44 +1,17 @@
|
|
|
1
1
|
# The config recipe.
|
|
2
|
-
# https://rasa.com/docs/rasa-pro/nlu-based-assistants/model-configuration/
|
|
3
2
|
recipe: default.v1
|
|
4
3
|
|
|
5
4
|
# The assistant project unique identifier
|
|
6
5
|
# This default value must be replaced with a unique assistant name within your deployment
|
|
7
6
|
assistant_id: placeholder_default
|
|
8
7
|
|
|
9
|
-
# Configuration for Rasa NLU.
|
|
10
|
-
# https://rasa.com/docs/rasa-pro/nlu-based-assistants/components/
|
|
11
8
|
language: en
|
|
12
|
-
|
|
13
9
|
pipeline:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
# - name: WhitespaceTokenizer
|
|
18
|
-
# - name: RegexFeaturizer
|
|
19
|
-
# - name: LexicalSyntacticFeaturizer
|
|
20
|
-
# - name: CountVectorsFeaturizer
|
|
21
|
-
# - name: CountVectorsFeaturizer
|
|
22
|
-
# analyzer: char_wb
|
|
23
|
-
# min_ngram: 1
|
|
24
|
-
# max_ngram: 4
|
|
25
|
-
# - name: DIETClassifier
|
|
26
|
-
# epochs: 100
|
|
27
|
-
# - name: EntitySynonymMapper
|
|
28
|
-
# - name: ResponseSelector
|
|
29
|
-
# epochs: 100
|
|
30
|
-
# - name: FallbackClassifier
|
|
31
|
-
# threshold: 0.3
|
|
32
|
-
# ambiguity_threshold: 0.1
|
|
10
|
+
- name: CompactLLMCommandGenerator
|
|
11
|
+
llm:
|
|
12
|
+
model_group: openai-gpt-4o
|
|
33
13
|
|
|
34
14
|
# Configuration for Rasa Core.
|
|
35
|
-
# https://rasa.com/docs/rasa-pro/concepts/policies/policy-overview/
|
|
36
15
|
policies:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
# # See https://rasa.com/docs/rasa-pro/concepts/policies/policy-overview/ for more information.
|
|
40
|
-
# - name: MemoizationPolicy
|
|
41
|
-
# - name: TEDPolicy
|
|
42
|
-
# max_history: 5
|
|
43
|
-
# epochs: 100
|
|
44
|
-
# - name: RulePolicy
|
|
16
|
+
- name: FlowPolicy
|
|
17
|
+
- name: IntentlessPolicy
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
# Server which runs your custom actions.
|
|
11
11
|
# https://rasa.com/docs/rasa-pro/concepts/custom-actions
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
action_endpoint:
|
|
14
|
+
actions_module: "actions"
|
|
15
15
|
|
|
16
16
|
# Tracker store which is used to store the conversations.
|
|
17
17
|
# By default the conversations are stored in memory.
|
|
@@ -40,3 +40,19 @@
|
|
|
40
40
|
# username: username
|
|
41
41
|
# password: password
|
|
42
42
|
# queue: queue
|
|
43
|
+
|
|
44
|
+
# The lines below activate contextual rephrasing, using the default OpenAI language model.
|
|
45
|
+
# Ensure the OPENAI_API_KEY is set to prevent any missing API key errors.
|
|
46
|
+
# For more details, refer to the documentation:
|
|
47
|
+
# https://rasa.com/docs/rasa-pro/concepts/contextual-response-rephraser
|
|
48
|
+
# To enable the rephraser, remove the comment symbols in the lines below.
|
|
49
|
+
#nlg:
|
|
50
|
+
# type: rephrase
|
|
51
|
+
|
|
52
|
+
model_groups:
|
|
53
|
+
- id: openai-gpt-4o
|
|
54
|
+
models:
|
|
55
|
+
- provider: openai
|
|
56
|
+
model: gpt-4o-2024-11-20
|
|
57
|
+
request_timeout: 7
|
|
58
|
+
max_tokens: 256
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import tempfile
|
|
4
|
+
from typing import Any, Dict, List, Optional, Text
|
|
5
|
+
|
|
6
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
7
|
+
|
|
8
|
+
from rasa.dialogue_understanding.patterns.domain_for_patterns import (
|
|
9
|
+
ContextField,
|
|
10
|
+
generate_domain_for_default_patterns,
|
|
11
|
+
)
|
|
12
|
+
from rasa.shared.core.domain import Domain
|
|
13
|
+
from rasa.shared.importers.importer import FlowSyncImporter, TrainingDataImporter
|
|
14
|
+
from rasa.shared.utils.llm import SystemPrompts, get_system_default_prompts
|
|
15
|
+
from rasa.shared.utils.yaml import read_yaml, write_yaml
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class Response(BaseModel):
|
|
19
|
+
text: str = Field(..., description="The human-readable response string.")
|
|
20
|
+
metadata: Optional[Dict[str, Any]] = Field(
|
|
21
|
+
None, description="Optional metadata used by Rasa at runtime."
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class Slot(BaseModel):
|
|
26
|
+
name: Text = Field(..., description="Name of the slot.")
|
|
27
|
+
type: Text = Field(..., description="Type of the slot.")
|
|
28
|
+
mappings: Optional[List[Dict[str, Any]]] = Field(
|
|
29
|
+
None, description="Mappings for the slot."
|
|
30
|
+
)
|
|
31
|
+
model_config = ConfigDict(extra="allow")
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class PatternFlow(BaseModel):
|
|
35
|
+
description: str = Field(..., description="Description of the flow.")
|
|
36
|
+
name: Text = Field(..., description="Name of the flow.")
|
|
37
|
+
steps: List[Any] = Field(..., description="List of steps in the flow.")
|
|
38
|
+
nlu_trigger: Optional[Any] = Field(None, description="NLU trigger for the flow.")
|
|
39
|
+
persisted_slots: Optional[List[Text]] = Field(None, description="Slots to persist.")
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class PatternDefaults(BaseModel):
|
|
43
|
+
"""Content of `default_flows_for_patterns.yml` after it is loaded from disk."""
|
|
44
|
+
|
|
45
|
+
responses: Dict[Text, List[Response]] = Field(
|
|
46
|
+
default_factory=dict,
|
|
47
|
+
description="Response templates available out-of-the-box.",
|
|
48
|
+
)
|
|
49
|
+
slots: Dict[Text, Slot] = Field(
|
|
50
|
+
default_factory=dict, description="Slot definitions used by the default flows."
|
|
51
|
+
)
|
|
52
|
+
flows: Dict[Text, PatternFlow] = Field(
|
|
53
|
+
default_factory=dict, description="Default flows (conversation patterns)."
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class RasaDefaults(PatternDefaults):
|
|
58
|
+
"""Full set of defaults that Rasa injects when a project is created."""
|
|
59
|
+
|
|
60
|
+
prompts: SystemPrompts = Field(..., description="Built-in system prompts.")
|
|
61
|
+
actions: List[Text] = Field(..., description="Default actions shipped by Rasa.")
|
|
62
|
+
intents: List[Text] = Field(..., description="Default intents shipped by Rasa.")
|
|
63
|
+
contexts: Dict[Text, ContextField] = Field(
|
|
64
|
+
..., description="Context fields that can appear on the conversation stack."
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
class Config:
|
|
68
|
+
extra = "forbid"
|
|
69
|
+
validate_assignment = True
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def _get_domain_from_importer(config: Dict[Text, Any]) -> Domain:
|
|
73
|
+
"""Get the domain from the TrainingDataImporter.
|
|
74
|
+
|
|
75
|
+
Args:
|
|
76
|
+
config: The config.yml file data.
|
|
77
|
+
|
|
78
|
+
Returns:
|
|
79
|
+
A Domain object .
|
|
80
|
+
"""
|
|
81
|
+
with tempfile.NamedTemporaryFile("w+", suffix=".yml") as tmp:
|
|
82
|
+
write_yaml(config, tmp.name)
|
|
83
|
+
importer = TrainingDataImporter.load_from_config(
|
|
84
|
+
domain_path=FlowSyncImporter.default_pattern_path(),
|
|
85
|
+
config_path=tmp.name,
|
|
86
|
+
)
|
|
87
|
+
return importer.get_domain()
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def get_pattern_defaults(config: Dict[Text, Any]) -> PatternDefaults:
|
|
91
|
+
"""Get the default flows, responses and slots for patterns.
|
|
92
|
+
|
|
93
|
+
Args:
|
|
94
|
+
config: The config.yml file data.
|
|
95
|
+
|
|
96
|
+
Returns:
|
|
97
|
+
A PatternDefaults object containing the defaults.
|
|
98
|
+
"""
|
|
99
|
+
domain = _get_domain_from_importer(config)
|
|
100
|
+
domain_dict = domain.as_dict()
|
|
101
|
+
|
|
102
|
+
# Make sure all the slots are exported, including the builtin slots
|
|
103
|
+
domain_dict["slots"] = {slot.name: slot.to_dict() for slot in domain.slots}
|
|
104
|
+
|
|
105
|
+
return PatternDefaults(**domain_dict)
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def get_rasa_defaults(config_yaml: Text, endpoints_yaml: Text) -> RasaDefaults:
|
|
109
|
+
"""Get the default values for a Rasa project.
|
|
110
|
+
|
|
111
|
+
Args:
|
|
112
|
+
config_yaml: The content of the config.yml file.
|
|
113
|
+
endpoints_yaml: The content of the endpoints.yml file.
|
|
114
|
+
|
|
115
|
+
Returns:
|
|
116
|
+
A RasaDefaults object containing the default values for the project.
|
|
117
|
+
"""
|
|
118
|
+
config = read_yaml(config_yaml)
|
|
119
|
+
endpoints = read_yaml(endpoints_yaml)
|
|
120
|
+
|
|
121
|
+
prompts = get_system_default_prompts(config, endpoints)
|
|
122
|
+
pattern_domain = generate_domain_for_default_patterns()
|
|
123
|
+
pattern_defaults = get_pattern_defaults(config)
|
|
124
|
+
|
|
125
|
+
return RasaDefaults(
|
|
126
|
+
prompts=prompts,
|
|
127
|
+
actions=pattern_domain.actions,
|
|
128
|
+
intents=pattern_domain.intents,
|
|
129
|
+
contexts=pattern_domain.contexts,
|
|
130
|
+
responses=pattern_defaults.responses,
|
|
131
|
+
slots=pattern_defaults.slots,
|
|
132
|
+
flows=pattern_defaults.flows,
|
|
133
|
+
)
|
rasa/cli/run.py
CHANGED
|
@@ -109,7 +109,7 @@ def run(args: argparse.Namespace) -> None:
|
|
|
109
109
|
# configured
|
|
110
110
|
|
|
111
111
|
import rasa.model
|
|
112
|
-
from rasa.core.
|
|
112
|
+
from rasa.core.available_endpoints import AvailableEndpoints
|
|
113
113
|
|
|
114
114
|
# start server if remote storage is configured
|
|
115
115
|
if args.remote_storage is not None:
|
rasa/cli/scaffold.py
CHANGED
|
@@ -20,18 +20,17 @@ from rasa.shared.utils.cli import print_error_and_exit, print_success
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
class ProjectTemplateName(Enum):
|
|
23
|
-
"""Enum of
|
|
23
|
+
"""Enum of CALM project templates."""
|
|
24
24
|
|
|
25
25
|
DEFAULT = "default"
|
|
26
26
|
TUTORIAL = "tutorial"
|
|
27
|
-
CALM = "calm"
|
|
28
27
|
|
|
29
28
|
def __str__(self) -> str:
|
|
30
29
|
return self.value
|
|
31
30
|
|
|
32
31
|
|
|
33
32
|
template_domain_path = defaultdict(lambda: DEFAULT_DOMAIN_PATH)
|
|
34
|
-
template_domain_path[ProjectTemplateName.
|
|
33
|
+
template_domain_path[ProjectTemplateName.DEFAULT] = "domain"
|
|
35
34
|
|
|
36
35
|
|
|
37
36
|
def add_subparser(
|
rasa/cli/studio/download.py
CHANGED
|
@@ -8,7 +8,7 @@ from rasa.cli.arguments.default_arguments import (
|
|
|
8
8
|
)
|
|
9
9
|
from rasa.cli.arguments.train import add_data_param, add_domain_param
|
|
10
10
|
from rasa.shared.constants import DEFAULT_CONFIG_PATH, DEFAULT_ENDPOINTS_PATH
|
|
11
|
-
from rasa.studio.download import handle_download
|
|
11
|
+
from rasa.studio.download.download import handle_download
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
def add_subparser(
|