rasa-pro 3.14.0.dev5__py3-none-any.whl → 3.14.0.dev6__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/agents/agent_factory.py +122 -0
- rasa/agents/agent_manager.py +163 -0
- rasa/agents/constants.py +40 -0
- rasa/agents/core/agent_protocol.py +107 -0
- rasa/agents/core/types.py +70 -0
- rasa/agents/exceptions.py +8 -0
- rasa/agents/protocol/__init__.py +5 -0
- rasa/agents/protocol/a2a/a2a_agent.py +662 -0
- rasa/agents/protocol/mcp/mcp_base_agent.py +684 -0
- rasa/agents/protocol/mcp/mcp_open_agent.py +290 -0
- rasa/agents/protocol/mcp/mcp_task_agent.py +484 -0
- rasa/agents/schemas/__init__.py +12 -0
- rasa/agents/schemas/agent_input.py +38 -0
- rasa/agents/schemas/agent_output.py +26 -0
- rasa/agents/schemas/agent_tool_result.py +67 -0
- rasa/agents/schemas/agent_tool_schema.py +134 -0
- rasa/agents/templates/mcp_open_agent_prompt_template.jinja2 +15 -0
- rasa/agents/templates/mcp_task_agent_prompt_template.jinja2 +17 -0
- rasa/agents/utils.py +72 -0
- rasa/api.py +5 -0
- rasa/cli/arguments/default_arguments.py +12 -0
- rasa/cli/arguments/run.py +2 -0
- rasa/cli/dialogue_understanding_test.py +4 -0
- rasa/cli/e2e_test.py +4 -0
- rasa/cli/inspect.py +3 -0
- rasa/cli/llm_fine_tuning.py +5 -0
- rasa/cli/project_templates/tutorial/config.yml +1 -2
- rasa/cli/run.py +4 -0
- rasa/cli/scaffold.py +2 -46
- rasa/cli/shell.py +3 -0
- rasa/constants.py +6 -0
- rasa/core/actions/action.py +56 -10
- rasa/core/agent.py +19 -1
- rasa/core/available_agents.py +199 -0
- rasa/core/available_endpoints.py +30 -0
- rasa/core/channels/channel.py +3 -4
- rasa/core/channels/development_inspector.py +4 -4
- rasa/core/channels/hangouts.py +2 -2
- rasa/core/channels/inspector/dist/assets/{arc-18042c22.js → arc-63212852.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{blockDiagram-38ab4fdb-fdd6bcfa.js → blockDiagram-38ab4fdb-eecf6b13.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{c4Diagram-3d4e48cf-f5ae6786.js → c4Diagram-3d4e48cf-8f798a9a.js} +1 -1
- rasa/core/channels/inspector/dist/assets/channel-0cd70adf.js +1 -0
- rasa/core/channels/inspector/dist/assets/{classDiagram-70f12bd4-81efba3e.js → classDiagram-70f12bd4-df71a04c.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{classDiagram-v2-f2320105-3b6b6a92.js → classDiagram-v2-f2320105-9b275968.js} +1 -1
- rasa/core/channels/inspector/dist/assets/clone-a0f9c4ed.js +1 -0
- rasa/core/channels/inspector/dist/assets/{createText-2e5e7dd3-31422447.js → createText-2e5e7dd3-1c669cad.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{edges-e0da2a9e-518a90db.js → edges-e0da2a9e-b1553799.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{erDiagram-9861fffd-a6d3c25a.js → erDiagram-9861fffd-112388d6.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{flowDb-956e92f1-e048c2be.js → flowDb-956e92f1-fdebec47.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{flowDiagram-66a62f08-c7474c91.js → flowDiagram-66a62f08-6280ede1.js} +1 -1
- rasa/core/channels/inspector/dist/assets/flowDiagram-v2-96b9c2cf-de9cc4aa.js +1 -0
- rasa/core/channels/inspector/dist/assets/{flowchart-elk-definition-4a651766-cb4d8723.js → flowchart-elk-definition-4a651766-e1dc03e5.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{ganttDiagram-c361ad54-346636a2.js → ganttDiagram-c361ad54-83f68c51.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{gitGraphDiagram-72cf32ee-7c508874.js → gitGraphDiagram-72cf32ee-22f8666f.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{graph-14702d8a.js → graph-ca9e6217.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{index-3862675e-f18b534b.js → index-3862675e-c5ceb692.js} +1 -1
- rasa/core/channels/inspector/dist/assets/index-3e293924.js +1353 -0
- rasa/core/channels/inspector/dist/assets/{infoDiagram-f8f76790-64154b83.js → infoDiagram-f8f76790-faa9999b.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{journeyDiagram-49397b02-833a5f95.js → journeyDiagram-49397b02-c4dda8d9.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{layout-5a3b2123.js → layout-d4307784.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{line-2272a8c7.js → line-0567aaa7.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{linear-35bcf273.js → linear-c11b95cf.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{mindmap-definition-fc14e90a-92dcb0e9.js → mindmap-definition-fc14e90a-0c7d3ca9.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{pieDiagram-8a3498a8-94dbc900.js → pieDiagram-8a3498a8-34b433fa.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{quadrantDiagram-120e2f19-8b7a9c33.js → quadrantDiagram-120e2f19-4cab816e.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{requirementDiagram-deff3bca-6f7eab81.js → requirementDiagram-deff3bca-8c22fa9e.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{sankeyDiagram-04a897e0-f43e581d.js → sankeyDiagram-04a897e0-70ce9e8e.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{sequenceDiagram-704730f1-0bcbefc3.js → sequenceDiagram-704730f1-fbcd7fc9.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{stateDiagram-587899a1-b8a74083.js → stateDiagram-587899a1-45f05ea6.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{stateDiagram-v2-d93cdb3a-2070218f.js → stateDiagram-v2-d93cdb3a-beab1ea6.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-6aaf32cf-f1d54e34.js → styles-6aaf32cf-2f29dbd5.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-9a916d00-980de489.js → styles-9a916d00-951eac83.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-c10674c1-3c03abde.js → styles-c10674c1-897fbfdd.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{svgDrawCommon-08f97a94-46ba068f.js → svgDrawCommon-08f97a94-d667fac1.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{timeline-definition-85554ec2-901f5e3d.js → timeline-definition-85554ec2-e3205144.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{xychartDiagram-e933f94c-acbc628a.js → xychartDiagram-e933f94c-4abeb0e2.js} +1 -1
- rasa/core/channels/inspector/dist/index.html +2 -2
- rasa/core/channels/inspector/index.html +1 -1
- rasa/core/channels/inspector/src/App.tsx +11 -10
- rasa/core/channels/inspector/src/components/DialogueInformation.tsx +3 -12
- rasa/core/channels/inspector/src/components/DialogueStack.tsx +6 -4
- rasa/core/channels/inspector/src/helpers/formatters.ts +24 -3
- rasa/core/channels/inspector/src/theme/base/styles.ts +19 -1
- rasa/core/channels/inspector/src/types.ts +4 -0
- rasa/core/channels/socketio.py +51 -212
- rasa/core/channels/studio_chat.py +29 -49
- rasa/core/channels/voice_stream/genesys.py +1 -1
- rasa/core/channels/voice_stream/voice_channel.py +3 -5
- rasa/core/constants.py +4 -0
- rasa/core/policies/enterprise_search_policy.py +11 -6
- rasa/core/policies/flow_policy.py +4 -4
- rasa/core/policies/flows/flow_executor.py +470 -45
- rasa/core/policies/flows/mcp_tool_executor.py +277 -0
- rasa/core/policies/intentless_policy.py +1 -1
- rasa/core/policies/unexpected_intent_policy.py +1 -0
- rasa/core/processor.py +18 -15
- rasa/core/run.py +11 -14
- rasa/core/tracker_stores/tracker_store.py +3 -7
- rasa/core/train.py +1 -1
- rasa/core/training/interactive.py +16 -16
- rasa/core/training/story_conflict.py +5 -5
- rasa/core/utils.py +21 -1
- rasa/dialogue_understanding/commands/__init__.py +8 -0
- rasa/dialogue_understanding/commands/cancel_flow_command.py +97 -4
- rasa/dialogue_understanding/commands/chit_chat_answer_command.py +11 -0
- rasa/dialogue_understanding/commands/clarify_command.py +10 -0
- rasa/dialogue_understanding/commands/continue_agent_command.py +91 -0
- rasa/dialogue_understanding/commands/knowledge_answer_command.py +11 -0
- rasa/dialogue_understanding/commands/restart_agent_command.py +162 -0
- rasa/dialogue_understanding/commands/start_flow_command.py +164 -8
- rasa/dialogue_understanding/commands/utils.py +6 -2
- rasa/dialogue_understanding/generator/command_parser.py +4 -0
- rasa/dialogue_understanding/generator/flow_retrieval.py +9 -10
- rasa/dialogue_understanding/generator/llm_based_command_generator.py +50 -12
- rasa/dialogue_understanding/generator/llm_command_generator.py +1 -1
- rasa/dialogue_understanding/generator/multi_step/multi_step_llm_command_generator.py +1 -1
- rasa/dialogue_understanding/generator/prompt_templates/agent_command_prompt_v2_claude_3_5_sonnet_20240620_template.jinja2 +61 -0
- rasa/{cli/project_templates/telco/prompts/command-generator.jinja2 → dialogue_understanding/generator/prompt_templates/agent_command_prompt_v2_gpt_4o_2024_11_20_template.jinja2} +7 -3
- rasa/dialogue_understanding/generator/prompt_templates/agent_command_prompt_v3_claude_3_5_sonnet_20240620_template.jinja2 +81 -0
- rasa/dialogue_understanding/generator/prompt_templates/agent_command_prompt_v3_gpt_4o_2024_11_20_template.jinja2 +81 -0
- rasa/dialogue_understanding/generator/single_step/compact_llm_command_generator.py +7 -6
- rasa/dialogue_understanding/generator/single_step/search_ready_llm_command_generator.py +7 -6
- rasa/dialogue_understanding/generator/single_step/single_step_based_llm_command_generator.py +41 -2
- rasa/dialogue_understanding/patterns/continue_interrupted.py +163 -1
- rasa/dialogue_understanding/patterns/default_flows_for_patterns.yml +52 -8
- rasa/dialogue_understanding/processor/command_processor.py +31 -15
- rasa/dialogue_understanding/stack/dialogue_stack.py +123 -2
- rasa/dialogue_understanding/stack/frames/flow_stack_frame.py +57 -0
- rasa/dialogue_understanding/stack/utils.py +17 -2
- rasa/dialogue_understanding_test/du_test_runner.py +7 -2
- rasa/e2e_test/e2e_test_runner.py +12 -2
- rasa/engine/caching.py +2 -2
- rasa/engine/recipes/default_components.py +10 -18
- rasa/engine/storage/local_model_storage.py +2 -45
- rasa/graph_components/validators/default_recipe_validator.py +134 -134
- rasa/hooks.py +5 -5
- rasa/llm_fine_tuning/utils.py +2 -2
- rasa/model_manager/model_api.py +5 -4
- rasa/model_manager/runner_service.py +1 -1
- rasa/model_manager/socket_bridge.py +14 -20
- rasa/model_manager/trainer_service.py +9 -12
- rasa/model_manager/utils.py +29 -1
- rasa/model_manager/warm_rasa_process.py +1 -1
- rasa/nlu/extractors/extractor.py +2 -1
- rasa/plugin.py +8 -8
- rasa/privacy/privacy_manager.py +11 -2
- rasa/server.py +14 -2
- rasa/shared/agents/utils.py +35 -0
- rasa/shared/constants.py +5 -0
- rasa/shared/core/constants.py +12 -1
- rasa/shared/core/domain.py +11 -58
- rasa/shared/core/events.py +327 -0
- rasa/shared/core/flows/flow_step.py +1 -7
- rasa/shared/core/flows/flows_list.py +15 -5
- rasa/shared/core/flows/flows_yaml_schema.json +112 -186
- rasa/shared/core/flows/steps/call.py +53 -5
- rasa/shared/core/flows/validation.py +177 -7
- rasa/shared/core/flows/yaml_flows_io.py +9 -17
- rasa/shared/core/slots.py +2 -6
- rasa/shared/core/trackers.py +5 -2
- rasa/shared/exceptions.py +4 -0
- rasa/shared/importers/importer.py +0 -6
- rasa/shared/importers/rasa.py +1 -1
- rasa/shared/importers/utils.py +10 -80
- rasa/shared/providers/_utils.py +44 -60
- rasa/shared/providers/embedding/default_litellm_embedding_client.py +0 -2
- rasa/shared/providers/llm/_base_litellm_client.py +39 -7
- rasa/shared/providers/llm/default_litellm_llm_client.py +0 -2
- rasa/shared/providers/llm/litellm_router_llm_client.py +8 -4
- rasa/shared/providers/llm/llm_client.py +7 -3
- rasa/shared/providers/llm/llm_response.py +66 -0
- rasa/shared/providers/llm/self_hosted_llm_client.py +8 -4
- rasa/shared/utils/llm.py +28 -5
- rasa/shared/utils/mcp/server_connection.py +166 -0
- rasa/shared/utils/schemas/events.py +42 -0
- rasa/shared/utils/yaml.py +3 -1
- rasa/studio/upload.py +47 -16
- rasa/telemetry.py +23 -97
- rasa/tracing/instrumentation/instrumentation.py +14 -10
- rasa/tracing/instrumentation/intentless_policy_instrumentation.py +4 -4
- rasa/utils/common.py +79 -0
- rasa/utils/io.py +9 -27
- rasa/utils/json_utils.py +1 -6
- rasa/utils/log_utils.py +2 -6
- rasa/utils/ml_utils.py +1 -1
- rasa/utils/tensorflow/rasa_layers.py +1 -1
- rasa/utils/train_utils.py +15 -15
- rasa/validator.py +19 -21
- rasa/version.py +1 -1
- {rasa_pro-3.14.0.dev5.dist-info → rasa_pro-3.14.0.dev6.dist-info}/METADATA +14 -17
- {rasa_pro-3.14.0.dev5.dist-info → rasa_pro-3.14.0.dev6.dist-info}/RECORD +201 -432
- rasa/builder/README.md +0 -120
- rasa/builder/auth.py +0 -176
- rasa/builder/config.py +0 -115
- rasa/builder/copilot/constants.py +0 -25
- rasa/builder/copilot/copilot.py +0 -372
- rasa/builder/copilot/copilot_response_handler.py +0 -487
- rasa/builder/copilot/copilot_templated_message_provider.py +0 -58
- rasa/builder/copilot/exceptions.py +0 -20
- rasa/builder/copilot/models.py +0 -431
- rasa/builder/copilot/prompts/copilot_system_prompt.jinja2 +0 -726
- rasa/builder/copilot/telemetry.py +0 -195
- rasa/builder/copilot/templated_messages/copilot_internal_messages_templates.yml +0 -16
- rasa/builder/copilot/templated_messages/copilot_templated_responses.yml +0 -26
- rasa/builder/document_retrieval/constants.py +0 -15
- rasa/builder/document_retrieval/inkeep-rag-response-schema.json +0 -64
- rasa/builder/document_retrieval/inkeep_document_retrieval.py +0 -238
- rasa/builder/document_retrieval/models.py +0 -62
- rasa/builder/download.py +0 -140
- rasa/builder/exceptions.py +0 -55
- rasa/builder/guardrails/__init__.py +0 -1
- rasa/builder/guardrails/constants.py +0 -3
- rasa/builder/guardrails/exceptions.py +0 -4
- rasa/builder/guardrails/lakera.py +0 -206
- rasa/builder/guardrails/models.py +0 -199
- rasa/builder/guardrails/utils.py +0 -305
- rasa/builder/job_manager.py +0 -87
- rasa/builder/jobs.py +0 -234
- rasa/builder/llm_service.py +0 -246
- rasa/builder/logging_utils.py +0 -209
- rasa/builder/main.py +0 -174
- rasa/builder/models.py +0 -197
- rasa/builder/project_generator.py +0 -450
- rasa/builder/project_info.py +0 -72
- rasa/builder/scrape_rasa_docs.py +0 -97
- rasa/builder/service.py +0 -1142
- rasa/builder/shared/tracker_context.py +0 -212
- rasa/builder/skill_to_bot_prompt.jinja2 +0 -164
- rasa/builder/training_service.py +0 -132
- rasa/builder/validation_service.py +0 -93
- rasa/cli/project_templates/basic/actions/action_api.py +0 -15
- rasa/cli/project_templates/basic/actions/action_human_handoff.py +0 -44
- rasa/cli/project_templates/basic/config.yml +0 -23
- rasa/cli/project_templates/basic/credentials.yml +0 -34
- rasa/cli/project_templates/basic/data/general/feedback.yml +0 -20
- rasa/cli/project_templates/basic/data/general/goodbye.yml +0 -6
- rasa/cli/project_templates/basic/data/general/hello.yml +0 -7
- rasa/cli/project_templates/basic/data/general/help.yml +0 -6
- rasa/cli/project_templates/basic/data/general/human_handoff.yml +0 -16
- rasa/cli/project_templates/basic/data/general/welcome.yml +0 -9
- rasa/cli/project_templates/basic/data/system/pattern_completed.yml +0 -7
- rasa/cli/project_templates/basic/data/system/pattern_correction.yml +0 -7
- rasa/cli/project_templates/basic/data/system/pattern_search.yml +0 -8
- rasa/cli/project_templates/basic/data/system/pattern_session_start.yml +0 -8
- rasa/cli/project_templates/basic/docs/rasa_assistant_qa.txt +0 -65
- rasa/cli/project_templates/basic/docs/template.txt +0 -7
- rasa/cli/project_templates/basic/domain/general/assistant_details.yml +0 -12
- rasa/cli/project_templates/basic/domain/general/bot_identity.yml +0 -5
- rasa/cli/project_templates/basic/domain/general/cannot_handle.yml +0 -5
- rasa/cli/project_templates/basic/domain/general/feedback.yml +0 -28
- rasa/cli/project_templates/basic/domain/general/goodbye.yml +0 -7
- rasa/cli/project_templates/basic/domain/general/help.yml +0 -5
- rasa/cli/project_templates/basic/domain/general/human_handoff_domain.yml +0 -35
- rasa/cli/project_templates/basic/domain/general/utils.yml +0 -13
- rasa/cli/project_templates/basic/domain/general/welcome.yml +0 -7
- rasa/cli/project_templates/basic/endpoints.yml +0 -73
- rasa/cli/project_templates/basic/prompts/rephraser_demo_personality_prompt.jinja2 +0 -19
- rasa/cli/project_templates/finance/actions/__init__.py +0 -46
- rasa/cli/project_templates/finance/actions/accounts/action_ask_account.py +0 -47
- rasa/cli/project_templates/finance/actions/accounts/action_check_balance.py +0 -40
- rasa/cli/project_templates/finance/actions/action_session_start.py +0 -74
- rasa/cli/project_templates/finance/actions/cards/action_ask_card.py +0 -48
- rasa/cli/project_templates/finance/actions/cards/action_check_card_existence.py +0 -36
- rasa/cli/project_templates/finance/actions/cards/action_update_card_status.py +0 -54
- rasa/cli/project_templates/finance/actions/database.py +0 -277
- rasa/cli/project_templates/finance/actions/transfers/__init__.py +0 -0
- rasa/cli/project_templates/finance/actions/transfers/action_add_payee.py +0 -52
- rasa/cli/project_templates/finance/actions/transfers/action_ask_account_from.py +0 -51
- rasa/cli/project_templates/finance/actions/transfers/action_check_payee_existence.py +0 -40
- rasa/cli/project_templates/finance/actions/transfers/action_check_sufficient_funds.py +0 -40
- rasa/cli/project_templates/finance/actions/transfers/action_list_payees.py +0 -46
- rasa/cli/project_templates/finance/actions/transfers/action_process_immediate_payment.py +0 -18
- rasa/cli/project_templates/finance/actions/transfers/action_remove_payee.py +0 -49
- rasa/cli/project_templates/finance/actions/transfers/action_schedule_payment.py +0 -19
- rasa/cli/project_templates/finance/actions/transfers/action_validate_payment_date.py +0 -36
- rasa/cli/project_templates/finance/config.yml +0 -21
- rasa/cli/project_templates/finance/credentials.yml +0 -32
- rasa/cli/project_templates/finance/csvs/accounts.csv +0 -8
- rasa/cli/project_templates/finance/csvs/advisors.csv +0 -7
- rasa/cli/project_templates/finance/csvs/appointments.csv +0 -211
- rasa/cli/project_templates/finance/csvs/branches.csv +0 -10
- rasa/cli/project_templates/finance/csvs/cards.csv +0 -11
- rasa/cli/project_templates/finance/csvs/payees.csv +0 -11
- rasa/cli/project_templates/finance/csvs/transactions.csv +0 -71
- rasa/cli/project_templates/finance/csvs/users.csv +0 -4
- rasa/cli/project_templates/finance/data/accounts/check_balance.yml +0 -10
- rasa/cli/project_templates/finance/data/cards/block_card.yml +0 -66
- rasa/cli/project_templates/finance/data/cards/select_card.yml +0 -12
- rasa/cli/project_templates/finance/data/general/bot_identity.yml +0 -6
- rasa/cli/project_templates/finance/data/general/feedback.yml +0 -20
- rasa/cli/project_templates/finance/data/general/goodbye.yml +0 -6
- rasa/cli/project_templates/finance/data/general/hello.yml +0 -7
- rasa/cli/project_templates/finance/data/general/help.yml +0 -9
- rasa/cli/project_templates/finance/data/general/human_handoff.yml +0 -16
- rasa/cli/project_templates/finance/data/general/welcome.yml +0 -9
- rasa/cli/project_templates/finance/data/system/patterns/pattern_chitchat.yml +0 -5
- rasa/cli/project_templates/finance/data/system/patterns/pattern_completed.yml +0 -7
- rasa/cli/project_templates/finance/data/system/patterns/pattern_correction.yml +0 -7
- rasa/cli/project_templates/finance/data/system/patterns/pattern_search.yml +0 -8
- rasa/cli/project_templates/finance/data/system/patterns/pattern_session_start.yml +0 -8
- rasa/cli/project_templates/finance/data/system/source/accounts.json +0 -51
- rasa/cli/project_templates/finance/data/system/source/advisors.json +0 -44
- rasa/cli/project_templates/finance/data/system/source/appointments.json +0 -1474
- rasa/cli/project_templates/finance/data/system/source/branches.json +0 -47
- rasa/cli/project_templates/finance/data/system/source/cards.json +0 -72
- rasa/cli/project_templates/finance/data/system/source/payees.json +0 -74
- rasa/cli/project_templates/finance/data/system/source/transactions.json +0 -492
- rasa/cli/project_templates/finance/data/system/source/users.json +0 -29
- rasa/cli/project_templates/finance/data/transfers/add_payee.yml +0 -29
- rasa/cli/project_templates/finance/data/transfers/list_payees.yml +0 -5
- rasa/cli/project_templates/finance/data/transfers/remove_payee.yml +0 -21
- rasa/cli/project_templates/finance/data/transfers/transfer_money.yml +0 -67
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/block_card/consequences_of_blocking_card.txt +0 -8
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/block_card/reasons_to_block_card.txt +0 -8
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/block_card/recovering_from_card_fraud.txt +0 -8
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/block_card/tips_for_card_security.txt +0 -8
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/block_card/what_to_do_if_card_is_lost.txt +0 -8
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/check_balance/account_balance_security.txt +0 -7
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/check_balance/common_balance_inquiries.txt +0 -8
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/check_balance/methods_to_check_balance.txt +0 -8
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/check_balance/understanding_balance_updates.txt +0 -8
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/check_balance/what_to_do_if_balance_is_incorrect.txt +0 -8
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/manage_payees/benefits_of_authorised_payees.txt +0 -8
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/manage_payees/common_issues_with_payees.txt +0 -8
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/manage_payees/general_payee_information.txt +0 -8
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/manage_payees/payee_management_tips.txt +0 -8
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/manage_payees/understanding_payee_types.txt +0 -8
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/transfer_money/common_transfer_errors.txt +0 -8
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/transfer_money/fees_for_transfers.txt +0 -8
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/transfer_money/general_transfer_information.txt +0 -8
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/transfer_money/security_tips_for_transfers.txt +0 -8
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/transfer_money/transfer_processing_times.txt +0 -8
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part1.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part10.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part11.txt +0 -48
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part12.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part13.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part14.txt +0 -47
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part15.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part16.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part17.txt +0 -47
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part18.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part19.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part2.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part20.txt +0 -47
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part21.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part22.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part23.txt +0 -47
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part24.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part25.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part26.txt +0 -47
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part27.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part28.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part29.txt +0 -47
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part3.txt +0 -47
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part30.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part31.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part32.txt +0 -47
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part33.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part34.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part35.txt +0 -47
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part36.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part37.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part38.txt +0 -47
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part39.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part4.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part40.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part41.txt +0 -47
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part42.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part43.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part44.txt +0 -47
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part45.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part46.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part47.txt +0 -47
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part48.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part49.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part5.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part50.txt +0 -47
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part51.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part52.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part53.txt +0 -47
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part54.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part55.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part56.txt +0 -47
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part57.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part58.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part59.txt +0 -47
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part6.txt +0 -47
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part60.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part61.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part7.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part8.txt +0 -50
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part9.txt +0 -47
- rasa/cli/project_templates/finance/domain/accounts/check_balance.yml +0 -11
- rasa/cli/project_templates/finance/domain/cards/block_card.yml +0 -101
- rasa/cli/project_templates/finance/domain/cards/select_card.yml +0 -12
- rasa/cli/project_templates/finance/domain/general/assistant_details.yml +0 -12
- rasa/cli/project_templates/finance/domain/general/bot_identity.yml +0 -5
- rasa/cli/project_templates/finance/domain/general/cannot_handle.yml +0 -5
- rasa/cli/project_templates/finance/domain/general/defaults.yml +0 -24
- rasa/cli/project_templates/finance/domain/general/feedback.yml +0 -28
- rasa/cli/project_templates/finance/domain/general/goodbye.yml +0 -7
- rasa/cli/project_templates/finance/domain/general/help.yml +0 -5
- rasa/cli/project_templates/finance/domain/general/human_handoff.yml +0 -30
- rasa/cli/project_templates/finance/domain/general/utils.yml +0 -13
- rasa/cli/project_templates/finance/domain/general/welcome.yml +0 -8
- rasa/cli/project_templates/finance/domain/transfers/add_payee.yml +0 -47
- rasa/cli/project_templates/finance/domain/transfers/list_payees.yml +0 -4
- rasa/cli/project_templates/finance/domain/transfers/remove_payee.yml +0 -16
- rasa/cli/project_templates/finance/domain/transfers/transfer_money.yml +0 -79
- rasa/cli/project_templates/finance/endpoints.yml +0 -63
- rasa/cli/project_templates/finance/prompts/rephraser_demo_personality_prompt.jinja2 +0 -19
- rasa/cli/project_templates/telco/actions/__init__.py +0 -0
- rasa/cli/project_templates/telco/actions/actions_billing.py +0 -204
- rasa/cli/project_templates/telco/actions/actions_get_data_from_db.py +0 -48
- rasa/cli/project_templates/telco/actions/actions_run_diagnostics.py +0 -28
- rasa/cli/project_templates/telco/actions/actions_session_start.py +0 -18
- rasa/cli/project_templates/telco/config.yml +0 -25
- rasa/cli/project_templates/telco/credentials.yml +0 -33
- rasa/cli/project_templates/telco/csvs/billing.csv +0 -10
- rasa/cli/project_templates/telco/csvs/customers.csv +0 -5
- rasa/cli/project_templates/telco/data/flows/flow_global.yml +0 -5
- rasa/cli/project_templates/telco/data/flows/flow_reboot_router.yml +0 -8
- rasa/cli/project_templates/telco/data/flows/flow_reset_router.yml +0 -7
- rasa/cli/project_templates/telco/data/flows/flow_solve_internet_issue.yml +0 -73
- rasa/cli/project_templates/telco/data/flows/flow_undertand_bill.yml +0 -45
- rasa/cli/project_templates/telco/data/patterns/pattern_completed.yml +0 -7
- rasa/cli/project_templates/telco/data/patterns/pattern_human_handoff.yml +0 -6
- rasa/cli/project_templates/telco/data/patterns/pattern_search.yml +0 -7
- rasa/cli/project_templates/telco/data/patterns/pattern_session_start.yml +0 -9
- rasa/cli/project_templates/telco/docs/reset_vs_rboot_router.txt +0 -1
- rasa/cli/project_templates/telco/docs/restart_router.txt +0 -6
- rasa/cli/project_templates/telco/docs/run_speed_test.txt +0 -6
- rasa/cli/project_templates/telco/domain/domain_global.yml +0 -29
- rasa/cli/project_templates/telco/domain/domain_patterns.yml +0 -17
- rasa/cli/project_templates/telco/domain/domain_reboot_router.yml +0 -20
- rasa/cli/project_templates/telco/domain/domain_reset_router.yml +0 -11
- rasa/cli/project_templates/telco/domain/domain_run_speed_test.yml +0 -24
- rasa/cli/project_templates/telco/domain/domain_solve_internet_issue.yml +0 -74
- rasa/cli/project_templates/telco/domain/domain_undertand_bill.yml +0 -102
- rasa/cli/project_templates/telco/endpoints.yml +0 -60
- rasa/cli/project_templates/telco/tests/e2e_results_failed.yml +0 -62
- rasa/cli/project_templates/telco/tests/e2e_results_passed.yml +0 -130
- rasa/cli/project_templates/telco/tests/e2e_test_cases/billing_test_cases.yml +0 -68
- rasa/cli/project_templates/telco/tests/e2e_test_cases/global_test_cases.yml +0 -13
- rasa/cli/project_templates/telco/tests/e2e_test_cases/internet_slow_test_case.yml +0 -47
- rasa/cli/project_templates/telco/tests/e2e_test_cases/out_of_scope_test_case.yml +0 -21
- rasa/cli/project_templates/telco/tests/e2e_test_cases/patterns_test_cases.yml +0 -15
- rasa/core/channels/constants.py +0 -3
- rasa/core/channels/inspector/dist/assets/channel-b9b536fc.js +0 -1
- rasa/core/channels/inspector/dist/assets/clone-78d2ddcf.js +0 -1
- rasa/core/channels/inspector/dist/assets/flowDiagram-v2-96b9c2cf-8b09c060.js +0 -1
- rasa/core/channels/inspector/dist/assets/index-4d4bdf3a.js +0 -1335
- rasa/utils/openapi.py +0 -144
- /rasa/{builder → agents}/__init__.py +0 -0
- /rasa/{builder/copilot → agents/core}/__init__.py +0 -0
- /rasa/{builder/copilot/prompts → agents/protocol/a2a}/__init__.py +0 -0
- /rasa/{builder/copilot/templated_messages → agents/protocol/mcp}/__init__.py +0 -0
- /rasa/{builder/document_retrieval → agents/templates}/__init__.py +0 -0
- /rasa/{cli/project_templates/finance/actions/accounts → shared/agents}/__init__.py +0 -0
- /rasa/{cli/project_templates/finance/actions/cards → shared/utils/mcp}/__init__.py +0 -0
- {rasa_pro-3.14.0.dev5.dist-info → rasa_pro-3.14.0.dev6.dist-info}/NOTICE +0 -0
- {rasa_pro-3.14.0.dev5.dist-info → rasa_pro-3.14.0.dev6.dist-info}/WHEEL +0 -0
- {rasa_pro-3.14.0.dev5.dist-info → rasa_pro-3.14.0.dev6.dist-info}/entry_points.txt +0 -0
rasa/core/actions/action.py
CHANGED
|
@@ -47,6 +47,7 @@ from rasa.shared.constants import (
|
|
|
47
47
|
UTTER_PREFIX,
|
|
48
48
|
)
|
|
49
49
|
from rasa.shared.core.constants import (
|
|
50
|
+
ACTION_AGENT_REQUEST_USER_INPUT_NAME,
|
|
50
51
|
ACTION_BACK_NAME,
|
|
51
52
|
ACTION_DEACTIVATE_LOOP_NAME,
|
|
52
53
|
ACTION_DEFAULT_ASK_AFFIRMATION_NAME,
|
|
@@ -56,6 +57,8 @@ from rasa.shared.core.constants import (
|
|
|
56
57
|
ACTION_LISTEN_NAME,
|
|
57
58
|
ACTION_METADATA_EXECUTION_ERROR_MESSAGE,
|
|
58
59
|
ACTION_METADATA_EXECUTION_SUCCESS,
|
|
60
|
+
ACTION_METADATA_MESSAGE_KEY,
|
|
61
|
+
ACTION_METADATA_TEXT_KEY,
|
|
59
62
|
ACTION_RESET_ROUTING,
|
|
60
63
|
ACTION_RESTART_NAME,
|
|
61
64
|
ACTION_REVERT_FALLBACK_EVENTS_NAME,
|
|
@@ -88,7 +91,12 @@ from rasa.shared.core.slot_mappings import (
|
|
|
88
91
|
)
|
|
89
92
|
from rasa.shared.core.trackers import DialogueStateTracker
|
|
90
93
|
from rasa.shared.exceptions import RasaException
|
|
91
|
-
from rasa.shared.nlu.constants import
|
|
94
|
+
from rasa.shared.nlu.constants import (
|
|
95
|
+
INTENT,
|
|
96
|
+
INTENT_NAME_KEY,
|
|
97
|
+
INTENT_RANKING_KEY,
|
|
98
|
+
PREDICTED_CONFIDENCE_KEY,
|
|
99
|
+
)
|
|
92
100
|
from rasa.shared.utils.io import raise_warning
|
|
93
101
|
from rasa.shared.utils.schemas.events import EVENTS_SCHEMA
|
|
94
102
|
from rasa.utils.endpoints import EndpointConfig
|
|
@@ -113,6 +121,12 @@ def default_actions(action_endpoint: Optional[EndpointConfig] = None) -> List["A
|
|
|
113
121
|
from rasa.core.actions.two_stage_fallback import TwoStageFallbackAction
|
|
114
122
|
from rasa.dialogue_understanding.patterns.cancel import ActionCancelFlow
|
|
115
123
|
from rasa.dialogue_understanding.patterns.clarify import ActionClarifyFlows
|
|
124
|
+
from rasa.dialogue_understanding.patterns.continue_interrupted import (
|
|
125
|
+
ActionAskInterruptedFlowToContinue,
|
|
126
|
+
ActionCancelInterruptedFlow,
|
|
127
|
+
ActionContinueInterruptedFlow,
|
|
128
|
+
ActionSetInterruptedFlows,
|
|
129
|
+
)
|
|
116
130
|
from rasa.dialogue_understanding.patterns.correction import ActionCorrectFlowSlot
|
|
117
131
|
|
|
118
132
|
return [
|
|
@@ -127,6 +141,7 @@ def default_actions(action_endpoint: Optional[EndpointConfig] = None) -> List["A
|
|
|
127
141
|
TwoStageFallbackAction(action_endpoint),
|
|
128
142
|
ActionUnlikelyIntent(),
|
|
129
143
|
ActionSendText(),
|
|
144
|
+
ActionAgentRequestUserInfo(),
|
|
130
145
|
ActionBack(),
|
|
131
146
|
ActionExtractSlots(action_endpoint),
|
|
132
147
|
ActionCancelFlow(),
|
|
@@ -139,6 +154,10 @@ def default_actions(action_endpoint: Optional[EndpointConfig] = None) -> List["A
|
|
|
139
154
|
ActionResetRouting(),
|
|
140
155
|
ActionHangup(),
|
|
141
156
|
ActionRepeatBotMessages(),
|
|
157
|
+
ActionContinueInterruptedFlow(),
|
|
158
|
+
ActionSetInterruptedFlows(),
|
|
159
|
+
ActionCancelInterruptedFlow(),
|
|
160
|
+
ActionAskInterruptedFlowToContinue(),
|
|
142
161
|
]
|
|
143
162
|
|
|
144
163
|
|
|
@@ -873,8 +892,8 @@ class RemoteAction(Action):
|
|
|
873
892
|
) -> List[BotUttered]:
|
|
874
893
|
"""Use the responses generated by the action endpoint and utter them."""
|
|
875
894
|
bot_messages = []
|
|
876
|
-
domain: Domain = kwargs.get("domain", None)
|
|
877
|
-
action_name: str = kwargs.get("action_name", None)
|
|
895
|
+
domain: Optional[Domain] = kwargs.get("domain", None)
|
|
896
|
+
action_name: Optional[str] = kwargs.get("action_name", None)
|
|
878
897
|
for response in responses:
|
|
879
898
|
generated_response = response.pop("response", None)
|
|
880
899
|
if generated_response is not None:
|
|
@@ -897,6 +916,7 @@ class RemoteAction(Action):
|
|
|
897
916
|
draft.setdefault("buttons", [])
|
|
898
917
|
draft["buttons"].extend(buttons)
|
|
899
918
|
|
|
919
|
+
# Avoid overwriting `draft` values with empty values
|
|
900
920
|
response = {k: v for k, v in response.items() if v}
|
|
901
921
|
response.update(draft)
|
|
902
922
|
bot_messages.append(create_bot_utterance(response))
|
|
@@ -1014,13 +1034,13 @@ def _revert_affirmation_events(tracker: "DialogueStateTracker") -> List[Event]:
|
|
|
1014
1034
|
revert_events += _revert_rephrasing_events()
|
|
1015
1035
|
|
|
1016
1036
|
last_user_event = tracker.get_last_event_for(UserUttered)
|
|
1017
|
-
if not last_user_event:
|
|
1018
|
-
raise TypeError("Cannot find last event to revert to.")
|
|
1037
|
+
if not last_user_event or not isinstance(last_user_event, UserUttered):
|
|
1038
|
+
raise TypeError("Cannot find last user uttered event to revert to.")
|
|
1019
1039
|
|
|
1020
1040
|
last_user_event = copy.deepcopy(last_user_event)
|
|
1021
1041
|
# FIXME: better type annotation for `parse_data` would require
|
|
1022
1042
|
# a larger refactoring (e.g. switch to dataclass)
|
|
1023
|
-
last_user_event.parse_data[
|
|
1043
|
+
last_user_event.parse_data[INTENT][PREDICTED_CONFIDENCE_KEY] = 1.0 # type: ignore[literal-required]
|
|
1024
1044
|
|
|
1025
1045
|
return revert_events + [last_user_event]
|
|
1026
1046
|
|
|
@@ -1037,8 +1057,8 @@ def _revert_single_affirmation_events() -> List[Event]:
|
|
|
1037
1057
|
|
|
1038
1058
|
def _revert_successful_rephrasing(tracker: "DialogueStateTracker") -> List[Event]:
|
|
1039
1059
|
last_user_event = tracker.get_last_event_for(UserUttered)
|
|
1040
|
-
if not last_user_event:
|
|
1041
|
-
raise TypeError("Cannot find last event to revert to.")
|
|
1060
|
+
if not last_user_event or not isinstance(last_user_event, UserUttered):
|
|
1061
|
+
raise TypeError("Cannot find last user uttered event to revert to.")
|
|
1042
1062
|
|
|
1043
1063
|
last_user_event = copy.deepcopy(last_user_event)
|
|
1044
1064
|
return _revert_rephrasing_events() + [last_user_event]
|
|
@@ -1138,9 +1158,9 @@ class ActionSendText(Action):
|
|
|
1138
1158
|
metadata: Optional[Dict[Text, Any]] = None,
|
|
1139
1159
|
) -> List[Event]:
|
|
1140
1160
|
"""Runs action. Please see parent class for the full docstring."""
|
|
1141
|
-
fallback = {
|
|
1161
|
+
fallback = {ACTION_METADATA_TEXT_KEY: ""}
|
|
1142
1162
|
metadata_copy = copy.deepcopy(metadata) if metadata else {}
|
|
1143
|
-
message = metadata_copy.get(
|
|
1163
|
+
message = metadata_copy.get(ACTION_METADATA_MESSAGE_KEY, fallback)
|
|
1144
1164
|
|
|
1145
1165
|
should_send_text = metadata_copy.get("should_send_text", True)
|
|
1146
1166
|
if should_send_text:
|
|
@@ -1148,6 +1168,32 @@ class ActionSendText(Action):
|
|
|
1148
1168
|
return []
|
|
1149
1169
|
|
|
1150
1170
|
|
|
1171
|
+
class ActionAgentRequestUserInfo(Action):
|
|
1172
|
+
"""Sends a text message to the output channel that requests some user information.
|
|
1173
|
+
|
|
1174
|
+
The difference to `ActionSendText` is that this action will pause the main advancing
|
|
1175
|
+
flow loop until the user responds to the request
|
|
1176
|
+
(`should_predict_another_action` will return False for this action).
|
|
1177
|
+
"""
|
|
1178
|
+
|
|
1179
|
+
def name(self) -> Text:
|
|
1180
|
+
return ACTION_AGENT_REQUEST_USER_INPUT_NAME
|
|
1181
|
+
|
|
1182
|
+
async def run(
|
|
1183
|
+
self,
|
|
1184
|
+
output_channel: "OutputChannel",
|
|
1185
|
+
nlg: "NaturalLanguageGenerator",
|
|
1186
|
+
tracker: "DialogueStateTracker",
|
|
1187
|
+
domain: "Domain",
|
|
1188
|
+
metadata: Optional[Dict[Text, Any]] = None,
|
|
1189
|
+
) -> List[Event]:
|
|
1190
|
+
"""Runs action. Please see parent class for the full docstring."""
|
|
1191
|
+
fallback = {ACTION_METADATA_TEXT_KEY: ""}
|
|
1192
|
+
metadata_copy = copy.deepcopy(metadata) if metadata else {}
|
|
1193
|
+
message = metadata_copy.get(ACTION_METADATA_MESSAGE_KEY, fallback)
|
|
1194
|
+
return [create_bot_utterance(message)]
|
|
1195
|
+
|
|
1196
|
+
|
|
1151
1197
|
class ActionExtractSlots(Action):
|
|
1152
1198
|
"""Default action that runs after each user turn.
|
|
1153
1199
|
|
rasa/core/agent.py
CHANGED
|
@@ -12,7 +12,9 @@ import aiohttp
|
|
|
12
12
|
from aiohttp import ClientError
|
|
13
13
|
|
|
14
14
|
import rasa.shared.utils.io
|
|
15
|
+
from rasa.agents.utils import initialize_agents
|
|
15
16
|
from rasa.core import jobs
|
|
17
|
+
from rasa.core.available_agents import AvailableAgents
|
|
16
18
|
from rasa.core.available_endpoints import AvailableEndpoints
|
|
17
19
|
from rasa.core.channels.channel import OutputChannel, UserMessage
|
|
18
20
|
from rasa.core.constants import DEFAULT_REQUEST_TIMEOUT
|
|
@@ -34,7 +36,7 @@ from rasa.privacy.privacy_manager import BackgroundPrivacyManager
|
|
|
34
36
|
from rasa.shared.constants import DEFAULT_SENDER_ID
|
|
35
37
|
from rasa.shared.core.domain import Domain
|
|
36
38
|
from rasa.shared.core.trackers import DialogueStateTracker, EventVerbosity
|
|
37
|
-
from rasa.shared.exceptions import RasaException
|
|
39
|
+
from rasa.shared.exceptions import AgentInitializationException, RasaException
|
|
38
40
|
from rasa.telemetry import track_privacy_enabled
|
|
39
41
|
from rasa.utils.common import TempDirectoryPath, get_temp_dir_name
|
|
40
42
|
from rasa.utils.endpoints import EndpointConfig
|
|
@@ -202,6 +204,7 @@ async def load_agent(
|
|
|
202
204
|
model_server: Optional[EndpointConfig] = None,
|
|
203
205
|
remote_storage: Optional[StorageType] = None,
|
|
204
206
|
endpoints: Optional[AvailableEndpoints] = None,
|
|
207
|
+
sub_agents: Optional[AvailableAgents] = None,
|
|
205
208
|
loop: Optional[AbstractEventLoop] = None,
|
|
206
209
|
) -> Agent:
|
|
207
210
|
"""Loads agent from server, remote storage or disk.
|
|
@@ -211,6 +214,7 @@ async def load_agent(
|
|
|
211
214
|
model_server: Configuration for a potential server which serves the model.
|
|
212
215
|
remote_storage: Remote storage to use for loading the model.
|
|
213
216
|
endpoints: Endpoint configuration.
|
|
217
|
+
sub_agents: Sub-agents configuration.
|
|
214
218
|
loop: Optional async loop to pass to broker creation.
|
|
215
219
|
|
|
216
220
|
Returns:
|
|
@@ -281,8 +285,20 @@ async def load_agent(
|
|
|
281
285
|
"No valid configuration given to load agent. "
|
|
282
286
|
"Agent loaded with no model!"
|
|
283
287
|
)
|
|
288
|
+
|
|
289
|
+
if agent.processor:
|
|
290
|
+
flows = await agent.processor.get_flows()
|
|
291
|
+
domain = agent.processor.domain
|
|
292
|
+
# CLI commands that accept --sub-agents
|
|
293
|
+
# all route through this entry point.
|
|
294
|
+
# With all required data available,
|
|
295
|
+
# this is the best spot to initialize the subagents.
|
|
296
|
+
await initialize_agents(flows, domain, sub_agents)
|
|
297
|
+
|
|
284
298
|
return agent
|
|
285
299
|
|
|
300
|
+
except AgentInitializationException as e:
|
|
301
|
+
raise e
|
|
286
302
|
except Exception as e:
|
|
287
303
|
logger.error(f"Could not load model due to {e}.", exc_info=True)
|
|
288
304
|
return agent
|
|
@@ -322,6 +338,7 @@ class Agent:
|
|
|
322
338
|
remote_storage: Optional[StorageType] = None,
|
|
323
339
|
http_interpreter: Optional[RasaNLUHttpInterpreter] = None,
|
|
324
340
|
endpoints: Optional[AvailableEndpoints] = None,
|
|
341
|
+
sub_agents: Optional[AvailableAgents] = None,
|
|
325
342
|
privacy_manager: Optional[BackgroundPrivacyManager] = None,
|
|
326
343
|
):
|
|
327
344
|
"""Initializes an `Agent`."""
|
|
@@ -334,6 +351,7 @@ class Agent:
|
|
|
334
351
|
self.action_endpoint = action_endpoint
|
|
335
352
|
self.http_interpreter = http_interpreter
|
|
336
353
|
self.endpoints = endpoints
|
|
354
|
+
self.sub_agents = sub_agents
|
|
337
355
|
|
|
338
356
|
self._set_fingerprint(fingerprint)
|
|
339
357
|
self.model_server = model_server
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
from enum import Enum
|
|
5
|
+
from typing import Any, Dict, List, Optional
|
|
6
|
+
|
|
7
|
+
import structlog
|
|
8
|
+
from pydantic import BaseModel, Field, model_validator
|
|
9
|
+
from ruamel import yaml as yaml
|
|
10
|
+
|
|
11
|
+
from rasa.utils.singleton import Singleton
|
|
12
|
+
|
|
13
|
+
DEFAULT_AGENTS_CONFIG_FOLDER = "sub_agents"
|
|
14
|
+
|
|
15
|
+
structlogger = structlog.get_logger()
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class ProtocolConfig(str, Enum):
|
|
19
|
+
"""Supported protocols for agents."""
|
|
20
|
+
|
|
21
|
+
MCP = "MCP"
|
|
22
|
+
A2A = "A2A"
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class AgentInfo(BaseModel):
|
|
26
|
+
"""Configuration for an agent."""
|
|
27
|
+
|
|
28
|
+
name: str = Field(..., description="Agent name")
|
|
29
|
+
protocol: ProtocolConfig = Field(
|
|
30
|
+
..., description="Protocol used to communicate with the agent."
|
|
31
|
+
)
|
|
32
|
+
description: str = Field(..., description="Agent description")
|
|
33
|
+
|
|
34
|
+
@model_validator(mode="before")
|
|
35
|
+
@classmethod
|
|
36
|
+
def validate_protocol(cls, values: Any) -> Any:
|
|
37
|
+
"""Validate and normalize protocol values to support lowercase input."""
|
|
38
|
+
if isinstance(values, dict) and "protocol" in values:
|
|
39
|
+
protocol_value = values["protocol"]
|
|
40
|
+
if isinstance(protocol_value, str):
|
|
41
|
+
# Map lowercase protocol names to uppercase enum values
|
|
42
|
+
protocol_mapping = {
|
|
43
|
+
"mcp": ProtocolConfig.MCP,
|
|
44
|
+
"a2a": ProtocolConfig.A2A,
|
|
45
|
+
"MCP": ProtocolConfig.MCP,
|
|
46
|
+
"A2A": ProtocolConfig.A2A,
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if protocol_value.lower() in protocol_mapping:
|
|
50
|
+
values["protocol"] = protocol_mapping[protocol_value.lower()]
|
|
51
|
+
else:
|
|
52
|
+
# If it's not a recognized protocol, let Pydantic handle the
|
|
53
|
+
# validation
|
|
54
|
+
# This will raise a proper validation error
|
|
55
|
+
pass
|
|
56
|
+
|
|
57
|
+
return values
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
class AgentConfiguration(BaseModel):
|
|
61
|
+
llm: Optional[Dict[str, Any]] = None
|
|
62
|
+
prompt_template: Optional[str] = None
|
|
63
|
+
module: Optional[str] = None
|
|
64
|
+
timeout: Optional[int] = None # timeout in seconds
|
|
65
|
+
max_retries: Optional[int] = None
|
|
66
|
+
agent_card: Optional[str] = None
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
class AgentConnections(BaseModel):
|
|
70
|
+
mcp_servers: Optional[List[AgentMCPServerConfig]] = None
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
class AgentMCPServerConfig(BaseModel):
|
|
74
|
+
name: str # Reference to MCPServerConfig
|
|
75
|
+
url: Optional[str] = None
|
|
76
|
+
type: Optional[str] = None
|
|
77
|
+
include_tools: Optional[List[str]] = None
|
|
78
|
+
exclude_tools: Optional[List[str]] = None
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
class AgentConfig(BaseModel):
|
|
82
|
+
agent: AgentInfo
|
|
83
|
+
configuration: Optional[AgentConfiguration] = None
|
|
84
|
+
connections: Optional[AgentConnections] = None
|
|
85
|
+
|
|
86
|
+
@model_validator(mode="after")
|
|
87
|
+
def check_agent_config(self) -> AgentConfig:
|
|
88
|
+
protocol = self.agent.protocol if self.agent else None
|
|
89
|
+
if protocol == ProtocolConfig.MCP:
|
|
90
|
+
if self.connections is None or self.connections.mcp_servers is None:
|
|
91
|
+
raise ValueError(
|
|
92
|
+
"For protocol 'MCP', "
|
|
93
|
+
"'mcp_servers' in 'connections' must be provided."
|
|
94
|
+
)
|
|
95
|
+
if protocol == ProtocolConfig.A2A:
|
|
96
|
+
if self.configuration is None or self.configuration.agent_card is None:
|
|
97
|
+
raise ValueError(
|
|
98
|
+
"For protocol 'A2A', "
|
|
99
|
+
"'agent_card' in 'configuration' must be provided."
|
|
100
|
+
)
|
|
101
|
+
return self
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
class AvailableAgents(metaclass=Singleton):
|
|
105
|
+
"""Collection of configured agents."""
|
|
106
|
+
|
|
107
|
+
_instance = None
|
|
108
|
+
|
|
109
|
+
def __init__(self, agents: Optional[Dict[str, AgentConfig]] = None) -> None:
|
|
110
|
+
"""Create an `AvailableAgents` object."""
|
|
111
|
+
self.agents = agents or {}
|
|
112
|
+
|
|
113
|
+
@classmethod
|
|
114
|
+
def _read_agent_folder(cls, agent_folder: str) -> AvailableAgents:
|
|
115
|
+
"""Read the different agents from the given folder."""
|
|
116
|
+
agents: Dict[str, AgentConfig] = {}
|
|
117
|
+
|
|
118
|
+
if not os.path.isdir(agent_folder):
|
|
119
|
+
if agent_folder != DEFAULT_AGENTS_CONFIG_FOLDER:
|
|
120
|
+
# User explicitly specified a folder, it should exist
|
|
121
|
+
structlogger.error(
|
|
122
|
+
f"The specified agents config folder '{agent_folder}' does not "
|
|
123
|
+
f"exist or is not a directory."
|
|
124
|
+
)
|
|
125
|
+
raise ValueError(
|
|
126
|
+
f"The specified agents config folder '{agent_folder}' does not "
|
|
127
|
+
f"exist or is not a directory."
|
|
128
|
+
)
|
|
129
|
+
else:
|
|
130
|
+
# We are using the default folder, it may not be created yet
|
|
131
|
+
# Init with an empty agents in this case
|
|
132
|
+
structlogger.warning(
|
|
133
|
+
f"Default agents config folder '{agent_folder}' does not exist. "
|
|
134
|
+
f"Agent configurations won't be loaded."
|
|
135
|
+
)
|
|
136
|
+
return cls(agents)
|
|
137
|
+
|
|
138
|
+
for agent_name in os.listdir(agent_folder):
|
|
139
|
+
config_path = os.path.join(agent_folder, agent_name, "config.yml")
|
|
140
|
+
if not os.path.isfile(config_path):
|
|
141
|
+
continue
|
|
142
|
+
try:
|
|
143
|
+
agent_config = cls._read_agent_config(config_path)
|
|
144
|
+
if not isinstance(agent_config, AgentConfig):
|
|
145
|
+
raise ValueError(f"Invalid agent config type for {agent_name}")
|
|
146
|
+
agents[agent_config.agent.name] = agent_config
|
|
147
|
+
except Exception as e:
|
|
148
|
+
raise RuntimeError(f"Failed to load agent '{agent_name}': {e}")
|
|
149
|
+
|
|
150
|
+
return cls(agents)
|
|
151
|
+
|
|
152
|
+
@staticmethod
|
|
153
|
+
def _read_agent_config(config_path: str) -> AgentConfig:
|
|
154
|
+
"""Read the agent config from a yaml file."""
|
|
155
|
+
with open(config_path, "r") as f:
|
|
156
|
+
data = yaml.safe_load(f)
|
|
157
|
+
agent_config = AgentConfig(
|
|
158
|
+
agent=AgentInfo(**data.get("agent", {})),
|
|
159
|
+
configuration=AgentConfiguration(**data.get("configuration", {})),
|
|
160
|
+
connections=AgentConnections(**data.get("connections", {})),
|
|
161
|
+
)
|
|
162
|
+
return agent_config
|
|
163
|
+
|
|
164
|
+
@classmethod
|
|
165
|
+
def get_instance(
|
|
166
|
+
cls, agent_folder: Optional[str] = DEFAULT_AGENTS_CONFIG_FOLDER
|
|
167
|
+
) -> AvailableAgents:
|
|
168
|
+
"""Get the singleton instance of `AvailableAgents`."""
|
|
169
|
+
if cls._instance is None:
|
|
170
|
+
cls._instance = cls._read_agent_folder(agent_folder)
|
|
171
|
+
return cls._instance
|
|
172
|
+
|
|
173
|
+
@classmethod
|
|
174
|
+
def reset_instance(cls) -> None:
|
|
175
|
+
cls._instance = None
|
|
176
|
+
# Also clear the metaclass singleton instances
|
|
177
|
+
if hasattr(type(cls), "_instances"):
|
|
178
|
+
type(cls)._instances.clear()
|
|
179
|
+
|
|
180
|
+
def as_json_list(self) -> List[Dict[str, Any]]:
|
|
181
|
+
"""Convert the available agents to a JSON-serializable list."""
|
|
182
|
+
return [
|
|
183
|
+
{
|
|
184
|
+
"name": agent_name,
|
|
185
|
+
"agent": agent_config.agent.model_dump(),
|
|
186
|
+
"configuration": agent_config.configuration.model_dump()
|
|
187
|
+
if agent_config.configuration
|
|
188
|
+
else None,
|
|
189
|
+
"connections": agent_config.connections.model_dump()
|
|
190
|
+
if agent_config.connections
|
|
191
|
+
else None,
|
|
192
|
+
}
|
|
193
|
+
for agent_name, agent_config in self.agents.items()
|
|
194
|
+
]
|
|
195
|
+
|
|
196
|
+
@classmethod
|
|
197
|
+
def get_agent_config(cls, agent_id: str) -> Optional[AgentConfig]:
|
|
198
|
+
instance = cls.get_instance()
|
|
199
|
+
return instance.agents.get(agent_id)
|
rasa/core/available_endpoints.py
CHANGED
|
@@ -3,6 +3,9 @@ from __future__ import annotations
|
|
|
3
3
|
import dataclasses
|
|
4
4
|
from typing import Any, Dict, List, Optional, Union
|
|
5
5
|
|
|
6
|
+
from pydantic import BaseModel, Field, model_validator
|
|
7
|
+
|
|
8
|
+
from rasa.core.constants import MCP_SERVERS_KEY
|
|
6
9
|
from rasa.shared.constants import DEFAULT_ENDPOINTS_PATH
|
|
7
10
|
from rasa.shared.core.constants import (
|
|
8
11
|
GLOBAL_SILENCE_TIMEOUT_DEFAULT_VALUE,
|
|
@@ -57,6 +60,22 @@ class InteractionHandlingConfig:
|
|
|
57
60
|
)
|
|
58
61
|
|
|
59
62
|
|
|
63
|
+
class MCPServerConfig(BaseModel):
|
|
64
|
+
name: str = Field(..., description="The name of the MCP server.")
|
|
65
|
+
url: str = Field(..., description="The URL of the MCP server.")
|
|
66
|
+
type: str = Field(..., description="The type of the MCP server.")
|
|
67
|
+
|
|
68
|
+
@model_validator(mode="after")
|
|
69
|
+
def validate_type(self) -> MCPServerConfig:
|
|
70
|
+
# validate that type is "http"
|
|
71
|
+
if self.type not in ["http"]:
|
|
72
|
+
raise ValueError(f"Invalid MCP server type: {self.type}")
|
|
73
|
+
# validate that name and url are not empty
|
|
74
|
+
if not self.name or not self.url:
|
|
75
|
+
raise ValueError("Name and URL cannot be empty")
|
|
76
|
+
return self
|
|
77
|
+
|
|
78
|
+
|
|
60
79
|
class AvailableEndpoints:
|
|
61
80
|
"""Collection of configured endpoints."""
|
|
62
81
|
|
|
@@ -75,6 +94,14 @@ class AvailableEndpoints:
|
|
|
75
94
|
lock_store = read_endpoint_config(endpoint_file, endpoint_type="lock_store")
|
|
76
95
|
event_broker = read_endpoint_config(endpoint_file, endpoint_type="event_broker")
|
|
77
96
|
vector_store = read_endpoint_config(endpoint_file, endpoint_type="vector_store")
|
|
97
|
+
raw_mcp_servers = read_property_config_from_endpoints_file(
|
|
98
|
+
endpoint_file, property_name=MCP_SERVERS_KEY
|
|
99
|
+
)
|
|
100
|
+
mcp_servers = (
|
|
101
|
+
[MCPServerConfig(**server) for server in raw_mcp_servers]
|
|
102
|
+
if raw_mcp_servers
|
|
103
|
+
else None
|
|
104
|
+
)
|
|
78
105
|
model_groups = read_property_config_from_endpoints_file(
|
|
79
106
|
endpoint_file, property_name="model_groups"
|
|
80
107
|
)
|
|
@@ -97,6 +124,7 @@ class AvailableEndpoints:
|
|
|
97
124
|
lock_store,
|
|
98
125
|
event_broker,
|
|
99
126
|
vector_store,
|
|
127
|
+
mcp_servers,
|
|
100
128
|
model_groups,
|
|
101
129
|
privacy,
|
|
102
130
|
interaction_handling,
|
|
@@ -112,6 +140,7 @@ class AvailableEndpoints:
|
|
|
112
140
|
lock_store: Optional[EndpointConfig] = None,
|
|
113
141
|
event_broker: Optional[EndpointConfig] = None,
|
|
114
142
|
vector_store: Optional[EndpointConfig] = None,
|
|
143
|
+
mcp_servers: Optional[List[MCPServerConfig]] = None,
|
|
115
144
|
model_groups: Optional[List[Dict[str, Any]]] = None,
|
|
116
145
|
privacy: Optional[Dict[str, Any]] = None,
|
|
117
146
|
interaction_handling: InteractionHandlingConfig = InteractionHandlingConfig(
|
|
@@ -127,6 +156,7 @@ class AvailableEndpoints:
|
|
|
127
156
|
self.lock_store = lock_store
|
|
128
157
|
self.event_broker = event_broker
|
|
129
158
|
self.vector_store = vector_store
|
|
159
|
+
self.mcp_servers = mcp_servers
|
|
130
160
|
self.model_groups = model_groups
|
|
131
161
|
self.privacy = privacy
|
|
132
162
|
self.interaction_handling = interaction_handling
|
rasa/core/channels/channel.py
CHANGED
|
@@ -102,9 +102,6 @@ class UserMessage:
|
|
|
102
102
|
return f"{self.__class__.__name__}({self.text})"
|
|
103
103
|
|
|
104
104
|
|
|
105
|
-
OnNewMessageType = Callable[[UserMessage], Awaitable[Any]]
|
|
106
|
-
|
|
107
|
-
|
|
108
105
|
def register(
|
|
109
106
|
input_channels: List[InputChannel], app: Sanic, route: Optional[Text]
|
|
110
107
|
) -> None:
|
|
@@ -138,7 +135,9 @@ class InputChannel:
|
|
|
138
135
|
def url_prefix(self) -> Text:
|
|
139
136
|
return self.name()
|
|
140
137
|
|
|
141
|
-
def blueprint(
|
|
138
|
+
def blueprint(
|
|
139
|
+
self, on_new_message: Callable[[UserMessage], Awaitable[Any]]
|
|
140
|
+
) -> Blueprint:
|
|
142
141
|
"""Defines a Sanic blueprint.
|
|
143
142
|
|
|
144
143
|
The blueprint will be attached to a running sanic server and handle
|
|
@@ -70,17 +70,17 @@ class DevelopmentInspectorPlugin:
|
|
|
70
70
|
self.tasks.append(task)
|
|
71
71
|
self._cleanup_completed_tasks()
|
|
72
72
|
|
|
73
|
-
@hookimpl
|
|
73
|
+
@hookimpl
|
|
74
74
|
def after_new_user_message(self, tracker: DialogueStateTracker) -> None:
|
|
75
75
|
"""Broadcasts tracker updates after a new user message."""
|
|
76
76
|
self._create_broadcast_task(tracker)
|
|
77
77
|
|
|
78
|
-
@hookimpl
|
|
78
|
+
@hookimpl
|
|
79
79
|
def after_action_executed(self, tracker: DialogueStateTracker) -> None:
|
|
80
80
|
"""Broadcasts tracker updates after an action is executed."""
|
|
81
81
|
self._create_broadcast_task(tracker)
|
|
82
82
|
|
|
83
|
-
@hookimpl
|
|
83
|
+
@hookimpl
|
|
84
84
|
def after_server_stop(self) -> None:
|
|
85
85
|
"""Cancels all remaining tasks when the server stops."""
|
|
86
86
|
self._cancel_tasks()
|
|
@@ -195,7 +195,7 @@ class DevelopmentInspectProxy(InputChannel):
|
|
|
195
195
|
self, on_new_message: Callable[[UserMessage], Awaitable[Any]]
|
|
196
196
|
) -> "Blueprint":
|
|
197
197
|
"""Defines a Sanic blueprint."""
|
|
198
|
-
self.
|
|
198
|
+
self.sio = AsyncServer(async_mode="sanic", cors_allowed_origins=[])
|
|
199
199
|
underlying_webhook: Blueprint = self.underlying.blueprint(
|
|
200
200
|
partial(self.on_message_proxy, on_new_message)
|
|
201
201
|
)
|
rasa/core/channels/hangouts.py
CHANGED
|
@@ -213,7 +213,7 @@ class HangoutsInput(InputChannel):
|
|
|
213
213
|
# every message. Actual caching depends on response headers.
|
|
214
214
|
# see: https://github.com/googleapis/google-auth-library-python/blob/main/google/oauth2/id_token.py#L15 # noqa: E501
|
|
215
215
|
cached_session = cachecontrol.CacheControl(requests.session())
|
|
216
|
-
self.google_request = google.auth.transport.requests.Request(
|
|
216
|
+
self.google_request = google.auth.transport.requests.Request( # type: ignore[no-untyped-call]
|
|
217
217
|
session=cached_session
|
|
218
218
|
)
|
|
219
219
|
|
|
@@ -267,7 +267,7 @@ class HangoutsInput(InputChannel):
|
|
|
267
267
|
# see https://developers.google.com/chat/how-tos/bots-develop#verifying_bot_authenticity # noqa: E501
|
|
268
268
|
# and https://google-auth.readthedocs.io/en/latest/user-guide.html#identity-tokens # noqa: E501
|
|
269
269
|
try:
|
|
270
|
-
decoded_token = id_token.verify_token(
|
|
270
|
+
decoded_token = id_token.verify_token( # type: ignore[no-untyped-call]
|
|
271
271
|
bot_token,
|
|
272
272
|
self.google_request,
|
|
273
273
|
audience=self.project_id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{w as ln,c as H}from"./path-53f90ab3.js";import{aw as an,ax as V,ay as D,az as rn,aA as y,V as on,aB as K,aC as _,aD as un,aE as t,aF as sn,aG as tn,aH as fn}from"./index-
|
|
1
|
+
import{w as ln,c as H}from"./path-53f90ab3.js";import{aw as an,ax as V,ay as D,az as rn,aA as y,V as on,aB as K,aC as _,aD as un,aE as t,aF as sn,aG as tn,aH as fn}from"./index-3e293924.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function mn(l){return l.endAngle}function pn(l){return l&&l.padAngle}function xn(l,h,z,E,v,A,I,a){var B=z-l,i=E-h,n=I-v,m=a-A,r=m*B-n*i;if(!(r*r<y))return r=(n*(h-A)-m*(l-v))/r,[l+r*B,h+r*i]}function W(l,h,z,E,v,A,I){var a=l-z,B=h-E,i=(I?A:-A)/K(a*a+B*B),n=i*B,m=-i*a,r=l+n,s=h+m,f=z+n,c=E+m,O=(r+f)/2,o=(s+c)/2,p=f-r,g=c-s,R=p*p+g*g,T=v-A,w=r*c-f*s,C=(g<0?-1:1)*K(fn(0,T*T*R-w*w)),F=(w*g-p*C)/R,G=(-w*p-g*C)/R,P=(w*g+p*C)/R,x=(-w*p+g*C)/R,d=F-O,e=G-o,u=P-O,S=x-o;return d*d+e*e>u*u+S*S&&(F=P,G=x),{cx:F,cy:G,x01:-n,y01:-m,x11:F*(v/T-1),y11:G*(v/T-1)}}function vn(){var l=cn,h=yn,z=H(0),E=null,v=gn,A=mn,I=pn,a=null,B=ln(i);function i(){var n,m,r=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-rn,c=A.apply(this,arguments)-rn,O=un(c-f),o=c>f;if(a||(a=n=B()),s<r&&(m=s,s=r,r=m),!(s>y))a.moveTo(0,0);else if(O>on-y)a.moveTo(s*V(f),s*D(f)),a.arc(0,0,s,f,c,!o),r>y&&(a.moveTo(r*V(c),r*D(c)),a.arc(0,0,r,c,f,o));else{var p=f,g=c,R=f,T=c,w=O,C=O,F=I.apply(this,arguments)/2,G=F>y&&(E?+E.apply(this,arguments):K(r*r+s*s)),P=_(un(s-r)/2,+z.apply(this,arguments)),x=P,d=P,e,u;if(G>y){var S=sn(G/r*D(F)),L=sn(G/s*D(F));(w-=S*2)>y?(S*=o?1:-1,R+=S,T-=S):(w=0,R=T=(f+c)/2),(C-=L*2)>y?(L*=o?1:-1,p+=L,g-=L):(C=0,p=g=(f+c)/2)}var j=s*V(p),J=s*D(p),M=r*V(T),N=r*D(T);if(P>y){var Q=s*V(g),U=s*D(g),X=r*V(R),Y=r*D(R),q;if(O<an)if(q=xn(j,J,X,Y,Q,U,M,N)){var Z=j-q[0],$=J-q[1],k=Q-q[0],b=U-q[1],nn=1/D(tn((Z*k+$*b)/(K(Z*Z+$*$)*K(k*k+b*b)))/2),en=K(q[0]*q[0]+q[1]*q[1]);x=_(P,(r-en)/(nn-1)),d=_(P,(s-en)/(nn+1))}else x=d=0}C>y?d>y?(e=W(X,Y,j,J,s,d,o),u=W(Q,U,M,N,s,d,o),a.moveTo(e.cx+e.x01,e.cy+e.y01),d<P?a.arc(e.cx,e.cy,d,t(e.y01,e.x01),t(u.y01,u.x01),!o):(a.arc(e.cx,e.cy,d,t(e.y01,e.x01),t(e.y11,e.x11),!o),a.arc(0,0,s,t(e.cy+e.y11,e.cx+e.x11),t(u.cy+u.y11,u.cx+u.x11),!o),a.arc(u.cx,u.cy,d,t(u.y11,u.x11),t(u.y01,u.x01),!o))):(a.moveTo(j,J),a.arc(0,0,s,p,g,!o)):a.moveTo(j,J),!(r>y)||!(w>y)?a.lineTo(M,N):x>y?(e=W(M,N,Q,U,r,-x,o),u=W(j,J,X,Y,r,-x,o),a.lineTo(e.cx+e.x01,e.cy+e.y01),x<P?a.arc(e.cx,e.cy,x,t(e.y01,e.x01),t(u.y01,u.x01),!o):(a.arc(e.cx,e.cy,x,t(e.y01,e.x01),t(e.y11,e.x11),!o),a.arc(0,0,r,t(e.cy+e.y11,e.cx+e.x11),t(u.cy+u.y11,u.cx+u.x11),o),a.arc(u.cx,u.cy,x,t(u.y11,u.x11),t(u.y01,u.x01),!o))):a.arc(0,0,r,T,R,o)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,m=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[V(m)*n,D(m)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:H(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:H(+n),i):h},i.cornerRadius=function(n){return arguments.length?(z=typeof n=="function"?n:H(+n),i):z},i.padRadius=function(n){return arguments.length?(E=n==null?null:typeof n=="function"?n:H(+n),i):E},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:H(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:H(+n),i):A},i.padAngle=function(n){return arguments.length?(I=typeof n=="function"?n:H(+n),i):I},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{vn as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as he,_ as se,h as H,i as Ee,l as S,E as ye,B as we,j as De,o as ve}from"./index-
|
|
1
|
+
import{c as he,_ as se,h as H,i as Ee,l as S,E as ye,B as we,j as De,o as ve}from"./index-3e293924.js";import{c as Ne}from"./clone-a0f9c4ed.js";import{i as ke,c as Ie,b as Oe,d as Te,a as ge,p as ze}from"./edges-e0da2a9e-b1553799.js";import{G as Ce}from"./graph-ca9e6217.js";import{o as Ae}from"./ordinal-ba9b4969.js";import{s as Re}from"./Tableau10-1b767f5e.js";import{c as Be}from"./channel-0cd70adf.js";import"./createText-2e5e7dd3-1c669cad.js";import"./line-0567aaa7.js";import"./array-9f3ba611.js";import"./path-53f90ab3.js";import"./init-77b53fdd.js";var le,oe,ee=function(){var e=function(D,o,s,i){for(s=s||{},i=D.length;i--;s[D[i]]=o);return s},a=[1,7],d=[1,13],c=[1,14],n=[1,15],g=[1,19],l=[1,16],f=[1,17],b=[1,18],p=[8,30],x=[8,21,28,29,30,31,32,40,44,47],E=[1,23],T=[1,24],v=[8,15,16,21,28,29,30,31,32,40,44,47],N=[8,15,16,21,27,28,29,30,31,32,40,44,47],y=[1,49],L={trace:function(){},yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,block:31,NODE_ID:32,nodeShapeNLabel:33,dirList:34,DIR:35,NODE_DSTART:36,NODE_DEND:37,BLOCK_ARROW_START:38,BLOCK_ARROW_END:39,classDef:40,CLASSDEF_ID:41,CLASSDEF_STYLEOPTS:42,DEFAULT:43,class:44,CLASSENTITY_IDS:45,STYLECLASS:46,style:47,STYLE_ENTITY_IDS:48,STYLE_DEFINITION_DATA:49,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"block",32:"NODE_ID",35:"DIR",36:"NODE_DSTART",37:"NODE_DEND",38:"BLOCK_ARROW_START",39:"BLOCK_ARROW_END",40:"classDef",41:"CLASSDEF_ID",42:"CLASSDEF_STYLEOPTS",43:"DEFAULT",44:"class",45:"CLASSENTITY_IDS",46:"STYLECLASS",47:"style",48:"STYLE_ENTITY_IDS",49:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[34,1],[34,2],[33,3],[33,4],[23,3],[23,3],[24,3],[25,3]],performAction:function(o,s,i,u,h,t,m){var r=t.length-1;switch(h){case 4:u.getLogger().debug("Rule: separator (NL) ");break;case 5:u.getLogger().debug("Rule: separator (Space) ");break;case 6:u.getLogger().debug("Rule: separator (EOF) ");break;case 7:u.getLogger().debug("Rule: hierarchy: ",t[r-1]),u.setHierarchy(t[r-1]);break;case 8:u.getLogger().debug("Stop NL ");break;case 9:u.getLogger().debug("Stop EOF ");break;case 10:u.getLogger().debug("Stop NL2 ");break;case 11:u.getLogger().debug("Stop EOF2 ");break;case 12:u.getLogger().debug("Rule: statement: ",t[r]),typeof t[r].length=="number"?this.$=t[r]:this.$=[t[r]];break;case 13:u.getLogger().debug("Rule: statement #2: ",t[r-1]),this.$=[t[r-1]].concat(t[r]);break;case 14:u.getLogger().debug("Rule: link: ",t[r],o),this.$={edgeTypeStr:t[r],label:""};break;case 15:u.getLogger().debug("Rule: LABEL link: ",t[r-3],t[r-1],t[r]),this.$={edgeTypeStr:t[r],label:t[r-1]};break;case 18:const R=parseInt(t[r]),Y=u.generateId();this.$={id:Y,type:"space",label:"",width:R,children:[]};break;case 23:u.getLogger().debug("Rule: (nodeStatement link node) ",t[r-2],t[r-1],t[r]," typestr: ",t[r-1].edgeTypeStr);const F=u.edgeStrToEdgeData(t[r-1].edgeTypeStr);this.$=[{id:t[r-2].id,label:t[r-2].label,type:t[r-2].type,directions:t[r-2].directions},{id:t[r-2].id+"-"+t[r].id,start:t[r-2].id,end:t[r].id,label:t[r-1].label,type:"edge",directions:t[r].directions,arrowTypeEnd:F,arrowTypeStart:"arrow_open"},{id:t[r].id,label:t[r].label,type:u.typeStr2Type(t[r].typeStr),directions:t[r].directions}];break;case 24:u.getLogger().debug("Rule: nodeStatement (abc88 node size) ",t[r-1],t[r]),this.$={id:t[r-1].id,label:t[r-1].label,type:u.typeStr2Type(t[r-1].typeStr),directions:t[r-1].directions,widthInColumns:parseInt(t[r],10)};break;case 25:u.getLogger().debug("Rule: nodeStatement (node) ",t[r]),this.$={id:t[r].id,label:t[r].label,type:u.typeStr2Type(t[r].typeStr),directions:t[r].directions,widthInColumns:1};break;case 26:u.getLogger().debug("APA123",this?this:"na"),u.getLogger().debug("COLUMNS: ",t[r]),this.$={type:"column-setting",columns:t[r]==="auto"?-1:parseInt(t[r])};break;case 27:u.getLogger().debug("Rule: id-block statement : ",t[r-2],t[r-1]),u.generateId(),this.$={...t[r-2],type:"composite",children:t[r-1]};break;case 28:u.getLogger().debug("Rule: blockStatement : ",t[r-2],t[r-1],t[r]);const C=u.generateId();this.$={id:C,type:"composite",label:"",children:t[r-1]};break;case 29:u.getLogger().debug("Rule: node (NODE_ID separator): ",t[r]),this.$={id:t[r]};break;case 30:u.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",t[r-1],t[r]),this.$={id:t[r-1],label:t[r].label,typeStr:t[r].typeStr,directions:t[r].directions};break;case 31:u.getLogger().debug("Rule: dirList: ",t[r]),this.$=[t[r]];break;case 32:u.getLogger().debug("Rule: dirList: ",t[r-1],t[r]),this.$=[t[r-1]].concat(t[r]);break;case 33:u.getLogger().debug("Rule: nodeShapeNLabel: ",t[r-2],t[r-1],t[r]),this.$={typeStr:t[r-2]+t[r],label:t[r-1]};break;case 34:u.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",t[r-3],t[r-2]," #3:",t[r-1],t[r]),this.$={typeStr:t[r-3]+t[r],label:t[r-2],directions:t[r-1]};break;case 35:case 36:this.$={type:"classDef",id:t[r-1].trim(),css:t[r].trim()};break;case 37:this.$={type:"applyClass",id:t[r-1].trim(),styleClass:t[r].trim()};break;case 38:this.$={type:"applyStyles",id:t[r-1].trim(),stylesStr:t[r].trim()};break}},table:[{9:1,10:[1,2]},{1:[3]},{11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:d,29:c,31:n,32:g,40:l,44:f,47:b},{8:[1,20]},e(p,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,21:a,28:d,29:c,31:n,32:g,40:l,44:f,47:b}),e(x,[2,16],{14:22,15:E,16:T}),e(x,[2,17]),e(x,[2,18]),e(x,[2,19]),e(x,[2,20]),e(x,[2,21]),e(x,[2,22]),e(v,[2,25],{27:[1,25]}),e(x,[2,26]),{19:26,26:12,32:g},{11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:d,29:c,31:n,32:g,40:l,44:f,47:b},{41:[1,28],43:[1,29]},{45:[1,30]},{48:[1,31]},e(N,[2,29],{33:32,36:[1,33],38:[1,34]}),{1:[2,7]},e(p,[2,13]),{26:35,32:g},{32:[2,14]},{17:[1,36]},e(v,[2,24]),{11:37,13:4,14:22,15:E,16:T,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:d,29:c,31:n,32:g,40:l,44:f,47:b},{30:[1,38]},{42:[1,39]},{42:[1,40]},{46:[1,41]},{49:[1,42]},e(N,[2,30]),{18:[1,43]},{18:[1,44]},e(v,[2,23]),{18:[1,45]},{30:[1,46]},e(x,[2,28]),e(x,[2,35]),e(x,[2,36]),e(x,[2,37]),e(x,[2,38]),{37:[1,47]},{34:48,35:y},{15:[1,50]},e(x,[2,27]),e(N,[2,33]),{39:[1,51]},{34:52,35:y,39:[2,31]},{32:[2,15]},e(N,[2,34]),{39:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:function(o,s){if(s.recoverable)this.trace(o);else{var i=new Error(o);throw i.hash=s,i}},parse:function(o){var s=this,i=[0],u=[],h=[null],t=[],m=this.table,r="",R=0,Y=0,F=2,C=1,Le=t.slice.call(arguments,1),w=Object.create(this.lexer),K={yy:{}};for(var Z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Z)&&(K.yy[Z]=this.yy[Z]);w.setInput(o,K.yy),K.yy.lexer=w,K.yy.parser=this,typeof w.yylloc>"u"&&(w.yylloc={});var J=w.yylloc;t.push(J);var me=w.options&&w.options.ranges;typeof K.yy.parseError=="function"?this.parseError=K.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function _e(){var P;return P=u.pop()||w.lex()||C,typeof P!="number"&&(P instanceof Array&&(u=P,P=u.pop()),P=s.symbols_[P]||P),P}for(var I,M,z,Q,W={},X,B,ae,G;;){if(M=i[i.length-1],this.defaultActions[M]?z=this.defaultActions[M]:((I===null||typeof I>"u")&&(I=_e()),z=m[M]&&m[M][I]),typeof z>"u"||!z.length||!z[0]){var $="";G=[];for(X in m[M])this.terminals_[X]&&X>F&&G.push("'"+this.terminals_[X]+"'");w.showPosition?$="Parse error on line "+(R+1)+`:
|
|
2
2
|
`+w.showPosition()+`
|
|
3
3
|
Expecting `+G.join(", ")+", got '"+(this.terminals_[I]||I)+"'":$="Parse error on line "+(R+1)+": Unexpected "+(I==C?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError($,{text:w.match,token:this.terminals_[I]||I,line:w.yylineno,loc:J,expected:G})}if(z[0]instanceof Array&&z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+M+", token: "+I);switch(z[0]){case 1:i.push(I),h.push(w.yytext),t.push(w.yylloc),i.push(z[1]),I=null,Y=w.yyleng,r=w.yytext,R=w.yylineno,J=w.yylloc;break;case 2:if(B=this.productions_[z[1]][1],W.$=h[h.length-B],W._$={first_line:t[t.length-(B||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(B||1)].first_column,last_column:t[t.length-1].last_column},me&&(W._$.range=[t[t.length-(B||1)].range[0],t[t.length-1].range[1]]),Q=this.performAction.apply(W,[r,Y,R,K.yy,z[1],h,t].concat(Le)),typeof Q<"u")return Q;B&&(i=i.slice(0,-1*B*2),h=h.slice(0,-1*B),t=t.slice(0,-1*B)),i.push(this.productions_[z[1]][0]),h.push(W.$),t.push(W._$),ae=m[i[i.length-2]][i[i.length-1]],i.push(ae);break;case 3:return!0}}return!0}},A=function(){var D={EOF:1,parseError:function(s,i){if(this.yy.parser)this.yy.parser.parseError(s,i);else throw new Error(s)},setInput:function(o,s){return this.yy=s||this.yy||{},this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var s=o.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},unput:function(o){var s=o.length,i=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var u=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var h=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===u.length?this.yylloc.first_column:0)+u[u.length-i.length].length-i[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[h[0],h[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(o){this.unput(this.match.slice(o))},pastInput:function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var o=this.pastInput(),s=new Array(o.length+1).join("-");return o+this.upcomingInput()+`
|