rasa-pro 3.12.21__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.21.dist-info → rasa_pro-3.13.0.dist-info}/METADATA +13 -14
- {rasa_pro-3.12.21.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.21.dist-info → rasa_pro-3.13.0.dist-info}/NOTICE +0 -0
- {rasa_pro-3.12.21.dist-info → rasa_pro-3.13.0.dist-info}/WHEEL +0 -0
- {rasa_pro-3.12.21.dist-info → rasa_pro-3.13.0.dist-info}/entry_points.txt +0 -0
|
@@ -47,8 +47,8 @@ import rasa.shared.utils.io
|
|
|
47
47
|
import rasa.utils.io as io_utils
|
|
48
48
|
from rasa import telemetry
|
|
49
49
|
from rasa.core import run, utils
|
|
50
|
+
from rasa.core.available_endpoints import AvailableEndpoints
|
|
50
51
|
from rasa.core.constants import DEFAULT_SERVER_FORMAT, DEFAULT_SERVER_PORT
|
|
51
|
-
from rasa.core.utils import AvailableEndpoints
|
|
52
52
|
from rasa.shared.constants import (
|
|
53
53
|
DEFAULT_SENDER_ID,
|
|
54
54
|
DOCS_URL_NLU_BASED_POLICIES,
|
rasa/core/utils.py
CHANGED
|
@@ -2,7 +2,7 @@ import logging
|
|
|
2
2
|
import os
|
|
3
3
|
from pathlib import Path
|
|
4
4
|
from socket import SOCK_DGRAM, SOCK_STREAM
|
|
5
|
-
from typing import TYPE_CHECKING, Any, Dict,
|
|
5
|
+
from typing import TYPE_CHECKING, Any, Dict, Optional, Set, Text, Tuple, Union
|
|
6
6
|
|
|
7
7
|
import numpy as np
|
|
8
8
|
import structlog
|
|
@@ -11,6 +11,7 @@ from sanic import Sanic
|
|
|
11
11
|
import rasa.cli.utils as cli_utils
|
|
12
12
|
import rasa.shared.utils.io
|
|
13
13
|
from rasa.constants import DEFAULT_SANIC_WORKERS, ENV_SANIC_WORKERS
|
|
14
|
+
from rasa.core.available_endpoints import AvailableEndpoints
|
|
14
15
|
from rasa.core.constants import (
|
|
15
16
|
ACTIVE_FLOW_METADATA_KEY,
|
|
16
17
|
DOMAIN_GROUND_TRUTH_METADATA_KEY,
|
|
@@ -19,12 +20,12 @@ from rasa.core.constants import (
|
|
|
19
20
|
)
|
|
20
21
|
from rasa.core.lock_store import InMemoryLockStore, LockStore, RedisLockStore
|
|
21
22
|
from rasa.shared.constants import DEFAULT_ENDPOINTS_PATH, TCP_PROTOCOL
|
|
22
|
-
from rasa.shared.core.constants import
|
|
23
|
+
from rasa.shared.core.constants import (
|
|
24
|
+
SlotMappingType,
|
|
25
|
+
)
|
|
23
26
|
from rasa.shared.core.trackers import DialogueStateTracker
|
|
24
27
|
from rasa.utils.endpoints import (
|
|
25
28
|
EndpointConfig,
|
|
26
|
-
read_endpoint_config,
|
|
27
|
-
read_property_config_from_endpoints_file,
|
|
28
29
|
)
|
|
29
30
|
from rasa.utils.io import write_yaml
|
|
30
31
|
|
|
@@ -36,6 +37,25 @@ if TYPE_CHECKING:
|
|
|
36
37
|
structlogger = structlog.get_logger()
|
|
37
38
|
|
|
38
39
|
|
|
40
|
+
def read_endpoints_from_path(
|
|
41
|
+
endpoints_path: Optional[Union[Path, str]] = None,
|
|
42
|
+
) -> AvailableEndpoints:
|
|
43
|
+
"""Get `AvailableEndpoints` object from specified path.
|
|
44
|
+
|
|
45
|
+
Args:
|
|
46
|
+
endpoints_path: Path of the endpoints file to be read. If `None` the
|
|
47
|
+
default path for that file is used (`endpoints.yml`).
|
|
48
|
+
|
|
49
|
+
Returns:
|
|
50
|
+
`AvailableEndpoints` object read from endpoints file.
|
|
51
|
+
|
|
52
|
+
"""
|
|
53
|
+
endpoints_config_path = cli_utils.get_validated_path(
|
|
54
|
+
endpoints_path, "endpoints", DEFAULT_ENDPOINTS_PATH, True
|
|
55
|
+
)
|
|
56
|
+
return AvailableEndpoints.get_instance(endpoints_config_path)
|
|
57
|
+
|
|
58
|
+
|
|
39
59
|
def configure_file_logging(
|
|
40
60
|
logger_obj: logging.Logger,
|
|
41
61
|
log_file: Optional[Text],
|
|
@@ -177,97 +197,6 @@ def is_limit_reached(num_messages: int, limit: Optional[int]) -> bool:
|
|
|
177
197
|
return limit is not None and num_messages >= limit
|
|
178
198
|
|
|
179
199
|
|
|
180
|
-
class AvailableEndpoints:
|
|
181
|
-
"""Collection of configured endpoints."""
|
|
182
|
-
|
|
183
|
-
_instance = None
|
|
184
|
-
|
|
185
|
-
@classmethod
|
|
186
|
-
def read_endpoints(cls, endpoint_file: Text) -> "AvailableEndpoints":
|
|
187
|
-
"""Read the different endpoints from a yaml file."""
|
|
188
|
-
nlg = read_endpoint_config(endpoint_file, endpoint_type="nlg")
|
|
189
|
-
nlu = read_endpoint_config(endpoint_file, endpoint_type="nlu")
|
|
190
|
-
action = read_endpoint_config(endpoint_file, endpoint_type="action_endpoint")
|
|
191
|
-
model = read_endpoint_config(endpoint_file, endpoint_type="models")
|
|
192
|
-
tracker_store = read_endpoint_config(
|
|
193
|
-
endpoint_file, endpoint_type="tracker_store"
|
|
194
|
-
)
|
|
195
|
-
lock_store = read_endpoint_config(endpoint_file, endpoint_type="lock_store")
|
|
196
|
-
event_broker = read_endpoint_config(endpoint_file, endpoint_type="event_broker")
|
|
197
|
-
vector_store = read_endpoint_config(endpoint_file, endpoint_type="vector_store")
|
|
198
|
-
model_groups = read_property_config_from_endpoints_file(
|
|
199
|
-
endpoint_file, property_name="model_groups"
|
|
200
|
-
)
|
|
201
|
-
|
|
202
|
-
return cls(
|
|
203
|
-
nlg,
|
|
204
|
-
nlu,
|
|
205
|
-
action,
|
|
206
|
-
model,
|
|
207
|
-
tracker_store,
|
|
208
|
-
lock_store,
|
|
209
|
-
event_broker,
|
|
210
|
-
vector_store,
|
|
211
|
-
model_groups,
|
|
212
|
-
)
|
|
213
|
-
|
|
214
|
-
def __init__(
|
|
215
|
-
self,
|
|
216
|
-
nlg: Optional[EndpointConfig] = None,
|
|
217
|
-
nlu: Optional[EndpointConfig] = None,
|
|
218
|
-
action: Optional[EndpointConfig] = None,
|
|
219
|
-
model: Optional[EndpointConfig] = None,
|
|
220
|
-
tracker_store: Optional[EndpointConfig] = None,
|
|
221
|
-
lock_store: Optional[EndpointConfig] = None,
|
|
222
|
-
event_broker: Optional[EndpointConfig] = None,
|
|
223
|
-
vector_store: Optional[EndpointConfig] = None,
|
|
224
|
-
model_groups: Optional[List[Dict[str, Any]]] = None,
|
|
225
|
-
) -> None:
|
|
226
|
-
"""Create an `AvailableEndpoints` object."""
|
|
227
|
-
self.model = model
|
|
228
|
-
self.action = action
|
|
229
|
-
self.nlu = nlu
|
|
230
|
-
self.nlg = nlg
|
|
231
|
-
self.tracker_store = tracker_store
|
|
232
|
-
self.lock_store = lock_store
|
|
233
|
-
self.event_broker = event_broker
|
|
234
|
-
self.vector_store = vector_store
|
|
235
|
-
self.model_groups = model_groups
|
|
236
|
-
|
|
237
|
-
@classmethod
|
|
238
|
-
def get_instance(
|
|
239
|
-
cls, endpoint_file: Optional[Text] = DEFAULT_ENDPOINTS_PATH
|
|
240
|
-
) -> "AvailableEndpoints":
|
|
241
|
-
"""Get the singleton instance of AvailableEndpoints."""
|
|
242
|
-
# Ensure that the instance is initialized only once.
|
|
243
|
-
if cls._instance is None:
|
|
244
|
-
cls._instance = cls.read_endpoints(endpoint_file)
|
|
245
|
-
return cls._instance
|
|
246
|
-
|
|
247
|
-
@classmethod
|
|
248
|
-
def reset_instance(cls) -> None:
|
|
249
|
-
cls._instance = None
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
def read_endpoints_from_path(
|
|
253
|
-
endpoints_path: Optional[Union[Path, Text]] = None,
|
|
254
|
-
) -> AvailableEndpoints:
|
|
255
|
-
"""Get `AvailableEndpoints` object from specified path.
|
|
256
|
-
|
|
257
|
-
Args:
|
|
258
|
-
endpoints_path: Path of the endpoints file to be read. If `None` the
|
|
259
|
-
default path for that file is used (`endpoints.yml`).
|
|
260
|
-
|
|
261
|
-
Returns:
|
|
262
|
-
`AvailableEndpoints` object read from endpoints file.
|
|
263
|
-
|
|
264
|
-
"""
|
|
265
|
-
endpoints_config_path = cli_utils.get_validated_path(
|
|
266
|
-
endpoints_path, "endpoints", DEFAULT_ENDPOINTS_PATH, True
|
|
267
|
-
)
|
|
268
|
-
return AvailableEndpoints.get_instance(endpoints_config_path)
|
|
269
|
-
|
|
270
|
-
|
|
271
200
|
def _lock_store_is_multi_worker_compatible(
|
|
272
201
|
lock_store: Union[EndpointConfig, LockStore, None],
|
|
273
202
|
) -> bool:
|
|
@@ -143,7 +143,8 @@ class IntentBasedRouter(GraphComponent):
|
|
|
143
143
|
if route_session_to_calm is None:
|
|
144
144
|
commands = self._generate_command_using_intent(message, flows, tracker)
|
|
145
145
|
structlogger.info(
|
|
146
|
-
"intent_based_router.predicated_commands",
|
|
146
|
+
"intent_based_router.predicated_commands",
|
|
147
|
+
commands=commands, # doesn't contain PII
|
|
147
148
|
)
|
|
148
149
|
return commands
|
|
149
150
|
elif route_session_to_calm is True:
|
|
@@ -15,9 +15,7 @@ from rasa.dialogue_understanding.coexistence.constants import (
|
|
|
15
15
|
)
|
|
16
16
|
from rasa.dialogue_understanding.commands import Command, SetSlotCommand
|
|
17
17
|
from rasa.dialogue_understanding.commands.noop_command import NoopCommand
|
|
18
|
-
from rasa.dialogue_understanding.generator.constants import
|
|
19
|
-
LLM_CONFIG_KEY,
|
|
20
|
-
)
|
|
18
|
+
from rasa.dialogue_understanding.generator.constants import LLM_CONFIG_KEY
|
|
21
19
|
from rasa.engine.graph import ExecutionContext, GraphComponent
|
|
22
20
|
from rasa.engine.recipes.default_recipe import DefaultV1Recipe
|
|
23
21
|
from rasa.engine.storage.resource import Resource
|
|
@@ -28,6 +26,7 @@ from rasa.shared.constants import (
|
|
|
28
26
|
MODEL_CONFIG_KEY,
|
|
29
27
|
OPENAI_PROVIDER,
|
|
30
28
|
PROMPT_CONFIG_KEY,
|
|
29
|
+
PROMPT_TEMPLATE_CONFIG_KEY,
|
|
31
30
|
PROVIDER_CONFIG_KEY,
|
|
32
31
|
ROUTE_TO_CALM_SLOT,
|
|
33
32
|
TEMPERATURE_CONFIG_KEY,
|
|
@@ -46,6 +45,7 @@ from rasa.shared.utils.health_check.llm_health_check_mixin import LLMHealthCheck
|
|
|
46
45
|
from rasa.shared.utils.io import deep_container_fingerprint
|
|
47
46
|
from rasa.shared.utils.llm import (
|
|
48
47
|
DEFAULT_OPENAI_CHAT_MODEL_NAME,
|
|
48
|
+
check_prompt_config_keys_and_warn_if_deprecated,
|
|
49
49
|
get_prompt_template,
|
|
50
50
|
llm_factory,
|
|
51
51
|
resolve_model_client_config,
|
|
@@ -58,11 +58,11 @@ DEFAULT_COMMAND_PROMPT_TEMPLATE = importlib.resources.read_text(
|
|
|
58
58
|
)
|
|
59
59
|
LLM_BASED_ROUTER_CONFIG_FILE_NAME = "config.json"
|
|
60
60
|
|
|
61
|
-
# Token ids for gpt
|
|
61
|
+
# Token ids for gpt-4o corresponding to space + capitalized Letter
|
|
62
62
|
A_TO_C_TOKEN_IDS_CHATGPT = [
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
355, # " A"
|
|
64
|
+
418, # " B"
|
|
65
|
+
363, # " C"
|
|
66
66
|
]
|
|
67
67
|
|
|
68
68
|
DEFAULT_LLM_CONFIG = {
|
|
@@ -90,7 +90,7 @@ class LLMBasedRouter(LLMHealthCheckMixin, GraphComponent):
|
|
|
90
90
|
def get_default_config() -> Dict[str, Any]:
|
|
91
91
|
"""The component's default config (see parent class for full docstring)."""
|
|
92
92
|
return {
|
|
93
|
-
|
|
93
|
+
PROMPT_TEMPLATE_CONFIG_KEY: None, # TODO: remove in Rasa 4.0.0
|
|
94
94
|
CALM_ENTRY: {STICKY: None},
|
|
95
95
|
NLU_ENTRY: {
|
|
96
96
|
NON_STICKY: "handles chitchat",
|
|
@@ -111,10 +111,13 @@ class LLMBasedRouter(LLMHealthCheckMixin, GraphComponent):
|
|
|
111
111
|
self.config.get(LLM_CONFIG_KEY), LLMBasedRouter.__name__
|
|
112
112
|
)
|
|
113
113
|
|
|
114
|
+
# Warn if the prompt config key is used to set the prompt template
|
|
115
|
+
check_prompt_config_keys_and_warn_if_deprecated(config, "llm_based_router")
|
|
116
|
+
|
|
114
117
|
self.prompt_template = (
|
|
115
118
|
prompt_template
|
|
116
119
|
or get_prompt_template(
|
|
117
|
-
config.get(PROMPT_CONFIG_KEY),
|
|
120
|
+
config.get(PROMPT_TEMPLATE_CONFIG_KEY) or config.get(PROMPT_CONFIG_KEY),
|
|
118
121
|
DEFAULT_COMMAND_PROMPT_TEMPLATE,
|
|
119
122
|
log_source_component=LLMBasedRouter.__name__,
|
|
120
123
|
log_source_method=LOG_COMPONENT_SOURCE_METHOD_INIT,
|
|
@@ -171,7 +174,6 @@ class LLMBasedRouter(LLMHealthCheckMixin, GraphComponent):
|
|
|
171
174
|
**kwargs: Any,
|
|
172
175
|
) -> "LLMBasedRouter":
|
|
173
176
|
"""Loads trained component (see parent class for full docstring)."""
|
|
174
|
-
|
|
175
177
|
# Perform health check on the resolved LLM client config
|
|
176
178
|
llm_config = resolve_model_client_config(config.get(LLM_CONFIG_KEY, {}))
|
|
177
179
|
cls.perform_llm_health_check(
|
|
@@ -327,7 +329,7 @@ class LLMBasedRouter(LLMHealthCheckMixin, GraphComponent):
|
|
|
327
329
|
def fingerprint_addon(cls, config: Dict[str, Any]) -> Optional[str]:
|
|
328
330
|
"""Add a fingerprint of llm based router for the graph."""
|
|
329
331
|
prompt_template = get_prompt_template(
|
|
330
|
-
config.get(PROMPT_CONFIG_KEY),
|
|
332
|
+
config.get(PROMPT_TEMPLATE_CONFIG_KEY) or config.get(PROMPT_CONFIG_KEY),
|
|
331
333
|
DEFAULT_COMMAND_PROMPT_TEMPLATE,
|
|
332
334
|
log_source_component=LLMBasedRouter.__name__,
|
|
333
335
|
log_source_method=LOG_COMPONENT_SOURCE_METHOD_FINGERPRINT_ADDON,
|
|
@@ -81,6 +81,7 @@ class CannotHandleCommand(Command):
|
|
|
81
81
|
mapper = {
|
|
82
82
|
CommandSyntaxVersion.v1: "CannotHandle()",
|
|
83
83
|
CommandSyntaxVersion.v2: "cannot handle",
|
|
84
|
+
CommandSyntaxVersion.v3: "cannot handle",
|
|
84
85
|
}
|
|
85
86
|
return mapper.get(
|
|
86
87
|
CommandSyntaxManager.get_syntax_version(),
|
|
@@ -100,6 +101,7 @@ class CannotHandleCommand(Command):
|
|
|
100
101
|
mapper = {
|
|
101
102
|
CommandSyntaxVersion.v1: r"CannotHandle\(\)",
|
|
102
103
|
CommandSyntaxVersion.v2: r"""^[\s\W\d]*cannot handle['"`]*$""",
|
|
104
|
+
CommandSyntaxVersion.v3: r"""^[\s\W\d]*cannot handle['"`]*$""",
|
|
103
105
|
}
|
|
104
106
|
return mapper.get(
|
|
105
107
|
CommandSyntaxManager.get_syntax_version(),
|
|
@@ -102,7 +102,7 @@ class CancelFlowCommand(Command):
|
|
|
102
102
|
|
|
103
103
|
if not current_flow:
|
|
104
104
|
structlogger.debug(
|
|
105
|
-
"
|
|
105
|
+
"cancel_command.skip_cancel_flow.no_active_flow", command=self
|
|
106
106
|
)
|
|
107
107
|
return []
|
|
108
108
|
|
|
@@ -136,6 +136,7 @@ class CancelFlowCommand(Command):
|
|
|
136
136
|
mapper = {
|
|
137
137
|
CommandSyntaxVersion.v1: "CancelFlow()",
|
|
138
138
|
CommandSyntaxVersion.v2: "cancel flow",
|
|
139
|
+
CommandSyntaxVersion.v3: "cancel flow",
|
|
139
140
|
}
|
|
140
141
|
return mapper.get(
|
|
141
142
|
CommandSyntaxManager.get_syntax_version(),
|
|
@@ -152,6 +153,7 @@ class CancelFlowCommand(Command):
|
|
|
152
153
|
mapper = {
|
|
153
154
|
CommandSyntaxVersion.v1: r"CancelFlow\(\)",
|
|
154
155
|
CommandSyntaxVersion.v2: r"""^[\s\W\d]*cancel flow['"`]*$""",
|
|
156
|
+
CommandSyntaxVersion.v3: r"""^[\s\W\d]*cancel flow['"`]*$""",
|
|
155
157
|
}
|
|
156
158
|
return mapper.get(
|
|
157
159
|
CommandSyntaxManager.get_syntax_version(),
|
|
@@ -66,6 +66,7 @@ class ChitChatAnswerCommand(FreeFormAnswerCommand):
|
|
|
66
66
|
mapper = {
|
|
67
67
|
CommandSyntaxVersion.v1: "ChitChat()",
|
|
68
68
|
CommandSyntaxVersion.v2: "offtopic reply",
|
|
69
|
+
CommandSyntaxVersion.v3: "offtopic reply",
|
|
69
70
|
}
|
|
70
71
|
return mapper.get(
|
|
71
72
|
CommandSyntaxManager.get_syntax_version(),
|
|
@@ -82,6 +83,7 @@ class ChitChatAnswerCommand(FreeFormAnswerCommand):
|
|
|
82
83
|
mapper = {
|
|
83
84
|
CommandSyntaxVersion.v1: r"ChitChat\(\)",
|
|
84
85
|
CommandSyntaxVersion.v2: r"""^[\s\W\d]*offtopic reply['"`]*$""",
|
|
86
|
+
CommandSyntaxVersion.v3: r"""^[\s\W\d]*offtopic reply['"`]*$""",
|
|
85
87
|
}
|
|
86
88
|
return mapper.get(
|
|
87
89
|
CommandSyntaxManager.get_syntax_version(),
|
|
@@ -65,14 +65,14 @@ class ClarifyCommand(Command):
|
|
|
65
65
|
clean_options = [flow.id for flow in flows if flow is not None]
|
|
66
66
|
if len(clean_options) != len(self.options):
|
|
67
67
|
structlogger.debug(
|
|
68
|
-
"
|
|
68
|
+
"clarify_command.altered_command.dropped_clarification_options",
|
|
69
69
|
command=self,
|
|
70
70
|
original_options=self.options,
|
|
71
71
|
cleaned_options=clean_options,
|
|
72
72
|
)
|
|
73
73
|
if len(clean_options) == 0:
|
|
74
74
|
structlogger.debug(
|
|
75
|
-
"
|
|
75
|
+
"clarify_command.skip_command.empty_clarification", command=self
|
|
76
76
|
)
|
|
77
77
|
return []
|
|
78
78
|
|
|
@@ -102,6 +102,7 @@ class ClarifyCommand(Command):
|
|
|
102
102
|
mapper = {
|
|
103
103
|
CommandSyntaxVersion.v1: f"Clarify({', '.join(self.options)})",
|
|
104
104
|
CommandSyntaxVersion.v2: f"disambiguate flows {' '.join(self.options)}",
|
|
105
|
+
CommandSyntaxVersion.v3: f"disambiguate flows {' '.join(self.options)}",
|
|
105
106
|
}
|
|
106
107
|
return mapper.get(
|
|
107
108
|
CommandSyntaxManager.get_syntax_version(),
|
|
@@ -121,6 +122,9 @@ class ClarifyCommand(Command):
|
|
|
121
122
|
CommandSyntaxVersion.v2: (
|
|
122
123
|
r"""^[\s\W\d]*disambiguate flows (["'a-zA-Z0-9_, -]*)[\W]*$"""
|
|
123
124
|
),
|
|
125
|
+
CommandSyntaxVersion.v3: (
|
|
126
|
+
r"""^[\s\W\d]*disambiguate flows (["'a-zA-Z0-9_, -]*)[\W]*$"""
|
|
127
|
+
),
|
|
124
128
|
}
|
|
125
129
|
return mapper.get(
|
|
126
130
|
CommandSyntaxManager.get_syntax_version(),
|
|
@@ -144,7 +144,8 @@ class CorrectSlotsCommand(Command):
|
|
|
144
144
|
}
|
|
145
145
|
else:
|
|
146
146
|
structlogger.debug(
|
|
147
|
-
"
|
|
147
|
+
"correct_slots_command.skip_correction.slot_already_set",
|
|
148
|
+
command=self,
|
|
148
149
|
)
|
|
149
150
|
return proposed_slots
|
|
150
151
|
|
|
@@ -236,7 +237,7 @@ class CorrectSlotsCommand(Command):
|
|
|
236
237
|
# previously set, and we also don't want to reset the slots, do
|
|
237
238
|
# not correct the slots.
|
|
238
239
|
structlogger.debug(
|
|
239
|
-
"
|
|
240
|
+
"correct_slots_command.skip_correction",
|
|
240
241
|
is_reset_only=is_reset_only,
|
|
241
242
|
)
|
|
242
243
|
return None
|
|
@@ -274,12 +275,10 @@ class CorrectSlotsCommand(Command):
|
|
|
274
275
|
# we shouldn't end up here as a correction shouldn't be triggered
|
|
275
276
|
# if we are not in any flow. but just in case we do, we
|
|
276
277
|
# just skip the command.
|
|
277
|
-
structlogger.warning(
|
|
278
|
-
"command_executor.correct_slots.no_active_flow", command=self
|
|
279
|
-
)
|
|
278
|
+
structlogger.warning("correct_slots_command.no_active_flow")
|
|
280
279
|
return []
|
|
281
280
|
|
|
282
|
-
structlogger.debug("
|
|
281
|
+
structlogger.debug("correct_slots_command", command=self)
|
|
283
282
|
proposed_slots = self.corrected_slots_dict(tracker)
|
|
284
283
|
|
|
285
284
|
correction_frame = self.create_correction_frame(
|
|
@@ -58,7 +58,7 @@ class ErrorCommand(Command):
|
|
|
58
58
|
The events to apply to the tracker.
|
|
59
59
|
"""
|
|
60
60
|
stack = tracker.stack
|
|
61
|
-
structlogger.debug("
|
|
61
|
+
structlogger.debug("error_command.error", command=self)
|
|
62
62
|
stack.push(
|
|
63
63
|
InternalErrorPatternFlowStackFrame(
|
|
64
64
|
error_type=self.error_type, info=self.info
|
|
@@ -57,9 +57,7 @@ class HumanHandoffCommand(Command):
|
|
|
57
57
|
"""
|
|
58
58
|
stack = tracker.stack
|
|
59
59
|
stack.push(HumanHandoffPatternFlowStackFrame())
|
|
60
|
-
structlogger.debug(
|
|
61
|
-
"command_executor.human_handoff.pushed_to_stack", command=self
|
|
62
|
-
)
|
|
60
|
+
structlogger.debug("human_handoff_command.pushed_to_stack", command=self)
|
|
63
61
|
return tracker.create_stack_updated_events(stack)
|
|
64
62
|
|
|
65
63
|
def __hash__(self) -> int:
|
|
@@ -73,6 +71,7 @@ class HumanHandoffCommand(Command):
|
|
|
73
71
|
mapper = {
|
|
74
72
|
CommandSyntaxVersion.v1: "HumanHandoff()",
|
|
75
73
|
CommandSyntaxVersion.v2: "hand over",
|
|
74
|
+
CommandSyntaxVersion.v3: "hand over",
|
|
76
75
|
}
|
|
77
76
|
return mapper.get(
|
|
78
77
|
CommandSyntaxManager.get_syntax_version(),
|
|
@@ -89,6 +88,7 @@ class HumanHandoffCommand(Command):
|
|
|
89
88
|
mapper = {
|
|
90
89
|
CommandSyntaxVersion.v1: r"HumanHandoff\(\)",
|
|
91
90
|
CommandSyntaxVersion.v2: r"""^[\s\W\d]*hand over['"`]*$""",
|
|
91
|
+
CommandSyntaxVersion.v3: r"""^[\s\W\d]*hand over['"`]*$""",
|
|
92
92
|
}
|
|
93
93
|
return mapper.get(
|
|
94
94
|
CommandSyntaxManager.get_syntax_version(),
|
|
@@ -66,6 +66,7 @@ class KnowledgeAnswerCommand(FreeFormAnswerCommand):
|
|
|
66
66
|
mapper = {
|
|
67
67
|
CommandSyntaxVersion.v1: "SearchAndReply()",
|
|
68
68
|
CommandSyntaxVersion.v2: "provide info",
|
|
69
|
+
CommandSyntaxVersion.v3: "search and reply",
|
|
69
70
|
}
|
|
70
71
|
return mapper.get(
|
|
71
72
|
CommandSyntaxManager.get_syntax_version(),
|
|
@@ -82,6 +83,7 @@ class KnowledgeAnswerCommand(FreeFormAnswerCommand):
|
|
|
82
83
|
mapper = {
|
|
83
84
|
CommandSyntaxVersion.v1: r"SearchAndReply\(\)",
|
|
84
85
|
CommandSyntaxVersion.v2: r"""^[\s\W\d]*provide info['"`]*$""",
|
|
86
|
+
CommandSyntaxVersion.v3: r"""^[\s\W\d]*search and reply['"`]*$""",
|
|
85
87
|
}
|
|
86
88
|
return mapper.get(
|
|
87
89
|
CommandSyntaxManager.get_syntax_version(),
|
|
@@ -67,6 +67,7 @@ class RepeatBotMessagesCommand(Command):
|
|
|
67
67
|
mapper = {
|
|
68
68
|
CommandSyntaxVersion.v1: "RepeatLastBotMessages()",
|
|
69
69
|
CommandSyntaxVersion.v2: "repeat message",
|
|
70
|
+
CommandSyntaxVersion.v3: "repeat message",
|
|
70
71
|
}
|
|
71
72
|
return mapper.get(
|
|
72
73
|
CommandSyntaxManager.get_syntax_version(),
|
|
@@ -83,6 +84,7 @@ class RepeatBotMessagesCommand(Command):
|
|
|
83
84
|
mapper = {
|
|
84
85
|
CommandSyntaxVersion.v1: r"RepeatLastBotMessages\(\)",
|
|
85
86
|
CommandSyntaxVersion.v2: r"""^[\s\W\d]*repeat message['"`]*$""",
|
|
87
|
+
CommandSyntaxVersion.v3: r"""^[\s\W\d]*repeat message['"`]*$""",
|
|
86
88
|
}
|
|
87
89
|
return mapper.get(
|
|
88
90
|
CommandSyntaxManager.get_syntax_version(),
|
|
@@ -100,14 +100,14 @@ class SetSlotCommand(Command):
|
|
|
100
100
|
slot = tracker.slots.get(self.name)
|
|
101
101
|
if slot is None:
|
|
102
102
|
structlogger.debug(
|
|
103
|
-
"
|
|
103
|
+
"set_slot_command.skip_command.slot_not_in_domain", command=self
|
|
104
104
|
)
|
|
105
105
|
return []
|
|
106
106
|
|
|
107
107
|
if slot.has_same_coerced_value(self.value):
|
|
108
108
|
# value hasn't changed, skip this one
|
|
109
109
|
structlogger.debug(
|
|
110
|
-
"
|
|
110
|
+
"set_slot_command.skip_command.slot_already_set", command=self
|
|
111
111
|
)
|
|
112
112
|
return []
|
|
113
113
|
|
|
@@ -150,11 +150,11 @@ class SetSlotCommand(Command):
|
|
|
150
150
|
)
|
|
151
151
|
if not use_slot_fill:
|
|
152
152
|
structlogger.debug(
|
|
153
|
-
"
|
|
153
|
+
"set_slot_command.skip_command.slot_not_asked_for", command=self
|
|
154
154
|
)
|
|
155
155
|
return []
|
|
156
156
|
|
|
157
|
-
structlogger.debug("
|
|
157
|
+
structlogger.debug("set_slot_command.set_slot", command=self)
|
|
158
158
|
return [
|
|
159
159
|
SlotSet(self.name, slot.coerce_value(self.value), filled_by=self.extractor)
|
|
160
160
|
]
|
|
@@ -176,6 +176,7 @@ class SetSlotCommand(Command):
|
|
|
176
176
|
mapper = {
|
|
177
177
|
CommandSyntaxVersion.v1: f"SetSlot({self.name}, {self.value})",
|
|
178
178
|
CommandSyntaxVersion.v2: f"set slot {self.name} {self.value}",
|
|
179
|
+
CommandSyntaxVersion.v3: f"set slot {self.name} {self.value}",
|
|
179
180
|
}
|
|
180
181
|
return mapper.get(
|
|
181
182
|
CommandSyntaxManager.get_syntax_version(),
|
|
@@ -198,6 +199,9 @@ class SetSlotCommand(Command):
|
|
|
198
199
|
CommandSyntaxVersion.v2: (
|
|
199
200
|
r"""^[\s\W\d]*set slot ['"`]?([a-zA-Z_][a-zA-Z0-9_-]*)['"`]? ['"`]?(.+?)[\W]*$""" # noqa: E501
|
|
200
201
|
),
|
|
202
|
+
CommandSyntaxVersion.v3: (
|
|
203
|
+
r"""^[\s\W\d]*set slot ['"`]?([a-zA-Z_][a-zA-Z0-9_-]*)['"`]? ['"`]?(.+?)[\W]*$""" # noqa: E501
|
|
204
|
+
),
|
|
201
205
|
}
|
|
202
206
|
return mapper.get(
|
|
203
207
|
CommandSyntaxManager.get_syntax_version(),
|
|
@@ -63,9 +63,7 @@ class SkipQuestionCommand(Command):
|
|
|
63
63
|
current_flow = user_frame.flow(all_flows) if user_frame else None
|
|
64
64
|
|
|
65
65
|
if not current_flow:
|
|
66
|
-
structlogger.debug(
|
|
67
|
-
"command_executor.skip_question.no_active_flow", command=self
|
|
68
|
-
)
|
|
66
|
+
structlogger.debug("skip_question_command.no_active_flow", command=self)
|
|
69
67
|
return []
|
|
70
68
|
|
|
71
69
|
stack.push(SkipQuestionPatternFlowStackFrame())
|
|
@@ -82,6 +80,7 @@ class SkipQuestionCommand(Command):
|
|
|
82
80
|
mapper = {
|
|
83
81
|
CommandSyntaxVersion.v1: "SkipQuestion()",
|
|
84
82
|
CommandSyntaxVersion.v2: "skip question",
|
|
83
|
+
CommandSyntaxVersion.v3: "skip question",
|
|
85
84
|
}
|
|
86
85
|
return mapper.get(
|
|
87
86
|
CommandSyntaxManager.get_syntax_version(),
|
|
@@ -98,6 +97,7 @@ class SkipQuestionCommand(Command):
|
|
|
98
97
|
mapper = {
|
|
99
98
|
CommandSyntaxVersion.v1: r"SkipQuestion\(\)",
|
|
100
99
|
CommandSyntaxVersion.v2: r"""^[\s\W\d]*skip question['"`]*$""",
|
|
100
|
+
CommandSyntaxVersion.v3: r"""^[\s\W\d]*skip question['"`]*$""",
|
|
101
101
|
}
|
|
102
102
|
return mapper.get(
|
|
103
103
|
CommandSyntaxManager.get_syntax_version(),
|
|
@@ -73,12 +73,12 @@ class StartFlowCommand(Command):
|
|
|
73
73
|
|
|
74
74
|
if self.flow in user_flows_on_the_stack(stack):
|
|
75
75
|
structlogger.debug(
|
|
76
|
-
"
|
|
76
|
+
"start_flow_command.skip_command.already_started_flow", command=self
|
|
77
77
|
)
|
|
78
78
|
return []
|
|
79
79
|
elif self.flow not in all_flows.flow_ids:
|
|
80
80
|
structlogger.debug(
|
|
81
|
-
"
|
|
81
|
+
"start_flow_command.skip_command.start_invalid_flow_id", command=self
|
|
82
82
|
)
|
|
83
83
|
return []
|
|
84
84
|
|
|
@@ -99,7 +99,7 @@ class StartFlowCommand(Command):
|
|
|
99
99
|
)
|
|
100
100
|
)
|
|
101
101
|
|
|
102
|
-
structlogger.debug("
|
|
102
|
+
structlogger.debug("start_flow_command.start_flow", command=self)
|
|
103
103
|
stack.push(UserFlowStackFrame(flow_id=self.flow, frame_type=frame_type))
|
|
104
104
|
return applied_events + tracker.create_stack_updated_events(stack)
|
|
105
105
|
|
|
@@ -117,6 +117,7 @@ class StartFlowCommand(Command):
|
|
|
117
117
|
mapper = {
|
|
118
118
|
CommandSyntaxVersion.v1: f"StartFlow({self.flow})",
|
|
119
119
|
CommandSyntaxVersion.v2: f"start flow {self.flow}",
|
|
120
|
+
CommandSyntaxVersion.v3: f"start flow {self.flow}",
|
|
120
121
|
}
|
|
121
122
|
return mapper.get(
|
|
122
123
|
CommandSyntaxManager.get_syntax_version(),
|
|
@@ -135,6 +136,9 @@ class StartFlowCommand(Command):
|
|
|
135
136
|
CommandSyntaxVersion.v2: (
|
|
136
137
|
r"""^[\s\W\d]*start flow ['"`]?([a-zA-Z0-9_-]+)['"`]*"""
|
|
137
138
|
),
|
|
139
|
+
CommandSyntaxVersion.v3: (
|
|
140
|
+
r"""^[\s\W\d]*start flow ['"`]?([a-zA-Z0-9_-]+)['"`]*"""
|
|
141
|
+
),
|
|
138
142
|
}
|
|
139
143
|
return mapper.get(
|
|
140
144
|
CommandSyntaxManager.get_syntax_version(),
|
|
@@ -8,8 +8,13 @@ from rasa.dialogue_understanding.generator.llm_command_generator import (
|
|
|
8
8
|
from rasa.dialogue_understanding.generator.multi_step.multi_step_llm_command_generator import ( # noqa: E501
|
|
9
9
|
MultiStepLLMCommandGenerator,
|
|
10
10
|
)
|
|
11
|
-
from rasa.dialogue_understanding.generator.single_step.
|
|
11
|
+
from rasa.dialogue_understanding.generator.single_step.compact_llm_command_generator import ( # noqa: E501
|
|
12
12
|
CompactLLMCommandGenerator,
|
|
13
|
+
)
|
|
14
|
+
from rasa.dialogue_understanding.generator.single_step.search_ready_llm_command_generator import ( # noqa: E501
|
|
15
|
+
SearchReadyLLMCommandGenerator,
|
|
16
|
+
)
|
|
17
|
+
from rasa.dialogue_understanding.generator.single_step.single_step_llm_command_generator import ( # noqa: E501
|
|
13
18
|
SingleStepLLMCommandGenerator,
|
|
14
19
|
)
|
|
15
20
|
|
|
@@ -20,4 +25,5 @@ __all__ = [
|
|
|
20
25
|
"MultiStepLLMCommandGenerator",
|
|
21
26
|
"SingleStepLLMCommandGenerator",
|
|
22
27
|
"CompactLLMCommandGenerator",
|
|
28
|
+
"SearchReadyLLMCommandGenerator",
|
|
23
29
|
]
|
|
@@ -322,7 +322,10 @@ class CommandGenerator:
|
|
|
322
322
|
if commands and len(checked_commands) != len(commands):
|
|
323
323
|
structlogger.info(
|
|
324
324
|
"command_generator.check_commands_against_startable_flows.startable_commands",
|
|
325
|
-
commands=
|
|
325
|
+
commands=[
|
|
326
|
+
checked_command.__class__.__name__
|
|
327
|
+
for checked_command in checked_commands
|
|
328
|
+
],
|
|
326
329
|
)
|
|
327
330
|
|
|
328
331
|
return checked_commands
|
|
@@ -358,7 +361,6 @@ class CommandGenerator:
|
|
|
358
361
|
"command_generator.evaluate_message.error",
|
|
359
362
|
event_info="Invalid message",
|
|
360
363
|
errors=[e.as_dict() for e in errors],
|
|
361
|
-
message=message.get(TEXT),
|
|
362
364
|
)
|
|
363
365
|
return errors
|
|
364
366
|
|
|
@@ -81,7 +81,7 @@ def _get_additional_parsing_logic(
|
|
|
81
81
|
|
|
82
82
|
def validate_custom_commands(command_classes: List[Type[PromptCommand]]) -> None:
|
|
83
83
|
clz_not_inheriting_from_command_clz = [
|
|
84
|
-
command_clz
|
|
84
|
+
command_clz.__name__
|
|
85
85
|
for command_clz in command_classes
|
|
86
86
|
if not issubclass(command_clz, Command)
|
|
87
87
|
]
|
|
@@ -99,7 +99,7 @@ def validate_custom_commands(command_classes: List[Type[PromptCommand]]) -> None
|
|
|
99
99
|
sys.exit(1)
|
|
100
100
|
|
|
101
101
|
clz_not_adhering_to_prompt_command_protocol = [
|
|
102
|
-
command_clz
|
|
102
|
+
command_clz.__name__
|
|
103
103
|
for command_clz in command_classes
|
|
104
104
|
if not isinstance(command_clz, PromptCommand)
|
|
105
105
|
]
|