rasa-pro 3.14.0.dev6__py3-none-any.whl → 3.14.0.dev8__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_manager.py +1 -1
- rasa/agents/constants.py +2 -2
- rasa/agents/exceptions.py +31 -1
- rasa/agents/protocol/a2a/a2a_agent.py +385 -227
- rasa/agents/protocol/mcp/mcp_base_agent.py +37 -19
- rasa/agents/protocol/mcp/mcp_open_agent.py +31 -8
- rasa/agents/protocol/mcp/mcp_task_agent.py +33 -10
- rasa/agents/schemas/agent_output.py +1 -1
- rasa/agents/utils.py +95 -1
- rasa/agents/validation.py +484 -0
- rasa/api.py +9 -6
- rasa/builder/README.md +120 -0
- rasa/builder/__init__.py +0 -0
- rasa/builder/auth.py +176 -0
- rasa/builder/config.py +92 -0
- rasa/builder/copilot/__init__.py +0 -0
- rasa/builder/copilot/constants.py +31 -0
- rasa/builder/copilot/copilot.py +450 -0
- rasa/builder/copilot/copilot_response_handler.py +522 -0
- rasa/builder/copilot/copilot_templated_message_provider.py +58 -0
- rasa/builder/copilot/exceptions.py +32 -0
- rasa/builder/copilot/models.py +500 -0
- rasa/builder/copilot/prompts/__init__.py +0 -0
- rasa/builder/copilot/prompts/copilot_system_prompt.jinja2 +766 -0
- rasa/builder/copilot/prompts/latest_user_message_context_prompt.jinja2 +61 -0
- rasa/builder/copilot/signing.py +305 -0
- rasa/builder/copilot/telemetry.py +210 -0
- rasa/builder/copilot/templated_messages/__init__.py +0 -0
- rasa/builder/copilot/templated_messages/copilot_internal_messages_templates.yml +16 -0
- rasa/builder/copilot/templated_messages/copilot_templated_responses.yml +38 -0
- rasa/builder/document_retrieval/__init__.py +0 -0
- rasa/builder/document_retrieval/constants.py +15 -0
- rasa/builder/document_retrieval/inkeep-rag-response-schema.json +64 -0
- rasa/builder/document_retrieval/inkeep_document_retrieval.py +238 -0
- rasa/builder/document_retrieval/models.py +62 -0
- rasa/builder/download.py +140 -0
- rasa/builder/exceptions.py +91 -0
- rasa/builder/guardrails/__init__.py +1 -0
- rasa/builder/guardrails/constants.py +9 -0
- rasa/builder/guardrails/exceptions.py +4 -0
- rasa/builder/guardrails/lakera.py +206 -0
- rasa/builder/guardrails/models.py +231 -0
- rasa/builder/guardrails/store.py +238 -0
- rasa/builder/guardrails/utils.py +328 -0
- rasa/builder/job_manager.py +87 -0
- rasa/builder/jobs.py +282 -0
- rasa/builder/llm_service.py +246 -0
- rasa/builder/logging_utils.py +265 -0
- rasa/builder/main.py +243 -0
- rasa/builder/models.py +216 -0
- rasa/builder/project_generator.py +458 -0
- rasa/builder/project_info.py +72 -0
- rasa/builder/scrape_rasa_docs.py +97 -0
- rasa/builder/service.py +1345 -0
- rasa/builder/shared/tracker_context.py +212 -0
- rasa/builder/skill_to_bot_prompt.jinja2 +164 -0
- rasa/builder/template_cache.py +244 -0
- rasa/builder/training_service.py +194 -0
- rasa/builder/validation_service.py +97 -0
- rasa/cli/arguments/train.py +2 -0
- rasa/cli/interactive.py +2 -0
- rasa/cli/project_templates/basic/README.md +23 -0
- rasa/cli/project_templates/basic/actions/__init__ +0 -0
- rasa/cli/project_templates/basic/actions/action_human_handoff.py +40 -0
- rasa/cli/project_templates/basic/actions/actions.md +10 -0
- rasa/cli/project_templates/basic/config.yml +29 -0
- rasa/cli/project_templates/basic/credentials.yml +33 -0
- rasa/cli/project_templates/basic/data/data.md +9 -0
- rasa/cli/project_templates/basic/data/general/feedback.yml +21 -0
- rasa/cli/project_templates/basic/data/general/goodbye.yml +6 -0
- rasa/cli/project_templates/basic/data/general/hello.yml +6 -0
- rasa/cli/project_templates/basic/data/general/help.yml +6 -0
- rasa/cli/project_templates/basic/data/general/human_handoff.yml +16 -0
- rasa/cli/project_templates/basic/data/general/show_faqs.yml +6 -0
- rasa/cli/project_templates/basic/data/system/patterns/pattern_cannot_handle.yml +7 -0
- rasa/cli/project_templates/basic/data/system/patterns/pattern_completed.yml +7 -0
- rasa/cli/project_templates/basic/data/system/patterns/pattern_correction.yml +7 -0
- rasa/cli/project_templates/basic/data/system/patterns/pattern_search.yml +8 -0
- rasa/cli/project_templates/basic/data/system/patterns/pattern_session_start.yml +8 -0
- rasa/cli/project_templates/basic/docs/docs.md +5 -0
- rasa/cli/project_templates/basic/docs/template.txt +28 -0
- rasa/cli/project_templates/basic/domain/domain.md +8 -0
- rasa/cli/project_templates/basic/domain/general/feedback.yml +25 -0
- rasa/cli/project_templates/basic/domain/general/goodbye.yml +9 -0
- rasa/cli/project_templates/basic/domain/general/hello.yml +7 -0
- rasa/cli/project_templates/basic/domain/general/help.yml +21 -0
- rasa/cli/project_templates/basic/domain/general/human_handoff.yml +32 -0
- rasa/cli/project_templates/basic/domain/general/show_faqs.yml +14 -0
- rasa/cli/project_templates/basic/domain/system/patterns/pattern_cannot_handle.yml +5 -0
- rasa/cli/project_templates/basic/domain/system/patterns/pattern_session_start.yml +19 -0
- rasa/cli/project_templates/basic/endpoints.yml +67 -0
- rasa/cli/project_templates/basic/prompts/rephraser_demo_personality_prompt.jinja2 +38 -0
- rasa/cli/project_templates/default/config.yml +4 -0
- rasa/cli/project_templates/default/endpoints.yml +4 -0
- rasa/cli/project_templates/finance/README.md +25 -0
- rasa/cli/project_templates/finance/actions/__init__.py +46 -0
- rasa/cli/project_templates/finance/actions/accounts/__init__.py +0 -0
- rasa/cli/project_templates/finance/actions/accounts/action_ask_account.py +47 -0
- rasa/cli/project_templates/finance/actions/accounts/action_check_balance.py +40 -0
- rasa/cli/project_templates/finance/actions/action_session_start.py +74 -0
- rasa/cli/project_templates/finance/actions/actions.md +15 -0
- rasa/cli/project_templates/finance/actions/cards/__init__.py +0 -0
- rasa/cli/project_templates/finance/actions/cards/action_ask_card.py +48 -0
- rasa/cli/project_templates/finance/actions/cards/action_check_card_existence.py +36 -0
- rasa/cli/project_templates/finance/actions/cards/action_update_card_status.py +54 -0
- rasa/cli/project_templates/finance/actions/database.py +277 -0
- rasa/cli/project_templates/finance/actions/transfers/__init__.py +0 -0
- rasa/cli/project_templates/finance/actions/transfers/action_add_payee.py +52 -0
- rasa/cli/project_templates/finance/actions/transfers/action_ask_account_from.py +51 -0
- rasa/cli/project_templates/finance/actions/transfers/action_check_payee_existence.py +40 -0
- rasa/cli/project_templates/finance/actions/transfers/action_check_sufficient_funds.py +40 -0
- rasa/cli/project_templates/finance/actions/transfers/action_list_payees.py +46 -0
- rasa/cli/project_templates/finance/actions/transfers/action_process_immediate_payment.py +18 -0
- rasa/cli/project_templates/finance/actions/transfers/action_remove_payee.py +49 -0
- rasa/cli/project_templates/finance/actions/transfers/action_schedule_payment.py +19 -0
- rasa/cli/project_templates/finance/actions/transfers/action_validate_payment_date.py +36 -0
- rasa/cli/project_templates/finance/config.yml +23 -0
- rasa/cli/project_templates/finance/credentials.yml +32 -0
- rasa/cli/project_templates/finance/csvs/accounts.csv +8 -0
- rasa/cli/project_templates/finance/csvs/advisors.csv +7 -0
- rasa/cli/project_templates/finance/csvs/appointments.csv +211 -0
- rasa/cli/project_templates/finance/csvs/branches.csv +10 -0
- rasa/cli/project_templates/finance/csvs/cards.csv +11 -0
- rasa/cli/project_templates/finance/csvs/payees.csv +11 -0
- rasa/cli/project_templates/finance/csvs/transactions.csv +71 -0
- rasa/cli/project_templates/finance/csvs/users.csv +4 -0
- rasa/cli/project_templates/finance/data/accounts/check_balance.yml +10 -0
- rasa/cli/project_templates/finance/data/cards/block_card.yml +66 -0
- rasa/cli/project_templates/finance/data/cards/select_card.yml +12 -0
- rasa/cli/project_templates/finance/data/data.md +11 -0
- rasa/cli/project_templates/finance/data/general/bot_identity.yml +6 -0
- rasa/cli/project_templates/finance/data/general/feedback.yml +20 -0
- rasa/cli/project_templates/finance/data/general/goodbye.yml +6 -0
- rasa/cli/project_templates/finance/data/general/hello.yml +7 -0
- rasa/cli/project_templates/finance/data/general/help.yml +9 -0
- rasa/cli/project_templates/finance/data/general/human_handoff.yml +16 -0
- rasa/cli/project_templates/finance/data/general/welcome.yml +9 -0
- rasa/cli/project_templates/finance/data/system/patterns/pattern_chitchat.yml +5 -0
- rasa/cli/project_templates/finance/data/system/patterns/pattern_completed.yml +7 -0
- rasa/cli/project_templates/finance/data/system/patterns/pattern_correction.yml +7 -0
- rasa/cli/project_templates/finance/data/system/patterns/pattern_search.yml +8 -0
- rasa/cli/project_templates/finance/data/system/patterns/pattern_session_start.yml +8 -0
- rasa/cli/project_templates/finance/data/system/source/accounts.json +51 -0
- rasa/cli/project_templates/finance/data/system/source/advisors.json +44 -0
- rasa/cli/project_templates/finance/data/system/source/appointments.json +1474 -0
- rasa/cli/project_templates/finance/data/system/source/branches.json +47 -0
- rasa/cli/project_templates/finance/data/system/source/cards.json +72 -0
- rasa/cli/project_templates/finance/data/system/source/payees.json +74 -0
- rasa/cli/project_templates/finance/data/system/source/transactions.json +492 -0
- rasa/cli/project_templates/finance/data/system/source/users.json +29 -0
- rasa/cli/project_templates/finance/data/transfers/add_payee.yml +29 -0
- rasa/cli/project_templates/finance/data/transfers/list_payees.yml +5 -0
- rasa/cli/project_templates/finance/data/transfers/remove_payee.yml +21 -0
- rasa/cli/project_templates/finance/data/transfers/transfer_money.yml +67 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/block_card/consequences_of_blocking_card.txt +8 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/block_card/reasons_to_block_card.txt +8 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/block_card/recovering_from_card_fraud.txt +8 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/block_card/tips_for_card_security.txt +8 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/block_card/what_to_do_if_card_is_lost.txt +8 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/check_balance/account_balance_security.txt +7 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/check_balance/common_balance_inquiries.txt +8 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/check_balance/methods_to_check_balance.txt +8 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/check_balance/understanding_balance_updates.txt +8 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/check_balance/what_to_do_if_balance_is_incorrect.txt +8 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/manage_payees/benefits_of_authorised_payees.txt +8 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/manage_payees/common_issues_with_payees.txt +8 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/manage_payees/general_payee_information.txt +8 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/manage_payees/payee_management_tips.txt +8 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/manage_payees/understanding_payee_types.txt +8 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/transfer_money/common_transfer_errors.txt +8 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/transfer_money/fees_for_transfers.txt +8 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/transfer_money/general_transfer_information.txt +8 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/transfer_money/security_tips_for_transfers.txt +8 -0
- rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/transfer_money/transfer_processing_times.txt +8 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part1.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part10.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part11.txt +48 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part12.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part13.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part14.txt +47 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part15.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part16.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part17.txt +47 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part18.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part19.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part2.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part20.txt +47 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part21.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part22.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part23.txt +47 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part24.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part25.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part26.txt +47 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part27.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part28.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part29.txt +47 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part3.txt +47 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part30.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part31.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part32.txt +47 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part33.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part34.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part35.txt +47 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part36.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part37.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part38.txt +47 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part39.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part4.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part40.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part41.txt +47 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part42.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part43.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part44.txt +47 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part45.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part46.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part47.txt +47 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part48.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part49.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part5.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part50.txt +47 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part51.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part52.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part53.txt +47 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part54.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part55.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part56.txt +47 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part57.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part58.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part59.txt +47 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part6.txt +47 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part60.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part61.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part7.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part8.txt +50 -0
- rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part9.txt +47 -0
- rasa/cli/project_templates/finance/domain/accounts/check_balance.yml +11 -0
- rasa/cli/project_templates/finance/domain/cards/block_card.yml +101 -0
- rasa/cli/project_templates/finance/domain/cards/select_card.yml +12 -0
- rasa/cli/project_templates/finance/domain/domain.md +10 -0
- rasa/cli/project_templates/finance/domain/general/agent_details.yml +12 -0
- rasa/cli/project_templates/finance/domain/general/bot_identity.yml +5 -0
- rasa/cli/project_templates/finance/domain/general/cannot_handle.yml +5 -0
- rasa/cli/project_templates/finance/domain/general/defaults.yml +24 -0
- rasa/cli/project_templates/finance/domain/general/feedback.yml +28 -0
- rasa/cli/project_templates/finance/domain/general/goodbye.yml +7 -0
- rasa/cli/project_templates/finance/domain/general/help.yml +5 -0
- rasa/cli/project_templates/finance/domain/general/human_handoff.yml +30 -0
- rasa/cli/project_templates/finance/domain/general/utils.yml +13 -0
- rasa/cli/project_templates/finance/domain/general/welcome.yml +8 -0
- rasa/cli/project_templates/finance/domain/transfers/add_payee.yml +47 -0
- rasa/cli/project_templates/finance/domain/transfers/list_payees.yml +4 -0
- rasa/cli/project_templates/finance/domain/transfers/remove_payee.yml +16 -0
- rasa/cli/project_templates/finance/domain/transfers/transfer_money.yml +79 -0
- rasa/cli/project_templates/finance/endpoints.yml +66 -0
- rasa/cli/project_templates/finance/prompts/rephraser_demo_personality_prompt.jinja2 +19 -0
- rasa/cli/project_templates/telco/README.md +25 -0
- rasa/cli/project_templates/telco/actions/__init__.py +0 -0
- rasa/cli/project_templates/telco/actions/actions.md +12 -0
- rasa/cli/project_templates/telco/actions/billing/__init__.py +0 -0
- rasa/cli/project_templates/telco/actions/billing/actions_billing.py +204 -0
- rasa/cli/project_templates/telco/actions/general/__init__.py +0 -0
- rasa/cli/project_templates/telco/actions/general/action_human_handoff.py +49 -0
- rasa/cli/project_templates/telco/actions/network/__init__.py +0 -0
- rasa/cli/project_templates/telco/actions/network/actions_get_data_from_db.py +48 -0
- rasa/cli/project_templates/telco/actions/network/actions_run_diagnostics.py +28 -0
- rasa/cli/project_templates/telco/actions/network/actions_session_start.py +18 -0
- rasa/cli/project_templates/telco/config.yml +29 -0
- rasa/cli/project_templates/telco/credentials.yml +33 -0
- rasa/cli/project_templates/telco/csvs/billing.csv +19 -0
- rasa/cli/project_templates/telco/csvs/customers.csv +5 -0
- rasa/cli/project_templates/telco/data/billing/flow_understand_bill.yml +45 -0
- rasa/cli/project_templates/telco/data/data.md +11 -0
- rasa/cli/project_templates/telco/data/general/bot_challenge.yml +6 -0
- rasa/cli/project_templates/telco/data/general/feedback.yml +20 -0
- rasa/cli/project_templates/telco/data/general/goodbye.yml +6 -0
- rasa/cli/project_templates/telco/data/general/hello.yml +6 -0
- rasa/cli/project_templates/telco/data/general/human_handoff.yml +16 -0
- rasa/cli/project_templates/telco/data/general/patterns.yml +30 -0
- rasa/cli/project_templates/telco/data/network/flow_reboot_router.yml +8 -0
- rasa/cli/project_templates/telco/data/network/flow_reset_router.yml +7 -0
- rasa/cli/project_templates/telco/data/network/flow_solve_internet_issue.yml +73 -0
- rasa/cli/project_templates/telco/docs/docs.md +5 -0
- rasa/cli/project_templates/telco/docs/network/reset_vs_rboot_router.txt +1 -0
- rasa/cli/project_templates/telco/docs/network/restart_router.txt +6 -0
- rasa/cli/project_templates/telco/docs/network/run_speed_test.txt +6 -0
- rasa/cli/project_templates/telco/domain/billing/understand_bill.yml +102 -0
- rasa/cli/project_templates/telco/domain/domain.md +14 -0
- rasa/cli/project_templates/telco/domain/general/bot_challenge.yml +4 -0
- rasa/cli/project_templates/telco/domain/general/feedback.yml +25 -0
- rasa/cli/project_templates/telco/domain/general/goodbye.yml +7 -0
- rasa/cli/project_templates/telco/domain/general/hello.yml +5 -0
- rasa/cli/project_templates/telco/domain/general/human_handoff.yml +26 -0
- rasa/cli/project_templates/telco/domain/general/patterns.yml +33 -0
- rasa/cli/project_templates/telco/domain/network/reboot_router.yml +21 -0
- rasa/cli/project_templates/telco/domain/network/reset_router.yml +12 -0
- rasa/cli/project_templates/telco/domain/network/run_speed_test.yml +25 -0
- rasa/cli/project_templates/telco/domain/network/solve_internet_issue.yml +75 -0
- rasa/cli/project_templates/telco/domain/shared.yml +129 -0
- rasa/cli/project_templates/telco/endpoints.yml +67 -0
- rasa/cli/project_templates/telco/prompts/rephraser_demo_personality_prompt.jinja2 +40 -0
- rasa/cli/project_templates/telco/tests/e2e_test_cases/billing/understand_bill.yml +67 -0
- rasa/cli/project_templates/telco/tests/e2e_test_cases/general/bot_challenge.yml +8 -0
- rasa/cli/project_templates/telco/tests/e2e_test_cases/general/feedback.yml +46 -0
- rasa/cli/project_templates/telco/tests/e2e_test_cases/general/goodbye.yml +9 -0
- rasa/cli/project_templates/telco/tests/e2e_test_cases/general/hello.yml +8 -0
- rasa/cli/project_templates/telco/tests/e2e_test_cases/general/human_handoff.yml +35 -0
- rasa/cli/project_templates/telco/tests/e2e_test_cases/general/patterns.yml +23 -0
- rasa/cli/project_templates/telco/tests/e2e_test_cases/network/solve_internet_issue.yml +57 -0
- rasa/cli/project_templates/tutorial/config.yml +2 -1
- rasa/cli/scaffold.py +46 -2
- rasa/cli/train.py +2 -0
- rasa/cli/utils.py +85 -1
- rasa/core/actions/action.py +2 -7
- rasa/core/available_agents.py +49 -26
- rasa/core/available_endpoints.py +17 -2
- rasa/core/channels/channel.py +4 -3
- rasa/core/channels/constants.py +3 -0
- rasa/core/channels/development_inspector.py +2 -22
- rasa/core/channels/inspector/README.md +26 -14
- rasa/core/channels/inspector/dist/assets/{arc-63212852.js → arc-edef10dd.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{blockDiagram-38ab4fdb-eecf6b13.js → blockDiagram-38ab4fdb-49f6762b.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{c4Diagram-3d4e48cf-8f798a9a.js → c4Diagram-3d4e48cf-313c08e6.js} +1 -1
- rasa/core/channels/inspector/dist/assets/channel-63aa27d1.js +1 -0
- rasa/core/channels/inspector/dist/assets/{classDiagram-70f12bd4-df71a04c.js → classDiagram-70f12bd4-35e41ce9.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{classDiagram-v2-f2320105-9b275968.js → classDiagram-v2-f2320105-f346068d.js} +1 -1
- rasa/core/channels/inspector/dist/assets/clone-5566bae8.js +1 -0
- rasa/core/channels/inspector/dist/assets/{createText-2e5e7dd3-1c669cad.js → createText-2e5e7dd3-7a44bce8.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{edges-e0da2a9e-b1553799.js → edges-e0da2a9e-d7cf78c7.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{erDiagram-9861fffd-112388d6.js → erDiagram-9861fffd-9813e81c.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{flowDb-956e92f1-fdebec47.js → flowDb-956e92f1-d8ba0870.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{flowDiagram-66a62f08-6280ede1.js → flowDiagram-66a62f08-51f0db4d.js} +1 -1
- rasa/core/channels/inspector/dist/assets/flowDiagram-v2-96b9c2cf-32936074.js +1 -0
- rasa/core/channels/inspector/dist/assets/{flowchart-elk-definition-4a651766-e1dc03e5.js → flowchart-elk-definition-4a651766-ff9ea384.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{ganttDiagram-c361ad54-83f68c51.js → ganttDiagram-c361ad54-a8e13b6b.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{gitGraphDiagram-72cf32ee-22f8666f.js → gitGraphDiagram-72cf32ee-3b171c6d.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{graph-ca9e6217.js → graph-790ef78b.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{index-3862675e-c5ceb692.js → index-3862675e-ecdce073.js} +1 -1
- rasa/core/channels/inspector/dist/assets/index-d705da80.js +1352 -0
- rasa/core/channels/inspector/dist/assets/{infoDiagram-f8f76790-faa9999b.js → infoDiagram-f8f76790-f5a422fe.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{journeyDiagram-49397b02-c4dda8d9.js → journeyDiagram-49397b02-3185b7ac.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{layout-d4307784.js → layout-837fd3aa.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{line-0567aaa7.js → line-7e05afcb.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{linear-c11b95cf.js → linear-162eb295.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{mindmap-definition-fc14e90a-0c7d3ca9.js → mindmap-definition-fc14e90a-f4978aee.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{pieDiagram-8a3498a8-34b433fa.js → pieDiagram-8a3498a8-b25d0a52.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{quadrantDiagram-120e2f19-4cab816e.js → quadrantDiagram-120e2f19-63db1afa.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{requirementDiagram-deff3bca-8c22fa9e.js → requirementDiagram-deff3bca-1b486cc9.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{sankeyDiagram-04a897e0-70ce9e8e.js → sankeyDiagram-04a897e0-7e795291.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{sequenceDiagram-704730f1-fbcd7fc9.js → sequenceDiagram-704730f1-b8aba159.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{stateDiagram-587899a1-45f05ea6.js → stateDiagram-587899a1-41529fd5.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{stateDiagram-v2-d93cdb3a-beab1ea6.js → stateDiagram-v2-d93cdb3a-b241043c.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-6aaf32cf-2f29dbd5.js → styles-6aaf32cf-b5b53234.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-9a916d00-951eac83.js → styles-9a916d00-13d138e5.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{styles-c10674c1-897fbfdd.js → styles-c10674c1-94cbde3f.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{svgDrawCommon-08f97a94-d667fac1.js → svgDrawCommon-08f97a94-453ae764.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{timeline-definition-85554ec2-e3205144.js → timeline-definition-85554ec2-8dcb88a4.js} +1 -1
- rasa/core/channels/inspector/dist/assets/{xychartDiagram-e933f94c-4abeb0e2.js → xychartDiagram-e933f94c-376af5f0.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 +42 -44
- rasa/core/channels/inspector/src/components/Chat.tsx +2 -3
- rasa/core/channels/inspector/src/components/DialogueAgentStack.tsx +108 -0
- rasa/core/channels/inspector/src/components/{DialogueStack.tsx → DialogueHistoryStack.tsx} +8 -8
- rasa/core/channels/inspector/src/components/DialogueInformation.tsx +20 -3
- rasa/core/channels/inspector/src/components/LatencyDisplay.tsx +63 -35
- rasa/core/channels/inspector/src/helpers/audio/audiostream.ts +14 -0
- rasa/core/channels/inspector/src/helpers/formatters.test.ts +4 -0
- rasa/core/channels/inspector/src/helpers/utils.test.ts +127 -0
- rasa/core/channels/inspector/src/helpers/utils.ts +66 -1
- rasa/core/channels/inspector/src/types.ts +49 -7
- rasa/core/channels/socketio.py +212 -51
- rasa/core/channels/studio_chat.py +59 -57
- rasa/core/channels/voice_stream/asr/asr_event.py +1 -1
- rasa/core/channels/voice_stream/asr/azure.py +6 -3
- rasa/core/channels/voice_stream/asr/deepgram.py +1 -1
- rasa/core/channels/voice_stream/audiocodes.py +3 -0
- rasa/core/channels/voice_stream/browser_audio.py +53 -3
- rasa/core/channels/voice_stream/genesys.py +2 -1
- rasa/core/channels/voice_stream/jambonz.py +9 -1
- rasa/core/channels/voice_stream/twilio_media_streams.py +16 -0
- rasa/core/channels/voice_stream/voice_channel.py +66 -3
- rasa/core/constants.py +6 -0
- rasa/core/iam_credentials_providers/__init__.py +0 -0
- rasa/core/iam_credentials_providers/aws_iam_credentials_providers.py +66 -0
- rasa/core/iam_credentials_providers/credentials_provider_protocol.py +89 -0
- rasa/core/policies/enterprise_search_policy.py +4 -7
- rasa/core/policies/flows/flow_executor.py +66 -36
- rasa/core/policies/ted_policy.py +7 -5
- rasa/core/processor.py +32 -0
- rasa/core/redis_connection_factory.py +411 -0
- rasa/core/run.py +13 -3
- rasa/core/tracker_stores/redis_tracker_store.py +32 -14
- rasa/core/tracker_stores/sql_tracker_store.py +57 -1
- rasa/dialogue_understanding/commands/cancel_flow_command.py +2 -81
- rasa/dialogue_understanding/commands/start_flow_command.py +18 -113
- rasa/dialogue_understanding/commands/utils.py +118 -0
- rasa/dialogue_understanding/generator/flow_retrieval.py +10 -9
- rasa/dialogue_understanding/generator/prompt_templates/agent_command_prompt_v2_claude_3_5_sonnet_20240620_template.jinja2 +10 -5
- rasa/dialogue_understanding/generator/prompt_templates/agent_command_prompt_v2_gpt_4o_2024_11_20_template.jinja2 +10 -5
- rasa/dialogue_understanding/generator/prompt_templates/agent_command_prompt_v3_claude_3_5_sonnet_20240620_template.jinja2 +20 -12
- rasa/dialogue_understanding/generator/prompt_templates/agent_command_prompt_v3_gpt_4o_2024_11_20_template.jinja2 +19 -12
- rasa/dialogue_understanding/generator/single_step/single_step_based_llm_command_generator.py +6 -35
- rasa/dialogue_understanding/patterns/cancel.py +27 -6
- rasa/dialogue_understanding/patterns/clarify.py +3 -14
- rasa/dialogue_understanding/patterns/continue_interrupted.py +185 -114
- rasa/dialogue_understanding/patterns/default_flows_for_patterns.yml +18 -24
- rasa/dialogue_understanding/processor/command_processor.py +35 -0
- rasa/dialogue_understanding/stack/utils.py +43 -4
- rasa/dialogue_understanding/utils.py +24 -4
- rasa/engine/graph.py +5 -1
- rasa/engine/recipes/default_components.py +78 -10
- rasa/engine/recipes/default_recipe.py +41 -1
- rasa/engine/storage/local_model_storage.py +83 -3
- rasa/graph_components/validators/default_recipe_validator.py +153 -135
- rasa/model_manager/model_api.py +4 -5
- rasa/model_manager/runner_service.py +1 -1
- rasa/model_manager/socket_bridge.py +20 -15
- rasa/model_manager/trainer_service.py +12 -9
- rasa/model_manager/utils.py +1 -29
- rasa/model_manager/warm_rasa_process.py +1 -1
- rasa/model_training.py +22 -6
- rasa/nlu/classifiers/diet_classifier.py +22 -6
- rasa/nlu/classifiers/logistic_regression_classifier.py +18 -0
- rasa/nlu/extractors/extractor.py +1 -2
- rasa/shared/agents/auth/__init__.py +0 -0
- rasa/shared/agents/auth/agent_auth_factory.py +74 -0
- rasa/shared/agents/auth/agent_auth_manager.py +86 -0
- rasa/shared/agents/auth/auth_strategy/__init__.py +19 -0
- rasa/shared/agents/auth/auth_strategy/agent_auth_strategy.py +52 -0
- rasa/shared/agents/auth/auth_strategy/api_key_auth_strategy.py +42 -0
- rasa/shared/agents/auth/auth_strategy/bearer_token_auth_strategy.py +28 -0
- rasa/shared/agents/auth/auth_strategy/oauth2_auth_strategy.py +159 -0
- rasa/shared/agents/auth/constants.py +11 -0
- rasa/shared/agents/auth/types.py +11 -0
- rasa/shared/constants.py +3 -0
- rasa/shared/core/constants.py +6 -6
- rasa/shared/core/domain.py +58 -11
- rasa/shared/core/events.py +2 -0
- rasa/shared/core/flows/constants.py +5 -0
- rasa/shared/core/flows/flow_step.py +7 -1
- rasa/shared/core/flows/flows_list.py +6 -0
- rasa/shared/core/flows/steps/call.py +15 -12
- rasa/shared/core/flows/validation.py +238 -44
- rasa/shared/core/flows/yaml_flows_io.py +15 -6
- rasa/shared/core/slots.py +4 -0
- rasa/shared/exceptions.py +12 -0
- rasa/shared/importers/importer.py +6 -0
- rasa/shared/importers/utils.py +77 -1
- rasa/shared/nlu/training_data/schemas/responses.yml +3 -0
- rasa/shared/providers/_utils.py +60 -44
- rasa/shared/providers/embedding/default_litellm_embedding_client.py +2 -0
- rasa/shared/providers/llm/_base_litellm_client.py +2 -2
- rasa/shared/providers/llm/default_litellm_llm_client.py +2 -0
- rasa/shared/providers/llm/llm_response.py +4 -4
- rasa/shared/utils/common.py +24 -0
- rasa/shared/utils/health_check/health_check.py +7 -3
- rasa/shared/utils/llm.py +2 -1
- rasa/shared/utils/mcp/server_connection.py +108 -27
- rasa/shared/utils/mcp/utils.py +20 -0
- rasa/studio/upload.py +16 -47
- rasa/telemetry.py +97 -23
- rasa/tracing/config.py +38 -12
- rasa/tracing/instrumentation/attribute_extractors.py +5 -1
- rasa/tracing/instrumentation/instrumentation.py +85 -8
- rasa/utils/common.py +1 -1
- rasa/utils/io.py +27 -9
- rasa/utils/json_utils.py +6 -1
- rasa/utils/log_utils.py +5 -1
- rasa/utils/openapi.py +144 -0
- rasa/utils/tensorflow/__init__.py +29 -0
- rasa/utils/tensorflow/callback.py +1 -1
- rasa/utils/tensorflow/crf.py +1 -1
- rasa/utils/tensorflow/data_generator.py +21 -8
- rasa/utils/tensorflow/layers.py +11 -4
- rasa/utils/tensorflow/metrics.py +7 -3
- rasa/utils/tensorflow/models.py +41 -6
- rasa/utils/tensorflow/rasa_layers.py +6 -4
- rasa/utils/tensorflow/transformer.py +2 -3
- rasa/utils/train_utils.py +68 -38
- rasa/validator.py +18 -16
- rasa/version.py +1 -1
- rasa_pro-3.14.0.dev8.dist-info/METADATA +199 -0
- {rasa_pro-3.14.0.dev6.dist-info → rasa_pro-3.14.0.dev8.dist-info}/RECORD +486 -173
- rasa/core/channels/inspector/dist/assets/channel-0cd70adf.js +0 -1
- rasa/core/channels/inspector/dist/assets/clone-a0f9c4ed.js +0 -1
- rasa/core/channels/inspector/dist/assets/flowDiagram-v2-96b9c2cf-de9cc4aa.js +0 -1
- rasa/core/channels/inspector/dist/assets/index-3e293924.js +0 -1353
- rasa_pro-3.14.0.dev6.dist-info/METADATA +0 -190
- {rasa_pro-3.14.0.dev6.dist-info → rasa_pro-3.14.0.dev8.dist-info}/NOTICE +0 -0
- {rasa_pro-3.14.0.dev6.dist-info → rasa_pro-3.14.0.dev8.dist-info}/WHEEL +0 -0
- {rasa_pro-3.14.0.dev6.dist-info → rasa_pro-3.14.0.dev8.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
import boto3
|
|
4
|
+
import structlog
|
|
5
|
+
from botocore.exceptions import BotoCoreError
|
|
6
|
+
|
|
7
|
+
from rasa.core.iam_credentials_providers.credentials_provider_protocol import (
|
|
8
|
+
IAMCredentialsProvider,
|
|
9
|
+
IAMCredentialsProviderInput,
|
|
10
|
+
SupportedServiceType,
|
|
11
|
+
TemporaryCredentials,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
structlogger = structlog.get_logger(__name__)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class AWSRDSIAMCredentialsProvider(IAMCredentialsProvider):
|
|
18
|
+
"""Generates temporary credentials for AWS RDS using IAM roles."""
|
|
19
|
+
|
|
20
|
+
def __init__(self, username: str, host: str, port: int):
|
|
21
|
+
"""Initializes the provider."""
|
|
22
|
+
self.username = username
|
|
23
|
+
self.host = host
|
|
24
|
+
self.port = port
|
|
25
|
+
|
|
26
|
+
def get_credentials(self) -> TemporaryCredentials:
|
|
27
|
+
"""Generates temporary credentials for AWS RDS."""
|
|
28
|
+
structlogger.debug(
|
|
29
|
+
"rasa.core.aws_rds_iam_credentials_provider.get_credentials",
|
|
30
|
+
event_info="IAM authentication for AWS RDS enabled. "
|
|
31
|
+
"Generating temporary auth token...",
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
try:
|
|
35
|
+
client = boto3.client("rds")
|
|
36
|
+
auth_token = client.generate_db_auth_token(
|
|
37
|
+
DBHostname=self.host,
|
|
38
|
+
Port=self.port,
|
|
39
|
+
DBUsername=self.username,
|
|
40
|
+
)
|
|
41
|
+
structlogger.info(
|
|
42
|
+
"rasa.core.aws_rds_iam_credentials_provider.generated_credentials",
|
|
43
|
+
event_info="Successfully generated temporary auth token for AWS RDS.",
|
|
44
|
+
)
|
|
45
|
+
return TemporaryCredentials(auth_token=auth_token)
|
|
46
|
+
except (BotoCoreError, ValueError) as exc:
|
|
47
|
+
structlogger.error(
|
|
48
|
+
"rasa.core.aws_rds_iam_credentials_provider.error_generating_credentials",
|
|
49
|
+
event_info="Failed to generate temporary auth token for AWS RDS.",
|
|
50
|
+
error=str(exc),
|
|
51
|
+
)
|
|
52
|
+
return TemporaryCredentials(auth_token=None)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def create_aws_iam_credentials_provider(
|
|
56
|
+
provider_input: "IAMCredentialsProviderInput",
|
|
57
|
+
) -> Optional["IAMCredentialsProvider"]:
|
|
58
|
+
"""Factory function to create an AWS IAM credentials provider."""
|
|
59
|
+
if provider_input.service_name == SupportedServiceType.TRACKER_STORE:
|
|
60
|
+
return AWSRDSIAMCredentialsProvider(
|
|
61
|
+
username=provider_input.username,
|
|
62
|
+
host=provider_input.host,
|
|
63
|
+
port=provider_input.port,
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
return None
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
from enum import Enum
|
|
5
|
+
from typing import Optional, Protocol, runtime_checkable
|
|
6
|
+
|
|
7
|
+
import structlog
|
|
8
|
+
from pydantic import BaseModel
|
|
9
|
+
|
|
10
|
+
from rasa.core.constants import IAM_CLOUD_PROVIDER_ENV_VAR_NAME
|
|
11
|
+
|
|
12
|
+
structlogger = structlog.get_logger(__name__)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class TemporaryCredentials(BaseModel):
|
|
16
|
+
"""Dataclass storing temporary credentials."""
|
|
17
|
+
|
|
18
|
+
auth_token: Optional[str] = None
|
|
19
|
+
expiration: Optional[int] = None
|
|
20
|
+
username: Optional[str] = None
|
|
21
|
+
presigned_url: Optional[str] = None
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@runtime_checkable
|
|
25
|
+
class IAMCredentialsProvider(Protocol):
|
|
26
|
+
"""Interface for generating temporary credentials using IAM roles."""
|
|
27
|
+
|
|
28
|
+
def get_credentials(self) -> TemporaryCredentials:
|
|
29
|
+
"""Generates temporary credentials using IAM roles."""
|
|
30
|
+
...
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class IAMCredentialsProviderType(Enum):
|
|
34
|
+
"""Enum for supported IAM credentials provider types."""
|
|
35
|
+
|
|
36
|
+
AWS = "aws"
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class SupportedServiceType(Enum):
|
|
40
|
+
"""Enum for supported services using IAM credentials providers."""
|
|
41
|
+
|
|
42
|
+
TRACKER_STORE = "tracker_store"
|
|
43
|
+
EVENT_BROKER = "event_broker"
|
|
44
|
+
LOCK_STORE = "lock_store"
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class IAMCredentialsProviderInput(BaseModel):
|
|
48
|
+
"""Input data for creating an IAM credentials provider."""
|
|
49
|
+
|
|
50
|
+
service_name: SupportedServiceType
|
|
51
|
+
username: Optional[str] = None
|
|
52
|
+
host: Optional[str] = None
|
|
53
|
+
port: Optional[int] = None
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def create_iam_credentials_provider(
|
|
57
|
+
provider_input: IAMCredentialsProviderInput,
|
|
58
|
+
) -> Optional[IAMCredentialsProvider]:
|
|
59
|
+
"""Factory function to create an IAM credentials provider.
|
|
60
|
+
|
|
61
|
+
Args:
|
|
62
|
+
provider_input: Input data for creating an IAM credentials provider.
|
|
63
|
+
|
|
64
|
+
Returns:
|
|
65
|
+
An instance of the specified IAM credentials provider or
|
|
66
|
+
None if the type is unsupported.
|
|
67
|
+
"""
|
|
68
|
+
iam_cloud_provider = os.getenv(IAM_CLOUD_PROVIDER_ENV_VAR_NAME)
|
|
69
|
+
|
|
70
|
+
if iam_cloud_provider is None:
|
|
71
|
+
return None
|
|
72
|
+
|
|
73
|
+
try:
|
|
74
|
+
provider_type = IAMCredentialsProviderType(iam_cloud_provider.lower())
|
|
75
|
+
except ValueError:
|
|
76
|
+
structlogger.warning(
|
|
77
|
+
"rasa.core.iam_credentials_provider.create_iam_credentials_provider.unsupported_provider",
|
|
78
|
+
event_info=f"Unsupported IAM cloud provider: {iam_cloud_provider}",
|
|
79
|
+
)
|
|
80
|
+
return None
|
|
81
|
+
|
|
82
|
+
if provider_type == IAMCredentialsProviderType.AWS:
|
|
83
|
+
from rasa.core.iam_credentials_providers.aws_iam_credentials_providers import (
|
|
84
|
+
create_aws_iam_credentials_provider,
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
return create_aws_iam_credentials_provider(provider_input)
|
|
88
|
+
|
|
89
|
+
return None
|
|
@@ -783,7 +783,7 @@ class EnterpriseSearchPolicy(LLMHealthCheckMixin, EmbeddingsHealthCheckMixin, Po
|
|
|
783
783
|
if not os.path.exists(docs_folder) or not os.path.isdir(docs_folder):
|
|
784
784
|
error_message = (
|
|
785
785
|
f"Document source directory does not exist or is not a "
|
|
786
|
-
f"directory: '{docs_folder}'. "
|
|
786
|
+
f"directory: '{os.path.abspath(docs_folder)}'. "
|
|
787
787
|
"Please specify a valid path to the documents source directory in the "
|
|
788
788
|
"vector_store configuration."
|
|
789
789
|
)
|
|
@@ -1132,8 +1132,7 @@ class EnterpriseSearchPolicy(LLMHealthCheckMixin, EmbeddingsHealthCheckMixin, Po
|
|
|
1132
1132
|
embeddings_config: Dict[Text, Any],
|
|
1133
1133
|
log_source_method: str,
|
|
1134
1134
|
) -> None:
|
|
1135
|
-
"""
|
|
1136
|
-
Perform the health checks using resolved LLM and embeddings configurations.
|
|
1135
|
+
"""Perform the health checks using resolved LLM and embeddings configurations.
|
|
1137
1136
|
Resolved means the configuration is either:
|
|
1138
1137
|
- A reference to a model group that has already been expanded into
|
|
1139
1138
|
its corresponding configuration using the information from
|
|
@@ -1162,8 +1161,7 @@ class EnterpriseSearchPolicy(LLMHealthCheckMixin, EmbeddingsHealthCheckMixin, Po
|
|
|
1162
1161
|
|
|
1163
1162
|
@classmethod
|
|
1164
1163
|
def get_system_default_prompt_based_on_config(cls, config: Dict[str, Any]) -> str:
|
|
1165
|
-
"""
|
|
1166
|
-
Resolves the default prompt template for Enterprise Search Policy based on
|
|
1164
|
+
"""Resolves the default prompt template for Enterprise Search Policy based on
|
|
1167
1165
|
the component's configuration.
|
|
1168
1166
|
|
|
1169
1167
|
- The old prompt is selected when both citation and relevancy check are either
|
|
@@ -1194,8 +1192,7 @@ class EnterpriseSearchPolicy(LLMHealthCheckMixin, EmbeddingsHealthCheckMixin, Po
|
|
|
1194
1192
|
relevancy_check_enabled: bool,
|
|
1195
1193
|
citation_enabled: bool,
|
|
1196
1194
|
) -> str:
|
|
1197
|
-
"""
|
|
1198
|
-
Returns the appropriate default prompt template based on the feature flags.
|
|
1195
|
+
"""Returns the appropriate default prompt template based on the feature flags.
|
|
1199
1196
|
|
|
1200
1197
|
The selection follows this priority:
|
|
1201
1198
|
1. If relevancy check is enabled, return the prompt that includes both relevancy
|
|
@@ -13,7 +13,7 @@ from rasa.agents.constants import (
|
|
|
13
13
|
A2A_AGENT_CONTEXT_ID_KEY,
|
|
14
14
|
AGENT_METADATA_AGENT_RESPONSE_KEY,
|
|
15
15
|
AGENT_METADATA_EXIT_IF_KEY,
|
|
16
|
-
|
|
16
|
+
AGENT_METADATA_STRUCTURED_RESULTS_KEY,
|
|
17
17
|
MAX_AGENT_RETRY_DELAY_SECONDS,
|
|
18
18
|
)
|
|
19
19
|
from rasa.agents.core.types import AgentStatus, ProtocolType
|
|
@@ -65,7 +65,10 @@ from rasa.dialogue_understanding.stack.frames.flow_stack_frame import (
|
|
|
65
65
|
AgentState,
|
|
66
66
|
FlowStackFrameType,
|
|
67
67
|
)
|
|
68
|
-
from rasa.dialogue_understanding.stack.utils import
|
|
68
|
+
from rasa.dialogue_understanding.stack.utils import (
|
|
69
|
+
user_frames_on_the_stack,
|
|
70
|
+
)
|
|
71
|
+
from rasa.dialogue_understanding.utils import assemble_options_string
|
|
69
72
|
from rasa.shared.agents.utils import get_protocol_type
|
|
70
73
|
from rasa.shared.constants import RASA_PATTERN_HUMAN_HANDOFF
|
|
71
74
|
from rasa.shared.core.constants import (
|
|
@@ -173,8 +176,8 @@ def select_next_step_id(
|
|
|
173
176
|
# if the current step is a call step to an agent, and we already have an
|
|
174
177
|
# AgentStackFrame on top of the stack, we need to return the current
|
|
175
178
|
# step id again in order to loop back to the agent.
|
|
176
|
-
|
|
177
|
-
if
|
|
179
|
+
top_stack_frame = tracker.stack.top()
|
|
180
|
+
if top_stack_frame and isinstance(top_stack_frame, AgentStackFrame):
|
|
178
181
|
return current.id
|
|
179
182
|
|
|
180
183
|
next_step = current.next
|
|
@@ -263,38 +266,58 @@ def trigger_pattern_continue_interrupted(
|
|
|
263
266
|
stack: DialogueStack,
|
|
264
267
|
flows: FlowsList,
|
|
265
268
|
tracker: DialogueStateTracker,
|
|
266
|
-
) ->
|
|
269
|
+
) -> None:
|
|
267
270
|
"""Trigger the pattern to continue an interrupted flow if needed."""
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
# get previously started user flow that will be continued
|
|
271
|
-
interrupted_user_flow_frame = top_user_flow_frame(stack)
|
|
272
|
-
interrupted_user_flow_step = (
|
|
273
|
-
interrupted_user_flow_frame.step(flows) if interrupted_user_flow_frame else None
|
|
274
|
-
)
|
|
275
|
-
interrupted_user_flow = (
|
|
276
|
-
interrupted_user_flow_frame.flow(flows) if interrupted_user_flow_frame else None
|
|
277
|
-
)
|
|
278
|
-
|
|
271
|
+
# only trigger the pattern if the current frame is a user flow frame
|
|
272
|
+
# with a frame type of interrupt
|
|
279
273
|
if (
|
|
280
|
-
isinstance(current_frame, UserFlowStackFrame)
|
|
281
|
-
|
|
282
|
-
and interrupted_user_flow is not None
|
|
283
|
-
and current_frame.frame_type == FlowStackFrameType.INTERRUPT
|
|
284
|
-
and not is_step_end_of_flow(interrupted_user_flow_step)
|
|
274
|
+
not isinstance(current_frame, UserFlowStackFrame)
|
|
275
|
+
or current_frame.frame_type != FlowStackFrameType.INTERRUPT
|
|
285
276
|
):
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
277
|
+
return None
|
|
278
|
+
|
|
279
|
+
# get all previously interrupted user flows
|
|
280
|
+
interrupted_user_flow_stack_frames = user_frames_on_the_stack(stack)
|
|
281
|
+
|
|
282
|
+
interrupted_user_flows_to_continue: List[UserFlowStackFrame] = []
|
|
283
|
+
# check if interrupted user flows can be continued
|
|
284
|
+
# i.e. the flow is not at the end of the flow
|
|
285
|
+
for frame in interrupted_user_flow_stack_frames:
|
|
286
|
+
interrupted_user_flow_step = frame.step(flows)
|
|
287
|
+
interrupted_user_flow = frame.flow(flows)
|
|
288
|
+
if (
|
|
289
|
+
interrupted_user_flow_step is not None
|
|
290
|
+
and interrupted_user_flow is not None
|
|
291
|
+
and not is_step_end_of_flow(interrupted_user_flow_step)
|
|
292
|
+
):
|
|
293
|
+
interrupted_user_flows_to_continue.append(frame)
|
|
294
|
+
|
|
295
|
+
# if there are no interrupted user flows to continue,
|
|
296
|
+
# we don't need to trigger the pattern
|
|
297
|
+
if len(interrupted_user_flows_to_continue) == 0:
|
|
298
|
+
return None
|
|
299
|
+
|
|
300
|
+
# get the flow names and ids of the interrupted flows
|
|
301
|
+
# and assemble the options string
|
|
302
|
+
flow_names: List[str] = []
|
|
303
|
+
flow_ids: List[str] = []
|
|
304
|
+
for frame in interrupted_user_flows_to_continue:
|
|
305
|
+
flow_names.append(
|
|
306
|
+
frame.flow(flows).readable_name(language=tracker.current_language)
|
|
292
307
|
)
|
|
293
|
-
|
|
294
|
-
|
|
308
|
+
flow_ids.append(frame.flow_id)
|
|
309
|
+
options_string = assemble_options_string(flow_names)
|
|
310
|
+
|
|
311
|
+
# trigger the pattern to continue the interrupted flows
|
|
312
|
+
stack.push(
|
|
313
|
+
ContinueInterruptedPatternFlowStackFrame(
|
|
314
|
+
interrupted_flow_names=flow_names,
|
|
315
|
+
interrupted_flow_ids=flow_ids,
|
|
316
|
+
interrupted_flow_options=options_string,
|
|
295
317
|
)
|
|
318
|
+
)
|
|
296
319
|
|
|
297
|
-
return
|
|
320
|
+
return None
|
|
298
321
|
|
|
299
322
|
|
|
300
323
|
def trigger_pattern_completed(
|
|
@@ -707,12 +730,10 @@ def _run_end_step(
|
|
|
707
730
|
structlogger.debug("flow.step.run.flow_end")
|
|
708
731
|
current_frame = stack.pop()
|
|
709
732
|
trigger_pattern_completed(current_frame, stack, flows)
|
|
710
|
-
|
|
711
|
-
current_frame, stack, flows, tracker
|
|
712
|
-
)
|
|
733
|
+
trigger_pattern_continue_interrupted(current_frame, stack, flows, tracker)
|
|
713
734
|
reset_events: List[Event] = reset_scoped_slots(current_frame, flow, tracker)
|
|
714
735
|
return ContinueFlowWithNextStep(
|
|
715
|
-
events=initial_events + reset_events
|
|
736
|
+
events=initial_events + reset_events, has_flow_ended=True
|
|
716
737
|
)
|
|
717
738
|
|
|
718
739
|
|
|
@@ -789,7 +810,14 @@ def _run_action_step(
|
|
|
789
810
|
# do not log about non-existing validation actions of collect steps
|
|
790
811
|
utter_action_name = render_template_variables("{{context.utter}}", context)
|
|
791
812
|
if utter_action_name not in available_actions:
|
|
792
|
-
structlogger.warning(
|
|
813
|
+
structlogger.warning(
|
|
814
|
+
"flow.step.run.action.unknown",
|
|
815
|
+
action=action_name,
|
|
816
|
+
event_info=(
|
|
817
|
+
f"The action '{action_name}' is not defined in the domain but "
|
|
818
|
+
f"getting triggered by the flow '{step.flow_id}'."
|
|
819
|
+
),
|
|
820
|
+
)
|
|
793
821
|
return ContinueFlowWithNextStep(events=initial_events)
|
|
794
822
|
|
|
795
823
|
|
|
@@ -999,7 +1027,9 @@ async def run_agent(
|
|
|
999
1027
|
output.metadata[AGENT_METADATA_AGENT_RESPONSE_KEY] = (
|
|
1000
1028
|
output.response_message or ""
|
|
1001
1029
|
)
|
|
1002
|
-
output.metadata[
|
|
1030
|
+
output.metadata[AGENT_METADATA_STRUCTURED_RESULTS_KEY] = (
|
|
1031
|
+
output.structured_results or []
|
|
1032
|
+
)
|
|
1003
1033
|
_update_agent_events(final_events, output.metadata)
|
|
1004
1034
|
|
|
1005
1035
|
top_stack_frame = stack.top()
|
rasa/core/policies/ted_policy.py
CHANGED
|
@@ -943,14 +943,16 @@ class TEDPolicy(Policy):
|
|
|
943
943
|
|
|
944
944
|
with self._model_storage.write_to(self._resource) as model_path:
|
|
945
945
|
model_filename = self._metadata_filename()
|
|
946
|
-
tf_model_file = model_path / f"{model_filename}.
|
|
946
|
+
tf_model_file = model_path / f"{model_filename}.weights.h5"
|
|
947
947
|
|
|
948
948
|
rasa.shared.utils.io.create_directory_for_file(tf_model_file)
|
|
949
949
|
|
|
950
950
|
self.featurizer.persist(model_path)
|
|
951
951
|
|
|
952
952
|
if self.config[CHECKPOINT_MODEL] and self.tmp_checkpoint_dir:
|
|
953
|
-
self.model.load_weights(
|
|
953
|
+
self.model.load_weights(
|
|
954
|
+
self.tmp_checkpoint_dir / "checkpoint.weights.h5"
|
|
955
|
+
)
|
|
954
956
|
# Save an empty file to flag that this model has been
|
|
955
957
|
# produced using checkpointing
|
|
956
958
|
checkpoint_marker = model_path / f"{model_filename}.from_checkpoint.pkl"
|
|
@@ -1009,7 +1011,7 @@ class TEDPolicy(Policy):
|
|
|
1009
1011
|
Args:
|
|
1010
1012
|
model_path: Path where model is to be persisted.
|
|
1011
1013
|
"""
|
|
1012
|
-
tf_model_file = model_path / f"{cls._metadata_filename()}.
|
|
1014
|
+
tf_model_file = model_path / f"{cls._metadata_filename()}.weights.h5"
|
|
1013
1015
|
|
|
1014
1016
|
# load data example
|
|
1015
1017
|
loaded_data = deserialize_nested_feature_arrays(
|
|
@@ -1463,7 +1465,7 @@ class TED(TransformerRasaModel):
|
|
|
1463
1465
|
|
|
1464
1466
|
dialogue_transformed, attention_weights = self._tf_layers[
|
|
1465
1467
|
f"transformer.{DIALOGUE}"
|
|
1466
|
-
](dialogue_in, 1 - mask, self._training)
|
|
1468
|
+
](dialogue_in, 1 - mask, training=self._training)
|
|
1467
1469
|
dialogue_transformed = tf.nn.gelu(dialogue_transformed)
|
|
1468
1470
|
|
|
1469
1471
|
if self.max_history_featurizer_is_used:
|
|
@@ -1708,7 +1710,7 @@ class TED(TransformerRasaModel):
|
|
|
1708
1710
|
|
|
1709
1711
|
if attribute in SENTENCE_FEATURES_TO_ENCODE + LABEL_FEATURES_TO_ENCODE:
|
|
1710
1712
|
attribute_features = self._tf_layers[f"encoding_layer.{attribute}"](
|
|
1711
|
-
attribute_features, self._training
|
|
1713
|
+
attribute_features, training=self._training
|
|
1712
1714
|
)
|
|
1713
1715
|
|
|
1714
1716
|
# attribute features have shape
|
rasa/core/processor.py
CHANGED
|
@@ -73,6 +73,7 @@ from rasa.shared.core.constants import (
|
|
|
73
73
|
ACTION_CORRECT_FLOW_SLOT,
|
|
74
74
|
ACTION_EXTRACT_SLOTS,
|
|
75
75
|
ACTION_LISTEN_NAME,
|
|
76
|
+
ACTION_METADATA_EXECUTION_TIME,
|
|
76
77
|
ACTION_SESSION_START_NAME,
|
|
77
78
|
FOLLOWUP_ACTION,
|
|
78
79
|
SESSION_START_METADATA_SLOT,
|
|
@@ -208,6 +209,7 @@ class MessageProcessor:
|
|
|
208
209
|
) -> Optional[List[Dict[Text, Any]]]:
|
|
209
210
|
"""Handle a single message with this processor."""
|
|
210
211
|
# preprocess message if necessary
|
|
212
|
+
self.time_turn_start = time.time()
|
|
211
213
|
tracker = await self.log_message(message, should_save_tracker=False)
|
|
212
214
|
|
|
213
215
|
if self.model_metadata.training_type == TrainingType.NLU:
|
|
@@ -1155,6 +1157,7 @@ class MessageProcessor:
|
|
|
1155
1157
|
should_predict_another_action = True
|
|
1156
1158
|
|
|
1157
1159
|
tracker = await self.run_command_processor(tracker)
|
|
1160
|
+
self.time_command_processor = time.time()
|
|
1158
1161
|
|
|
1159
1162
|
# action loop. predicts actions until we hit action listen
|
|
1160
1163
|
while should_predict_another_action and self._should_handle_message(tracker):
|
|
@@ -1408,6 +1411,34 @@ class MessageProcessor:
|
|
|
1408
1411
|
plugin_manager().hook.after_action_executed(tracker=tracker)
|
|
1409
1412
|
return self.should_predict_another_action(action.name())
|
|
1410
1413
|
|
|
1414
|
+
def _add_metadata_if_action_listen(
|
|
1415
|
+
self, action: Action, prediction: PolicyPrediction
|
|
1416
|
+
) -> None:
|
|
1417
|
+
"""Adds execution times to the ActionExecuted event metadata."""
|
|
1418
|
+
if not hasattr(self, "time_turn_start"):
|
|
1419
|
+
return
|
|
1420
|
+
|
|
1421
|
+
if not hasattr(self, "time_command_processor"):
|
|
1422
|
+
return
|
|
1423
|
+
|
|
1424
|
+
if not action.name() == ACTION_LISTEN_NAME:
|
|
1425
|
+
return
|
|
1426
|
+
|
|
1427
|
+
if prediction.action_metadata is None:
|
|
1428
|
+
prediction.action_metadata = {}
|
|
1429
|
+
|
|
1430
|
+
# calculate execution times
|
|
1431
|
+
execution_time_prediction_loop = (
|
|
1432
|
+
time.time() - self.time_command_processor
|
|
1433
|
+
) * 1000
|
|
1434
|
+
execution_time_command_processor = (
|
|
1435
|
+
self.time_command_processor - self.time_turn_start
|
|
1436
|
+
) * 1000
|
|
1437
|
+
prediction.action_metadata[ACTION_METADATA_EXECUTION_TIME] = {
|
|
1438
|
+
"command_processor": execution_time_command_processor,
|
|
1439
|
+
"prediction_loop": execution_time_prediction_loop,
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1411
1442
|
def _log_action_and_events_on_tracker(
|
|
1412
1443
|
self,
|
|
1413
1444
|
tracker: DialogueStateTracker,
|
|
@@ -1453,6 +1484,7 @@ class MessageProcessor:
|
|
|
1453
1484
|
tracker.update_with_events(prediction.events)
|
|
1454
1485
|
|
|
1455
1486
|
# log the action and its produced events
|
|
1487
|
+
self._add_metadata_if_action_listen(action, prediction)
|
|
1456
1488
|
tracker.update(
|
|
1457
1489
|
action.event_for_successful_execution(
|
|
1458
1490
|
prediction, was_successful, error_message
|