rasa-pro 3.22.0.dev3__py3-none-any.whl → 3.22.0.dev5__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.
- rasa/api/__init__.py +8 -0
- rasa/api/_class_resolution.py +207 -0
- rasa/api/brokers/__init__.py +6 -0
- rasa/api/brokers/_conversation_key.py +29 -0
- rasa/api/brokers/_factory.py +151 -0
- rasa/api/brokers/_sql.py +36 -0
- rasa/api/brokers/v1/__init__.py +28 -0
- rasa/api/brokers/v1/base.py +56 -0
- rasa/api/brokers/v1/file.py +70 -0
- rasa/{core/brokers → api/brokers/v1}/http.py +59 -42
- rasa/api/brokers/v1/kafka.py +578 -0
- rasa/api/brokers/v1/pika.py +436 -0
- rasa/api/brokers/v1/sql.py +98 -0
- rasa/api/brokers/v1/types.py +49 -0
- rasa/api/channels/__init__.py +6 -0
- rasa/api/channels/_auth.py +105 -0
- rasa/api/channels/_collector.py +11 -0
- rasa/api/channels/_credentials.py +39 -0
- rasa/api/channels/_factory.py +209 -0
- rasa/api/channels/_response.py +188 -0
- rasa/api/channels/_runtime.py +113 -0
- rasa/api/channels/v1/__init__.py +33 -0
- rasa/api/channels/v1/base.py +320 -0
- rasa/api/channels/v1/botframework.py +348 -0
- rasa/api/channels/v1/collector.py +99 -0
- rasa/api/channels/v1/facebook.py +441 -0
- rasa/api/channels/v1/hangouts.py +336 -0
- rasa/api/channels/v1/mattermost.py +240 -0
- rasa/api/channels/v1/rocketchat.py +187 -0
- rasa/api/channels/v1/slack.py +714 -0
- rasa/api/channels/v1/socketio.py +579 -0
- rasa/api/channels/v1/telegram.py +375 -0
- rasa/api/channels/v1/twilio.py +225 -0
- rasa/api/channels/v1/twilio_utils.py +29 -0
- rasa/api/channels/v1/types.py +100 -0
- rasa/api/channels/v1/vier_cvg.py +419 -0
- rasa/api/channels/v1/voice_ready/__init__.py +1 -0
- rasa/api/channels/v1/voice_ready/audiocodes.py +457 -0
- rasa/api/channels/v1/voice_ready/jambonz.py +144 -0
- rasa/api/channels/v1/voice_ready/twilio_voice.py +494 -0
- rasa/api/channels/v1/voice_stream/__init__.py +1 -0
- rasa/api/channels/v1/voice_stream/audiocodes.py +397 -0
- rasa/api/channels/v1/voice_stream/chirp.py +334 -0
- rasa/api/channels/v1/voice_stream/genesys.py +475 -0
- rasa/api/channels/v1/voice_stream/jambonz.py +283 -0
- rasa/api/channels/v1/voice_stream/signalwire.py +504 -0
- rasa/api/channels/v1/voice_stream/twilio_media_streams.py +381 -0
- rasa/api/channels/v1/voice_stream/voice_channel.py +2494 -0
- rasa/api/channels/v1/voice_stream/vonage.py +440 -0
- rasa/api/channels/v1/webexteams.py +146 -0
- rasa/api/knowledge/__init__.py +6 -0
- rasa/api/knowledge/_factory.py +108 -0
- rasa/api/knowledge/v1/__init__.py +40 -0
- rasa/api/knowledge/v1/base.py +33 -0
- rasa/api/knowledge/v1/embeddings.py +24 -0
- rasa/api/knowledge/v1/exceptions.py +16 -0
- rasa/api/knowledge/v1/faiss/__init__.py +49 -0
- rasa/api/knowledge/v1/faiss/constants.py +32 -0
- rasa/api/knowledge/v1/faiss/exceptions.py +25 -0
- rasa/api/knowledge/v1/faiss/knowledge.py +423 -0
- rasa/api/knowledge/v1/milvus/__init__.py +32 -0
- rasa/api/knowledge/v1/milvus/constants.py +15 -0
- rasa/api/knowledge/v1/milvus/knowledge.py +173 -0
- rasa/api/knowledge/v1/qdrant/__init__.py +35 -0
- rasa/api/knowledge/v1/qdrant/constants.py +11 -0
- rasa/api/knowledge/v1/qdrant/exceptions.py +13 -0
- rasa/api/knowledge/v1/qdrant/knowledge.py +118 -0
- rasa/api/knowledge/v1/types.py +74 -0
- rasa/api/locks/__init__.py +6 -0
- rasa/api/locks/_factory.py +96 -0
- rasa/api/locks/_ticket_lock.py +183 -0
- rasa/api/locks/v1/__init__.py +35 -0
- rasa/api/locks/v1/base.py +57 -0
- rasa/api/locks/v1/concurrent.py +303 -0
- rasa/api/locks/v1/exceptions.py +12 -0
- rasa/api/locks/v1/in_memory.py +34 -0
- rasa/api/locks/v1/redis.py +206 -0
- rasa/api/locks/v1/types.py +123 -0
- rasa/api/timers/__init__.py +6 -0
- rasa/api/timers/_factory.py +100 -0
- rasa/api/timers/v1/__init__.py +27 -0
- rasa/api/timers/v1/_helpers.py +33 -0
- rasa/api/timers/v1/base.py +63 -0
- rasa/api/timers/v1/in_memory.py +74 -0
- rasa/api/timers/v1/redis.py +353 -0
- rasa/api/timers/v1/types.py +68 -0
- rasa/api/tracker/__init__.py +6 -0
- rasa/api/tracker/_exceptions.py +12 -0
- rasa/api/tracker/_factory.py +185 -0
- rasa/api/tracker/_lifecycle.py +416 -0
- rasa/api/tracker/_serialisation.py +147 -0
- rasa/api/tracker/_storage_context.py +87 -0
- rasa/api/tracker/v1/__init__.py +57 -0
- rasa/api/tracker/v1/base.py +58 -0
- rasa/api/tracker/v1/dynamo.py +702 -0
- rasa/api/tracker/v1/exceptions.py +7 -0
- rasa/api/tracker/v1/in_memory.py +126 -0
- rasa/api/tracker/v1/mongo.py +467 -0
- rasa/api/tracker/v1/redis.py +579 -0
- rasa/api/tracker/v1/sql.py +1718 -0
- rasa/api/tracker/v1/types.py +21 -0
- rasa/api/versioning/__init__.py +45 -0
- rasa/api/versioning/discover.py +176 -0
- rasa/api/versioning/exceptions.py +25 -0
- rasa/api/versioning/resolve.py +152 -0
- rasa/api/voice/__init__.py +6 -0
- rasa/api/voice/_deepgram_endpoint.py +29 -0
- rasa/api/voice/_speech_api_key.py +113 -0
- rasa/api/voice/asr/__init__.py +6 -0
- rasa/api/voice/asr/_builtins.py +67 -0
- rasa/api/voice/asr/_factory.py +31 -0
- rasa/api/voice/asr/v1/__init__.py +73 -0
- rasa/api/voice/asr/v1/assemblyai.py +283 -0
- rasa/api/voice/asr/v1/azure/__init__.py +21 -0
- rasa/api/voice/asr/v1/azure/config.py +43 -0
- rasa/{core/channels/voice_stream/asr → api/voice/asr/v1}/azure/engine.py +7 -11
- rasa/api/voice/asr/v1/base.py +673 -0
- rasa/api/voice/asr/v1/deepgram/__init__.py +39 -0
- rasa/{core/channels/voice_stream/asr → api/voice/asr/v1}/deepgram/base.py +23 -12
- rasa/api/voice/asr/v1/deepgram/config.py +60 -0
- rasa/{core/channels/voice_stream/asr → api/voice/asr/v1}/deepgram/constants.py +2 -1
- rasa/{core/channels/voice_stream/asr → api/voice/asr/v1}/deepgram/flux.py +6 -5
- rasa/{core/channels/voice_stream/asr → api/voice/asr/v1}/deepgram/nova.py +16 -4
- rasa/api/voice/asr/v1/deepgram_flux.py +17 -0
- rasa/api/voice/asr/v1/elevenlabs.py +197 -0
- rasa/api/voice/asr/v1/events.py +23 -0
- rasa/api/voice/asr/v1/gradium.py +290 -0
- rasa/api/voice/asr/v1/inworld.py +201 -0
- rasa/api/voice/asr/v1/speechmatics.py +321 -0
- rasa/api/voice/reconnect/__init__.py +6 -0
- rasa/api/voice/reconnect/_constants.py +25 -0
- rasa/api/voice/reconnect/_errors.py +10 -0
- rasa/api/voice/reconnect/_retry.py +192 -0
- rasa/api/voice/reconnect/v1/__init__.py +15 -0
- rasa/api/voice/reconnect/v1/config.py +39 -0
- rasa/api/voice/reconnect/v1/errors.py +5 -0
- rasa/api/voice/tts/__init__.py +6 -0
- rasa/api/voice/tts/_builtins.py +74 -0
- rasa/api/voice/tts/_factory.py +31 -0
- rasa/api/voice/tts/v1/__init__.py +72 -0
- rasa/api/voice/tts/v1/assemblyai.py +333 -0
- rasa/api/voice/tts/v1/azure.py +561 -0
- rasa/api/voice/tts/v1/base.py +989 -0
- rasa/api/voice/tts/v1/cartesia.py +282 -0
- rasa/api/voice/tts/v1/config.py +12 -0
- rasa/api/voice/tts/v1/deepgram.py +245 -0
- rasa/api/voice/tts/v1/deepgram_flux.py +300 -0
- rasa/api/voice/tts/v1/elevenlabs.py +499 -0
- rasa/api/voice/tts/v1/gradium.py +271 -0
- rasa/api/voice/tts/v1/inworld.py +434 -0
- rasa/api/voice/tts/v1/rime.py +411 -0
- rasa/api/voice/v1/__init__.py +31 -0
- rasa/api/voice/v1/audio.py +120 -0
- rasa/builder/agent_id.py +189 -0
- rasa/builder/agent_skills.py +42 -16
- rasa/builder/behavior_editing.py +6 -31
- rasa/builder/branches.py +337 -17
- rasa/builder/config.py +0 -2
- rasa/builder/constants.py +3 -0
- rasa/builder/copilot/constants.py +3 -0
- rasa/builder/copilot/file_operations.py +342 -3
- rasa/builder/copilot/mcp_server/models.py +8 -0
- rasa/builder/copilot/mcp_server/schema/scenario_schema.yml +2 -0
- rasa/builder/copilot/mcp_server/tools/event_ledger.py +55 -10
- rasa/builder/copilot/mcp_server/tools/llm_judge_models.py +1 -1
- rasa/builder/copilot/mcp_server/tools/scenario.py +1 -0
- rasa/builder/copilot/modes/AGENTS.md +1 -1
- rasa/builder/copilot/modes/eval/AGENTS.md +19 -0
- rasa/builder/copilot/modes/eval/__init__.py +0 -0
- rasa/builder/copilot/modes/eval/actions.py +202 -0
- rasa/builder/copilot/modes/eval/capability.py +167 -0
- rasa/builder/copilot/modes/eval/cards.py +187 -0
- rasa/builder/copilot/modes/eval/job.py +252 -0
- rasa/builder/copilot/modes/eval/models.py +6 -0
- rasa/builder/copilot/modes/eval/sessions.py +36 -0
- rasa/builder/copilot/modes/plan/AGENTS.md +1 -1
- rasa/builder/copilot/modes/plan/actions.py +1 -0
- rasa/builder/copilot/modes/plan/build_job.py +111 -109
- rasa/builder/copilot/modes/plan/build_steps.py +12 -1
- rasa/builder/copilot/modes/plan/capability.py +14 -4
- rasa/builder/copilot/modes/registry.py +9 -2
- rasa/builder/copilot/prompts/evaluation_criteria_judge_prompt.jinja2 +2 -1
- rasa/builder/copilot/pydantic_ai/agent.py +24 -44
- rasa/builder/copilot/pydantic_ai/branch_tool.py +3 -3
- rasa/builder/copilot/pydantic_ai/config.py +1 -1
- rasa/builder/copilot/pydantic_ai/file_tools.py +87 -1
- rasa/builder/copilot/pydantic_ai/hooks.py +4 -0
- rasa/builder/copilot/pydantic_ai/mcp_calls.py +53 -0
- rasa/builder/copilot/pydantic_ai/model_registry.py +86 -78
- rasa/builder/copilot/pydantic_ai/prompt_loader.py +40 -29
- rasa/builder/copilot/pydantic_ai/run_context.py +10 -5
- rasa/builder/copilot/pydantic_ai/types.py +2 -0
- rasa/builder/copilot/skill_catalog.py +15 -0
- rasa/builder/copilot/skills/mantle/building-from-conversations/SKILL.md +5 -3
- rasa/builder/copilot/skills/mantle/building-skills/SKILL.md +24 -9
- rasa/builder/copilot/skills/mantle/building-skills/references/control-levers.md +3 -3
- rasa/builder/copilot/skills/mantle/building-skills/references/ordered-blocks.md +4 -2
- rasa/builder/copilot/skills/mantle/building-skills/references/responses.md +4 -4
- rasa/builder/copilot/skills/mantle/building-skills/references/tools.md +6 -2
- rasa/builder/copilot/skills/mantle/configuring-agent/SKILL.md +7 -5
- rasa/builder/copilot/skills/mantle/configuring-agent/references/agent-yml.md +5 -8
- rasa/builder/copilot/skills/mantle/configuring-agent/references/integrations-yml.md +10 -5
- rasa/builder/copilot/skills/mantle/configuring-agent/references/knowledge-and-hooks.md +5 -5
- rasa/builder/copilot/skills/mantle/migrating-from-calm/SKILL.md +7 -6
- rasa/builder/copilot/skills/mantle/simulating-evaluating/SKILL.md +23 -12
- rasa/builder/copilot/skills/mantle/simulating-evaluating/references/assertions.md +1 -1
- rasa/builder/copilot/skills/mantle/testing-debugging/SKILL.md +4 -4
- rasa/builder/copilot/skills/mantle/testing-debugging/references/validation-failures.md +4 -2
- rasa/builder/copilot/subagents/AGENTS.md +4 -1
- rasa/builder/copilot/subagents/base.py +5 -0
- rasa/builder/copilot/subagents/builder/agent.py +32 -105
- rasa/builder/copilot/subagents/evaluation.py +40 -0
- rasa/builder/copilot/subagents/evaluator/__init__.py +0 -0
- rasa/builder/copilot/subagents/evaluator/agent.py +330 -0
- rasa/builder/copilot/subagents/model_choice.py +2 -2
- rasa/builder/copilot/subagents/planner/agent.py +40 -4
- rasa/builder/copilot/subagents/project_validation.py +110 -0
- rasa/builder/copilot/subagents/registry.py +6 -1
- rasa/builder/document_retrieval/local/data/docs_vectors.parquet +0 -0
- rasa/builder/document_retrieval/local/data/mantle_docs_vectors.parquet +0 -0
- rasa/builder/eval_scenarios.py +1 -0
- rasa/builder/exceptions.py +17 -2
- rasa/builder/job_runner.py +82 -10
- rasa/builder/jobs.py +12 -2
- rasa/builder/models.py +56 -4
- rasa/builder/project_generator/project_generator.py +21 -7
- rasa/builder/service.py +147 -5
- rasa/builder/shared/tracker_context.py +12 -3
- rasa/builder/validation_service.py +32 -2
- rasa/cli/export.py +41 -9
- rasa/cli/project_templates/mantle/AGENTS.md +17 -1
- rasa/cli/project_templates/mantle/skills/view_transactions/memory.yml +1 -1
- rasa/cli/project_templates/mantle/skills/view_transactions/skill.md +4 -4
- rasa/cli/run.py +1 -1
- rasa/cli/scaffold.py +1 -1
- rasa/cli/tools/skills_data/mantle/mantle-building-from-conversations/SKILL.md +8 -1
- rasa/cli/tools/skills_data/mantle/mantle-building-skills/SKILL.md +44 -18
- rasa/cli/tools/skills_data/mantle/mantle-configuring-agent/SKILL.md +32 -20
- rasa/cli/tools/skills_data/mantle/mantle-docs/SKILL.md +1 -1
- rasa/cli/tools/skills_data/mantle/mantle-migrating-from-calm/SKILL.md +1 -1
- rasa/cli/tools/skills_data/mantle/mantle-simulating-evaluating/SKILL.md +9 -5
- rasa/cli/tools/skills_data/mantle/mantle-testing-debugging/SKILL.md +11 -3
- rasa/cli/train.py +1 -1
- rasa/core/a2a_server/rasa_a2a_agent_executor.py +11 -5
- rasa/core/actions/action.py +2 -1
- rasa/core/agent.py +76 -27
- rasa/core/brokers/broker.py +45 -16
- rasa/core/brokers/broker_only_metadata.py +38 -0
- rasa/core/brokers/file.py +11 -34
- rasa/core/brokers/kafka.py +59 -543
- rasa/core/brokers/pika.py +34 -351
- rasa/core/brokers/sql.py +19 -62
- rasa/core/channels/__init__.py +181 -120
- rasa/core/channels/botframework.py +11 -330
- rasa/core/channels/callback.py +8 -6
- rasa/core/channels/channel.py +89 -1066
- rasa/core/channels/console.py +6 -3
- rasa/core/channels/development_inspector.py +10 -8
- rasa/core/channels/facebook.py +11 -421
- rasa/core/channels/hangouts.py +11 -323
- rasa/core/channels/inspector/dist/assets/{abnfDiagram-VCTEODGH-9bb4b1b7.js → abnfDiagram-VCTEODGH-4dad96d5.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{arc-c3810888.js → arc-3e6f53b9.js} +1 -1
- rasa/core/channels/inspector/dist/assets/architecture-7GRP2DOG-699b1092.js +1 -0
- rasa/core/channels/inspector/dist/assets/{architectureDiagram-5GKGNRK7-871eab48.js → architectureDiagram-5GKGNRK7-196dd756.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{blockDiagram-I7D4REHJ-db15b3c9.js → blockDiagram-I7D4REHJ-dde191ce.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{c4Diagram-7LVT6UL2-d576670d.js → c4Diagram-7LVT6UL2-323f6330.js} +1 -1
- rasa/core/channels/inspector/dist/assets/channel-da9956d7.js +1 -0
- rasa/core/channels/inspector/dist/assets/{chunk-2Q5K7J3B-03b49407.js → chunk-2Q5K7J3B-442e95da.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{chunk-5VM5RSS4-21ebf9e7.js → chunk-5VM5RSS4-4b8f18bf.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{chunk-F27PBJKO-8c71eab7.js → chunk-F27PBJKO-0d13dc9c.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{chunk-IMKFNOWR-31c44837.js → chunk-IMKFNOWR-582c5eb2.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{chunk-JWPE2WC7-84ef11d7.js → chunk-JWPE2WC7-4eff958f.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{chunk-POPQ4Y6H-6567ef4e.js → chunk-POPQ4Y6H-e26f4239.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{chunk-SHT3W25Y-6c21498e.js → chunk-SHT3W25Y-b08c37cd.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{chunk-SVP7TREG-73f752ea.js → chunk-SVP7TREG-d321f270.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{chunk-TICWLB2K-00498b4c.js → chunk-TICWLB2K-1b2cbe3c.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{chunk-XXDRQBXY-344b78e6.js → chunk-XXDRQBXY-a9c5e0e5.js} +1 -1
- rasa/core/channels/inspector/dist/assets/classDiagram-ZZMXUADV-00200122.js +1 -0
- rasa/core/channels/inspector/dist/assets/classDiagram-v2-VYDZK3BY-00200122.js +1 -0
- rasa/core/channels/inspector/dist/assets/{cose-bilkent-JH36ORCC-e6dd637c.js → cose-bilkent-JH36ORCC-46815318.js} +1 -1
- rasa/core/channels/inspector/dist/assets/cynefin-OW5HDTMX-eda39f47.js +1 -0
- rasa/core/channels/inspector/dist/assets/{cynefinDiagram-5FMLGOSQ-8c24409a.js → cynefinDiagram-5FMLGOSQ-54c1624b.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{dagre-GXQ25YYZ-e453a665.js → dagre-GXQ25YYZ-b008a027.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{diagram-S7CK7UJ4-6a283b1b.js → diagram-S7CK7UJ4-ae89395e.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{diagram-UQ7AKVKN-554ef82f.js → diagram-UQ7AKVKN-999ae09e.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{diagram-VSXAHHWV-3be73563.js → diagram-VSXAHHWV-97c7889e.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{diagram-VX7I27RA-a2331b4f.js → diagram-VX7I27RA-823e67b2.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{diagram-Z3DM3KII-8f19966a.js → diagram-Z3DM3KII-e2703905.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{ebnfDiagram-PWID7BFC-776e52fe.js → ebnfDiagram-PWID7BFC-90957809.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{erDiagram-RLTQ6QDP-41e1a7a7.js → erDiagram-RLTQ6QDP-ab7d586b.js} +1 -1
- rasa/core/channels/inspector/dist/assets/eventmodeling-NTZA5JFV-5ba493ba.js +1 -0
- rasa/core/channels/inspector/dist/assets/flowDiagram-HODETNUW-878d9a43.js +1 -0
- rasa/core/channels/inspector/dist/assets/{ganttDiagram-EL5Y4UJY-53724fff.js → ganttDiagram-EL5Y4UJY-d51cb341.js} +1 -1
- rasa/core/channels/inspector/dist/assets/gitGraph-4MIJSDKK-a1e2f707.js +1 -0
- rasa/core/channels/inspector/dist/assets/{gitGraphDiagram-WWUBYQGX-1b7a87aa.js → gitGraphDiagram-WWUBYQGX-00e4986d.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{index-274d8869.js → index-f0843d4a.js} +214 -214
- rasa/core/channels/inspector/dist/assets/info-A6RAGUB7-899546b8.js +1 -0
- rasa/core/channels/inspector/dist/assets/{infoDiagram-27XIBGKW-3b7adc8a.js → infoDiagram-27XIBGKW-9b4914f1.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{ishikawaDiagram-5VMMS53U-6ceb54a2.js → ishikawaDiagram-5VMMS53U-60c66367.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{journeyDiagram-3NMN7TZE-b5ab0205.js → journeyDiagram-3NMN7TZE-5b85e88f.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{kanban-definition-UXKFOSKX-6ff5197e.js → kanban-definition-UXKFOSKX-49b30c4d.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{layout-06fc0ce8.js → layout-9f5b710a.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{linear-5063258f.js → linear-514ea504.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{mermaid-parser.core-cef7e732.js → mermaid-parser.core-30107f2c.js} +2 -2
- rasa/core/channels/inspector/dist/assets/{mindmap-definition-YA3MSWOX-78933baa.js → mindmap-definition-YA3MSWOX-3327eb70.js} +1 -1
- rasa/core/channels/inspector/dist/assets/packet-AYTQ26CC-20d1be69.js +1 -0
- rasa/core/channels/inspector/dist/assets/{pegDiagram-XKGWAZYB-b288834e.js → pegDiagram-XKGWAZYB-fc962248.js} +1 -1
- rasa/core/channels/inspector/dist/assets/pie-WAS4IAKB-1294e5e5.js +1 -0
- rasa/core/channels/inspector/dist/assets/{pieDiagram-E7YTZNPT-2c04e795.js → pieDiagram-E7YTZNPT-a28a6852.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{quadrantDiagram-AXDQQJYC-2ee4a399.js → quadrantDiagram-AXDQQJYC-aac7cd2a.js} +1 -1
- rasa/core/channels/inspector/dist/assets/radar-RG4KPBEZ-09727d46.js +1 -0
- rasa/core/channels/inspector/dist/assets/railroad-74A4TZTK-477c7b05.js +1 -0
- rasa/core/channels/inspector/dist/assets/railroad-abnf-HS5TGJTU-ab8e102e.js +1 -0
- rasa/core/channels/inspector/dist/assets/railroad-ebnf-LZEXJU2U-13acb37b.js +1 -0
- rasa/core/channels/inspector/dist/assets/railroad-peg-WCYAUIDC-49de1c2b.js +1 -0
- rasa/core/channels/inspector/dist/assets/{railroadDiagram-O6MQD6OU-9bfe3600.js → railroadDiagram-O6MQD6OU-23af80ec.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{requirementDiagram-BXWQKSXE-115ef51e.js → requirementDiagram-BXWQKSXE-3cfea867.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{sankeyDiagram-P5KCCOFB-23c7a678.js → sankeyDiagram-P5KCCOFB-da6ddca7.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{sequenceDiagram-WJ2MYXX4-08014e4a.js → sequenceDiagram-WJ2MYXX4-58a120cd.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{sizeCapture-INFHLROL-d66ec26a.js → sizeCapture-INFHLROL-e13c1480.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{stateDiagram-D77RDMKH-0542b581.js → stateDiagram-D77RDMKH-bf9decb0.js} +1 -1
- rasa/core/channels/inspector/dist/assets/stateDiagram-v2-MP3YSRHH-6b114887.js +1 -0
- rasa/core/channels/inspector/dist/assets/{swimlanes-42K2YHIH-7324252c.js → swimlanes-42K2YHIH-9f742571.js} +1 -1
- rasa/core/channels/inspector/dist/assets/swimlanesDiagram-VR7AAH4N-c58e1722.js +8 -0
- rasa/core/channels/inspector/dist/assets/{timeline-definition-24CTP7MA-fda150ab.js → timeline-definition-24CTP7MA-452c1abe.js} +1 -1
- rasa/core/channels/inspector/dist/assets/treeView-Q6P3EWNA-eea32e07.js +1 -0
- rasa/core/channels/inspector/dist/assets/treemap-WGGIJYW6-5e10075c.js +1 -0
- rasa/core/channels/inspector/dist/assets/{vennDiagram-4TSXK5OY-f6996200.js → vennDiagram-4TSXK5OY-9570c84f.js} +1 -1
- rasa/core/channels/inspector/dist/assets/wardley-WFR3VGLG-6370adc9.js +1 -0
- rasa/core/channels/inspector/dist/assets/{wardleyDiagram-VM6X3IG4-1076f51b.js → wardleyDiagram-VM6X3IG4-bd06177f.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{xychartDiagram-S5SC5T6Z-08b5eb79.js → xychartDiagram-S5SC5T6Z-9864c80f.js} +1 -1
- rasa/core/channels/inspector/dist/index.html +1 -1
- rasa/core/channels/inspector/package.json +6 -6
- rasa/core/channels/inspector/yarn.lock +25 -25
- rasa/core/channels/inspector-nextgen/dist/assets/{index--9qSkQVO.js → index-D9aqZG2L.js} +67 -67
- rasa/core/channels/inspector-nextgen/dist/index.html +1 -1
- rasa/core/channels/inspector-nextgen/e2e/agents/mantle/skills/builtin_session_start/skill.md +1 -1
- rasa/core/channels/inspector-nextgen/e2e/agents/mantle/skills/card_disambiguation/skill.md +1 -1
- rasa/core/channels/inspector-nextgen/e2e/agents/mantle/skills/card_replace/skill.md +28 -28
- rasa/core/channels/inspector-nextgen/e2e/agents/mantle/skills/card_replace/tools.py +5 -5
- rasa/core/channels/inspector-nextgen/e2e/agents/mantle/skills/close_savings_account/tools.py +1 -1
- rasa/core/channels/inspector-nextgen/e2e/agents/mantle/skills/report_fraudulent_transaction/skill.md +4 -4
- rasa/core/channels/inspector-nextgen/e2e/agents/mantle/skills/travel_notice/skill.md +6 -6
- rasa/core/channels/inspector-nextgen/src/Icon/LangfuseIcon.tsx +19 -0
- rasa/core/channels/inspector-nextgen/src/Icon/index.ts +4 -0
- rasa/core/channels/inspector-nextgen/src/assets/images/index.ts +1 -3
- rasa/core/channels/inspector-nextgen/src/components/EventInfo/BargeInEventInfo.test.tsx +4 -5
- rasa/core/channels/inspector-nextgen/src/components/EventInfo/BargeInEventInfo.tsx +7 -22
- rasa/core/channels/inspector-nextgen/src/components/EventInfo/LlmCallEventInfo.test.tsx +3 -3
- rasa/core/channels/inspector-nextgen/src/components/EventInfo/OrderedBlockEventInfo.test.tsx +1 -0
- rasa/core/channels/inspector-nextgen/src/components/EventInfo/SkillEventInfo.test.tsx +20 -1
- rasa/core/channels/inspector-nextgen/src/components/EventInfo/SkillEventInfo.tsx +21 -13
- rasa/core/channels/inspector-nextgen/src/hooks/useBotConnection.test.ts +1 -0
- rasa/core/channels/inspector-nextgen/src/store/selectors.test.ts +3 -1
- rasa/core/channels/inspector-nextgen/src/try-assistant/ChatHeader.test.tsx +10 -0
- rasa/core/channels/inspector-nextgen/src/try-assistant/ChatHeader.tsx +1 -1
- rasa/core/channels/inspector-nextgen/src/try-assistant/ConversationLog/Event/BargeInEvent.test.tsx +50 -8
- rasa/core/channels/inspector-nextgen/src/try-assistant/ConversationLog/Event/BargeInEvent.tsx +3 -13
- rasa/core/channels/inspector-nextgen/src/try-assistant/ConversationLog/Event/FlowEvent.test.tsx +1 -0
- rasa/core/channels/inspector-nextgen/src/try-assistant/ConversationLog/Event/OrderedBlockEvent.test.tsx +1 -0
- rasa/core/channels/inspector-nextgen/src/try-assistant/ConversationLog/Event/SkillEvent.test.tsx +1 -0
- rasa/core/channels/inspector-nextgen/src/try-assistant/ConversationLog/Message/MessageMarkup.test.tsx +12 -0
- rasa/core/channels/inspector-nextgen/src/try-assistant/ConversationLog/Message/MessageMarkup.tsx +3 -2
- rasa/core/channels/inspector-nextgen/src/try-assistant/ConversationLog/groupEventsByToolCall.test.ts +61 -17
- rasa/core/channels/inspector-nextgen/src/try-assistant/ConversationLog/groupEventsByToolCall.ts +24 -17
- rasa/core/channels/inspector-nextgen/src/try-assistant/LangfuseSessionButton.test.tsx +11 -4
- rasa/core/channels/inspector-nextgen/src/try-assistant/LangfuseSessionButton.tsx +3 -3
- rasa/core/channels/inspector-nextgen/src/try-assistant/MiddlePane.test.tsx +2 -1
- rasa/core/channels/inspector-nextgen/src/try-assistant/SkillMemoryDetails.test.tsx +1 -0
- rasa/core/channels/inspector-nextgen/src/try-assistant/SkillSection/ReferenceTag.tsx +5 -1
- rasa/core/channels/inspector-nextgen/src/try-assistant/SkillSection/SkillSection.test.tsx +31 -1
- rasa/core/channels/inspector-nextgen/src/try-assistant/SkillSection/SkillSection.tsx +10 -2
- rasa/core/channels/inspector-nextgen/src/try-assistant/SkillSection/deriveSkillStateAt.test.ts +1 -0
- rasa/core/channels/inspector-nextgen/src/try-assistant/SkillSection/references.test.ts +1 -0
- rasa/core/channels/inspector-nextgen/src/try-assistant/SkillSection/references.ts +5 -2
- rasa/core/channels/inspector-nextgen/src/try-assistant/deriveLlmCallView.test.ts +4 -4
- rasa/core/channels/inspector-nextgen/src/types/conversation.ts +1 -0
- rasa/core/channels/inspector-nextgen/src/types/skill.test.ts +23 -0
- rasa/core/channels/inspector-nextgen/src/types/skill.ts +3 -0
- rasa/core/channels/inspector-nextgen/src/utils/barge-in.ts +12 -12
- rasa/core/channels/inspector-nextgen/src/utils/broker-event.test.ts +5 -2
- rasa/core/channels/inspector-nextgen/src/utils/skill-flow-import.test.ts +9 -6
- rasa/core/channels/inspector-nextgen/src/utils/skill-flow-import.ts +2 -2
- rasa/core/channels/inspector.py +29 -5
- rasa/core/channels/mattermost.py +11 -221
- rasa/core/channels/rasa_chat.py +6 -9
- rasa/core/channels/rest.py +84 -156
- rasa/core/channels/rocketchat.py +11 -167
- rasa/core/channels/slack.py +11 -690
- rasa/core/channels/socketio.py +14 -564
- rasa/core/channels/telegram.py +11 -335
- rasa/core/channels/twilio.py +11 -210
- rasa/core/channels/twilio_utils.py +8 -27
- rasa/core/channels/vier_cvg.py +11 -401
- rasa/core/channels/voice_ready/audiocodes.py +11 -439
- rasa/core/channels/voice_ready/jambonz.py +13 -132
- rasa/core/channels/voice_ready/twilio_voice.py +13 -482
- rasa/core/channels/voice_stream/asr/__init__.py +11 -42
- rasa/core/channels/voice_stream/asr/asr_engine.py +17 -466
- rasa/core/channels/voice_stream/asr/asr_event.py +14 -23
- rasa/core/channels/voice_stream/asr/azure/__init__.py +8 -21
- rasa/core/channels/voice_stream/asr/azure/config.py +3 -41
- rasa/core/channels/voice_stream/asr/deepgram/__init__.py +46 -36
- rasa/core/channels/voice_stream/asr/deepgram/config.py +12 -58
- rasa/core/channels/voice_stream/asr/deepgram_flux.py +11 -7
- rasa/core/channels/voice_stream/asr/elevenlabs.py +10 -242
- rasa/core/channels/voice_stream/asr/speechmatics.py +13 -307
- rasa/core/channels/voice_stream/audio_bytes.py +32 -120
- rasa/core/channels/voice_stream/audiocodes.py +13 -388
- rasa/core/channels/voice_stream/browser_audio.py +17 -14
- rasa/core/channels/voice_stream/call_recording/recording.py +164 -42
- rasa/core/channels/voice_stream/chirp.py +11 -325
- rasa/core/channels/voice_stream/genesys.py +11 -466
- rasa/core/channels/voice_stream/jambonz.py +13 -271
- rasa/core/channels/voice_stream/json_audio.py +15 -12
- rasa/core/channels/voice_stream/marker_scheduler.py +121 -48
- rasa/core/channels/voice_stream/signalwire.py +13 -470
- rasa/core/channels/voice_stream/speech_api_key.py +8 -113
- rasa/core/channels/voice_stream/speech_model/README.md +51 -0
- rasa/core/channels/voice_stream/speech_model/__init__.py +8 -0
- rasa/core/channels/voice_stream/speech_model/constants.py +13 -0
- rasa/core/channels/voice_stream/speech_model/engine.py +452 -0
- rasa/core/channels/voice_stream/speech_model/factory.py +89 -0
- rasa/core/channels/voice_stream/speech_model/openai.py +53 -0
- rasa/core/channels/voice_stream/speech_model/openai_live.py +482 -0
- rasa/core/channels/voice_stream/speech_model/output_channel.py +150 -0
- rasa/core/channels/voice_stream/speech_model/polyai.py +95 -0
- rasa/core/channels/voice_stream/speech_model/rime_prism.py +402 -0
- rasa/core/channels/voice_stream/tts/__init__.py +31 -55
- rasa/core/channels/voice_stream/tts/azure.py +10 -562
- rasa/core/channels/voice_stream/tts/cartesia.py +5 -276
- rasa/core/channels/voice_stream/tts/config.py +4 -11
- rasa/core/channels/voice_stream/tts/deepgram.py +5 -239
- rasa/core/channels/voice_stream/tts/deepgram_flux.py +5 -298
- rasa/core/channels/voice_stream/tts/elevenlabs.py +16 -472
- rasa/core/channels/voice_stream/tts/rime.py +5 -403
- rasa/core/channels/voice_stream/tts/tts_engine.py +27 -839
- rasa/core/channels/voice_stream/tts/utterance_audio.py +66 -0
- rasa/core/channels/voice_stream/twilio_media_streams.py +15 -372
- rasa/core/channels/voice_stream/util.py +15 -1
- rasa/core/channels/voice_stream/voice_channel.py +29 -2196
- rasa/core/channels/voice_stream/vonage.py +10 -416
- rasa/core/channels/voice_stream/websockets.py +20 -16
- rasa/core/channels/webexteams.py +11 -125
- rasa/core/concurrent_lock_store.py +28 -308
- rasa/core/config/channel_loading.py +5 -3
- rasa/core/constants.py +32 -21
- rasa/core/exporter.py +1 -1
- rasa/core/iam_credentials_providers/aws_iam_credentials_providers.py +17 -326
- rasa/core/iam_credentials_providers/credentials_provider_protocol.py +19 -92
- rasa/core/information_retrieval/_results.py +25 -0
- rasa/core/information_retrieval/faiss.py +50 -448
- rasa/core/information_retrieval/milvus.py +24 -157
- rasa/core/information_retrieval/qdrant.py +28 -98
- rasa/core/lock.py +3 -136
- rasa/core/lock_store.py +26 -412
- rasa/core/nlg/contextual_response_rephraser.py +12 -15
- rasa/core/policies/enterprise_search_policy.py +11 -14
- rasa/core/processor.py +3 -3
- rasa/core/redis_connection_factory.py +19 -472
- rasa/core/run.py +45 -4
- rasa/core/timer_managers/persistent_timer_manager.py +372 -0
- rasa/core/timer_managers/redis_timer_manager.py +19 -337
- rasa/core/timer_managers/timer_manager.py +22 -8
- rasa/core/timer_stores/in_memory_timer_store.py +7 -66
- rasa/core/timer_stores/redis_timer_store.py +20 -326
- rasa/core/timer_stores/timer_store.py +22 -171
- rasa/core/tracker_stores/auth_retry_tracker_store.py +126 -46
- rasa/core/tracker_stores/dynamo_tracker_store.py +23 -656
- rasa/core/tracker_stores/mongo_tracker_store.py +24 -377
- rasa/core/tracker_stores/redis_tracker_store.py +36 -510
- rasa/core/tracker_stores/sql_tracker_store.py +46 -1635
- rasa/core/tracker_stores/tracker_store.py +203 -802
- rasa/core/voice/event_composition/composer/composer.py +0 -3
- rasa/core/voice/event_composition/events/composite_events.py +1 -0
- rasa/core/voice/event_composition/events/constants.py +0 -3
- rasa/core/voice/event_composition/handlers/barge_in/backchannel/__init__.py +5 -0
- rasa/core/voice/event_composition/handlers/barge_in/backchannel/classifiers/__init__.py +5 -0
- rasa/core/voice/event_composition/handlers/barge_in/backchannel/classifiers/constants.py +54 -0
- rasa/core/voice/event_composition/handlers/barge_in/backchannel/classifiers/deberta.py +65 -0
- rasa/core/voice/event_composition/handlers/barge_in/backchannel/classifiers/deberta_hypothesis.jinja2 +1 -0
- rasa/core/voice/event_composition/handlers/barge_in/backchannel/classifiers/deberta_premise.jinja2 +5 -0
- rasa/core/voice/event_composition/handlers/barge_in/backchannel/classifiers/loader.py +116 -0
- rasa/core/voice/event_composition/handlers/barge_in/backchannel/classifiers/nli_model.py +104 -0
- rasa/core/voice/event_composition/handlers/barge_in/backchannel/classifiers/protocol.py +18 -0
- rasa/core/voice/event_composition/handlers/barge_in/backchannel/detector.py +103 -0
- rasa/core/voice/event_composition/handlers/barge_in/backchannel/runtime.py +75 -0
- rasa/core/voice/event_composition/handlers/barge_in/barge_in_handler.py +11 -22
- rasa/core/voice/event_composition/handlers/playback_tracking_handler.py +0 -112
- rasa/core/voice/event_composition/handlers/transcript_merge_handler.py +1 -9
- rasa/core/voice/interruptions.py +4 -14
- rasa/dialogue_understanding/stack/frames/mantle_stack_frames.py +21 -1
- rasa/dialogue_understanding/utils.py +34 -8
- rasa/{api.py → entrypoint.py} +2 -6
- rasa/events/v1/broker_event_mapper.py +126 -5
- rasa/events/v1/broker_event_pb2.py +62 -54
- rasa/mantle/README-INTERNAL.md +16 -10
- rasa/mantle/a2a/cancel.py +2 -5
- rasa/mantle/builtin_skills/__init__.py +12 -15
- rasa/mantle/builtin_skills/builtin_customer_satisfaction/responses.yml +1 -1
- rasa/mantle/builtin_skills/builtin_customer_satisfaction/skill.md +1 -1
- rasa/mantle/builtin_skills/builtin_silence_timeout/skill.md +1 -1
- rasa/mantle/builtin_skills/builtin_silence_timeout_hangup/skill.md +2 -2
- rasa/mantle/builtin_skills/builtin_unsupported_request_handler/skill.md +2 -2
- rasa/mantle/builtin_skills/default_responses.yml +1 -1
- rasa/mantle/config/_tracker_auth_retry.py +214 -0
- rasa/mantle/config/agent_spec.py +4 -2
- rasa/mantle/config/authoring_documents.py +4 -13
- rasa/mantle/config/builtin_tool_constraints.py +50 -17
- rasa/mantle/config/channels.py +57 -16
- rasa/mantle/config/integration_factory.py +102 -0
- rasa/mantle/config/integrations.py +23 -10
- rasa/mantle/config/integrations_file.py +38 -1
- rasa/mantle/config/runtime_endpoints.py +240 -48
- rasa/mantle/config/validation.py +8 -7
- rasa/mantle/content/response_references.py +3 -3
- rasa/mantle/content/responses.py +75 -8
- rasa/mantle/content/static_buttons.py +3 -3
- rasa/mantle/content/validation.py +53 -7
- rasa/mantle/decorator_contract.py +492 -0
- rasa/mantle/hooks/__init__.py +6 -6
- rasa/mantle/hooks/constants.py +3 -3
- rasa/mantle/hooks/decorators.py +2 -2
- rasa/mantle/hooks/defaults.py +188 -0
- rasa/mantle/hooks/loader.py +21 -0
- rasa/mantle/hooks/outgoing_message.py +90 -0
- rasa/mantle/hooks/payloads.py +1 -1
- rasa/mantle/hooks/points.py +5 -5
- rasa/mantle/hooks/registry.py +45 -1
- rasa/mantle/hooks/runner.py +7 -1
- rasa/mantle/inspector.py +50 -35
- rasa/mantle/llm/client.py +5 -4
- rasa/mantle/llm/tool_schemas.py +472 -284
- rasa/mantle/memory/coercion.py +90 -0
- rasa/mantle/memory/discovery/catalog.py +2 -3
- rasa/mantle/memory/discovery/extractor.py +3 -3
- rasa/mantle/memory/field.py +9 -8
- rasa/mantle/memory/manager.py +29 -53
- rasa/mantle/memory/schema.py +3 -3
- rasa/mantle/memory/validation.py +4 -4
- rasa/mantle/model_archive/snapshot.py +2 -2
- rasa/mantle/model_archive/training_telemetry.py +20 -11
- rasa/mantle/orchestration/ask_before_filling.py +380 -0
- rasa/mantle/orchestration/cancel_events.py +5 -13
- rasa/mantle/orchestration/collect_ask_state.py +16 -9
- rasa/mantle/orchestration/contracts.py +7 -12
- rasa/mantle/orchestration/correction/coercion.py +2 -29
- rasa/mantle/orchestration/correction/discovery.py +129 -52
- rasa/mantle/orchestration/correction/executor.py +490 -99
- rasa/mantle/orchestration/correction/models.py +11 -9
- rasa/mantle/orchestration/correction/replay.py +3 -16
- rasa/mantle/orchestration/dispatch_result.py +101 -0
- rasa/mantle/orchestration/hooks/__init__.py +10 -10
- rasa/mantle/orchestration/hooks/{outgoing_text.py → outgoing_message.py} +11 -11
- rasa/mantle/orchestration/hybrid_link.py +158 -0
- rasa/mantle/orchestration/memory_utils.py +5 -7
- rasa/mantle/orchestration/memory_validation_tools.py +8 -6
- rasa/mantle/orchestration/orchestrator.py +362 -391
- rasa/mantle/orchestration/pending_hold.py +225 -0
- rasa/mantle/orchestration/precondition_stack.py +95 -37
- rasa/mantle/orchestration/responses.py +4 -4
- rasa/mantle/orchestration/set_memory/__init__.py +1 -0
- rasa/mantle/orchestration/set_memory/argument_names.py +70 -0
- rasa/mantle/orchestration/set_memory/dispatcher.py +533 -0
- rasa/mantle/orchestration/set_memory/outcomes.py +98 -0
- rasa/mantle/orchestration/set_memory/revision.py +211 -0
- rasa/mantle/orchestration/set_memory/revision_applier.py +208 -0
- rasa/mantle/orchestration/set_memory_button.py +2 -5
- rasa/mantle/orchestration/settable_write.py +85 -14
- rasa/mantle/orchestration/skill_completion/gate.py +6 -4
- rasa/mantle/orchestration/skill_digression.py +18 -60
- rasa/mantle/orchestration/skill_executor.py +1984 -1455
- rasa/mantle/orchestration/skill_utils.py +388 -29
- rasa/mantle/orchestration/stated_fields.py +454 -0
- rasa/mantle/orchestration/tool_call_batch.py +77 -0
- rasa/mantle/orchestration/tool_execution/constraints.py +145 -14
- rasa/mantle/orchestration/tool_execution/invoker.py +9 -13
- rasa/mantle/orchestration/turn_context.py +34 -32
- rasa/mantle/orchestration/verbatim_triggers.py +11 -13
- rasa/mantle/processor.py +99 -37
- rasa/mantle/prompts/builtin_history.py +35 -0
- rasa/mantle/prompts/constructor.py +56 -36
- rasa/mantle/prompts/memory_lines.py +11 -0
- rasa/mantle/prompts/messages.py +198 -33
- rasa/mantle/prompts/renderer.py +23 -0
- rasa/mantle/prompts/state.py +111 -186
- rasa/mantle/prompts/system_prompt.py +88 -63
- rasa/mantle/prompts/templates/__init__.py +0 -4
- rasa/mantle/prompts/templates/active_skill.jinja2 +13 -26
- rasa/mantle/prompts/templates/knowledge_answering.jinja2 +5 -0
- rasa/mantle/prompts/templates/lifecycle_tools.jinja2 +13 -110
- rasa/mantle/prompts/templates/pending_tool_confirmation.jinja2 +32 -7
- rasa/mantle/prompts/templates/routing_catalog.jinja2 +3 -6
- rasa/mantle/prompts/templates/scope_handling.jinja2 +6 -14
- rasa/mantle/prompts/templates/skipped_collect_notice.jinja2 +1 -1
- rasa/mantle/skills/catalog.py +76 -9
- rasa/mantle/skills/conditions.py +4 -4
- rasa/mantle/skills/markdown_skill_compiler.py +6 -6
- rasa/mantle/skills/prose_scoping.py +29 -19
- rasa/mantle/skills/stack_frame_helpers.py +21 -13
- rasa/mantle/skills/steps.py +45 -44
- rasa/mantle/skills/validation.py +94 -68
- rasa/mantle/state/provenance.py +1 -1
- rasa/mantle/state/repair_metadata.py +11 -11
- rasa/mantle/state/session_continuation.py +77 -0
- rasa/mantle/state/tracker_handle.py +72 -44
- rasa/mantle/tools/constants.py +9 -0
- rasa/mantle/tools/decorator.py +31 -21
- rasa/mantle/tools/inventory.py +6 -4
- rasa/mantle/tools/loader.py +33 -31
- rasa/mantle/tools/mcp_import_spec.py +34 -19
- rasa/mantle/tools/mcp_meta.py +1 -1
- rasa/mantle/tools/result.py +1 -1
- rasa/mantle/tools/validation.py +42 -6
- rasa/mantle/validation.py +3 -3
- rasa/mantle/validation_finding.py +1 -1
- rasa/model_manager/config.py +18 -0
- rasa/model_manager/runner_service.py +84 -0
- rasa/privacy/event_broker_utils.py +24 -3
- rasa/privacy/mantle_anonymization.py +17 -7
- rasa/privacy/privacy_filter.py +282 -77
- rasa/privacy/privacy_manager.py +25 -7
- rasa/server.py +25 -7
- rasa/shared/constants.py +8 -0
- rasa/shared/core/constants.py +15 -1
- rasa/shared/core/events.py +107 -6
- rasa/shared/core/playback_marker.py +50 -16
- rasa/shared/core/trackers.py +9 -6
- rasa/shared/infrastructure/__init__.py +1 -0
- rasa/shared/infrastructure/constants.py +22 -0
- rasa/shared/infrastructure/iam/__init__.py +1 -0
- rasa/shared/infrastructure/iam/aws_iam_credentials_providers.py +328 -0
- rasa/shared/infrastructure/iam/credentials_provider_protocol.py +92 -0
- rasa/shared/infrastructure/redis_connection_factory.py +474 -0
- rasa/shared/nlu/constants.py +2 -0
- rasa/shared/utils/llm.py +17 -21
- rasa/shared/utils/schemas/events.py +9 -1
- rasa/studio/train.py +1 -1
- rasa/tracing/engine_token_usage.py +0 -1
- rasa/tracing/voice/__init__.py +8 -4
- rasa/tracing/voice/recorders/asr/connection.py +8 -6
- rasa/tracing/voice/recorders/asr/span_attributes.py +34 -17
- rasa/tracing/voice/recorders/connection.py +10 -5
- rasa/tracing/voice/recorders/reconnect.py +165 -0
- rasa/tracing/voice/recorders/tts/connection.py +6 -6
- rasa/tracing/voice/recorders/tts/span_attributes.py +6 -0
- rasa/tracing/voice/shared/semconv.py +23 -18
- rasa/version.py +1 -1
- {rasa_pro-3.22.0.dev3.dist-info → rasa_pro-3.22.0.dev5.dist-info}/METADATA +13 -11
- {rasa_pro-3.22.0.dev3.dist-info → rasa_pro-3.22.0.dev5.dist-info}/RECORD +655 -447
- rasa/core/channels/inspector/dist/assets/architecture-7GRP2DOG-c3261b6f.js +0 -1
- rasa/core/channels/inspector/dist/assets/channel-6a478806.js +0 -1
- rasa/core/channels/inspector/dist/assets/classDiagram-ZZMXUADV-aa376894.js +0 -1
- rasa/core/channels/inspector/dist/assets/classDiagram-v2-VYDZK3BY-aa376894.js +0 -1
- rasa/core/channels/inspector/dist/assets/cynefin-OW5HDTMX-1d4764f4.js +0 -1
- rasa/core/channels/inspector/dist/assets/eventmodeling-NTZA5JFV-4198fc99.js +0 -1
- rasa/core/channels/inspector/dist/assets/flowDiagram-HODETNUW-39aa8123.js +0 -1
- rasa/core/channels/inspector/dist/assets/gitGraph-4MIJSDKK-3c8a2697.js +0 -1
- rasa/core/channels/inspector/dist/assets/info-A6RAGUB7-b357205e.js +0 -1
- rasa/core/channels/inspector/dist/assets/packet-AYTQ26CC-a0566fcd.js +0 -1
- rasa/core/channels/inspector/dist/assets/pie-WAS4IAKB-2c914674.js +0 -1
- rasa/core/channels/inspector/dist/assets/radar-RG4KPBEZ-250e6275.js +0 -1
- rasa/core/channels/inspector/dist/assets/railroad-74A4TZTK-2e6a515c.js +0 -1
- rasa/core/channels/inspector/dist/assets/railroad-abnf-HS5TGJTU-d87728ed.js +0 -1
- rasa/core/channels/inspector/dist/assets/railroad-ebnf-LZEXJU2U-80278ef8.js +0 -1
- rasa/core/channels/inspector/dist/assets/railroad-peg-WCYAUIDC-0976b887.js +0 -1
- rasa/core/channels/inspector/dist/assets/stateDiagram-v2-MP3YSRHH-868b26bc.js +0 -1
- rasa/core/channels/inspector/dist/assets/swimlanesDiagram-VR7AAH4N-56dce0e5.js +0 -8
- rasa/core/channels/inspector/dist/assets/treeView-Q6P3EWNA-865c6aae.js +0 -1
- rasa/core/channels/inspector/dist/assets/treemap-WGGIJYW6-25956d6c.js +0 -1
- rasa/core/channels/inspector/dist/assets/wardley-WFR3VGLG-99c5646c.js +0 -1
- rasa/core/channels/inspector-nextgen/src/assets/images/tya-bot.png +0 -0
- rasa/core/channels/inspector-nextgen/src/assets/images/tya-user.png +0 -0
- rasa/core/voice/event_composition/handlers/barge_in/backchannel.py +0 -245
- rasa/mantle/hooks/outgoing_text.py +0 -82
- rasa/mantle/prompts/templates/set_fields_fill_instruction.jinja2 +0 -2
- rasa/mantle/prompts/templates/set_fields_fill_task.jinja2 +0 -11
- rasa/tracing/voice/recorders/call_recording.py +0 -118
- /rasa/{core/channels/voice_stream/asr → api/voice/asr/v1}/azure/constants.py +0 -0
- /rasa/{core/channels/voice_stream/tts → api/voice/tts/v1}/_client_session.py +0 -0
- {rasa_pro-3.22.0.dev3.dist-info → rasa_pro-3.22.0.dev5.dist-info}/WHEEL +0 -0
- {rasa_pro-3.22.0.dev3.dist-info → rasa_pro-3.22.0.dev5.dist-info}/entry_points.txt +0 -0
- {rasa_pro-3.22.0.dev3.dist-info → rasa_pro-3.22.0.dev5.dist-info}/licenses/NOTICE +0 -0
rasa/api/__init__.py
ADDED
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
"""Shared class resolution for Mantle ``rasa.api.<stage>._factory`` modules.
|
|
2
|
+
|
|
3
|
+
Every stage factory turns an ``integrations.yml`` type into a class: a builtin
|
|
4
|
+
short name, or a ``module.path.ClassName`` import path that is then checked
|
|
5
|
+
against the published contract. The lookup, the import, and the contract
|
|
6
|
+
checks several stages repeat live here so they cannot drift. Which methods a
|
|
7
|
+
stage requires and how an instance is constructed stay in the stage factory.
|
|
8
|
+
|
|
9
|
+
This module resolves classes only. The Mantle agent-load entrypoint that calls
|
|
10
|
+
the stage factories is ``rasa.mantle.config.integration_factory``.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
import importlib
|
|
16
|
+
from collections.abc import Callable, Iterable, Mapping
|
|
17
|
+
from dataclasses import dataclass
|
|
18
|
+
from typing import Any
|
|
19
|
+
|
|
20
|
+
from rasa.api.versioning import (
|
|
21
|
+
AmbiguousApiVersionError,
|
|
22
|
+
ResolvedApiVersion,
|
|
23
|
+
UnknownApiVersionError,
|
|
24
|
+
current_version,
|
|
25
|
+
resolve_version,
|
|
26
|
+
)
|
|
27
|
+
from rasa.shared.exceptions import RasaException
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@dataclass(frozen=True)
|
|
31
|
+
class ResolveErrors:
|
|
32
|
+
"""Exception types raised for each way an import path can fail to resolve.
|
|
33
|
+
|
|
34
|
+
Stages raise ``RasaException`` throughout. Knowledge stores keep the
|
|
35
|
+
built-in exception types their published factory has always raised.
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
invalid_type: type[Exception] = RasaException
|
|
39
|
+
import_failed: type[Exception] = RasaException
|
|
40
|
+
not_a_class: type[Exception] = RasaException
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
_RASA_ERRORS = ResolveErrors()
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def import_version_module(
|
|
47
|
+
component: str,
|
|
48
|
+
name: str,
|
|
49
|
+
*,
|
|
50
|
+
version: str | None = None,
|
|
51
|
+
) -> Any:
|
|
52
|
+
"""Import ``rasa.api.<component>.<version>.<name>``.
|
|
53
|
+
|
|
54
|
+
``version`` defaults to the current published version of ``component``.
|
|
55
|
+
"""
|
|
56
|
+
resolved = version or current_version(component)
|
|
57
|
+
return importlib.import_module(f"rasa.api.{component}.{resolved}.{name}")
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def import_version_base(component: str, *, version: str | None = None) -> Any:
|
|
61
|
+
"""Import the published ``base`` module for ``component``."""
|
|
62
|
+
return import_version_module(component, "base", version=version)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def resolve_integration_class(
|
|
66
|
+
config_type: str,
|
|
67
|
+
*,
|
|
68
|
+
kind: str,
|
|
69
|
+
load_builtins: Callable[[], Mapping[str, type]],
|
|
70
|
+
validate: Callable[[type, str], None],
|
|
71
|
+
errors: ResolveErrors = _RASA_ERRORS,
|
|
72
|
+
) -> type:
|
|
73
|
+
"""Resolve a builtin short name or a ``module.path.ClassName`` import path.
|
|
74
|
+
|
|
75
|
+
A name without a dot is looked up among the builtins. Anything else is
|
|
76
|
+
imported and handed to ``validate``. Builtins are returned unvalidated;
|
|
77
|
+
a factory that also validates builtins does so itself.
|
|
78
|
+
|
|
79
|
+
Args:
|
|
80
|
+
config_type: Builtin short name or dotted import path.
|
|
81
|
+
kind: Human-readable kind used in error messages (for example
|
|
82
|
+
``lock store``).
|
|
83
|
+
load_builtins: Returns the short name → class map for the current
|
|
84
|
+
version. Called only for a name without a dot, so an import path
|
|
85
|
+
never imports the builtin backends.
|
|
86
|
+
validate: Checks an imported class against the stage contract and
|
|
87
|
+
raises when it does not satisfy it. Receives the class and
|
|
88
|
+
``config_type``.
|
|
89
|
+
errors: Exception types for the three import failures.
|
|
90
|
+
|
|
91
|
+
Raises:
|
|
92
|
+
Exception: The matching type from ``errors`` when ``config_type`` is
|
|
93
|
+
neither a builtin nor an import path, when its module cannot be
|
|
94
|
+
imported, or when the name is not a class. Whatever ``validate``
|
|
95
|
+
raises propagates unchanged.
|
|
96
|
+
"""
|
|
97
|
+
if "." not in config_type:
|
|
98
|
+
builtin = load_builtins().get(config_type.lower())
|
|
99
|
+
if builtin is not None:
|
|
100
|
+
return builtin
|
|
101
|
+
|
|
102
|
+
try:
|
|
103
|
+
module_name, class_name = config_type.rsplit(".", 1)
|
|
104
|
+
module = importlib.import_module(module_name)
|
|
105
|
+
except ValueError as error:
|
|
106
|
+
raise errors.invalid_type(
|
|
107
|
+
f"Invalid {kind} type '{config_type}'. "
|
|
108
|
+
f"Expected a builtin name ({', '.join(sorted(load_builtins()))}) "
|
|
109
|
+
f"or module.path.ClassName."
|
|
110
|
+
) from error
|
|
111
|
+
except ModuleNotFoundError as error:
|
|
112
|
+
raise errors.import_failed(
|
|
113
|
+
f"Cannot retrieve class from path {config_type}."
|
|
114
|
+
) from error
|
|
115
|
+
|
|
116
|
+
external_class = getattr(module, class_name, None)
|
|
117
|
+
if not isinstance(external_class, type):
|
|
118
|
+
raise errors.not_a_class(f"{config_type} did not resolve to a class.")
|
|
119
|
+
|
|
120
|
+
validate(external_class, config_type)
|
|
121
|
+
return external_class
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
def require_published_version(
|
|
125
|
+
cls: type,
|
|
126
|
+
component: str,
|
|
127
|
+
*,
|
|
128
|
+
message: str,
|
|
129
|
+
error_type: type[Exception] = RasaException,
|
|
130
|
+
) -> ResolvedApiVersion:
|
|
131
|
+
"""Resolve the published version of ``cls`` or raise ``error_type``.
|
|
132
|
+
|
|
133
|
+
Use this where a stage reports an unversioned or ambiguous class in its
|
|
134
|
+
own words. A stage that lets the versioning errors through calls
|
|
135
|
+
``resolve_version`` directly.
|
|
136
|
+
"""
|
|
137
|
+
try:
|
|
138
|
+
return resolve_version(cls, component)
|
|
139
|
+
except (UnknownApiVersionError, AmbiguousApiVersionError) as error:
|
|
140
|
+
raise error_type(message) from error
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
def require_version_base(
|
|
144
|
+
cls: type,
|
|
145
|
+
resolved: ResolvedApiVersion,
|
|
146
|
+
base_attr: str,
|
|
147
|
+
*,
|
|
148
|
+
config_type: str,
|
|
149
|
+
) -> type:
|
|
150
|
+
"""Require ``cls`` to subclass ``base_attr`` of its own published version.
|
|
151
|
+
|
|
152
|
+
A class can resolve to a version through any published type, such as a
|
|
153
|
+
storage port. This checks it against the base customers are meant to
|
|
154
|
+
subclass, and returns that base.
|
|
155
|
+
"""
|
|
156
|
+
version_base: type = getattr(
|
|
157
|
+
import_version_base(resolved.component, version=resolved.version),
|
|
158
|
+
base_attr,
|
|
159
|
+
)
|
|
160
|
+
if not issubclass(cls, version_base):
|
|
161
|
+
raise RasaException(
|
|
162
|
+
f"{config_type} must be a subclass of "
|
|
163
|
+
f"rasa.api.{resolved.component}.{resolved.version}.{base_attr}."
|
|
164
|
+
)
|
|
165
|
+
return version_base
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
def reject_compatibility_bases(
|
|
169
|
+
cls: type,
|
|
170
|
+
resolved: ResolvedApiVersion,
|
|
171
|
+
*,
|
|
172
|
+
config_type: str,
|
|
173
|
+
contract: str,
|
|
174
|
+
) -> None:
|
|
175
|
+
"""Reject a class that reaches the published contract through ``rasa.core``.
|
|
176
|
+
|
|
177
|
+
The ``rasa.core`` classes that subclass a published base are compatibility
|
|
178
|
+
shims for the other engine. A Mantle customization subclasses the published
|
|
179
|
+
contract directly.
|
|
180
|
+
"""
|
|
181
|
+
matched_base_index = cls.__mro__.index(resolved.matched_base)
|
|
182
|
+
if any(
|
|
183
|
+
base.__module__.startswith("rasa.core.")
|
|
184
|
+
for base in cls.__mro__[:matched_base_index]
|
|
185
|
+
):
|
|
186
|
+
raise RasaException(
|
|
187
|
+
f"{config_type} must subclass the published "
|
|
188
|
+
f"rasa.api.{resolved.component}.{resolved.version} {contract} "
|
|
189
|
+
"contract, not an internal compatibility class."
|
|
190
|
+
)
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
def require_implemented(
|
|
194
|
+
cls: type,
|
|
195
|
+
base: type,
|
|
196
|
+
method_names: Iterable[str],
|
|
197
|
+
*,
|
|
198
|
+
config_type: str,
|
|
199
|
+
) -> None:
|
|
200
|
+
"""Require ``cls`` to override each named method of ``base``.
|
|
201
|
+
|
|
202
|
+
Raised before construction, so a class that inherits an abstract method is
|
|
203
|
+
reported without running customer code.
|
|
204
|
+
"""
|
|
205
|
+
for method_name in method_names:
|
|
206
|
+
if getattr(cls, method_name, None) is getattr(base, method_name):
|
|
207
|
+
raise RasaException(f"{config_type} must implement {method_name}().")
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"""Conversation field selection for brokers that key events by conversation.
|
|
2
|
+
|
|
3
|
+
Kafka and SQL need to know whether an event identifies its conversation as
|
|
4
|
+
``sender_id`` or ``conversation_id``. That choice follows the loaded engine
|
|
5
|
+
and is not part of the published ``EventBroker`` port. A later broker version
|
|
6
|
+
can reuse this mixin without copying it onto the storage contract.
|
|
7
|
+
|
|
8
|
+
This module does not import a published version.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from __future__ import annotations
|
|
12
|
+
|
|
13
|
+
from rasa.shared.engine_version import DEFAULT_ENGINE_VERSION, MANTLE_ENGINE_VERSION
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class ConversationKeyMixin:
|
|
17
|
+
"""Select the event field that identifies a conversation.
|
|
18
|
+
|
|
19
|
+
``engine_version`` is set from the loaded model. Until then the default
|
|
20
|
+
engine version selects ``sender_id``.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
engine_version: str = DEFAULT_ENGINE_VERSION
|
|
24
|
+
|
|
25
|
+
def conversation_key_name(self) -> str:
|
|
26
|
+
"""Return the event field that identifies the conversation."""
|
|
27
|
+
if self.engine_version == MANTLE_ENGINE_VERSION:
|
|
28
|
+
return "conversation_id"
|
|
29
|
+
return "sender_id"
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"""Create Mantle event brokers from a type key or import path.
|
|
2
|
+
|
|
3
|
+
The leading underscore marks this module as private. Customers subclass
|
|
4
|
+
``EventBroker`` from the published brokers API package. Rasa loads brokers
|
|
5
|
+
through this module.
|
|
6
|
+
|
|
7
|
+
Short names resolve to the builtins of the current published version. A custom
|
|
8
|
+
class may subclass the current or previous version; ``prepare_instance`` wraps
|
|
9
|
+
a previous version so callers receive the current interface.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from __future__ import annotations
|
|
13
|
+
|
|
14
|
+
from typing import Any
|
|
15
|
+
|
|
16
|
+
import structlog
|
|
17
|
+
|
|
18
|
+
from rasa.api._class_resolution import (
|
|
19
|
+
import_version_base,
|
|
20
|
+
import_version_module,
|
|
21
|
+
reject_compatibility_bases,
|
|
22
|
+
require_implemented,
|
|
23
|
+
require_published_version,
|
|
24
|
+
resolve_integration_class,
|
|
25
|
+
)
|
|
26
|
+
from rasa.api.versioning import current_version, prepare_instance
|
|
27
|
+
from rasa.shared.exceptions import ConnectionException, RasaException
|
|
28
|
+
|
|
29
|
+
structlogger = structlog.get_logger()
|
|
30
|
+
|
|
31
|
+
_BUILTIN_SPECS = {
|
|
32
|
+
"pika": ("pika", "PikaEventBroker"),
|
|
33
|
+
"sql": ("sql", "SQLEventBroker"),
|
|
34
|
+
"file": ("file", "FileEventBroker"),
|
|
35
|
+
"kafka": ("kafka", "KafkaEventBroker"),
|
|
36
|
+
"concurrent_kafka": ("kafka", "ConcurrentKafkaEventBroker"),
|
|
37
|
+
"http": ("http", "HttpEventBroker"),
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def _version_base(version: str | None = None) -> Any:
|
|
42
|
+
return import_version_base("brokers", version=version)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def _version_submodule(version: str, name: str) -> Any:
|
|
46
|
+
return import_version_module("brokers", name, version=version)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def builtin_types(version: str | None = None) -> dict[str, type]:
|
|
50
|
+
"""Map builtin short names to event broker classes for ``version``."""
|
|
51
|
+
resolved = version or current_version("brokers")
|
|
52
|
+
return {
|
|
53
|
+
name: getattr(_version_submodule(resolved, module_name), class_name)
|
|
54
|
+
for name, (module_name, class_name) in _BUILTIN_SPECS.items()
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
_BUILTIN_TYPES: dict[str, type] | None = None
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def _builtin_types_cached() -> dict[str, type]:
|
|
62
|
+
"""Load builtin broker classes once, on first use of a short name."""
|
|
63
|
+
global _BUILTIN_TYPES
|
|
64
|
+
if _BUILTIN_TYPES is None:
|
|
65
|
+
_BUILTIN_TYPES = builtin_types()
|
|
66
|
+
return _BUILTIN_TYPES
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
async def create_event_broker(
|
|
70
|
+
config_type: str | None,
|
|
71
|
+
settings: Any,
|
|
72
|
+
) -> Any:
|
|
73
|
+
"""Instantiate a Mantle event broker and normalize it to the current API.
|
|
74
|
+
|
|
75
|
+
``config_type`` is a builtin short name (``pika``, ``sql``, ``file``,
|
|
76
|
+
``kafka``, ``concurrent_kafka``, ``http``), a ``module.path.ClassName``
|
|
77
|
+
import path, or omitted for the Pika default when a broker section is
|
|
78
|
+
present.
|
|
79
|
+
|
|
80
|
+
``connect`` is awaited after preparation so this never returns an
|
|
81
|
+
unconfigured builtin.
|
|
82
|
+
|
|
83
|
+
Omitting the ``event_broker`` section entirely is handled by the Mantle
|
|
84
|
+
loader and yields ``None`` — this factory always builds a broker.
|
|
85
|
+
"""
|
|
86
|
+
resolved_type = config_type or "pika"
|
|
87
|
+
structlogger.debug(
|
|
88
|
+
"rasa.api.brokers.create_event_broker", config_type=resolved_type
|
|
89
|
+
)
|
|
90
|
+
base = _version_base()
|
|
91
|
+
broker_cls = resolve_event_broker_class(resolved_type)
|
|
92
|
+
_validate_event_broker_class(broker_cls, resolved_type)
|
|
93
|
+
try:
|
|
94
|
+
broker = broker_cls()
|
|
95
|
+
except TypeError as error:
|
|
96
|
+
raise RasaException(
|
|
97
|
+
f"{resolved_type} must be constructible without arguments."
|
|
98
|
+
) from error
|
|
99
|
+
prepared = prepare_instance(broker, "brokers")
|
|
100
|
+
if not isinstance(prepared, base.EventBroker):
|
|
101
|
+
raise RasaException(
|
|
102
|
+
f"Prepared event broker must implement EventBroker, got {type(prepared)!r}."
|
|
103
|
+
)
|
|
104
|
+
try:
|
|
105
|
+
await prepared.connect(settings)
|
|
106
|
+
except _connection_errors() as error:
|
|
107
|
+
raise ConnectionException("Cannot connect to event broker.") from error
|
|
108
|
+
return prepared
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
def resolve_event_broker_class(config_type: str) -> type:
|
|
112
|
+
"""Resolve a builtin name or import path to an event broker class."""
|
|
113
|
+
return resolve_integration_class(
|
|
114
|
+
config_type,
|
|
115
|
+
kind="event broker",
|
|
116
|
+
load_builtins=_builtin_types_cached,
|
|
117
|
+
validate=_validate_event_broker_class,
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
def _validate_event_broker_class(broker_cls: type, config_type: str) -> None:
|
|
122
|
+
"""Validate a broker contract before running customer construction code."""
|
|
123
|
+
resolved = require_published_version(
|
|
124
|
+
broker_cls,
|
|
125
|
+
"brokers",
|
|
126
|
+
message=f"{config_type} must be a subclass of EventBroker.",
|
|
127
|
+
)
|
|
128
|
+
broker_base = _version_base(resolved.version).EventBroker
|
|
129
|
+
if not issubclass(broker_cls, broker_base):
|
|
130
|
+
raise RasaException(f"{config_type} must be a subclass of EventBroker.")
|
|
131
|
+
|
|
132
|
+
reject_compatibility_bases(
|
|
133
|
+
broker_cls, resolved, config_type=config_type, contract="EventBroker"
|
|
134
|
+
)
|
|
135
|
+
require_implemented(
|
|
136
|
+
broker_cls, broker_base, ("connect", "publish"), config_type=config_type
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
def _connection_errors() -> tuple[type[BaseException], ...]:
|
|
141
|
+
"""Return backend connection failures normalized by both runtime paths."""
|
|
142
|
+
import aio_pika.exceptions
|
|
143
|
+
import aiormq.exceptions
|
|
144
|
+
import sqlalchemy.exc
|
|
145
|
+
|
|
146
|
+
return (
|
|
147
|
+
sqlalchemy.exc.OperationalError,
|
|
148
|
+
aio_pika.exceptions.AMQPConnectionError,
|
|
149
|
+
aiormq.exceptions.ChannelNotFoundEntity,
|
|
150
|
+
*aio_pika.exceptions.CONNECTION_EXCEPTIONS,
|
|
151
|
+
)
|
rasa/api/brokers/_sql.py
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"""Private SQL helpers shared by published broker implementations."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Any
|
|
6
|
+
from urllib import parse
|
|
7
|
+
|
|
8
|
+
from sqlalchemy.engine import URL
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def build_db_url(
|
|
12
|
+
dialect: str = "sqlite",
|
|
13
|
+
host: str | None = None,
|
|
14
|
+
port: int | None = None,
|
|
15
|
+
db: str = "events.db",
|
|
16
|
+
username: str | None = None,
|
|
17
|
+
password: str | None = None,
|
|
18
|
+
query: dict[str, Any] | None = None,
|
|
19
|
+
) -> str | URL:
|
|
20
|
+
"""Build an SQLAlchemy URL without depending on a CALM tracker store."""
|
|
21
|
+
if host and "://" in host:
|
|
22
|
+
return host
|
|
23
|
+
if host:
|
|
24
|
+
parsed = parse.urlsplit(f"scheme://{host}")
|
|
25
|
+
port = parsed.port or port
|
|
26
|
+
host = parsed.hostname or host
|
|
27
|
+
|
|
28
|
+
return URL.create(
|
|
29
|
+
dialect,
|
|
30
|
+
username=username,
|
|
31
|
+
password=password,
|
|
32
|
+
host=host,
|
|
33
|
+
port=port,
|
|
34
|
+
database=db,
|
|
35
|
+
query=query or {},
|
|
36
|
+
)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"""Mantle event broker contract — version 1.
|
|
2
|
+
|
|
3
|
+
Public surface for custom event brokers.
|
|
4
|
+
|
|
5
|
+
Publishing this package under ``rasa.api.brokers.v1`` is enough for the
|
|
6
|
+
versioning framework to discover it — no registration call is required.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
from rasa.api.brokers.v1.base import EventBroker
|
|
12
|
+
from rasa.api.brokers.v1.file import FileEventBroker
|
|
13
|
+
from rasa.api.brokers.v1.http import HttpEventBroker
|
|
14
|
+
from rasa.api.brokers.v1.kafka import ConcurrentKafkaEventBroker, KafkaEventBroker
|
|
15
|
+
from rasa.api.brokers.v1.pika import PikaEventBroker
|
|
16
|
+
from rasa.api.brokers.v1.sql import SQLEventBroker
|
|
17
|
+
from rasa.api.brokers.v1.types import EventBrokerSettings
|
|
18
|
+
|
|
19
|
+
__all__ = [
|
|
20
|
+
"ConcurrentKafkaEventBroker",
|
|
21
|
+
"EventBroker",
|
|
22
|
+
"EventBrokerSettings",
|
|
23
|
+
"FileEventBroker",
|
|
24
|
+
"HttpEventBroker",
|
|
25
|
+
"KafkaEventBroker",
|
|
26
|
+
"PikaEventBroker",
|
|
27
|
+
"SQLEventBroker",
|
|
28
|
+
]
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"""Mantle ``EventBroker`` abstract base (``rasa.api.brokers.v1``)."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from abc import ABC, abstractmethod
|
|
6
|
+
from typing import Any, Optional
|
|
7
|
+
|
|
8
|
+
from rasa.api.brokers.v1.types import EventBrokerSettings
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class EventBroker(ABC):
|
|
12
|
+
"""Published Mantle contract for event broker backends.
|
|
13
|
+
|
|
14
|
+
Customers subclass this base, or a builtin from the same module, and import
|
|
15
|
+
it from ``rasa.api.brokers.v1``. YAML names the class only; the import names
|
|
16
|
+
the version.
|
|
17
|
+
|
|
18
|
+
A backend implements ``connect``, ``publish``, and may override ``is_ready``
|
|
19
|
+
and ``close``.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
def __init__(self) -> None:
|
|
23
|
+
"""Create an unconnected event broker."""
|
|
24
|
+
|
|
25
|
+
@abstractmethod
|
|
26
|
+
async def connect(self, settings: EventBrokerSettings) -> None:
|
|
27
|
+
"""Connect or configure the broker using Mantle settings."""
|
|
28
|
+
|
|
29
|
+
@abstractmethod
|
|
30
|
+
def publish(self, event: dict[str, Any]) -> None:
|
|
31
|
+
"""Publish a JSON-formatted Rasa event."""
|
|
32
|
+
|
|
33
|
+
def publish_batch(self, events: list[dict[str, Any]]) -> None:
|
|
34
|
+
"""Publish the new events of one conversation, in order.
|
|
35
|
+
|
|
36
|
+
A transport that pays a per-request cost overrides this to send them
|
|
37
|
+
together. Publishing them one at a time is what the caller would do
|
|
38
|
+
otherwise, so a broker that has no use for the batch inherits exactly
|
|
39
|
+
the behaviour it had before.
|
|
40
|
+
"""
|
|
41
|
+
for event in events:
|
|
42
|
+
self.publish(event)
|
|
43
|
+
|
|
44
|
+
def raise_if_engine_unsupported(self, engine_version: Optional[str]) -> None:
|
|
45
|
+
"""Refuse a model whose events this broker cannot carry.
|
|
46
|
+
|
|
47
|
+
Brokers carry every engine by default. Engine-specific transports can
|
|
48
|
+
override this hook to reject an incompatible model before it is loaded.
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
def is_ready(self) -> bool:
|
|
52
|
+
"""Return whether the broker is ready to publish."""
|
|
53
|
+
return True
|
|
54
|
+
|
|
55
|
+
async def close(self) -> None:
|
|
56
|
+
"""Close the connection to the event broker."""
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"""File Mantle event broker builtin."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
import logging
|
|
7
|
+
from typing import Any, Optional
|
|
8
|
+
|
|
9
|
+
from rasa.api.brokers.v1.base import EventBroker
|
|
10
|
+
from rasa.api.brokers.v1.types import EventBrokerSettings
|
|
11
|
+
|
|
12
|
+
logger = logging.getLogger(__name__)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class FileEventBroker(EventBroker):
|
|
16
|
+
"""Log events to a file in json format.
|
|
17
|
+
|
|
18
|
+
There will be one event per line and each event is stored as json.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
DEFAULT_LOG_FILE_NAME = "rasa_event.log"
|
|
22
|
+
|
|
23
|
+
def __init__(self) -> None:
|
|
24
|
+
"""Create an unconnected file event broker."""
|
|
25
|
+
super().__init__()
|
|
26
|
+
self.path: str = self.DEFAULT_LOG_FILE_NAME
|
|
27
|
+
self.event_logger: logging.Logger | None = None
|
|
28
|
+
|
|
29
|
+
async def connect(self, settings: EventBrokerSettings) -> None:
|
|
30
|
+
"""Configure the log file from Mantle settings."""
|
|
31
|
+
params = dict(settings.params)
|
|
32
|
+
self._configure(path=params.get("path"))
|
|
33
|
+
|
|
34
|
+
def publish(self, event: dict[str, Any]) -> None:
|
|
35
|
+
"""Write event to file."""
|
|
36
|
+
if self.event_logger is None:
|
|
37
|
+
raise RuntimeError("FileEventBroker.connect must be called before publish.")
|
|
38
|
+
self.event_logger.info(json.dumps(event))
|
|
39
|
+
self.event_logger.handlers[0].flush()
|
|
40
|
+
|
|
41
|
+
async def close(self) -> None:
|
|
42
|
+
"""Close this broker's file handlers."""
|
|
43
|
+
if self.event_logger is None:
|
|
44
|
+
return
|
|
45
|
+
for handler in list(self.event_logger.handlers):
|
|
46
|
+
self.event_logger.removeHandler(handler)
|
|
47
|
+
handler.close()
|
|
48
|
+
logging.Logger.manager.loggerDict.pop(self.event_logger.name, None)
|
|
49
|
+
self.event_logger = None
|
|
50
|
+
|
|
51
|
+
def _configure(self, path: Optional[str] = None) -> None:
|
|
52
|
+
self.path = path or self.DEFAULT_LOG_FILE_NAME
|
|
53
|
+
self.event_logger = self._event_logger()
|
|
54
|
+
|
|
55
|
+
def _event_logger(self) -> logging.Logger:
|
|
56
|
+
"""Instantiate the file logger."""
|
|
57
|
+
logger_file = self.path
|
|
58
|
+
query_logger = logging.getLogger(f"event-logger.{id(self)}")
|
|
59
|
+
query_logger.setLevel(logging.INFO)
|
|
60
|
+
for existing_handler in list(query_logger.handlers):
|
|
61
|
+
query_logger.removeHandler(existing_handler)
|
|
62
|
+
existing_handler.close()
|
|
63
|
+
handler = logging.FileHandler(logger_file)
|
|
64
|
+
handler.setFormatter(logging.Formatter("%(message)s"))
|
|
65
|
+
query_logger.propagate = False
|
|
66
|
+
query_logger.addHandler(handler)
|
|
67
|
+
|
|
68
|
+
logger.info(f"Logging events to '{logger_file}'.")
|
|
69
|
+
|
|
70
|
+
return query_logger
|