rasa-pro 3.12.18.dev1__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/__init__.py +0 -6
- 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 +42 -31
- 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 +57 -20
- rasa/core/processor.py +114 -54
- 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 +10 -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 +10 -0
- rasa/dialogue_understanding/commands/skip_question_command.py +2 -0
- rasa/dialogue_understanding/commands/start_flow_command.py +4 -0
- rasa/dialogue_understanding/commands/utils.py +26 -2
- rasa/dialogue_understanding/generator/__init__.py +7 -1
- rasa/dialogue_understanding/generator/command_generator.py +4 -2
- rasa/dialogue_understanding/generator/command_parser.py +2 -2
- rasa/dialogue_understanding/generator/command_parser_validator.py +63 -0
- rasa/dialogue_understanding/generator/llm_based_command_generator.py +5 -17
- rasa/dialogue_understanding/generator/llm_command_generator.py +1 -3
- rasa/dialogue_understanding/generator/multi_step/multi_step_llm_command_generator.py +4 -44
- 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 -474
- 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/frames/flow_stack_frame.py +17 -4
- rasa/dialogue_understanding/stack/utils.py +3 -1
- rasa/dialogue_understanding/utils.py +68 -12
- 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/io.py +35 -8
- rasa/e2e_test/e2e_test_runner.py +1 -1
- 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 -85
- rasa/llm_fine_tuning/paraphrasing/conversation_rephraser.py +1 -5
- rasa/llm_fine_tuning/utils.py +2 -4
- 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 +13 -4
- 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/constants.py +0 -9
- rasa/shared/providers/llm/_base_litellm_client.py +4 -14
- rasa/shared/providers/llm/default_litellm_llm_client.py +2 -2
- rasa/shared/providers/llm/litellm_router_llm_client.py +7 -17
- rasa/shared/providers/llm/llm_client.py +15 -24
- rasa/shared/providers/llm/self_hosted_llm_client.py +2 -10
- 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 +49 -11
- 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.dev1.dist-info → rasa_pro-3.13.0a1.dev1.dist-info}/METADATA +12 -14
- {rasa_pro-3.12.18.dev1.dist-info → rasa_pro-3.13.0a1.dev1.dist-info}/RECORD +318 -294
- 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/monkey_patches.py +0 -91
- 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.dev1.dist-info → rasa_pro-3.13.0a1.dev1.dist-info}/NOTICE +0 -0
- {rasa_pro-3.12.18.dev1.dist-info → rasa_pro-3.13.0a1.dev1.dist-info}/WHEEL +0 -0
- {rasa_pro-3.12.18.dev1.dist-info → rasa_pro-3.13.0a1.dev1.dist-info}/entry_points.txt +0 -0
|
@@ -9,6 +9,7 @@ from rasa.dialogue_understanding.generator import (
|
|
|
9
9
|
CompactLLMCommandGenerator,
|
|
10
10
|
LLMCommandGenerator,
|
|
11
11
|
MultiStepLLMCommandGenerator,
|
|
12
|
+
SearchReadyLLMCommandGenerator,
|
|
12
13
|
SingleStepLLMCommandGenerator,
|
|
13
14
|
)
|
|
14
15
|
from rasa.tracing.constants import (
|
|
@@ -17,7 +18,10 @@ from rasa.tracing.constants import (
|
|
|
17
18
|
COMPACT_LLM_COMMAND_GENERATOR_MEMORY_USAGE_METRIC_NAME,
|
|
18
19
|
COMPACT_LLM_COMMAND_GENERATOR_PROMPT_TOKEN_USAGE_METRIC_NAME,
|
|
19
20
|
CONTEXTUAL_RESPONSE_REPHRASER_LLM_RESPONSE_DURATION_METRIC_NAME,
|
|
21
|
+
ENTERPRISE_SEARCH_POLICY_CPU_USAGE_METRIC_NAME,
|
|
20
22
|
ENTERPRISE_SEARCH_POLICY_LLM_RESPONSE_DURATION_METRIC_NAME,
|
|
23
|
+
ENTERPRISE_SEARCH_POLICY_MEMORY_USAGE_METRIC_NAME,
|
|
24
|
+
ENTERPRISE_SEARCH_POLICY_PROMPT_TOKEN_USAGE_METRIC_NAME,
|
|
21
25
|
INTENTLESS_POLICY_LLM_RESPONSE_DURATION_METRIC_NAME,
|
|
22
26
|
LLM_COMMAND_GENERATOR_CPU_USAGE_METRIC_NAME,
|
|
23
27
|
LLM_COMMAND_GENERATOR_LLM_RESPONSE_DURATION_METRIC_NAME,
|
|
@@ -31,6 +35,10 @@ from rasa.tracing.constants import (
|
|
|
31
35
|
RASA_CLIENT_REQUEST_BODY_SIZE_METRIC_NAME,
|
|
32
36
|
RASA_CLIENT_REQUEST_DURATION_METRIC_NAME,
|
|
33
37
|
REQUEST_BODY_SIZE_IN_BYTES_ATTRIBUTE_NAME,
|
|
38
|
+
SEARCH_READY_LLM_COMMAND_GENERATOR_CPU_USAGE_METRIC_NAME,
|
|
39
|
+
SEARCH_READY_LLM_COMMAND_GENERATOR_LLM_RESPONSE_DURATION_METRIC_NAME,
|
|
40
|
+
SEARCH_READY_LLM_COMMAND_GENERATOR_MEMORY_USAGE_METRIC_NAME,
|
|
41
|
+
SEARCH_READY_LLM_COMMAND_GENERATOR_PROMPT_TOKEN_USAGE_METRIC_NAME,
|
|
34
42
|
SINGLE_STEP_LLM_COMMAND_GENERATOR_CPU_USAGE_METRIC_NAME,
|
|
35
43
|
SINGLE_STEP_LLM_COMMAND_GENERATOR_LLM_RESPONSE_DURATION_METRIC_NAME,
|
|
36
44
|
SINGLE_STEP_LLM_COMMAND_GENERATOR_MEMORY_USAGE_METRIC_NAME,
|
|
@@ -40,7 +48,7 @@ from rasa.tracing.metric_instrument_provider import MetricInstrumentProvider
|
|
|
40
48
|
from rasa.utils.endpoints import EndpointConfig
|
|
41
49
|
|
|
42
50
|
|
|
43
|
-
def
|
|
51
|
+
def record_llm_based_component_cpu_usage(
|
|
44
52
|
metric_instrument_provider: MetricInstrumentProvider,
|
|
45
53
|
metric_name: str,
|
|
46
54
|
) -> None:
|
|
@@ -60,8 +68,10 @@ def record_llm_based_command_generator_cpu_usage(
|
|
|
60
68
|
cpu_usage = psutil.cpu_percent()
|
|
61
69
|
metric_instrument.record(amount=cpu_usage)
|
|
62
70
|
|
|
71
|
+
return None
|
|
63
72
|
|
|
64
|
-
|
|
73
|
+
|
|
74
|
+
def record_llm_based_component_memory_usage(
|
|
65
75
|
metric_instrument_provider: MetricInstrumentProvider,
|
|
66
76
|
metric_name: str,
|
|
67
77
|
) -> None:
|
|
@@ -81,8 +91,10 @@ def record_llm_based_command_generator_memory_usage(
|
|
|
81
91
|
memory_usage = psutil.virtual_memory().percent
|
|
82
92
|
metric_instrument.record(amount=memory_usage)
|
|
83
93
|
|
|
94
|
+
return None
|
|
95
|
+
|
|
84
96
|
|
|
85
|
-
def
|
|
97
|
+
def record_llm_based_component_prompt_token(
|
|
86
98
|
metric_instrument_provider: MetricInstrumentProvider,
|
|
87
99
|
attributes: Dict[str, Any],
|
|
88
100
|
metric_name: str,
|
|
@@ -116,6 +128,8 @@ def record_llm_based_command_generator_prompt_token(
|
|
|
116
128
|
amount=prompt_tokens_len,
|
|
117
129
|
)
|
|
118
130
|
|
|
131
|
+
return None
|
|
132
|
+
|
|
119
133
|
|
|
120
134
|
def record_llm_command_generator_metrics(attributes: Dict[str, Any]) -> None:
|
|
121
135
|
"""
|
|
@@ -132,17 +146,18 @@ def record_llm_command_generator_metrics(attributes: Dict[str, Any]) -> None:
|
|
|
132
146
|
if not instrument_provider.instruments:
|
|
133
147
|
return None
|
|
134
148
|
|
|
135
|
-
|
|
149
|
+
record_llm_based_component_cpu_usage(
|
|
136
150
|
instrument_provider, LLM_COMMAND_GENERATOR_CPU_USAGE_METRIC_NAME
|
|
137
151
|
)
|
|
138
|
-
|
|
152
|
+
record_llm_based_component_memory_usage(
|
|
139
153
|
instrument_provider, LLM_COMMAND_GENERATOR_MEMORY_USAGE_METRIC_NAME
|
|
140
154
|
)
|
|
141
|
-
|
|
155
|
+
record_llm_based_component_prompt_token(
|
|
142
156
|
instrument_provider,
|
|
143
157
|
attributes,
|
|
144
158
|
LLM_COMMAND_GENERATOR_PROMPT_TOKEN_USAGE_METRIC_NAME,
|
|
145
159
|
)
|
|
160
|
+
return None
|
|
146
161
|
|
|
147
162
|
|
|
148
163
|
def record_single_step_llm_command_generator_metrics(
|
|
@@ -162,17 +177,18 @@ def record_single_step_llm_command_generator_metrics(
|
|
|
162
177
|
if not instrument_provider.instruments:
|
|
163
178
|
return None
|
|
164
179
|
|
|
165
|
-
|
|
180
|
+
record_llm_based_component_cpu_usage(
|
|
166
181
|
instrument_provider, SINGLE_STEP_LLM_COMMAND_GENERATOR_CPU_USAGE_METRIC_NAME
|
|
167
182
|
)
|
|
168
|
-
|
|
183
|
+
record_llm_based_component_memory_usage(
|
|
169
184
|
instrument_provider, SINGLE_STEP_LLM_COMMAND_GENERATOR_MEMORY_USAGE_METRIC_NAME
|
|
170
185
|
)
|
|
171
|
-
|
|
186
|
+
record_llm_based_component_prompt_token(
|
|
172
187
|
instrument_provider,
|
|
173
188
|
attributes,
|
|
174
189
|
SINGLE_STEP_LLM_COMMAND_GENERATOR_PROMPT_TOKEN_USAGE_METRIC_NAME,
|
|
175
190
|
)
|
|
191
|
+
return None
|
|
176
192
|
|
|
177
193
|
|
|
178
194
|
def record_compact_llm_command_generator_metrics(
|
|
@@ -192,17 +208,49 @@ def record_compact_llm_command_generator_metrics(
|
|
|
192
208
|
if not instrument_provider.instruments:
|
|
193
209
|
return None
|
|
194
210
|
|
|
195
|
-
|
|
211
|
+
record_llm_based_component_cpu_usage(
|
|
196
212
|
instrument_provider, COMPACT_LLM_COMMAND_GENERATOR_CPU_USAGE_METRIC_NAME
|
|
197
213
|
)
|
|
198
|
-
|
|
214
|
+
record_llm_based_component_memory_usage(
|
|
199
215
|
instrument_provider, COMPACT_LLM_COMMAND_GENERATOR_MEMORY_USAGE_METRIC_NAME
|
|
200
216
|
)
|
|
201
|
-
|
|
217
|
+
record_llm_based_component_prompt_token(
|
|
202
218
|
instrument_provider,
|
|
203
219
|
attributes,
|
|
204
220
|
COMPACT_LLM_COMMAND_GENERATOR_PROMPT_TOKEN_USAGE_METRIC_NAME,
|
|
205
221
|
)
|
|
222
|
+
return None
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
def record_search_ready_llm_command_generator_metrics(
|
|
226
|
+
attributes: Dict[str, Any],
|
|
227
|
+
) -> None:
|
|
228
|
+
"""
|
|
229
|
+
Record measurements for SearchReadyLLMCommandGenerator specific metrics.
|
|
230
|
+
|
|
231
|
+
The recording is done by the opentelemetry.metrics.Histogram instruments.
|
|
232
|
+
These instruments are registered to the MetricInstrumentProvider internal singleton.
|
|
233
|
+
|
|
234
|
+
:param attributes: Extracted tracing attributes
|
|
235
|
+
:return: None
|
|
236
|
+
"""
|
|
237
|
+
instrument_provider = MetricInstrumentProvider()
|
|
238
|
+
|
|
239
|
+
if not instrument_provider.instruments:
|
|
240
|
+
return None
|
|
241
|
+
|
|
242
|
+
record_llm_based_component_cpu_usage(
|
|
243
|
+
instrument_provider, SEARCH_READY_LLM_COMMAND_GENERATOR_CPU_USAGE_METRIC_NAME
|
|
244
|
+
)
|
|
245
|
+
record_llm_based_component_memory_usage(
|
|
246
|
+
instrument_provider, SEARCH_READY_LLM_COMMAND_GENERATOR_MEMORY_USAGE_METRIC_NAME
|
|
247
|
+
)
|
|
248
|
+
record_llm_based_component_prompt_token(
|
|
249
|
+
instrument_provider,
|
|
250
|
+
attributes,
|
|
251
|
+
SEARCH_READY_LLM_COMMAND_GENERATOR_PROMPT_TOKEN_USAGE_METRIC_NAME,
|
|
252
|
+
)
|
|
253
|
+
return None
|
|
206
254
|
|
|
207
255
|
|
|
208
256
|
def record_multi_step_llm_command_generator_metrics(attributes: Dict[str, Any]) -> None:
|
|
@@ -220,17 +268,47 @@ def record_multi_step_llm_command_generator_metrics(attributes: Dict[str, Any])
|
|
|
220
268
|
if not instrument_provider.instruments:
|
|
221
269
|
return None
|
|
222
270
|
|
|
223
|
-
|
|
271
|
+
record_llm_based_component_cpu_usage(
|
|
224
272
|
instrument_provider, MULTI_STEP_LLM_COMMAND_GENERATOR_CPU_USAGE_METRIC_NAME
|
|
225
273
|
)
|
|
226
|
-
|
|
274
|
+
record_llm_based_component_memory_usage(
|
|
227
275
|
instrument_provider, MULTI_STEP_LLM_COMMAND_GENERATOR_MEMORY_USAGE_METRIC_NAME
|
|
228
276
|
)
|
|
229
|
-
|
|
277
|
+
record_llm_based_component_prompt_token(
|
|
230
278
|
instrument_provider,
|
|
231
279
|
attributes,
|
|
232
280
|
MULTI_STEP_LLM_COMMAND_GENERATOR_PROMPT_TOKEN_USAGE_METRIC_NAME,
|
|
233
281
|
)
|
|
282
|
+
return None
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
def record_enterprise_search_policy_metrics(attributes: Dict[str, Any]) -> None:
|
|
286
|
+
"""
|
|
287
|
+
Record measurements for EnterpriseSearchPolicy specific metrics.
|
|
288
|
+
|
|
289
|
+
The recording is done by the opentelemetry.metrics.Histogram instruments.
|
|
290
|
+
These instruments are registered to the MetricInstrumentProvider internal singleton.
|
|
291
|
+
|
|
292
|
+
:param attributes: Extracted tracing attributes
|
|
293
|
+
:return: None
|
|
294
|
+
"""
|
|
295
|
+
instrument_provider = MetricInstrumentProvider()
|
|
296
|
+
|
|
297
|
+
if not instrument_provider.instruments:
|
|
298
|
+
return None
|
|
299
|
+
|
|
300
|
+
record_llm_based_component_cpu_usage(
|
|
301
|
+
instrument_provider, ENTERPRISE_SEARCH_POLICY_CPU_USAGE_METRIC_NAME
|
|
302
|
+
)
|
|
303
|
+
record_llm_based_component_memory_usage(
|
|
304
|
+
instrument_provider, ENTERPRISE_SEARCH_POLICY_MEMORY_USAGE_METRIC_NAME
|
|
305
|
+
)
|
|
306
|
+
record_llm_based_component_prompt_token(
|
|
307
|
+
instrument_provider,
|
|
308
|
+
attributes,
|
|
309
|
+
ENTERPRISE_SEARCH_POLICY_PROMPT_TOKEN_USAGE_METRIC_NAME,
|
|
310
|
+
)
|
|
311
|
+
return None
|
|
234
312
|
|
|
235
313
|
|
|
236
314
|
def record_callable_duration_metrics(
|
|
@@ -276,6 +354,11 @@ def record_callable_duration_metrics(
|
|
|
276
354
|
COMPACT_LLM_COMMAND_GENERATOR_LLM_RESPONSE_DURATION_METRIC_NAME
|
|
277
355
|
)
|
|
278
356
|
|
|
357
|
+
if type(self) == SearchReadyLLMCommandGenerator:
|
|
358
|
+
metric_instrument = instrument_provider.get_instrument(
|
|
359
|
+
SEARCH_READY_LLM_COMMAND_GENERATOR_LLM_RESPONSE_DURATION_METRIC_NAME
|
|
360
|
+
)
|
|
361
|
+
|
|
279
362
|
if type(self) == MultiStepLLMCommandGenerator:
|
|
280
363
|
metric_instrument = instrument_provider.get_instrument(
|
|
281
364
|
MULTI_STEP_LLM_COMMAND_GENERATOR_LLM_RESPONSE_DURATION_METRIC_NAME
|
|
@@ -10,7 +10,10 @@ from rasa.tracing.constants import (
|
|
|
10
10
|
COMPACT_LLM_COMMAND_GENERATOR_PROMPT_TOKEN_USAGE_METRIC_NAME,
|
|
11
11
|
CONTEXTUAL_RESPONSE_REPHRASER_LLM_RESPONSE_DURATION_METRIC_NAME,
|
|
12
12
|
DURATION_UNIT_NAME,
|
|
13
|
+
ENTERPRISE_SEARCH_POLICY_CPU_USAGE_METRIC_NAME,
|
|
13
14
|
ENTERPRISE_SEARCH_POLICY_LLM_RESPONSE_DURATION_METRIC_NAME,
|
|
15
|
+
ENTERPRISE_SEARCH_POLICY_MEMORY_USAGE_METRIC_NAME,
|
|
16
|
+
ENTERPRISE_SEARCH_POLICY_PROMPT_TOKEN_USAGE_METRIC_NAME,
|
|
14
17
|
INTENTLESS_POLICY_LLM_RESPONSE_DURATION_METRIC_NAME,
|
|
15
18
|
LLM_BASED_COMMAND_GENERATOR_CPU_MEMORY_USAGE_UNIT_NAME,
|
|
16
19
|
LLM_COMMAND_GENERATOR_CPU_USAGE_METRIC_NAME,
|
|
@@ -23,6 +26,10 @@ from rasa.tracing.constants import (
|
|
|
23
26
|
MULTI_STEP_LLM_COMMAND_GENERATOR_PROMPT_TOKEN_USAGE_METRIC_NAME,
|
|
24
27
|
RASA_CLIENT_REQUEST_BODY_SIZE_METRIC_NAME,
|
|
25
28
|
RASA_CLIENT_REQUEST_DURATION_METRIC_NAME,
|
|
29
|
+
SEARCH_READY_LLM_COMMAND_GENERATOR_CPU_USAGE_METRIC_NAME,
|
|
30
|
+
SEARCH_READY_LLM_COMMAND_GENERATOR_LLM_RESPONSE_DURATION_METRIC_NAME,
|
|
31
|
+
SEARCH_READY_LLM_COMMAND_GENERATOR_MEMORY_USAGE_METRIC_NAME,
|
|
32
|
+
SEARCH_READY_LLM_COMMAND_GENERATOR_PROMPT_TOKEN_USAGE_METRIC_NAME,
|
|
26
33
|
SINGLE_STEP_LLM_COMMAND_GENERATOR_CPU_USAGE_METRIC_NAME,
|
|
27
34
|
SINGLE_STEP_LLM_COMMAND_GENERATOR_LLM_RESPONSE_DURATION_METRIC_NAME,
|
|
28
35
|
SINGLE_STEP_LLM_COMMAND_GENERATOR_MEMORY_USAGE_METRIC_NAME,
|
|
@@ -48,7 +55,9 @@ class MetricInstrumentProvider(metaclass=Singleton):
|
|
|
48
55
|
**self._create_llm_command_generator_instruments(meter),
|
|
49
56
|
**self._create_single_step_llm_command_generator_instruments(meter),
|
|
50
57
|
**self._create_compact_llm_command_generator_instruments(meter),
|
|
58
|
+
**self._create_search_ready_llm_command_generator_instruments(meter),
|
|
51
59
|
**self._create_multi_step_llm_command_generator_instruments(meter),
|
|
60
|
+
**self._create_enterprise_search_policy_instruments(meter),
|
|
52
61
|
**self._create_llm_response_duration_instruments(meter),
|
|
53
62
|
**self._create_client_request_instruments(meter),
|
|
54
63
|
}
|
|
@@ -162,6 +171,41 @@ class MetricInstrumentProvider(metaclass=Singleton):
|
|
|
162
171
|
COMPACT_LLM_COMMAND_GENERATOR_LLM_RESPONSE_DURATION_METRIC_NAME: compact_llm_response_duration_llm_command_generator, # noqa: E501
|
|
163
172
|
}
|
|
164
173
|
|
|
174
|
+
@staticmethod
|
|
175
|
+
def _create_search_ready_llm_command_generator_instruments(
|
|
176
|
+
meter: Meter,
|
|
177
|
+
) -> Dict[str, Any]:
|
|
178
|
+
search_ready_llm_command_generator_cpu_usage = meter.create_histogram(
|
|
179
|
+
name=SEARCH_READY_LLM_COMMAND_GENERATOR_CPU_USAGE_METRIC_NAME,
|
|
180
|
+
description="CPU percentage for SearchReadyLLMCommandGenerator",
|
|
181
|
+
unit=LLM_BASED_COMMAND_GENERATOR_CPU_MEMORY_USAGE_UNIT_NAME,
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
search_ready_llm_command_generator_memory_usage = meter.create_histogram(
|
|
185
|
+
name=SEARCH_READY_LLM_COMMAND_GENERATOR_MEMORY_USAGE_METRIC_NAME,
|
|
186
|
+
description="RAM memory usage for SearchReadyLLMCommandGenerator",
|
|
187
|
+
unit=LLM_BASED_COMMAND_GENERATOR_CPU_MEMORY_USAGE_UNIT_NAME,
|
|
188
|
+
)
|
|
189
|
+
|
|
190
|
+
search_ready_llm_command_generator_prompt_token_usage = meter.create_histogram(
|
|
191
|
+
name=SEARCH_READY_LLM_COMMAND_GENERATOR_PROMPT_TOKEN_USAGE_METRIC_NAME,
|
|
192
|
+
description="SearchReadyLLMCommandGenerator prompt token length",
|
|
193
|
+
unit="1",
|
|
194
|
+
)
|
|
195
|
+
|
|
196
|
+
search_ready_llm_response_duration_command_generator = meter.create_histogram(
|
|
197
|
+
name=SEARCH_READY_LLM_COMMAND_GENERATOR_LLM_RESPONSE_DURATION_METRIC_NAME,
|
|
198
|
+
description="The duration of SearchReadyLLMCommandGenerator's LLM call",
|
|
199
|
+
unit=DURATION_UNIT_NAME,
|
|
200
|
+
)
|
|
201
|
+
|
|
202
|
+
return {
|
|
203
|
+
SEARCH_READY_LLM_COMMAND_GENERATOR_CPU_USAGE_METRIC_NAME: search_ready_llm_command_generator_cpu_usage, # noqa: E501
|
|
204
|
+
SEARCH_READY_LLM_COMMAND_GENERATOR_MEMORY_USAGE_METRIC_NAME: search_ready_llm_command_generator_memory_usage, # noqa: E501
|
|
205
|
+
SEARCH_READY_LLM_COMMAND_GENERATOR_PROMPT_TOKEN_USAGE_METRIC_NAME: search_ready_llm_command_generator_prompt_token_usage, # noqa: E501
|
|
206
|
+
SEARCH_READY_LLM_COMMAND_GENERATOR_LLM_RESPONSE_DURATION_METRIC_NAME: search_ready_llm_response_duration_command_generator, # noqa: E501
|
|
207
|
+
}
|
|
208
|
+
|
|
165
209
|
@staticmethod
|
|
166
210
|
def _create_multi_step_llm_command_generator_instruments(
|
|
167
211
|
meter: Meter,
|
|
@@ -198,13 +242,42 @@ class MetricInstrumentProvider(metaclass=Singleton):
|
|
|
198
242
|
}
|
|
199
243
|
|
|
200
244
|
@staticmethod
|
|
201
|
-
def
|
|
202
|
-
|
|
245
|
+
def _create_enterprise_search_policy_instruments(
|
|
246
|
+
meter: Meter,
|
|
247
|
+
) -> Dict[str, Any]:
|
|
248
|
+
enterprise_search_policy_cpu_usage = meter.create_histogram(
|
|
249
|
+
name=ENTERPRISE_SEARCH_POLICY_CPU_USAGE_METRIC_NAME,
|
|
250
|
+
description="CPU percentage for EnterpriseSearchPolicy",
|
|
251
|
+
unit=LLM_BASED_COMMAND_GENERATOR_CPU_MEMORY_USAGE_UNIT_NAME,
|
|
252
|
+
)
|
|
253
|
+
|
|
254
|
+
enterprise_search_policy_memory_usage = meter.create_histogram(
|
|
255
|
+
name=ENTERPRISE_SEARCH_POLICY_MEMORY_USAGE_METRIC_NAME,
|
|
256
|
+
description="RAM memory usage for EnterpriseSearchPolicy",
|
|
257
|
+
unit=LLM_BASED_COMMAND_GENERATOR_CPU_MEMORY_USAGE_UNIT_NAME,
|
|
258
|
+
)
|
|
259
|
+
|
|
260
|
+
enterprise_search_policy_prompt_token_usage = meter.create_histogram(
|
|
261
|
+
name=ENTERPRISE_SEARCH_POLICY_PROMPT_TOKEN_USAGE_METRIC_NAME,
|
|
262
|
+
description="EnterpriseSearchPolicy prompt token length",
|
|
263
|
+
unit="1",
|
|
264
|
+
)
|
|
265
|
+
|
|
266
|
+
enterprise_search_policy_llm_response_duration = meter.create_histogram(
|
|
203
267
|
name=ENTERPRISE_SEARCH_POLICY_LLM_RESPONSE_DURATION_METRIC_NAME,
|
|
204
268
|
description="The duration of EnterpriseSearchPolicy's LLM call",
|
|
205
269
|
unit=DURATION_UNIT_NAME,
|
|
206
270
|
)
|
|
207
271
|
|
|
272
|
+
return {
|
|
273
|
+
ENTERPRISE_SEARCH_POLICY_CPU_USAGE_METRIC_NAME: enterprise_search_policy_cpu_usage, # noqa: E501
|
|
274
|
+
ENTERPRISE_SEARCH_POLICY_MEMORY_USAGE_METRIC_NAME: enterprise_search_policy_memory_usage, # noqa: E501
|
|
275
|
+
ENTERPRISE_SEARCH_POLICY_PROMPT_TOKEN_USAGE_METRIC_NAME: enterprise_search_policy_prompt_token_usage, # noqa: E501
|
|
276
|
+
ENTERPRISE_SEARCH_POLICY_LLM_RESPONSE_DURATION_METRIC_NAME: enterprise_search_policy_llm_response_duration, # noqa: E501
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
@staticmethod
|
|
280
|
+
def _create_llm_response_duration_instruments(meter: Meter) -> Dict[str, Any]:
|
|
208
281
|
llm_response_duration_intentless = meter.create_histogram(
|
|
209
282
|
name=INTENTLESS_POLICY_LLM_RESPONSE_DURATION_METRIC_NAME,
|
|
210
283
|
description="The duration of IntentlessPolicy's LLM call",
|
|
@@ -218,7 +291,6 @@ class MetricInstrumentProvider(metaclass=Singleton):
|
|
|
218
291
|
)
|
|
219
292
|
|
|
220
293
|
return {
|
|
221
|
-
ENTERPRISE_SEARCH_POLICY_LLM_RESPONSE_DURATION_METRIC_NAME: llm_response_duration_enterprise_search, # noqa: E501
|
|
222
294
|
INTENTLESS_POLICY_LLM_RESPONSE_DURATION_METRIC_NAME: llm_response_duration_intentless, # noqa: E501
|
|
223
295
|
CONTEXTUAL_RESPONSE_REPHRASER_LLM_RESPONSE_DURATION_METRIC_NAME: llm_response_duration_contextual_nlg, # noqa: E501
|
|
224
296
|
}
|
rasa/utils/common.py
CHANGED
|
@@ -29,7 +29,6 @@ import numpy as np
|
|
|
29
29
|
|
|
30
30
|
import rasa.shared.utils.io
|
|
31
31
|
import rasa.utils.io
|
|
32
|
-
from rasa.anonymization import ENV_LOG_LEVEL_FAKER, ENV_LOG_LEVEL_PRESIDIO
|
|
33
32
|
from rasa.constants import (
|
|
34
33
|
DEFAULT_LOG_LEVEL_LIBRARIES,
|
|
35
34
|
ENV_LOG_LEVEL_KAFKA,
|
|
@@ -48,11 +47,12 @@ T = TypeVar("T")
|
|
|
48
47
|
|
|
49
48
|
EXPECTED_WARNINGS: List[Tuple[Type[Warning], str]] = [
|
|
50
49
|
# TODO (issue #9932)
|
|
50
|
+
# DM1 warnings
|
|
51
51
|
(
|
|
52
52
|
np.VisibleDeprecationWarning,
|
|
53
53
|
"Creating an ndarray from ragged nested sequences.*",
|
|
54
54
|
),
|
|
55
|
-
# raised by
|
|
55
|
+
# raised by magic_filter, google rpc
|
|
56
56
|
# and probably other dependencies that use pkg_resources instead of importlib
|
|
57
57
|
(DeprecationWarning, ".*pkg_resources.*"),
|
|
58
58
|
# This warning is triggered by sanic-cors 2.0.0 and by langchain -> faiss.
|
|
@@ -94,6 +94,41 @@ EXPECTED_WARNINGS: List[Tuple[Type[Warning], str]] = [
|
|
|
94
94
|
DeprecationWarning,
|
|
95
95
|
"https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy",
|
|
96
96
|
),
|
|
97
|
+
# CALM warnings
|
|
98
|
+
# Ignore deprecation warning for ml_dtypes.float8_e4m3b11
|
|
99
|
+
(
|
|
100
|
+
DeprecationWarning,
|
|
101
|
+
"ml_dtypes.float8_e4m3b11 is deprecated. Use ml_dtypes.float8_e4m3b11fnuz",
|
|
102
|
+
),
|
|
103
|
+
# Ignore deprecation warning for the load_module() method
|
|
104
|
+
(
|
|
105
|
+
DeprecationWarning,
|
|
106
|
+
"the load_module\\(\\) method is deprecated and slated for removal*",
|
|
107
|
+
),
|
|
108
|
+
# Ignore deprecation warning for the rule-based policy
|
|
109
|
+
(
|
|
110
|
+
UserWarning,
|
|
111
|
+
"Found a rule-based policy in your configuration but no rule-based training*",
|
|
112
|
+
),
|
|
113
|
+
# Ignore deprecation warning for the TEDPolicy
|
|
114
|
+
(
|
|
115
|
+
UserWarning,
|
|
116
|
+
"Skipping training of `TEDPolicy` as no data was provided.*",
|
|
117
|
+
),
|
|
118
|
+
# Ignore deprecation warning for the LexicalSyntacticFeaturizer
|
|
119
|
+
(
|
|
120
|
+
UserWarning,
|
|
121
|
+
"No lexical syntactic features could be extracted from the training data.*",
|
|
122
|
+
),
|
|
123
|
+
# Ignore deprecation warning for the LexicalSyntacticFeaturizer2
|
|
124
|
+
(
|
|
125
|
+
UserWarning,
|
|
126
|
+
"The LexicalSyntacticFeaturizer run_LexicalSyntacticFeaturizer2 has not been*",
|
|
127
|
+
),
|
|
128
|
+
(
|
|
129
|
+
FutureWarning,
|
|
130
|
+
"'request_timeout' is deprecated and will be removed in 4.0.0. Use 'timeout'*",
|
|
131
|
+
),
|
|
97
132
|
]
|
|
98
133
|
|
|
99
134
|
PYTHON_LOGGING_SCHEMA_DOCS = (
|
|
@@ -245,8 +280,6 @@ def configure_library_logging() -> None:
|
|
|
245
280
|
update_matplotlib_log_level(library_log_level)
|
|
246
281
|
update_kafka_log_level(library_log_level)
|
|
247
282
|
update_rabbitmq_log_level(library_log_level)
|
|
248
|
-
update_presidio_log_level(library_log_level)
|
|
249
|
-
update_faker_log_level(library_log_level)
|
|
250
283
|
|
|
251
284
|
|
|
252
285
|
def update_apscheduler_log_level() -> None:
|
|
@@ -371,29 +404,6 @@ def update_rabbitmq_log_level(library_log_level: Text) -> None:
|
|
|
371
404
|
logging.getLogger("aiormq").setLevel(log_level)
|
|
372
405
|
|
|
373
406
|
|
|
374
|
-
def update_presidio_log_level(library_log_level: Text) -> None:
|
|
375
|
-
"""Set the log level of presidio.
|
|
376
|
-
|
|
377
|
-
Uses the library specific log level or the general libraries log level.
|
|
378
|
-
"""
|
|
379
|
-
log_level = os.environ.get(ENV_LOG_LEVEL_PRESIDIO, library_log_level)
|
|
380
|
-
presidio_loggers = ["presidio_analyzer", "presidio_anonymizer"]
|
|
381
|
-
|
|
382
|
-
for logger_name in presidio_loggers:
|
|
383
|
-
logging.getLogger(logger_name).setLevel(log_level)
|
|
384
|
-
logging.getLogger(logger_name).propagate = False
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
def update_faker_log_level(library_log_level: Text) -> None:
|
|
388
|
-
"""Set the log level of faker.
|
|
389
|
-
|
|
390
|
-
Uses the library specific log level or the general libraries log level.
|
|
391
|
-
"""
|
|
392
|
-
log_level = os.environ.get(ENV_LOG_LEVEL_FAKER, library_log_level)
|
|
393
|
-
logging.getLogger("faker").setLevel(log_level)
|
|
394
|
-
logging.getLogger("faker").propagate = False
|
|
395
|
-
|
|
396
|
-
|
|
397
407
|
def sort_list_of_dicts_by_first_key(dicts: List[Dict]) -> List[Dict]:
|
|
398
408
|
"""Sorts a list of dictionaries by their first key."""
|
|
399
409
|
return sorted(dicts, key=lambda d: next(iter(d.keys())))
|
rasa/utils/endpoints.py
CHANGED
|
@@ -190,7 +190,13 @@ class EndpointConfig:
|
|
|
190
190
|
sslcontext = None
|
|
191
191
|
if self.cafile:
|
|
192
192
|
try:
|
|
193
|
-
|
|
193
|
+
# create a SSL context with the provided CA file
|
|
194
|
+
# and set the minimum TLS version to 1.2
|
|
195
|
+
# Purpose is set to SERVER_AUTH to verify the server's certificate
|
|
196
|
+
sslcontext = ssl.create_default_context(
|
|
197
|
+
purpose=ssl.Purpose.SERVER_AUTH, cafile=self.cafile
|
|
198
|
+
)
|
|
199
|
+
sslcontext.minimum_version = ssl.TLSVersion.TLSv1_2
|
|
194
200
|
except FileNotFoundError as e:
|
|
195
201
|
raise FileNotFoundException(
|
|
196
202
|
f"Failed to find certificate file, "
|
|
@@ -233,6 +239,21 @@ class EndpointConfig:
|
|
|
233
239
|
**self.kwargs,
|
|
234
240
|
)
|
|
235
241
|
|
|
242
|
+
def to_dict(self) -> Dict[Text, Any]:
|
|
243
|
+
"""Convert the endpoint config to a dictionary."""
|
|
244
|
+
data = {
|
|
245
|
+
"url": self.url,
|
|
246
|
+
"params": self.params,
|
|
247
|
+
"headers": self.headers,
|
|
248
|
+
"basic_auth": self.basic_auth,
|
|
249
|
+
"token": self.token,
|
|
250
|
+
"token_name": self.token_name,
|
|
251
|
+
"cafile": self.cafile,
|
|
252
|
+
"actions_module": self.actions_module,
|
|
253
|
+
}
|
|
254
|
+
data.update(self.kwargs)
|
|
255
|
+
return data
|
|
256
|
+
|
|
236
257
|
def __eq__(self, other: Any) -> bool:
|
|
237
258
|
if isinstance(self, type(other)):
|
|
238
259
|
return (
|
rasa/utils/licensing.py
CHANGED
|
@@ -15,12 +15,10 @@ from dotenv import dotenv_values
|
|
|
15
15
|
from sanic import Sanic
|
|
16
16
|
|
|
17
17
|
from rasa import telemetry
|
|
18
|
-
from rasa.core import jobs
|
|
19
18
|
from rasa.shared.utils.cli import print_error_and_exit
|
|
20
19
|
|
|
21
20
|
if typing.TYPE_CHECKING:
|
|
22
|
-
from rasa.core.tracker_store import TrackerStore
|
|
23
|
-
|
|
21
|
+
from rasa.core.tracker_stores.tracker_store import TrackerStore
|
|
24
22
|
|
|
25
23
|
LICENSE_ENV_VAR = "RASA_PRO_LICENSE"
|
|
26
24
|
ALGORITHM = "RS256"
|
|
@@ -506,6 +504,7 @@ async def _schedule_conversation_counting(
|
|
|
506
504
|
app: Sanic, tracker_store: Optional["TrackerStore"], max_number_conversations: int
|
|
507
505
|
) -> None:
|
|
508
506
|
"""Schedule a job counting the number of conversations in the current month."""
|
|
507
|
+
from rasa.core import jobs
|
|
509
508
|
|
|
510
509
|
async def conversation_counting_job(
|
|
511
510
|
app: Sanic,
|
rasa/utils/log_utils.py
CHANGED
|
@@ -3,14 +3,13 @@ from __future__ import annotations
|
|
|
3
3
|
import logging
|
|
4
4
|
import os
|
|
5
5
|
import sys
|
|
6
|
-
from typing import Any,
|
|
6
|
+
from typing import Any, Optional
|
|
7
7
|
|
|
8
8
|
import structlog
|
|
9
9
|
from structlog.dev import ConsoleRenderer
|
|
10
10
|
from structlog.typing import EventDict, WrappedLogger
|
|
11
11
|
from structlog_sentry import SentryProcessor
|
|
12
12
|
|
|
13
|
-
from rasa.plugin import plugin_manager
|
|
14
13
|
from rasa.shared.constants import (
|
|
15
14
|
DEFAULT_LOG_LEVEL,
|
|
16
15
|
DEFAULT_LOG_LEVEL_LLM,
|
|
@@ -35,48 +34,6 @@ class HumanConsoleRenderer(ConsoleRenderer):
|
|
|
35
34
|
return super().__call__(logger, name, event_dict)
|
|
36
35
|
|
|
37
36
|
|
|
38
|
-
def _anonymizer(
|
|
39
|
-
_: structlog.BoundLogger, __: str, event_dict: Dict[str, Any]
|
|
40
|
-
) -> Dict[str, Any]:
|
|
41
|
-
"""Anonymizes event dict."""
|
|
42
|
-
anonymizable_keys = [
|
|
43
|
-
"text",
|
|
44
|
-
"response_text",
|
|
45
|
-
"user_text",
|
|
46
|
-
"slots",
|
|
47
|
-
"parse_data_text",
|
|
48
|
-
"parse_data_entities",
|
|
49
|
-
"prediction_events",
|
|
50
|
-
"tracker_latest_message",
|
|
51
|
-
"prefilled_slots",
|
|
52
|
-
"message",
|
|
53
|
-
"response",
|
|
54
|
-
"slot_candidates",
|
|
55
|
-
"rasa_event",
|
|
56
|
-
"rasa_events",
|
|
57
|
-
"tracker_states",
|
|
58
|
-
"current_states",
|
|
59
|
-
"old_states",
|
|
60
|
-
"current_states",
|
|
61
|
-
"successes",
|
|
62
|
-
"current_entity",
|
|
63
|
-
"next_entity",
|
|
64
|
-
"states",
|
|
65
|
-
"entity",
|
|
66
|
-
"token_text",
|
|
67
|
-
"user_message",
|
|
68
|
-
"json_message",
|
|
69
|
-
]
|
|
70
|
-
anonymization_pipeline = plugin_manager().hook.get_anonymization_pipeline()
|
|
71
|
-
|
|
72
|
-
if anonymization_pipeline:
|
|
73
|
-
for key in anonymizable_keys:
|
|
74
|
-
if key in event_dict:
|
|
75
|
-
anonymized_value = anonymization_pipeline.log_run(event_dict[key])
|
|
76
|
-
event_dict[key] = anonymized_value
|
|
77
|
-
return event_dict
|
|
78
|
-
|
|
79
|
-
|
|
80
37
|
def configure_structlog(
|
|
81
38
|
log_level: Optional[int] = None,
|
|
82
39
|
include_time: bool = False,
|
|
@@ -95,7 +52,6 @@ def configure_structlog(
|
|
|
95
52
|
)
|
|
96
53
|
|
|
97
54
|
shared_processors = [
|
|
98
|
-
_anonymizer,
|
|
99
55
|
# Processors that have nothing to do with output,
|
|
100
56
|
# e.g., add timestamps or log level names.
|
|
101
57
|
# If log level is too low, abort pipeline and throw away log entry.
|
rasa/validator.py
CHANGED
|
@@ -630,11 +630,14 @@ class Validator:
|
|
|
630
630
|
flow_id: str,
|
|
631
631
|
) -> bool:
|
|
632
632
|
"""Validates that a collect step can have either an action or an utterance.
|
|
633
|
+
|
|
633
634
|
Also logs an error if neither an action nor an utterance is defined.
|
|
634
635
|
|
|
635
636
|
Args:
|
|
636
637
|
collect: the name of the slot to collect
|
|
637
638
|
all_good: boolean value indicating the validation status
|
|
639
|
+
domain_slots: the slots of the domain
|
|
640
|
+
flow_id: the id of the flow
|
|
638
641
|
|
|
639
642
|
Returns:
|
|
640
643
|
False, if validation failed, true, otherwise
|
|
@@ -683,9 +686,10 @@ class Validator:
|
|
|
683
686
|
has_action_defined=has_action_defined,
|
|
684
687
|
flow=flow_id,
|
|
685
688
|
event_info=(
|
|
686
|
-
f"The collect step '{collect.collect}' has neither
|
|
687
|
-
f"nor an action defined,
|
|
688
|
-
f"You
|
|
689
|
+
f"The collect step '{collect.collect}' has neither a response "
|
|
690
|
+
f"nor an action defined, nor an initial value defined in the "
|
|
691
|
+
f"domain. You can fix this by adding a response named "
|
|
692
|
+
f"'{collect.utter}' used in the collect step."
|
|
689
693
|
),
|
|
690
694
|
)
|
|
691
695
|
all_good = False
|
|
@@ -1014,11 +1018,6 @@ class Validator:
|
|
|
1014
1018
|
for sv in slot_value
|
|
1015
1019
|
]
|
|
1016
1020
|
if not all(slot_values_validity):
|
|
1017
|
-
invalid_slot_values = [
|
|
1018
|
-
sv
|
|
1019
|
-
for (sv, slot_value_valid) in zip(slot_value, slot_values_validity)
|
|
1020
|
-
if not slot_value_valid
|
|
1021
|
-
]
|
|
1022
1021
|
structlogger.error(
|
|
1023
1022
|
"validator.verify_predicates.link.invalid_condition",
|
|
1024
1023
|
step=step_id,
|
|
@@ -1027,8 +1026,7 @@ class Validator:
|
|
|
1027
1026
|
event_info=(
|
|
1028
1027
|
f"Detected invalid condition '{link_condition}' "
|
|
1029
1028
|
f"at step '{step_id}' for flow id '{flow_id}'. "
|
|
1030
|
-
f"
|
|
1031
|
-
f"for slot {slot_name}. "
|
|
1029
|
+
f"The condition contains invalid values for slot {slot_name}. "
|
|
1032
1030
|
f"Please make sure that all conditions are valid."
|
|
1033
1031
|
),
|
|
1034
1032
|
)
|
|
@@ -1998,7 +1996,7 @@ class Validator:
|
|
|
1998
1996
|
"validator.validate_conditional_response_variation_predicates.invalid_slot",
|
|
1999
1997
|
utter=utter_name,
|
|
2000
1998
|
event_info=(
|
|
2001
|
-
f"Detected invalid slot '{slot_namespace[
|
|
1999
|
+
f"Detected invalid slot '{slot_namespace[0]}' in "
|
|
2002
2000
|
f"condition '{condition}' for response variation "
|
|
2003
2001
|
f"'{utter_name}'. Please make sure that all slots "
|
|
2004
2002
|
f"are specified in the domain file."
|
rasa/version.py
CHANGED