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
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
|
|
4
|
+
from rasa.shared.core.domain import (
|
|
5
|
+
Domain,
|
|
6
|
+
)
|
|
7
|
+
from rasa.shared.importers.importer import TrainingDataImporter
|
|
8
|
+
from rasa.studio.constants import STUDIO_DOMAIN_FILENAME
|
|
9
|
+
|
|
10
|
+
logger = logging.getLogger(__name__)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def merge_domain(
|
|
14
|
+
data_from_studio: TrainingDataImporter,
|
|
15
|
+
data_local: TrainingDataImporter,
|
|
16
|
+
domain_path: Path,
|
|
17
|
+
) -> None:
|
|
18
|
+
"""Merges the domain from Rasa Studio with the local domain.
|
|
19
|
+
|
|
20
|
+
Args:
|
|
21
|
+
data_from_studio: The training data importer for the Rasa Studio domain.
|
|
22
|
+
data_local: The training data importer for the local domain.
|
|
23
|
+
domain_path: The path to the domain file or directory.
|
|
24
|
+
"""
|
|
25
|
+
if domain_path.is_file():
|
|
26
|
+
all_local_domain_files = [str(domain_path)]
|
|
27
|
+
domain_path = domain_path.parent
|
|
28
|
+
else:
|
|
29
|
+
all_local_domain_files = data_local.get_domain_files([str(domain_path)])
|
|
30
|
+
|
|
31
|
+
studio_domain_file_path = domain_path / STUDIO_DOMAIN_FILENAME
|
|
32
|
+
|
|
33
|
+
# leftover_domain represents the items in the studio
|
|
34
|
+
# domain that are not in the local domain
|
|
35
|
+
leftover_domain = data_from_studio.get_user_domain()
|
|
36
|
+
for file_path in all_local_domain_files:
|
|
37
|
+
if file_path == str(studio_domain_file_path):
|
|
38
|
+
# we need to exclude the studio domain file from the merge,
|
|
39
|
+
# since we want to dump ALL the remaining items to this path
|
|
40
|
+
# after the merge. if we include it here, we will remove the existing
|
|
41
|
+
# items from the leftover domain and after this loop we will
|
|
42
|
+
# overwrite the studio domain file with the remaining items in
|
|
43
|
+
# the leftover domain - this means we loose the items that were
|
|
44
|
+
# in the studio domain file before we started the merge.
|
|
45
|
+
continue
|
|
46
|
+
|
|
47
|
+
# For each local domain file, we do a partial merge
|
|
48
|
+
local_domain = Domain.from_file(str(file_path))
|
|
49
|
+
updated_local_domain = local_domain.partial_merge(leftover_domain)
|
|
50
|
+
|
|
51
|
+
# If this partial merge made changes, persist them
|
|
52
|
+
if local_domain != updated_local_domain:
|
|
53
|
+
updated_local_domain.persist(file_path)
|
|
54
|
+
|
|
55
|
+
# Remove every item now present in updated_local_domain from leftover_domain
|
|
56
|
+
leftover_domain = leftover_domain.difference(updated_local_domain)
|
|
57
|
+
|
|
58
|
+
# If there are still items in leftover_domain, persist them
|
|
59
|
+
if not leftover_domain.is_empty():
|
|
60
|
+
leftover_domain.persist(studio_domain_file_path)
|
rasa/studio/pull/pull.py
ADDED
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import argparse
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from typing import Any, Tuple
|
|
6
|
+
|
|
7
|
+
import structlog
|
|
8
|
+
|
|
9
|
+
import rasa.cli.utils
|
|
10
|
+
import rasa.shared.utils.cli
|
|
11
|
+
from rasa.shared.constants import (
|
|
12
|
+
DEFAULT_CONFIG_PATH,
|
|
13
|
+
DEFAULT_DATA_PATH,
|
|
14
|
+
DEFAULT_DOMAIN_PATH,
|
|
15
|
+
DEFAULT_DOMAIN_PATHS,
|
|
16
|
+
DEFAULT_ENDPOINTS_PATH,
|
|
17
|
+
)
|
|
18
|
+
from rasa.shared.importers.importer import TrainingDataImporter
|
|
19
|
+
from rasa.shared.utils.io import write_text_file
|
|
20
|
+
from rasa.studio.config import StudioConfig
|
|
21
|
+
from rasa.studio.data_handler import StudioDataHandler, import_data_from_studio
|
|
22
|
+
from rasa.studio.link import read_assistant_name
|
|
23
|
+
from rasa.studio.pull.data import merge_flows_in_directory, merge_nlu_in_directory
|
|
24
|
+
from rasa.studio.pull.domains import merge_domain
|
|
25
|
+
from rasa.studio.utils import validate_argument_paths
|
|
26
|
+
from rasa.utils.mapper import RasaPrimitiveStorageMapper
|
|
27
|
+
|
|
28
|
+
structlogger = structlog.get_logger(__name__)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def handle_pull(args: argparse.Namespace) -> None:
|
|
32
|
+
"""Pull the complete assistant and overwrite all local files.
|
|
33
|
+
|
|
34
|
+
Args:
|
|
35
|
+
args: The command line arguments.
|
|
36
|
+
"""
|
|
37
|
+
validate_argument_paths(args)
|
|
38
|
+
handler = _create_studio_handler()
|
|
39
|
+
handler.request_all_data()
|
|
40
|
+
|
|
41
|
+
_pull_config_file(handler, args.config or DEFAULT_CONFIG_PATH)
|
|
42
|
+
_pull_endpoints_file(handler, args.endpoints or DEFAULT_ENDPOINTS_PATH)
|
|
43
|
+
|
|
44
|
+
domain_path, data_path = _prepare_data_and_domain_paths(args)
|
|
45
|
+
_merge_domain_and_data(handler, domain_path, data_path)
|
|
46
|
+
|
|
47
|
+
structlogger.info(
|
|
48
|
+
"studio.push.success",
|
|
49
|
+
event_info="Pulled assistant data from Studio.",
|
|
50
|
+
)
|
|
51
|
+
rasa.shared.utils.cli.print_success("Pulled assistant data from Studio.")
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def handle_pull_config(args: argparse.Namespace) -> None:
|
|
55
|
+
"""Pull nothing but the assistant's `config.yml`.
|
|
56
|
+
|
|
57
|
+
Args:
|
|
58
|
+
args: The command line arguments.
|
|
59
|
+
"""
|
|
60
|
+
validate_argument_paths(args)
|
|
61
|
+
handler = _create_studio_handler()
|
|
62
|
+
handler.request_all_data()
|
|
63
|
+
|
|
64
|
+
_pull_config_file(handler, args.config or DEFAULT_CONFIG_PATH)
|
|
65
|
+
|
|
66
|
+
structlogger.info(
|
|
67
|
+
"studio.push.success",
|
|
68
|
+
event_info="Pulled assistant data from Studio.",
|
|
69
|
+
)
|
|
70
|
+
rasa.shared.utils.cli.print_success("Pulled assistant data from Studio.")
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def handle_pull_endpoints(args: argparse.Namespace) -> None:
|
|
74
|
+
"""Pull nothing but the assistant's `endpoints.yml`.
|
|
75
|
+
|
|
76
|
+
Args:
|
|
77
|
+
args: The command line arguments.
|
|
78
|
+
"""
|
|
79
|
+
validate_argument_paths(args)
|
|
80
|
+
handler = _create_studio_handler()
|
|
81
|
+
handler.request_all_data()
|
|
82
|
+
|
|
83
|
+
_pull_endpoints_file(handler, args.endpoints or DEFAULT_ENDPOINTS_PATH)
|
|
84
|
+
structlogger.info(
|
|
85
|
+
"studio.push.success",
|
|
86
|
+
event_info="Pulled assistant data from Studio.",
|
|
87
|
+
)
|
|
88
|
+
rasa.shared.utils.cli.print_success("Pulled assistant data from Studio.")
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def _create_studio_handler() -> StudioDataHandler:
|
|
92
|
+
"""Return an initialised StudioDataHandler for the linked assistant.
|
|
93
|
+
|
|
94
|
+
Returns:
|
|
95
|
+
An instance of `StudioDataHandler` for the linked assistant.
|
|
96
|
+
"""
|
|
97
|
+
assistant_name = read_assistant_name()
|
|
98
|
+
return StudioDataHandler(
|
|
99
|
+
studio_config=StudioConfig.read_config(), assistant_name=assistant_name
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def _pull_config_file(handler: StudioDataHandler, target_path: str | Path) -> None:
|
|
104
|
+
"""Pull the assistant's `config.yml` file and write it to the specified path.
|
|
105
|
+
|
|
106
|
+
Args:
|
|
107
|
+
handler: The data handler to retrieve the config from.
|
|
108
|
+
target_path: The path where the config file should be written.
|
|
109
|
+
"""
|
|
110
|
+
config_yaml = handler.get_config()
|
|
111
|
+
if not config_yaml:
|
|
112
|
+
rasa.shared.utils.cli.print_error_and_exit("No config data found in assistant.")
|
|
113
|
+
|
|
114
|
+
_write_text(config_yaml, target_path)
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def _pull_endpoints_file(handler: StudioDataHandler, target_path: str | Path) -> None:
|
|
118
|
+
"""Pull the assistant's `endpoints.yml` file and write it to the specified path.
|
|
119
|
+
|
|
120
|
+
Args:
|
|
121
|
+
handler: The data handler to retrieve the endpoints from.
|
|
122
|
+
target_path: The path where the endpoints file should be written.
|
|
123
|
+
"""
|
|
124
|
+
endpoints_yaml = handler.get_endpoints()
|
|
125
|
+
if not endpoints_yaml:
|
|
126
|
+
rasa.shared.utils.cli.print_error_and_exit(
|
|
127
|
+
"No endpoints data found in assistant."
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
_write_text(endpoints_yaml, target_path)
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
def _prepare_data_and_domain_paths(args: argparse.Namespace) -> Tuple[Path, Path]:
|
|
134
|
+
"""Prepars the domain and data paths based on the provided arguments.
|
|
135
|
+
|
|
136
|
+
Args:
|
|
137
|
+
args: The command line arguments.
|
|
138
|
+
|
|
139
|
+
Returns:
|
|
140
|
+
A tuple containing the domain path and a data path.
|
|
141
|
+
"""
|
|
142
|
+
# Prepare domain path.
|
|
143
|
+
domain_path = rasa.cli.utils.get_validated_path(
|
|
144
|
+
args.domain, "domain", DEFAULT_DOMAIN_PATHS, none_is_valid=True
|
|
145
|
+
)
|
|
146
|
+
domain_or_default_path = args.domain or DEFAULT_DOMAIN_PATH
|
|
147
|
+
|
|
148
|
+
if domain_path is None:
|
|
149
|
+
domain_path = Path(domain_or_default_path)
|
|
150
|
+
domain_path.touch()
|
|
151
|
+
|
|
152
|
+
if isinstance(domain_path, str):
|
|
153
|
+
domain_path = Path(domain_path)
|
|
154
|
+
|
|
155
|
+
data_path = rasa.cli.utils.get_validated_path(
|
|
156
|
+
args.data, "data", DEFAULT_DATA_PATH, none_is_valid=True
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
data_path = Path(data_path or args.data)
|
|
160
|
+
if not (data_path.is_file() or data_path.is_dir()):
|
|
161
|
+
data_path.mkdir(parents=True, exist_ok=True)
|
|
162
|
+
|
|
163
|
+
return domain_path, data_path
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
def _merge_domain_and_data(
|
|
167
|
+
handler: StudioDataHandler, domain_path: Path, data_path: Path
|
|
168
|
+
) -> None:
|
|
169
|
+
"""Merge local assistant data with Studio assistant data.
|
|
170
|
+
|
|
171
|
+
Args:
|
|
172
|
+
handler: The data handler to retrieve the assistant data from.
|
|
173
|
+
domain_path: The path to the local domain file or directory.
|
|
174
|
+
data_path: The path to the local training data file or directory.
|
|
175
|
+
"""
|
|
176
|
+
data_from_studio, data_local = import_data_from_studio(
|
|
177
|
+
handler, domain_path, data_path
|
|
178
|
+
)
|
|
179
|
+
mapper = RasaPrimitiveStorageMapper(
|
|
180
|
+
domain_path=domain_path, training_data_paths=[data_path]
|
|
181
|
+
)
|
|
182
|
+
|
|
183
|
+
merge_domain(data_from_studio, data_local, domain_path)
|
|
184
|
+
merge_data(data_path, handler, data_from_studio, data_local, mapper)
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
def merge_data(
|
|
188
|
+
data_path: Path,
|
|
189
|
+
handler: Any,
|
|
190
|
+
data_from_studio: TrainingDataImporter,
|
|
191
|
+
data_local: TrainingDataImporter,
|
|
192
|
+
mapper: RasaPrimitiveStorageMapper,
|
|
193
|
+
) -> None:
|
|
194
|
+
"""
|
|
195
|
+
Merges flows data from a file or directory.
|
|
196
|
+
|
|
197
|
+
Args:
|
|
198
|
+
data_path: List of paths to the training data.
|
|
199
|
+
handler: The StudioDataHandler instance.
|
|
200
|
+
data_from_studio: The TrainingDataImporter instance for Studio data.
|
|
201
|
+
data_local: The TrainingDataImporter instance for local data.
|
|
202
|
+
mapper: The RasaPrimitiveStorageMapper instance for mapping.
|
|
203
|
+
"""
|
|
204
|
+
if not data_path.is_file() and not data_path.is_dir():
|
|
205
|
+
raise ValueError("Provided data path is neither a file nor a directory.")
|
|
206
|
+
|
|
207
|
+
if handler.has_nlu():
|
|
208
|
+
if data_path.is_file():
|
|
209
|
+
nlu_data_merged = data_from_studio.get_nlu_data().merge(
|
|
210
|
+
data_local.get_nlu_data()
|
|
211
|
+
)
|
|
212
|
+
nlu_data_merged.persist_nlu(data_path)
|
|
213
|
+
else:
|
|
214
|
+
merge_nlu_in_directory(
|
|
215
|
+
data_from_studio,
|
|
216
|
+
data_local,
|
|
217
|
+
data_path,
|
|
218
|
+
mapper,
|
|
219
|
+
)
|
|
220
|
+
|
|
221
|
+
if handler.has_flows():
|
|
222
|
+
flows_root = data_path.parent if data_path.is_file() else data_path
|
|
223
|
+
merge_flows_in_directory(
|
|
224
|
+
data_from_studio,
|
|
225
|
+
flows_root,
|
|
226
|
+
mapper,
|
|
227
|
+
)
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
def _write_text(content: str, target: str | Path) -> None:
|
|
231
|
+
"""Write `content` to `target`, ensuring parent directories exist.
|
|
232
|
+
|
|
233
|
+
Args:
|
|
234
|
+
content: The content to write to the file.
|
|
235
|
+
target: The path where the content should be written.
|
|
236
|
+
"""
|
|
237
|
+
path = Path(target)
|
|
238
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
239
|
+
write_text_file(content, path, encoding="utf-8")
|
rasa/studio/push.py
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import argparse
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from typing import Dict, Text
|
|
6
|
+
|
|
7
|
+
import structlog
|
|
8
|
+
|
|
9
|
+
import rasa.shared.utils.cli
|
|
10
|
+
from rasa.shared.core.flows.yaml_flows_io import YamlFlowsWriter
|
|
11
|
+
from rasa.shared.importers.importer import TrainingDataImporter
|
|
12
|
+
from rasa.shared.nlu.training_data.formats.rasa_yaml import RasaYAMLWriter
|
|
13
|
+
from rasa.shared.utils.io import read_file
|
|
14
|
+
from rasa.shared.utils.yaml import dump_obj_as_yaml_to_string
|
|
15
|
+
from rasa.studio.config import StudioConfig
|
|
16
|
+
from rasa.studio.link import get_studio_config, read_assistant_name
|
|
17
|
+
from rasa.studio.upload import (
|
|
18
|
+
build_import_request,
|
|
19
|
+
make_request,
|
|
20
|
+
run_validation,
|
|
21
|
+
)
|
|
22
|
+
from rasa.studio.utils import validate_argument_paths
|
|
23
|
+
|
|
24
|
+
structlogger = structlog.get_logger(__name__)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def _send_to_studio(
|
|
28
|
+
assistant_name: Text,
|
|
29
|
+
payload_parts: Dict[Text, Text],
|
|
30
|
+
studio_cfg: StudioConfig,
|
|
31
|
+
) -> None:
|
|
32
|
+
"""Build the GraphQL request and send it.
|
|
33
|
+
|
|
34
|
+
Args:
|
|
35
|
+
assistant_name: The name of the assistant.
|
|
36
|
+
payload_parts: The parts of the payload to send.
|
|
37
|
+
studio_cfg: The StudioConfig object.
|
|
38
|
+
"""
|
|
39
|
+
graphql_req = build_import_request(
|
|
40
|
+
assistant_name=assistant_name,
|
|
41
|
+
flows_yaml=payload_parts.get("flows"),
|
|
42
|
+
domain_yaml=payload_parts.get("domain"),
|
|
43
|
+
config_yaml=payload_parts.get("config"),
|
|
44
|
+
endpoints=payload_parts.get("endpoints"),
|
|
45
|
+
nlu_yaml=payload_parts.get("nlu"),
|
|
46
|
+
)
|
|
47
|
+
verify = not studio_cfg.disable_verify
|
|
48
|
+
result = make_request(studio_cfg.studio_url, graphql_req, verify)
|
|
49
|
+
if not result.was_successful:
|
|
50
|
+
rasa.shared.utils.cli.print_error_and_exit(result.message)
|
|
51
|
+
|
|
52
|
+
structlogger.info(
|
|
53
|
+
"studio.push.success",
|
|
54
|
+
event_info=f"Pushed data to assistant '{assistant_name}'.",
|
|
55
|
+
assistant_name=assistant_name,
|
|
56
|
+
)
|
|
57
|
+
rasa.shared.utils.cli.print_success(f"Pushed data to assistant '{assistant_name}'.")
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def handle_push(args: argparse.Namespace) -> None:
|
|
61
|
+
"""Push the entire assistant.
|
|
62
|
+
|
|
63
|
+
Args:
|
|
64
|
+
args: The command line arguments.
|
|
65
|
+
"""
|
|
66
|
+
validate_argument_paths(args)
|
|
67
|
+
studio_cfg = get_studio_config()
|
|
68
|
+
|
|
69
|
+
run_validation(args)
|
|
70
|
+
|
|
71
|
+
importer = TrainingDataImporter.load_from_dict(
|
|
72
|
+
domain_path=args.domain,
|
|
73
|
+
config_path=args.config,
|
|
74
|
+
expand_env_vars=False,
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
domain_yaml = dump_obj_as_yaml_to_string(importer.get_user_domain().as_dict())
|
|
78
|
+
config_yaml = read_file(Path(args.config))
|
|
79
|
+
endpoints_yaml = read_file(Path(args.endpoints))
|
|
80
|
+
|
|
81
|
+
flow_importer = TrainingDataImporter.load_from_dict(
|
|
82
|
+
training_data_paths=args.data, expand_env_vars=False
|
|
83
|
+
)
|
|
84
|
+
flows_yaml = YamlFlowsWriter().dumps(flow_importer.get_user_flows())
|
|
85
|
+
|
|
86
|
+
nlu_importer = TrainingDataImporter.load_from_dict(
|
|
87
|
+
training_data_paths=args.data, expand_env_vars=False
|
|
88
|
+
)
|
|
89
|
+
nlu_yaml = RasaYAMLWriter().dumps(nlu_importer.get_nlu_data())
|
|
90
|
+
|
|
91
|
+
assistant_name = read_assistant_name()
|
|
92
|
+
_send_to_studio(
|
|
93
|
+
assistant_name,
|
|
94
|
+
{
|
|
95
|
+
"flows": flows_yaml,
|
|
96
|
+
"domain": domain_yaml,
|
|
97
|
+
"config": config_yaml,
|
|
98
|
+
"endpoints": endpoints_yaml,
|
|
99
|
+
"nlu": nlu_yaml,
|
|
100
|
+
},
|
|
101
|
+
studio_cfg,
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def handle_push_config(args: argparse.Namespace) -> None:
|
|
106
|
+
"""Push only the assistant configuration (config.yml).
|
|
107
|
+
|
|
108
|
+
Args:
|
|
109
|
+
args: The command line arguments.
|
|
110
|
+
"""
|
|
111
|
+
studio_cfg = get_studio_config()
|
|
112
|
+
assistant_name = read_assistant_name()
|
|
113
|
+
|
|
114
|
+
config_yaml = read_file(Path(args.config))
|
|
115
|
+
if not config_yaml:
|
|
116
|
+
rasa.shared.utils.cli.print_error_and_exit(
|
|
117
|
+
"No configuration data was found in the assistant."
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
_send_to_studio(assistant_name, {"config": config_yaml}, studio_cfg)
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
def handle_push_endpoints(args: argparse.Namespace) -> None:
|
|
124
|
+
"""Push only the endpoints configuration (endpoints.yml).
|
|
125
|
+
|
|
126
|
+
Args:
|
|
127
|
+
args: The command line arguments.
|
|
128
|
+
"""
|
|
129
|
+
studio_cfg = get_studio_config()
|
|
130
|
+
assistant_name = read_assistant_name()
|
|
131
|
+
|
|
132
|
+
endpoints_yaml = read_file(Path(args.endpoints))
|
|
133
|
+
if not endpoints_yaml:
|
|
134
|
+
rasa.shared.utils.cli.print_error_and_exit(
|
|
135
|
+
"No endpoints data was found in the assistant."
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
_send_to_studio(assistant_name, {"endpoints": endpoints_yaml}, studio_cfg)
|
rasa/studio/results_logger.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from dataclasses import dataclass
|
|
2
2
|
from functools import wraps
|
|
3
|
-
from typing import Any, Callable, Dict
|
|
3
|
+
from typing import Any, Callable, Dict, Text
|
|
4
4
|
|
|
5
5
|
import structlog
|
|
6
6
|
from keycloak.exceptions import KeycloakError
|
|
@@ -78,6 +78,11 @@ def response_has_errors(response: Dict) -> bool:
|
|
|
78
78
|
)
|
|
79
79
|
|
|
80
80
|
|
|
81
|
+
def response_has_id(response: Dict[Text, Any]) -> bool:
|
|
82
|
+
response_id = response.get("id")
|
|
83
|
+
return isinstance(response_id, str) and bool(response_id)
|
|
84
|
+
|
|
85
|
+
|
|
81
86
|
def _handle_rasa_exception(e: RasaException) -> StudioResult:
|
|
82
87
|
error_msg = "Rasa internal exception was raised while interacting with Studio."
|
|
83
88
|
structlogger.error("studio.rasa_error", event_info=error_msg, exception=str(e))
|
rasa/studio/train.py
CHANGED
|
@@ -34,7 +34,7 @@ def handle_train(args: argparse.Namespace) -> Optional[str]:
|
|
|
34
34
|
from rasa.api import train as train_all
|
|
35
35
|
|
|
36
36
|
handler = StudioDataHandler(
|
|
37
|
-
studio_config=StudioConfig.read_config(), assistant_name=args.assistant_name
|
|
37
|
+
studio_config=StudioConfig.read_config(), assistant_name=args.assistant_name
|
|
38
38
|
)
|
|
39
39
|
if args.entities or args.intents:
|
|
40
40
|
handler.request_data(args.intents, args.entities)
|