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
rasa/tracing/config.py
CHANGED
|
@@ -23,15 +23,13 @@ from rasa.core.actions.custom_action_executor import (
|
|
|
23
23
|
from rasa.core.actions.grpc_custom_action_executor import GRPCCustomActionExecutor
|
|
24
24
|
from rasa.core.agent import Agent
|
|
25
25
|
from rasa.core.processor import MessageProcessor
|
|
26
|
-
from rasa.core.tracker_store import TrackerStore
|
|
27
|
-
from rasa.dialogue_understanding.commands import
|
|
28
|
-
Command,
|
|
29
|
-
FreeFormAnswerCommand,
|
|
30
|
-
)
|
|
26
|
+
from rasa.core.tracker_stores.tracker_store import TrackerStore
|
|
27
|
+
from rasa.dialogue_understanding.commands import Command, FreeFormAnswerCommand
|
|
31
28
|
from rasa.dialogue_understanding.generator import (
|
|
32
29
|
CompactLLMCommandGenerator,
|
|
33
30
|
LLMCommandGenerator,
|
|
34
31
|
MultiStepLLMCommandGenerator,
|
|
32
|
+
SearchReadyLLMCommandGenerator,
|
|
35
33
|
SingleStepLLMCommandGenerator,
|
|
36
34
|
)
|
|
37
35
|
from rasa.dialogue_understanding.generator.flow_retrieval import FlowRetrieval
|
|
@@ -112,6 +110,7 @@ def configure_tracing(tracer_provider: Optional[TracerProvider]) -> None:
|
|
|
112
110
|
grpc_custom_action_executor_class=GRPCCustomActionExecutor,
|
|
113
111
|
single_step_llm_command_generator_class=SingleStepLLMCommandGenerator,
|
|
114
112
|
compact_llm_command_generator_class=CompactLLMCommandGenerator,
|
|
113
|
+
search_ready_llm_command_generator_class=SearchReadyLLMCommandGenerator,
|
|
115
114
|
multi_step_llm_command_generator_class=MultiStepLLMCommandGenerator,
|
|
116
115
|
custom_action_executor_subclasses=custom_action_executor_subclasses,
|
|
117
116
|
flow_retrieval_class=FlowRetrieval,
|
rasa/tracing/constants.py
CHANGED
|
@@ -44,6 +44,18 @@ COMPACT_LLM_COMMAND_GENERATOR_PROMPT_TOKEN_USAGE_METRIC_NAME = (
|
|
|
44
44
|
COMPACT_LLM_COMMAND_GENERATOR_LLM_RESPONSE_DURATION_METRIC_NAME = (
|
|
45
45
|
"compact_llm_command_generator_llm_response_duration"
|
|
46
46
|
)
|
|
47
|
+
SEARCH_READY_LLM_COMMAND_GENERATOR_CPU_USAGE_METRIC_NAME = (
|
|
48
|
+
"search_ready_llm_command_generator_cpu_usage"
|
|
49
|
+
)
|
|
50
|
+
SEARCH_READY_LLM_COMMAND_GENERATOR_MEMORY_USAGE_METRIC_NAME = (
|
|
51
|
+
"search_ready_llm_command_generator_memory_usage"
|
|
52
|
+
)
|
|
53
|
+
SEARCH_READY_LLM_COMMAND_GENERATOR_PROMPT_TOKEN_USAGE_METRIC_NAME = (
|
|
54
|
+
"search_ready_llm_command_generator_prompt_token_usage"
|
|
55
|
+
)
|
|
56
|
+
SEARCH_READY_LLM_COMMAND_GENERATOR_LLM_RESPONSE_DURATION_METRIC_NAME = (
|
|
57
|
+
"search_ready_llm_command_generator_llm_response_duration"
|
|
58
|
+
)
|
|
47
59
|
MULTI_STEP_LLM_COMMAND_GENERATOR_CPU_USAGE_METRIC_NAME = (
|
|
48
60
|
"multi_step_llm_command_generator_cpu_usage"
|
|
49
61
|
)
|
|
@@ -56,7 +68,13 @@ MULTI_STEP_LLM_COMMAND_GENERATOR_PROMPT_TOKEN_USAGE_METRIC_NAME = (
|
|
|
56
68
|
MULTI_STEP_LLM_COMMAND_GENERATOR_LLM_RESPONSE_DURATION_METRIC_NAME = (
|
|
57
69
|
"multi_step_llm_command_generator_llm_response_duration"
|
|
58
70
|
)
|
|
59
|
-
|
|
71
|
+
ENTERPRISE_SEARCH_POLICY_CPU_USAGE_METRIC_NAME = "enterprise_search_policy_cpu_usage"
|
|
72
|
+
ENTERPRISE_SEARCH_POLICY_MEMORY_USAGE_METRIC_NAME = (
|
|
73
|
+
"enterprise_search_policy_memory_usage"
|
|
74
|
+
)
|
|
75
|
+
ENTERPRISE_SEARCH_POLICY_PROMPT_TOKEN_USAGE_METRIC_NAME = (
|
|
76
|
+
"enterprise_search_policy_prompt_token_usage"
|
|
77
|
+
)
|
|
60
78
|
ENTERPRISE_SEARCH_POLICY_LLM_RESPONSE_DURATION_METRIC_NAME = (
|
|
61
79
|
"enterprise_search_policy_llm_response_duration"
|
|
62
80
|
)
|
|
@@ -16,14 +16,20 @@ from rasa.core.channels import UserMessage
|
|
|
16
16
|
from rasa.core.lock_store import LOCK_LIFETIME, LockStore
|
|
17
17
|
from rasa.core.nlg.contextual_response_rephraser import ContextualResponseRephraser
|
|
18
18
|
from rasa.core.processor import MessageProcessor
|
|
19
|
-
from rasa.core.tracker_store import TrackerStore
|
|
19
|
+
from rasa.core.tracker_stores.tracker_store import TrackerStore
|
|
20
20
|
from rasa.dialogue_understanding.commands import Command
|
|
21
21
|
from rasa.dialogue_understanding.generator import LLMBasedCommandGenerator
|
|
22
22
|
from rasa.dialogue_understanding.generator.constants import FLOW_RETRIEVAL_KEY
|
|
23
23
|
from rasa.dialogue_understanding.stack.dialogue_stack import DialogueStack
|
|
24
24
|
from rasa.dialogue_understanding_test.du_test_result import (
|
|
25
|
+
KEY_COMMANDS_F1_MACRO,
|
|
26
|
+
KEY_COMMANDS_F1_MICRO,
|
|
27
|
+
KEY_COMMANDS_F1_WEIGHTED,
|
|
25
28
|
KEY_TEST_CASES_ACCURACY,
|
|
26
29
|
KEY_USER_UTTERANCES_ACCURACY,
|
|
30
|
+
OUTPUT_COMMANDS_F1_MACRO_INSTRUMENTATION_ATTR,
|
|
31
|
+
OUTPUT_COMMANDS_F1_MICRO_INSTRUMENTATION_ATTR,
|
|
32
|
+
OUTPUT_COMMANDS_F1_WEIGHTED_INSTRUMENTATION_ATTR,
|
|
27
33
|
OUTPUT_COMPLETION_TOKEN_METRICS,
|
|
28
34
|
OUTPUT_LATENCY_METRICS,
|
|
29
35
|
OUTPUT_NAMES_OF_FAILED_TESTS,
|
|
@@ -58,7 +64,10 @@ from rasa.shared.core.trackers import DialogueStateTracker
|
|
|
58
64
|
from rasa.shared.core.training_data.structures import StoryGraph
|
|
59
65
|
from rasa.shared.importers.importer import TrainingDataImporter
|
|
60
66
|
from rasa.shared.nlu.constants import INTENT_NAME_KEY, SET_SLOT_COMMAND
|
|
61
|
-
from rasa.shared.utils.llm import
|
|
67
|
+
from rasa.shared.utils.llm import (
|
|
68
|
+
combine_custom_and_default_config,
|
|
69
|
+
resolve_model_client_config,
|
|
70
|
+
)
|
|
62
71
|
from rasa.tracing.constants import (
|
|
63
72
|
PROMPT_TOKEN_LENGTH_ATTRIBUTE_NAME,
|
|
64
73
|
REQUEST_BODY_SIZE_IN_BYTES_ATTRIBUTE_NAME,
|
|
@@ -329,9 +338,8 @@ def extract_llm_config(
|
|
|
329
338
|
else:
|
|
330
339
|
config = self.config
|
|
331
340
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
)
|
|
341
|
+
llm_config = resolve_model_client_config(config.get(LLM_CONFIG_KEY))
|
|
342
|
+
llm_property = combine_custom_and_default_config(llm_config, default_llm_config)
|
|
335
343
|
|
|
336
344
|
if isinstance(self, LLMBasedCommandGenerator):
|
|
337
345
|
flow_retrieval_config = config.get(FLOW_RETRIEVAL_KEY, {}) or {}
|
|
@@ -340,8 +348,11 @@ def extract_llm_config(
|
|
|
340
348
|
default_embeddings_config,
|
|
341
349
|
)
|
|
342
350
|
else:
|
|
351
|
+
embeddings_config = resolve_model_client_config(
|
|
352
|
+
config.get(EMBEDDINGS_CONFIG_KEY)
|
|
353
|
+
)
|
|
343
354
|
embeddings_property = combine_custom_and_default_config(
|
|
344
|
-
|
|
355
|
+
embeddings_config, default_embeddings_config
|
|
345
356
|
)
|
|
346
357
|
|
|
347
358
|
attributes = {
|
|
@@ -614,6 +625,15 @@ def extract_attrs_for_du_print_test_results(
|
|
|
614
625
|
OUTPUT_NAMES_OF_FAILED_TESTS: json.dumps(
|
|
615
626
|
test_suite_result.names_of_failed_tests
|
|
616
627
|
),
|
|
628
|
+
OUTPUT_COMMANDS_F1_MACRO_INSTRUMENTATION_ATTR: (
|
|
629
|
+
test_suite_result.f1_score[KEY_COMMANDS_F1_MACRO]
|
|
630
|
+
),
|
|
631
|
+
OUTPUT_COMMANDS_F1_MICRO_INSTRUMENTATION_ATTR: (
|
|
632
|
+
test_suite_result.f1_score[KEY_COMMANDS_F1_MICRO]
|
|
633
|
+
),
|
|
634
|
+
OUTPUT_COMMANDS_F1_WEIGHTED_INSTRUMENTATION_ATTR: (
|
|
635
|
+
test_suite_result.f1_score[KEY_COMMANDS_F1_WEIGHTED]
|
|
636
|
+
),
|
|
617
637
|
}
|
|
618
638
|
if test_suite_result.command_metrics:
|
|
619
639
|
for (
|
|
@@ -638,12 +658,27 @@ def extract_attrs_for_du_print_test_results(
|
|
|
638
658
|
for key, value in test_suite_result.llm_config.items():
|
|
639
659
|
attributes_dict[f"llm_config_0_{key}"] = value
|
|
640
660
|
|
|
641
|
-
for
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
661
|
+
for component_name, latency_metric in test_suite_result.latency_metrics.items():
|
|
662
|
+
for metric_name, metric_value in latency_metric.items():
|
|
663
|
+
attributes_dict[
|
|
664
|
+
f"{OUTPUT_LATENCY_METRICS}_{component_name}_{metric_name}"
|
|
665
|
+
] = metric_value
|
|
666
|
+
for (
|
|
667
|
+
component_name,
|
|
668
|
+
prompt_token_metric,
|
|
669
|
+
) in test_suite_result.prompt_token_metrics.items():
|
|
670
|
+
for metric_name, metric_value in prompt_token_metric.items():
|
|
671
|
+
attributes_dict[
|
|
672
|
+
f"{OUTPUT_PROMPT_TOKEN_METRICS}_{component_name}_{metric_name}"
|
|
673
|
+
] = metric_value
|
|
674
|
+
for (
|
|
675
|
+
component_name,
|
|
676
|
+
completion_token_metric,
|
|
677
|
+
) in test_suite_result.completion_token_metrics.items():
|
|
678
|
+
for metric_name, metric_value in completion_token_metric.items():
|
|
679
|
+
attributes_dict[
|
|
680
|
+
f"{OUTPUT_COMPLETION_TOKEN_METRICS}_{component_name}_{metric_name}"
|
|
681
|
+
] = metric_value
|
|
647
682
|
|
|
648
683
|
return attributes_dict
|
|
649
684
|
|
|
@@ -737,8 +772,8 @@ def extract_attrs_for_intentless_policy_generate_llm_answer(
|
|
|
737
772
|
return extend_attributes_with_prompt_tokens_length(self, attributes, prompt)
|
|
738
773
|
|
|
739
774
|
|
|
740
|
-
def
|
|
741
|
-
self: "EnterpriseSearchPolicy",
|
|
775
|
+
def extract_attrs_for_enterprise_search_invoke_llm(
|
|
776
|
+
self: "EnterpriseSearchPolicy", prompt: str
|
|
742
777
|
) -> Dict[str, Any]:
|
|
743
778
|
from rasa.core.policies.enterprise_search_policy import (
|
|
744
779
|
DEFAULT_EMBEDDINGS_CONFIG,
|
|
@@ -754,6 +789,14 @@ def extract_attrs_for_enterprise_search_generate_llm_answer(
|
|
|
754
789
|
return extend_attributes_with_prompt_tokens_length(self, attributes, prompt)
|
|
755
790
|
|
|
756
791
|
|
|
792
|
+
def extract_attrs_for_enterprise_search_parse_llm_relevancy_check_response(
|
|
793
|
+
self: "EnterpriseSearchPolicy", llm_answer: str
|
|
794
|
+
) -> Dict[str, Any]:
|
|
795
|
+
return {
|
|
796
|
+
"llm_answer": llm_answer,
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
|
|
757
800
|
def extract_current_context_attribute(stack: DialogueStack) -> Dict[str, Any]:
|
|
758
801
|
"""Utility function to extract the current context from the dialogue stack."""
|
|
759
802
|
current_context = stack.current_context()
|
|
@@ -776,14 +819,23 @@ def compute_prompt_tokens_length(
|
|
|
776
819
|
)
|
|
777
820
|
return None
|
|
778
821
|
|
|
779
|
-
if model_name
|
|
822
|
+
if model_name == "gpt-4":
|
|
780
823
|
logger.debug(
|
|
781
824
|
f"Model {model_name} may update over time. "
|
|
782
825
|
f"Returning num tokens assuming model '{model_name}-0613.'"
|
|
783
826
|
)
|
|
784
827
|
model_name = f"{model_name}-0613"
|
|
785
828
|
|
|
786
|
-
|
|
829
|
+
try:
|
|
830
|
+
encoding = tiktoken.encoding_for_model(model_name)
|
|
831
|
+
except KeyError:
|
|
832
|
+
# Fallback for unknown models
|
|
833
|
+
logger.warning(
|
|
834
|
+
f"Unknown model name '{model_name}', "
|
|
835
|
+
f"using 'cl100k_base' encoding as fallback."
|
|
836
|
+
)
|
|
837
|
+
encoding = tiktoken.get_encoding("cl100k_base")
|
|
838
|
+
|
|
787
839
|
return len(encoding.encode(prompt))
|
|
788
840
|
|
|
789
841
|
|
|
@@ -38,12 +38,13 @@ from rasa.core.nlg import NaturalLanguageGenerator
|
|
|
38
38
|
from rasa.core.policies.flows.flow_step_result import FlowActionPrediction
|
|
39
39
|
from rasa.core.policies.policy import Policy, PolicyPrediction
|
|
40
40
|
from rasa.core.processor import MessageProcessor
|
|
41
|
-
from rasa.core.tracker_store import TrackerStore
|
|
41
|
+
from rasa.core.tracker_stores.tracker_store import TrackerStore
|
|
42
42
|
from rasa.dialogue_understanding.commands import Command
|
|
43
43
|
from rasa.dialogue_understanding.generator import (
|
|
44
44
|
CompactLLMCommandGenerator,
|
|
45
45
|
LLMCommandGenerator,
|
|
46
46
|
MultiStepLLMCommandGenerator,
|
|
47
|
+
SearchReadyLLMCommandGenerator,
|
|
47
48
|
SingleStepLLMCommandGenerator,
|
|
48
49
|
)
|
|
49
50
|
from rasa.dialogue_understanding.generator.flow_retrieval import FlowRetrieval
|
|
@@ -66,9 +67,11 @@ from rasa.tracing.instrumentation.intentless_policy_instrumentation import (
|
|
|
66
67
|
from rasa.tracing.instrumentation.metrics import (
|
|
67
68
|
record_callable_duration_metrics,
|
|
68
69
|
record_compact_llm_command_generator_metrics,
|
|
70
|
+
record_enterprise_search_policy_metrics,
|
|
69
71
|
record_llm_command_generator_metrics,
|
|
70
72
|
record_multi_step_llm_command_generator_metrics,
|
|
71
73
|
record_request_size_in_bytes,
|
|
74
|
+
record_search_ready_llm_command_generator_metrics,
|
|
72
75
|
record_single_step_llm_command_generator_metrics,
|
|
73
76
|
)
|
|
74
77
|
from rasa.utils.endpoints import EndpointConfig, concat_url
|
|
@@ -291,6 +294,9 @@ SingleStepLLMCommandGeneratorType = TypeVar(
|
|
|
291
294
|
CompactLLMCommandGeneratorType = TypeVar(
|
|
292
295
|
"CompactLLMCommandGeneratorType", bound=CompactLLMCommandGenerator
|
|
293
296
|
)
|
|
297
|
+
SearchReadyLLMCommandGeneratorType = TypeVar(
|
|
298
|
+
"SearchReadyLLMCommandGeneratorType", bound=SearchReadyLLMCommandGenerator
|
|
299
|
+
)
|
|
294
300
|
MultiStepLLMCommandGeneratorType = TypeVar(
|
|
295
301
|
"MultiStepLLMCommandGeneratorType", bound=MultiStepLLMCommandGenerator
|
|
296
302
|
)
|
|
@@ -326,6 +332,9 @@ def instrument(
|
|
|
326
332
|
compact_llm_command_generator_class: Optional[
|
|
327
333
|
Type[CompactLLMCommandGeneratorType]
|
|
328
334
|
] = None,
|
|
335
|
+
search_ready_llm_command_generator_class: Optional[
|
|
336
|
+
Type[SearchReadyLLMCommandGeneratorType]
|
|
337
|
+
] = None,
|
|
329
338
|
multi_step_llm_command_generator_class: Optional[
|
|
330
339
|
Type[MultiStepLLMCommandGeneratorType]
|
|
331
340
|
] = None,
|
|
@@ -379,6 +388,9 @@ def instrument(
|
|
|
379
388
|
:param compact_llm_command_generator_class: The `CompactLLMCommandGenerator`
|
|
380
389
|
to be instrumented. If `None` is given, no `CompactLLMCommandGenerator` will
|
|
381
390
|
be instrumented.
|
|
391
|
+
:param search_ready_llm_command_generator_class: The`SearchReadyLLMCommandGenerator`
|
|
392
|
+
to be instrumented. If `None` is given, no `SearchReadyLLMCommandGenerator` will
|
|
393
|
+
be instrumented.
|
|
382
394
|
:param multi_step_llm_command_generator_class: The `MultiStepLLMCommandGenerator`
|
|
383
395
|
to be instrumented. If `None` is given, no `MultiStepLLMCommandGenerator` will
|
|
384
396
|
be instrumented.
|
|
@@ -527,6 +539,37 @@ def instrument(
|
|
|
527
539
|
)
|
|
528
540
|
mark_class_as_instrumented(compact_llm_command_generator_class)
|
|
529
541
|
|
|
542
|
+
if (
|
|
543
|
+
search_ready_llm_command_generator_class is not None
|
|
544
|
+
and not class_is_instrumented(search_ready_llm_command_generator_class)
|
|
545
|
+
):
|
|
546
|
+
_instrument_method(
|
|
547
|
+
tracer_provider.get_tracer(
|
|
548
|
+
search_ready_llm_command_generator_class.__module__
|
|
549
|
+
),
|
|
550
|
+
search_ready_llm_command_generator_class,
|
|
551
|
+
"invoke_llm",
|
|
552
|
+
attribute_extractors.extract_attrs_for_llm_based_command_generator,
|
|
553
|
+
metrics_recorder=record_search_ready_llm_command_generator_metrics,
|
|
554
|
+
)
|
|
555
|
+
_instrument_method(
|
|
556
|
+
tracer_provider.get_tracer(
|
|
557
|
+
search_ready_llm_command_generator_class.__module__
|
|
558
|
+
),
|
|
559
|
+
search_ready_llm_command_generator_class,
|
|
560
|
+
"_check_commands_against_startable_flows",
|
|
561
|
+
attribute_extractors.extract_attrs_for_check_commands_against_startable_flows,
|
|
562
|
+
)
|
|
563
|
+
_instrument_perform_health_check_method_for_component(
|
|
564
|
+
tracer_provider.get_tracer(
|
|
565
|
+
search_ready_llm_command_generator_class.__module__
|
|
566
|
+
),
|
|
567
|
+
search_ready_llm_command_generator_class,
|
|
568
|
+
"perform_llm_health_check",
|
|
569
|
+
attribute_extractors.extract_attrs_for_performing_health_check,
|
|
570
|
+
)
|
|
571
|
+
mark_class_as_instrumented(search_ready_llm_command_generator_class)
|
|
572
|
+
|
|
530
573
|
if multi_step_llm_command_generator_class is not None and not class_is_instrumented(
|
|
531
574
|
multi_step_llm_command_generator_class
|
|
532
575
|
):
|
|
@@ -562,6 +605,7 @@ def instrument(
|
|
|
562
605
|
llm_command_generator_class,
|
|
563
606
|
single_step_llm_command_generator_class,
|
|
564
607
|
compact_llm_command_generator_class,
|
|
608
|
+
search_ready_llm_command_generator_class,
|
|
565
609
|
multi_step_llm_command_generator_class,
|
|
566
610
|
)
|
|
567
611
|
)
|
|
@@ -847,8 +891,15 @@ def _instrument_enterprise_search_policy(
|
|
|
847
891
|
_instrument_method(
|
|
848
892
|
tracer,
|
|
849
893
|
policy_class,
|
|
850
|
-
"
|
|
851
|
-
attribute_extractors.
|
|
894
|
+
"_invoke_llm",
|
|
895
|
+
attribute_extractors.extract_attrs_for_enterprise_search_invoke_llm,
|
|
896
|
+
metrics_recorder=record_enterprise_search_policy_metrics,
|
|
897
|
+
)
|
|
898
|
+
_instrument_method(
|
|
899
|
+
tracer,
|
|
900
|
+
policy_class,
|
|
901
|
+
"_parse_llm_relevancy_check_response",
|
|
902
|
+
attribute_extractors.extract_attrs_for_enterprise_search_parse_llm_relevancy_check_response,
|
|
852
903
|
)
|
|
853
904
|
_instrument_perform_health_check_method_for_component(
|
|
854
905
|
tracer_provider.get_tracer(policy_class.__module__),
|
|
@@ -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
|