rasa-pro 3.14.0.dev10__py3-none-any.whl → 3.14.0.dev12__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of rasa-pro might be problematic. Click here for more details.
- rasa/__main__.py +15 -3
- rasa/agents/agent_factory.py +1 -1
- rasa/agents/agent_manager.py +52 -3
- rasa/agents/constants.py +3 -0
- rasa/agents/core/types.py +11 -0
- rasa/agents/protocol/__init__.py +11 -3
- rasa/agents/protocol/a2a/a2a_agent.py +45 -5
- rasa/agents/protocol/mcp/mcp_base_agent.py +14 -5
- rasa/agents/protocol/mcp/mcp_open_agent.py +27 -13
- rasa/agents/protocol/mcp/mcp_task_agent.py +42 -31
- rasa/agents/schemas/agent_tool_result.py +0 -2
- rasa/agents/schemas/agent_tool_schema.py +55 -3
- rasa/agents/templates/mcp_open_agent_prompt_template.jinja2 +6 -6
- rasa/agents/templates/mcp_task_agent_prompt_template.jinja2 +5 -5
- rasa/agents/utils.py +42 -3
- rasa/builder/copilot/telemetry.py +35 -19
- rasa/builder/main.py +5 -14
- rasa/builder/project_generator.py +1 -1
- rasa/builder/service.py +5 -0
- rasa/builder/template_cache.py +9 -184
- rasa/cli/project_templates/basic/data/data.md +5 -6
- rasa/cli/project_templates/basic/domain/domain.md +5 -2
- rasa/cli/project_templates/finance/README.md +8 -7
- rasa/cli/project_templates/finance/actions/__init__.py +0 -46
- rasa/cli/project_templates/finance/actions/accounts/check_balance.py +18 -0
- rasa/cli/project_templates/finance/actions/{transfers/action_process_immediate_payment.py → cards/check_that_card_exists.py} +6 -3
- rasa/cli/project_templates/finance/actions/cards/list_cards.py +22 -0
- rasa/cli/project_templates/finance/actions/contacts/__init__.py +0 -0
- rasa/cli/project_templates/finance/actions/contacts/add_contact.py +30 -0
- rasa/cli/project_templates/finance/actions/contacts/list_contacts.py +22 -0
- rasa/cli/project_templates/finance/actions/contacts/remove_contact.py +35 -0
- rasa/cli/project_templates/finance/actions/db.py +117 -0
- rasa/cli/project_templates/finance/actions/transfers/check_transfer_funds.py +27 -0
- rasa/cli/project_templates/finance/actions/transfers/check_transfer_limit.py +36 -0
- rasa/cli/project_templates/finance/actions/transfers/execute_recurrent_payment.py +20 -0
- rasa/cli/project_templates/finance/actions/transfers/execute_transfer.py +45 -0
- rasa/cli/project_templates/finance/actions/transfers/list_transactions.py +32 -0
- rasa/cli/project_templates/finance/config.yml +6 -0
- rasa/cli/project_templates/finance/credentials.yml +7 -6
- rasa/cli/project_templates/finance/data/accounts/check_balance.yml +3 -4
- rasa/cli/project_templates/finance/data/accounts/download_statements.yml +26 -0
- rasa/cli/project_templates/finance/data/bills/bill_pay_reminder.yml +25 -0
- rasa/cli/project_templates/finance/data/cards/activate_card.yml +35 -0
- rasa/cli/project_templates/finance/data/cards/block_card.yml +37 -58
- rasa/cli/project_templates/finance/data/cards/list_cards.yml +14 -0
- rasa/cli/project_templates/finance/data/cards/replace_card.yml +16 -0
- rasa/cli/project_templates/finance/data/cards/replace_eligible_card.yml +29 -0
- rasa/cli/project_templates/finance/data/contacts/add_contact.yml +33 -0
- rasa/cli/project_templates/finance/data/contacts/list_contacts.yml +14 -0
- rasa/cli/project_templates/finance/data/contacts/remove_contact.yml +31 -0
- rasa/cli/project_templates/finance/data/data.md +6 -3
- rasa/cli/project_templates/finance/data/general/agent_details.yml +6 -0
- rasa/cli/project_templates/finance/data/general/hello.yml +1 -2
- rasa/cli/project_templates/finance/data/general/human_handoff.yml +1 -1
- rasa/cli/project_templates/finance/data/transfers/check_transfer_limit.yml +18 -0
- rasa/cli/project_templates/finance/data/transfers/list_transactions.yml +46 -0
- rasa/cli/project_templates/finance/data/transfers/move_money_between_accounts.yml +51 -0
- rasa/cli/project_templates/finance/data/transfers/transfer_money.yml +29 -62
- rasa/cli/project_templates/finance/data/transfers/transfer_money_to_a_third_party.yml +175 -0
- rasa/cli/project_templates/finance/db/cards.json +18 -0
- rasa/cli/project_templates/finance/db/contacts.json +10 -0
- rasa/cli/project_templates/finance/db/my_account.json +6 -0
- rasa/cli/project_templates/finance/db/transactions.json +22 -0
- rasa/cli/project_templates/finance/docs/docs.md +8 -0
- rasa/cli/project_templates/finance/docs/fenlo_banking_faq/account_features/budgeting_analytics.txt +22 -0
- rasa/cli/project_templates/finance/docs/fenlo_banking_faq/account_features/multi_currency_accounts.txt +19 -0
- rasa/cli/project_templates/finance/docs/fenlo_banking_faq/account_features/premium_benefits.txt +19 -0
- rasa/cli/project_templates/finance/docs/fenlo_banking_faq/card_management/contactless_limits.txt +16 -0
- rasa/cli/project_templates/finance/docs/fenlo_banking_faq/card_management/freeze_unfreeze_card.txt +16 -0
- rasa/cli/project_templates/finance/docs/fenlo_banking_faq/card_management/lost_stolen_card.txt +19 -0
- rasa/cli/project_templates/finance/docs/fenlo_banking_faq/money_transfers/instant_payments.txt +19 -0
- rasa/cli/project_templates/finance/docs/fenlo_banking_faq/money_transfers/international_transfers.txt +19 -0
- rasa/cli/project_templates/finance/docs/fenlo_banking_faq/security_fraud/fraud_protection.txt +22 -0
- rasa/cli/project_templates/finance/docs/fenlo_banking_faq/security_fraud/secure_payments.txt +22 -0
- rasa/cli/project_templates/finance/domain/_system/patterns/pattern_session_start.yml +11 -0
- rasa/cli/project_templates/finance/domain/accounts/check_balance.yml +9 -5
- rasa/cli/project_templates/finance/domain/accounts/download_statements.yml +40 -0
- rasa/cli/project_templates/finance/domain/bills/bill_pay_reminder.yml +49 -0
- rasa/cli/project_templates/finance/domain/cards/activate_card.yml +24 -0
- rasa/cli/project_templates/finance/domain/cards/block_card.yml +33 -90
- rasa/cli/project_templates/finance/domain/cards/list_cards.yml +16 -0
- rasa/cli/project_templates/finance/domain/cards/replace_card.yml +43 -0
- rasa/cli/project_templates/finance/domain/cards/shared.yml +15 -0
- rasa/cli/project_templates/finance/domain/contacts/add_contact.yml +37 -0
- rasa/cli/project_templates/finance/domain/contacts/list_contacts.yml +16 -0
- rasa/cli/project_templates/finance/domain/contacts/remove_contact.yml +32 -0
- rasa/cli/project_templates/finance/domain/domain.md +9 -1
- rasa/cli/project_templates/finance/domain/general/_shared.yml +53 -0
- rasa/cli/project_templates/finance/domain/general/agent_details.yml +19 -0
- rasa/cli/project_templates/finance/domain/general/cannot_handle.yml +5 -2
- rasa/cli/project_templates/finance/domain/general/feedback.yml +0 -3
- rasa/cli/project_templates/finance/domain/general/human_handoff.yml +7 -3
- rasa/cli/project_templates/finance/domain/general/welcome.yml +5 -2
- rasa/cli/project_templates/finance/domain/transfers/check_transfer_limit.yml +32 -0
- rasa/cli/project_templates/finance/domain/transfers/list_transactions.yml +44 -0
- rasa/cli/project_templates/finance/domain/transfers/shared.yml +17 -0
- rasa/cli/project_templates/finance/domain/transfers/transfer_money.yml +203 -61
- rasa/cli/project_templates/finance/endpoints.yml +3 -2
- rasa/cli/project_templates/finance/prompts/rephraser_demo_personality_prompt.jinja2 +31 -12
- rasa/cli/project_templates/telco/data/data.md +1 -1
- rasa/cli/project_templates/telco/docs/docs.md +3 -0
- rasa/cli/project_templates/telco/domain/domain.md +1 -2
- rasa/constants.py +1 -1
- rasa/core/actions/direct_custom_actions_executor.py +9 -2
- rasa/core/actions/grpc_custom_action_executor.py +9 -4
- rasa/core/agent.py +2 -3
- rasa/core/available_agents.py +1 -1
- rasa/core/brokers/broker.py +1 -1
- rasa/core/brokers/kafka.py +52 -8
- rasa/core/channels/__init__.py +82 -35
- rasa/core/channels/inspector/README.md +1 -1
- rasa/core/channels/telegram.py +4 -9
- rasa/core/channels/voice_stream/twilio_media_streams.py +5 -1
- rasa/core/concurrent_lock_store.py +66 -16
- rasa/core/iam_credentials_providers/aws_iam_credentials_providers.py +76 -1
- rasa/core/iam_credentials_providers/credentials_provider_protocol.py +1 -1
- rasa/core/lock_store.py +41 -7
- rasa/core/policies/flows/agent_executor.py +632 -0
- rasa/core/policies/flows/flow_executor.py +3 -417
- rasa/core/policies/flows/mcp_tool_executor.py +32 -12
- rasa/core/processor.py +49 -28
- rasa/core/run.py +22 -0
- rasa/dialogue_understanding/commands/cancel_flow_command.py +1 -1
- rasa/dialogue_understanding/commands/chit_chat_answer_command.py +11 -3
- rasa/dialogue_understanding/commands/clarify_command.py +11 -3
- rasa/dialogue_understanding/commands/knowledge_answer_command.py +11 -3
- rasa/dialogue_understanding/generator/prompt_templates/agent_command_prompt_v2_claude_3_5_sonnet_20240620_template.jinja2 +3 -3
- rasa/dialogue_understanding/generator/prompt_templates/agent_command_prompt_v2_gpt_4o_2024_11_20_template.jinja2 +3 -3
- rasa/dialogue_understanding/generator/prompt_templates/agent_command_prompt_v3_claude_3_5_sonnet_20240620_template.jinja2 +3 -3
- rasa/dialogue_understanding/generator/prompt_templates/agent_command_prompt_v3_gpt_4o_2024_11_20_template.jinja2 +3 -3
- rasa/dialogue_understanding/generator/single_step/single_step_based_llm_command_generator.py +2 -0
- rasa/dialogue_understanding/processor/command_processor.py +70 -0
- rasa/dialogue_understanding/stack/dialogue_stack.py +0 -25
- rasa/engine/loader.py +12 -0
- rasa/engine/recipes/default_components.py +111 -82
- rasa/engine/recipes/default_recipe.py +79 -22
- rasa/engine/runner/dask.py +8 -5
- rasa/graph_components/validators/default_recipe_validator.py +59 -19
- rasa/model_manager/warm_rasa_process.py +13 -3
- rasa/model_training.py +0 -14
- rasa/nlu/classifiers/logistic_regression_classifier.py +1 -22
- rasa/nlu/classifiers/mitie_intent_classifier.py +3 -0
- rasa/nlu/classifiers/sklearn_intent_classifier.py +1 -3
- rasa/nlu/extractors/crf_entity_extractor.py +9 -10
- rasa/nlu/extractors/mitie_entity_extractor.py +3 -0
- rasa/nlu/extractors/spacy_entity_extractor.py +3 -0
- rasa/nlu/featurizers/dense_featurizer/mitie_featurizer.py +2 -0
- rasa/nlu/featurizers/dense_featurizer/spacy_featurizer.py +3 -0
- rasa/nlu/featurizers/sparse_featurizer/count_vectors_featurizer.py +4 -2
- rasa/nlu/featurizers/sparse_featurizer/lexical_syntactic_featurizer.py +4 -0
- rasa/nlu/tokenizers/jieba_tokenizer.py +3 -4
- rasa/nlu/tokenizers/mitie_tokenizer.py +3 -2
- rasa/nlu/tokenizers/spacy_tokenizer.py +3 -2
- rasa/nlu/utils/mitie_utils.py +3 -0
- rasa/nlu/utils/spacy_utils.py +3 -2
- rasa/telemetry.py +63 -0
- rasa/tracing/instrumentation/attribute_extractors.py +6 -1
- rasa/utils/log_utils.py +95 -4
- rasa/utils/tensorflow/__init__.py +0 -22
- rasa/utils/tensorflow/callback.py +17 -7
- rasa/utils/tensorflow/layers.py +10 -7
- rasa/utils/tensorflow/rasa_layers.py +1 -1
- rasa/version.py +1 -1
- {rasa_pro-3.14.0.dev10.dist-info → rasa_pro-3.14.0.dev12.dist-info}/METADATA +96 -89
- {rasa_pro-3.14.0.dev10.dist-info → rasa_pro-3.14.0.dev12.dist-info}/RECORD +168 -239
- 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/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_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/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/cards/select_card.yml +0 -12
- rasa/cli/project_templates/finance/data/general/bot_identity.yml +0 -6
- rasa/cli/project_templates/finance/data/system/patterns/pattern_chitchat.yml +0 -5
- 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/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/cards/select_card.yml +0 -12
- rasa/cli/project_templates/finance/domain/general/bot_identity.yml +0 -5
- rasa/cli/project_templates/finance/domain/general/defaults.yml +0 -24
- 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/utils.yml +0 -13
- 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_pro-3.14.0.dev10.dist-info → rasa_pro-3.14.0.dev12.dist-info}/NOTICE +0 -0
- {rasa_pro-3.14.0.dev10.dist-info → rasa_pro-3.14.0.dev12.dist-info}/WHEEL +0 -0
- {rasa_pro-3.14.0.dev10.dist-info → rasa_pro-3.14.0.dev12.dist-info}/entry_points.txt +0 -0
rasa/core/processor.py
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import copy
|
|
2
2
|
import inspect
|
|
3
|
-
import logging
|
|
4
3
|
import os
|
|
5
4
|
import re
|
|
6
5
|
import tarfile
|
|
@@ -117,7 +116,6 @@ if TYPE_CHECKING:
|
|
|
117
116
|
from rasa.core.available_endpoints import AvailableEndpoints
|
|
118
117
|
from rasa.privacy.privacy_manager import BackgroundPrivacyManager
|
|
119
118
|
|
|
120
|
-
logger = logging.getLogger(__name__)
|
|
121
119
|
structlogger = structlog.get_logger()
|
|
122
120
|
|
|
123
121
|
MAX_NUMBER_OF_PREDICTIONS = int(os.environ.get("MAX_NUMBER_OF_PREDICTIONS", "10"))
|
|
@@ -191,7 +189,11 @@ class MessageProcessor:
|
|
|
191
189
|
except TypeError:
|
|
192
190
|
raise ModelNotFound(f"Model {model_path} can not be loaded.")
|
|
193
191
|
|
|
194
|
-
|
|
192
|
+
structlogger.info(
|
|
193
|
+
"rasa.core.processor.load_model",
|
|
194
|
+
event_info="Loading model.",
|
|
195
|
+
model_path=model_tar,
|
|
196
|
+
)
|
|
195
197
|
with TempDirectoryPath(get_temp_dir_name()) as temporary_directory:
|
|
196
198
|
try:
|
|
197
199
|
metadata, runner = loader.load_predict_graph_runner(
|
|
@@ -366,8 +368,10 @@ class MessageProcessor:
|
|
|
366
368
|
`ActionSessionStart`.
|
|
367
369
|
"""
|
|
368
370
|
if not tracker.applied_events() or self._has_session_expired(tracker):
|
|
369
|
-
|
|
370
|
-
|
|
371
|
+
structlogger.debug(
|
|
372
|
+
"rasa.core.processor._update_tracker_session",
|
|
373
|
+
event_info="Starting a new session.",
|
|
374
|
+
sender_id=tracker.sender_id,
|
|
371
375
|
)
|
|
372
376
|
|
|
373
377
|
action_session_start = self._get_action(ACTION_SESSION_START_NAME)
|
|
@@ -599,9 +603,11 @@ class MessageProcessor:
|
|
|
599
603
|
prediction.max_confidence_index, self.domain, self.action_endpoint
|
|
600
604
|
)
|
|
601
605
|
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
606
|
+
structlogger.debug(
|
|
607
|
+
"rasa.core.processor.predict_next_with_tracker_if_should",
|
|
608
|
+
event_info="Predicted next action.",
|
|
609
|
+
action=action.name(),
|
|
610
|
+
confidence=prediction.max_confidence,
|
|
605
611
|
)
|
|
606
612
|
|
|
607
613
|
return action, prediction
|
|
@@ -651,8 +657,10 @@ class MessageProcessor:
|
|
|
651
657
|
and self._has_message_after_reminder(tracker, reminder_event)
|
|
652
658
|
or not self._is_reminder_still_valid(tracker, reminder_event)
|
|
653
659
|
):
|
|
654
|
-
|
|
655
|
-
|
|
660
|
+
structlogger.debug(
|
|
661
|
+
"rasa.core.processor.handle_reminder",
|
|
662
|
+
event_info="Canceled reminder because it is outdated.",
|
|
663
|
+
reminder_event=reminder_event,
|
|
656
664
|
)
|
|
657
665
|
else:
|
|
658
666
|
intent = reminder_event.intent
|
|
@@ -1051,8 +1059,11 @@ class MessageProcessor:
|
|
|
1051
1059
|
|
|
1052
1060
|
plugin_manager().hook.after_new_user_message(tracker=tracker)
|
|
1053
1061
|
|
|
1054
|
-
|
|
1055
|
-
|
|
1062
|
+
structlogger.debug(
|
|
1063
|
+
"rasa.core.processor.handle_message_with_tracker",
|
|
1064
|
+
event_info="Logged UserUtterance.",
|
|
1065
|
+
user_message=message.text,
|
|
1066
|
+
number_of_events=len(tracker.events),
|
|
1056
1067
|
)
|
|
1057
1068
|
|
|
1058
1069
|
@staticmethod
|
|
@@ -1167,9 +1178,11 @@ class MessageProcessor:
|
|
|
1167
1178
|
tracker
|
|
1168
1179
|
)
|
|
1169
1180
|
except ActionLimitReached:
|
|
1170
|
-
|
|
1171
|
-
"
|
|
1172
|
-
|
|
1181
|
+
structlogger.warning(
|
|
1182
|
+
"rasa.core.processor.run_prediction_loop",
|
|
1183
|
+
event_info="Circuit breaker tripped. Stopped predicting more "
|
|
1184
|
+
"actions.",
|
|
1185
|
+
sender_id=tracker.sender_id,
|
|
1173
1186
|
)
|
|
1174
1187
|
if self.on_circuit_break:
|
|
1175
1188
|
# call a registered callback
|
|
@@ -1177,9 +1190,11 @@ class MessageProcessor:
|
|
|
1177
1190
|
break
|
|
1178
1191
|
|
|
1179
1192
|
if prediction.is_end_to_end_prediction:
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1193
|
+
structlogger.debug(
|
|
1194
|
+
"rasa.core.processor.run_prediction_loop",
|
|
1195
|
+
event_info="An end-to-end prediction was made which has "
|
|
1196
|
+
"triggered the 2nd execution of the default action.",
|
|
1197
|
+
action=ACTION_EXTRACT_SLOTS,
|
|
1183
1198
|
)
|
|
1184
1199
|
tracker = await self.run_action_extract_slots(output_channel, tracker)
|
|
1185
1200
|
|
|
@@ -1395,10 +1410,11 @@ class MessageProcessor:
|
|
|
1395
1410
|
)
|
|
1396
1411
|
|
|
1397
1412
|
if any(isinstance(e, UserUttered) for e in events):
|
|
1398
|
-
|
|
1399
|
-
|
|
1413
|
+
structlogger.debug(
|
|
1414
|
+
"rasa.core.processor.run_action",
|
|
1415
|
+
message="A `UserUttered` event was returned by executing "
|
|
1400
1416
|
f"action '{action.name()}'. This will run the default action "
|
|
1401
|
-
f"'{ACTION_EXTRACT_SLOTS}'."
|
|
1417
|
+
f"'{ACTION_EXTRACT_SLOTS}'.",
|
|
1402
1418
|
)
|
|
1403
1419
|
tracker = await self.run_action_extract_slots(output_channel, tracker)
|
|
1404
1420
|
|
|
@@ -1517,9 +1533,10 @@ class MessageProcessor:
|
|
|
1517
1533
|
> self.domain.session_config.session_expiration_time
|
|
1518
1534
|
)
|
|
1519
1535
|
if has_expired:
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1536
|
+
structlogger.debug(
|
|
1537
|
+
"rasa.core.processor.has_session_expired",
|
|
1538
|
+
event_info="The latest session has expired.",
|
|
1539
|
+
sender_id=tracker.sender_id,
|
|
1523
1540
|
)
|
|
1524
1541
|
|
|
1525
1542
|
return has_expired
|
|
@@ -1545,10 +1562,14 @@ class MessageProcessor:
|
|
|
1545
1562
|
)
|
|
1546
1563
|
return prediction
|
|
1547
1564
|
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
"
|
|
1551
|
-
|
|
1565
|
+
structlogger.error(
|
|
1566
|
+
"rasa.core.processor.predict_next_with_tracker",
|
|
1567
|
+
event_info="Trying to run unknown follow-up action.",
|
|
1568
|
+
message=(
|
|
1569
|
+
"Trying to run unknown follow-up action. Instead of running "
|
|
1570
|
+
"that, Rasa Pro will ignore the action and predict the next action."
|
|
1571
|
+
),
|
|
1572
|
+
followup_action=followup_action,
|
|
1552
1573
|
)
|
|
1553
1574
|
|
|
1554
1575
|
target = self.model_metadata.core_target
|
rasa/core/run.py
CHANGED
|
@@ -97,10 +97,32 @@ def _create_single_channel(
|
|
|
97
97
|
"""
|
|
98
98
|
from rasa.core.channels import BUILTIN_CHANNELS
|
|
99
99
|
|
|
100
|
+
# Channels that have optional dependencies
|
|
101
|
+
channels_with_optional_deps = {
|
|
102
|
+
"facebook": "fbmessenger",
|
|
103
|
+
"slack": "slack-sdk",
|
|
104
|
+
"telegram": "aiogram",
|
|
105
|
+
"twilio": "twilio",
|
|
106
|
+
"twilio_voice": "twilio",
|
|
107
|
+
"twilio_media_streams": "twilio",
|
|
108
|
+
"webexteams": "webexteamssdk",
|
|
109
|
+
"vier_cvg": "cvg_sdk",
|
|
110
|
+
}
|
|
111
|
+
|
|
100
112
|
if channel in BUILTIN_CHANNELS:
|
|
101
113
|
channel_class = BUILTIN_CHANNELS[channel]
|
|
102
114
|
|
|
103
115
|
return channel_class.from_credentials(credentials)
|
|
116
|
+
elif channel in channels_with_optional_deps:
|
|
117
|
+
# Channel is known but not available due to missing dependency
|
|
118
|
+
dependency = channels_with_optional_deps[channel]
|
|
119
|
+
raise RasaException(
|
|
120
|
+
f"Channel '{channel}' is not available "
|
|
121
|
+
f"due to missing '{dependency}' dependency. "
|
|
122
|
+
f"Please install the required extra by running: "
|
|
123
|
+
f"pip install 'rasa-pro[channels]' OR "
|
|
124
|
+
f"poetry add 'rasa-pro[channels]'"
|
|
125
|
+
)
|
|
104
126
|
else:
|
|
105
127
|
# try to load channel based on class name
|
|
106
128
|
try:
|
|
@@ -6,7 +6,7 @@ from typing import Any, Dict, List
|
|
|
6
6
|
|
|
7
7
|
import structlog
|
|
8
8
|
|
|
9
|
-
from rasa.core.policies.flows.
|
|
9
|
+
from rasa.core.policies.flows.agent_executor import (
|
|
10
10
|
remove_agent_stack_frame,
|
|
11
11
|
)
|
|
12
12
|
from rasa.dialogue_understanding.commands.command import Command
|
|
@@ -16,7 +16,7 @@ from rasa.dialogue_understanding.stack.frames.flow_stack_frame import (
|
|
|
16
16
|
AgentStackFrame,
|
|
17
17
|
AgentState,
|
|
18
18
|
)
|
|
19
|
-
from rasa.shared.core.events import Event
|
|
19
|
+
from rasa.shared.core.events import AgentInterrupted, Event
|
|
20
20
|
from rasa.shared.core.flows import FlowsList
|
|
21
21
|
from rasa.shared.core.trackers import DialogueStateTracker
|
|
22
22
|
|
|
@@ -57,14 +57,22 @@ class ChitChatAnswerCommand(FreeFormAnswerCommand):
|
|
|
57
57
|
"""
|
|
58
58
|
stack = tracker.stack
|
|
59
59
|
|
|
60
|
+
applied_events: List[Event] = []
|
|
61
|
+
|
|
60
62
|
# if the top stack frame is an agent stack frame, we need to
|
|
61
|
-
# update the state to INTERRUPTED
|
|
63
|
+
# update the state to INTERRUPTED and add an AgentInterrupted event
|
|
62
64
|
if top_stack_frame := stack.top():
|
|
63
65
|
if isinstance(top_stack_frame, AgentStackFrame):
|
|
66
|
+
applied_events.append(
|
|
67
|
+
AgentInterrupted(
|
|
68
|
+
top_stack_frame.agent_id,
|
|
69
|
+
top_stack_frame.flow_id,
|
|
70
|
+
)
|
|
71
|
+
)
|
|
64
72
|
top_stack_frame.state = AgentState.INTERRUPTED
|
|
65
73
|
|
|
66
74
|
stack.push(ChitchatPatternFlowStackFrame())
|
|
67
|
-
return tracker.create_stack_updated_events(stack)
|
|
75
|
+
return applied_events + tracker.create_stack_updated_events(stack)
|
|
68
76
|
|
|
69
77
|
def __hash__(self) -> int:
|
|
70
78
|
return hash(self.command())
|
|
@@ -17,7 +17,7 @@ from rasa.dialogue_understanding.stack.frames.flow_stack_frame import (
|
|
|
17
17
|
AgentStackFrame,
|
|
18
18
|
AgentState,
|
|
19
19
|
)
|
|
20
|
-
from rasa.shared.core.events import Event
|
|
20
|
+
from rasa.shared.core.events import AgentInterrupted, Event
|
|
21
21
|
from rasa.shared.core.flows import FlowsList
|
|
22
22
|
from rasa.shared.core.trackers import DialogueStateTracker
|
|
23
23
|
|
|
@@ -89,14 +89,22 @@ class ClarifyCommand(Command):
|
|
|
89
89
|
if flow is not None
|
|
90
90
|
]
|
|
91
91
|
|
|
92
|
+
applied_events: List[Event] = []
|
|
93
|
+
|
|
92
94
|
# if the top stack frame is an agent stack frame, we need to
|
|
93
|
-
# update the state to INTERRUPTED
|
|
95
|
+
# update the state to INTERRUPTED and add an AgentInterrupted event
|
|
94
96
|
if top_stack_frame := stack.top():
|
|
95
97
|
if isinstance(top_stack_frame, AgentStackFrame):
|
|
98
|
+
applied_events.append(
|
|
99
|
+
AgentInterrupted(
|
|
100
|
+
top_stack_frame.agent_id,
|
|
101
|
+
top_stack_frame.flow_id,
|
|
102
|
+
)
|
|
103
|
+
)
|
|
96
104
|
top_stack_frame.state = AgentState.INTERRUPTED
|
|
97
105
|
|
|
98
106
|
stack.push(ClarifyPatternFlowStackFrame(names=names))
|
|
99
|
-
return tracker.create_stack_updated_events(stack)
|
|
107
|
+
return applied_events + tracker.create_stack_updated_events(stack)
|
|
100
108
|
|
|
101
109
|
def __hash__(self) -> int:
|
|
102
110
|
return hash(tuple(self.options))
|
|
@@ -16,7 +16,7 @@ from rasa.dialogue_understanding.stack.frames.flow_stack_frame import (
|
|
|
16
16
|
AgentStackFrame,
|
|
17
17
|
AgentState,
|
|
18
18
|
)
|
|
19
|
-
from rasa.shared.core.events import Event
|
|
19
|
+
from rasa.shared.core.events import AgentInterrupted, Event
|
|
20
20
|
from rasa.shared.core.flows import FlowsList
|
|
21
21
|
from rasa.shared.core.trackers import DialogueStateTracker
|
|
22
22
|
|
|
@@ -57,14 +57,22 @@ class KnowledgeAnswerCommand(FreeFormAnswerCommand):
|
|
|
57
57
|
"""
|
|
58
58
|
stack = tracker.stack
|
|
59
59
|
|
|
60
|
+
applied_events: List[Event] = []
|
|
61
|
+
|
|
60
62
|
# if the top stack frame is an agent stack frame, we need to
|
|
61
|
-
# update the state to INTERRUPTED
|
|
63
|
+
# update the state to INTERRUPTED and add an AgentInterrupted event
|
|
62
64
|
if top_stack_frame := stack.top():
|
|
63
65
|
if isinstance(top_stack_frame, AgentStackFrame):
|
|
66
|
+
applied_events.append(
|
|
67
|
+
AgentInterrupted(
|
|
68
|
+
top_stack_frame.agent_id,
|
|
69
|
+
top_stack_frame.flow_id,
|
|
70
|
+
)
|
|
71
|
+
)
|
|
64
72
|
top_stack_frame.state = AgentState.INTERRUPTED
|
|
65
73
|
|
|
66
74
|
stack.push(SearchPatternFlowStackFrame())
|
|
67
|
-
return tracker.create_stack_updated_events(stack)
|
|
75
|
+
return applied_events + tracker.create_stack_updated_events(stack)
|
|
68
76
|
|
|
69
77
|
def __hash__(self) -> int:
|
|
70
78
|
return hash(self.command())
|
|
@@ -11,9 +11,9 @@ Your task is to analyze the current conversation context and generate a list of
|
|
|
11
11
|
* `provide info`: Responding to the user's questions by supplying relevant information, such as answering FAQs or explaining services.
|
|
12
12
|
* `offtopic reply`: Responding to casual or social user messages that are unrelated to any flows, engaging in friendly conversation and addressing off-topic remarks.
|
|
13
13
|
* `hand over`: Handing over to a human, in case the user seems frustrated or explicitly asks to speak to one.
|
|
14
|
-
* `repeat message`: Repeating the last bot message.
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
* `repeat message`: Repeating the last bot message.{% if active_agent %}
|
|
15
|
+
* `continue agent`: Continue the currently active agent {{ active_agent.name }}. This has HIGHEST PRIORITY when an agent is active and the user is responding to agent questions.{% endif %}{% if completed_agents %}
|
|
16
|
+
* `restart agent agent_name`: Restart the agent with the given name, in case the user wants to change some answer to a previous question asked by the agent. For example, `restart agent car_research_agent` if the user changed his mind about the car he wants to buy. ONLY use agents that are listed in the `completed_agents` section.{% endif %}
|
|
17
17
|
|
|
18
18
|
--
|
|
19
19
|
|
|
@@ -19,9 +19,9 @@ Use the following structured data:
|
|
|
19
19
|
* `provide info`: Responding to the user's questions by supplying relevant information, such as answering FAQs or explaining services.
|
|
20
20
|
* `offtopic reply`: Responding to casual or social user messages that are unrelated to any flows, engaging in friendly conversation and addressing off-topic remarks.
|
|
21
21
|
* `hand over`: Handing over to a human, in case the user seems frustrated or explicitly asks to speak to one.
|
|
22
|
-
* `repeat message`: Repeating the last bot message.
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
* `repeat message`: Repeating the last bot message.{% if active_agent %}
|
|
23
|
+
* `continue agent`: Continue the currently active agent {{ active_agent.name }}. This has HIGHEST PRIORITY when an agent is active and the user is responding to agent questions.{% endif %}{% if completed_agents %}
|
|
24
|
+
* `restart agent agent_name`: Restart the agent with the given name, in case the user wants to change some answer to a previous question asked by the agent. For example, `restart agent car_research_agent` if the user changed his mind about the car he wants to buy. ONLY use agents that are listed in the `completed_agents` section.{% endif %}
|
|
25
25
|
|
|
26
26
|
---
|
|
27
27
|
|
|
@@ -9,9 +9,9 @@ Your task is to analyze the current conversation context and generate a list of
|
|
|
9
9
|
* `disambiguate flows flow_name1 flow_name2 ... flow_name_n`: When a message could refer to multiple flows, list the possible flows as options to clarify. Example: `disambiguate flows list_contacts add_contact remove_contact`.
|
|
10
10
|
* `search and reply`: Provide a response from the knowledge base to address the user's inquiry when no flows fit, including domain knowledge, FAQs, and all off-topic or social messages.
|
|
11
11
|
* `cancel flow`: Cancel the current flow if the user requests it.
|
|
12
|
-
* `repeat message`: Repeat the last bot message.
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
* `repeat message`: Repeat the last bot message.{% if active_agent %}
|
|
13
|
+
* `continue agent`: Continue the currently active agent {{ active_agent.name }}. This has HIGHEST PRIORITY when an agent is active and the user is responding to agent questions.{% endif %}{% if completed_agents %}
|
|
14
|
+
* `restart agent agent_name`: Restart the agent with the given name, in case the user wants to change some answer to a previous question asked by the agent. For example, `restart agent car_research_agent` if the user changed his mind about the car he wants to buy. ONLY use agents that are listed in the `completed_agents` section.{% endif %}
|
|
15
15
|
|
|
16
16
|
---
|
|
17
17
|
|
|
@@ -17,9 +17,9 @@ Use the following structured data:
|
|
|
17
17
|
* `disambiguate flows flow_name1 flow_name2 ... flow_name_n`: When a message could refer to multiple flows, list the possible flows as options to clarify. Example: `disambiguate flows list_contacts add_contact remove_contact`.
|
|
18
18
|
* `search and reply`: Provide a response from the knowledge base to address the user’s inquiry when no flows fit, including domain knowledge, FAQs, and all off-topic or social messages.
|
|
19
19
|
* `cancel flow`: Cancel the current flow if the user requests it.
|
|
20
|
-
* `repeat message`: Repeat the last bot message.
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
* `repeat message`: Repeat the last bot message.{% if active_agent %}
|
|
21
|
+
* `continue agent`: Continue the currently active agent {{ active_agent.name }}. This has HIGHEST PRIORITY when an agent is active and the user is responding to agent questions.{% endif %}{% if completed_agents %}
|
|
22
|
+
* `restart agent agent_name`: Restart the agent with the given name, in case the user wants to change some answer to a previous question asked by the agent. For example, `restart agent car_research_agent` if the user changed his mind about the car he wants to buy. ONLY use agents that are listed in the `completed_agents` section.{% endif %}
|
|
23
23
|
|
|
24
24
|
---
|
|
25
25
|
|
rasa/dialogue_understanding/generator/single_step/single_step_based_llm_command_generator.py
CHANGED
|
@@ -236,6 +236,8 @@ class SingleStepBasedLLMCommandGenerator(LLMBasedCommandGenerator, ABC):
|
|
|
236
236
|
log_module=self.__class__.__name__,
|
|
237
237
|
log_event="llm_command_generator.predict_commands.finished",
|
|
238
238
|
commands=commands,
|
|
239
|
+
event_info="Commands predictd by the Command Generator",
|
|
240
|
+
highlight=True,
|
|
239
241
|
)
|
|
240
242
|
|
|
241
243
|
domain = kwargs.get("domain")
|
|
@@ -499,6 +499,10 @@ def clean_up_commands(
|
|
|
499
499
|
else:
|
|
500
500
|
clean_commands.append(command)
|
|
501
501
|
|
|
502
|
+
# Replace CannotHandleCommands with ContinueAgentCommand when an agent is active
|
|
503
|
+
# to keep the agent running, but preserve chitchat
|
|
504
|
+
clean_commands = _replace_cannot_handle_with_continue_agent(clean_commands, tracker)
|
|
505
|
+
|
|
502
506
|
# when coexistence is enabled, by default there will be a SetSlotCommand
|
|
503
507
|
# for the ROUTE_TO_CALM_SLOT slot.
|
|
504
508
|
if tracker.has_coexistence_routing_slot and len(clean_commands) > 2:
|
|
@@ -509,9 +513,14 @@ def clean_up_commands(
|
|
|
509
513
|
clean_commands = ensure_max_number_of_command_type(
|
|
510
514
|
clean_commands, RepeatBotMessagesCommand, 1
|
|
511
515
|
)
|
|
516
|
+
clean_commands = ensure_max_number_of_command_type(
|
|
517
|
+
clean_commands, ContinueAgentCommand, 1
|
|
518
|
+
)
|
|
512
519
|
structlogger.debug(
|
|
513
520
|
"command_processor.clean_up_commands.final_commands",
|
|
514
521
|
command=clean_commands,
|
|
522
|
+
event_info="Final commands",
|
|
523
|
+
highlight=True,
|
|
515
524
|
)
|
|
516
525
|
|
|
517
526
|
return clean_commands
|
|
@@ -580,6 +589,67 @@ def clean_up_start_flow_command(
|
|
|
580
589
|
return clean_commands
|
|
581
590
|
|
|
582
591
|
|
|
592
|
+
def _replace_cannot_handle_with_continue_agent(
|
|
593
|
+
clean_commands: List[Command],
|
|
594
|
+
tracker: DialogueStateTracker,
|
|
595
|
+
) -> List[Command]:
|
|
596
|
+
"""Replace CannotHandleCommands with ContinueAgentCommand when agent is active.
|
|
597
|
+
|
|
598
|
+
ContinueAgentCommand is added in the following cases:
|
|
599
|
+
|
|
600
|
+
1. LLM Command Generation Failures:
|
|
601
|
+
- LLM parsing failures (default reason)
|
|
602
|
+
- Force slot filling failures (default reason)
|
|
603
|
+
|
|
604
|
+
2. Invalid Commands During Cleanup:
|
|
605
|
+
- Invalid SetSlot commands:
|
|
606
|
+
- Slot not in domain
|
|
607
|
+
- Incompatible extractor
|
|
608
|
+
(Note: ChitChatAnswer command failures are preserved as CannotHandleCommand)
|
|
609
|
+
|
|
610
|
+
3. Empty Commands List:
|
|
611
|
+
- When all commands are filtered out during cleanup
|
|
612
|
+
|
|
613
|
+
Preserved as CannotHandleCommand (not replaced):
|
|
614
|
+
- Chitchat: CannotHandleCommand(RASA_PATTERN_CANNOT_HANDLE_CHITCHAT)
|
|
615
|
+
"""
|
|
616
|
+
if not tracker.stack.agent_is_active():
|
|
617
|
+
return clean_commands
|
|
618
|
+
|
|
619
|
+
# If no commands at all and agent is active, add ContinueAgentCommand
|
|
620
|
+
if not clean_commands:
|
|
621
|
+
clean_commands.append(ContinueAgentCommand())
|
|
622
|
+
return clean_commands
|
|
623
|
+
|
|
624
|
+
has_continue_agent = any(
|
|
625
|
+
isinstance(cmd, ContinueAgentCommand) for cmd in clean_commands
|
|
626
|
+
)
|
|
627
|
+
|
|
628
|
+
# Collect CannotHandleCommands that should be replaced with ContinueAgentCommand
|
|
629
|
+
cannot_handle_commands = [
|
|
630
|
+
cmd
|
|
631
|
+
for cmd in clean_commands
|
|
632
|
+
if isinstance(cmd, CannotHandleCommand)
|
|
633
|
+
and cmd.reason != RASA_PATTERN_CANNOT_HANDLE_CHITCHAT
|
|
634
|
+
]
|
|
635
|
+
|
|
636
|
+
if cannot_handle_commands:
|
|
637
|
+
structlogger.debug(
|
|
638
|
+
"command_processor.clean_up_commands"
|
|
639
|
+
".replace_cannot_handle_with_continue_agent",
|
|
640
|
+
original_commands=clean_commands,
|
|
641
|
+
)
|
|
642
|
+
# Remove the CannotHandleCommands we collected
|
|
643
|
+
for cmd in cannot_handle_commands:
|
|
644
|
+
clean_commands.remove(cmd)
|
|
645
|
+
|
|
646
|
+
# Add ContinueAgentCommand if not already present
|
|
647
|
+
if not has_continue_agent:
|
|
648
|
+
clean_commands.append(ContinueAgentCommand())
|
|
649
|
+
|
|
650
|
+
return clean_commands
|
|
651
|
+
|
|
652
|
+
|
|
583
653
|
def clean_up_clarify_command(
|
|
584
654
|
commands_so_far: List[Command],
|
|
585
655
|
all_commands: List[Command],
|
|
@@ -273,28 +273,3 @@ class DialogueStack:
|
|
|
273
273
|
|
|
274
274
|
def agent_is_active(self) -> bool:
|
|
275
275
|
return self.find_active_agent_frame() is not None
|
|
276
|
-
|
|
277
|
-
def get_all_user_flow_frames(
|
|
278
|
-
self, ignore_call_and_link_frames: bool = True
|
|
279
|
-
) -> List[UserFlowStackFrame]:
|
|
280
|
-
"""Get all user flow frames from the dialogue stack.
|
|
281
|
-
|
|
282
|
-
Args:
|
|
283
|
-
ignore_call_and_link_frames: Whether to ignore user frames of type `call`
|
|
284
|
-
and `link`. By default, these frames are ignored.
|
|
285
|
-
|
|
286
|
-
Returns:
|
|
287
|
-
A list of all user flow frames in the dialogue stack.
|
|
288
|
-
"""
|
|
289
|
-
return [
|
|
290
|
-
frame
|
|
291
|
-
for frame in self.frames
|
|
292
|
-
if isinstance(frame, UserFlowStackFrame)
|
|
293
|
-
and (
|
|
294
|
-
not ignore_call_and_link_frames
|
|
295
|
-
or (
|
|
296
|
-
frame.frame_type != FlowStackFrameType.CALL
|
|
297
|
-
and frame.frame_type != FlowStackFrameType.LINK
|
|
298
|
-
)
|
|
299
|
-
)
|
|
300
|
-
]
|
rasa/engine/loader.py
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
from pathlib import Path
|
|
2
2
|
from typing import Tuple, Type
|
|
3
3
|
|
|
4
|
+
import structlog
|
|
5
|
+
|
|
4
6
|
from rasa.engine.graph import ExecutionContext
|
|
5
7
|
from rasa.engine.runner.interface import GraphRunner
|
|
6
8
|
from rasa.engine.storage.storage import ModelMetadata, ModelStorage
|
|
@@ -9,6 +11,8 @@ from rasa.engine.validation import (
|
|
|
9
11
|
validate_model_group_configuration_setup,
|
|
10
12
|
)
|
|
11
13
|
|
|
14
|
+
structlogger = structlog.get_logger()
|
|
15
|
+
|
|
12
16
|
|
|
13
17
|
def load_predict_graph_runner(
|
|
14
18
|
storage_path: Path,
|
|
@@ -30,6 +34,10 @@ def load_predict_graph_runner(
|
|
|
30
34
|
model_storage, model_metadata = model_storage_class.from_model_archive(
|
|
31
35
|
storage_path=storage_path, model_archive_path=model_archive_path
|
|
32
36
|
)
|
|
37
|
+
structlogger.debug(
|
|
38
|
+
"engine.loader.load_predict_graph_runner.success",
|
|
39
|
+
model_id=model_metadata.model_id,
|
|
40
|
+
)
|
|
33
41
|
|
|
34
42
|
# Components using LLMs or embeddings can reference model groups defined in
|
|
35
43
|
# the endpoints.yml file for their client configurations. To ensure they will work
|
|
@@ -38,6 +46,10 @@ def load_predict_graph_runner(
|
|
|
38
46
|
validate_model_group_configuration_setup()
|
|
39
47
|
validate_model_client_configuration_setup_during_inference_time(model_metadata)
|
|
40
48
|
|
|
49
|
+
structlogger.debug(
|
|
50
|
+
"engine.loader.config.validation.success",
|
|
51
|
+
model_id=model_metadata.model_id,
|
|
52
|
+
)
|
|
41
53
|
runner = graph_runner_class.create(
|
|
42
54
|
graph_schema=model_metadata.predict_schema,
|
|
43
55
|
model_storage=model_storage,
|