rasa-pro 3.14.0.dev9__py3-none-any.whl → 3.14.0.dev11__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.

Files changed (298) hide show
  1. rasa/__main__.py +15 -3
  2. rasa/agents/agent_factory.py +2 -2
  3. rasa/agents/agent_manager.py +50 -2
  4. rasa/agents/constants.py +3 -0
  5. rasa/agents/core/types.py +11 -0
  6. rasa/agents/protocol/a2a/a2a_agent.py +76 -17
  7. rasa/agents/protocol/mcp/mcp_base_agent.py +29 -5
  8. rasa/agents/protocol/mcp/mcp_open_agent.py +27 -13
  9. rasa/agents/protocol/mcp/mcp_task_agent.py +46 -31
  10. rasa/agents/schemas/__init__.py +2 -1
  11. rasa/agents/schemas/agent_tool_result.py +0 -2
  12. rasa/agents/schemas/agent_tool_schema.py +55 -3
  13. rasa/agents/templates/mcp_open_agent_prompt_template.jinja2 +6 -1
  14. rasa/agents/templates/mcp_task_agent_prompt_template.jinja2 +5 -0
  15. rasa/agents/utils.py +42 -3
  16. rasa/agents/validation.py +4 -4
  17. rasa/builder/copilot/telemetry.py +35 -19
  18. rasa/builder/main.py +5 -14
  19. rasa/builder/project_generator.py +1 -1
  20. rasa/builder/service.py +5 -0
  21. rasa/builder/template_cache.py +9 -184
  22. rasa/cli/project_templates/basic/data/data.md +5 -6
  23. rasa/cli/project_templates/basic/domain/domain.md +5 -2
  24. rasa/cli/project_templates/finance/README.md +8 -7
  25. rasa/cli/project_templates/finance/actions/__init__.py +0 -46
  26. rasa/cli/project_templates/finance/actions/accounts/check_balance.py +18 -0
  27. rasa/cli/project_templates/finance/actions/{transfers/action_process_immediate_payment.py → cards/check_that_card_exists.py} +6 -3
  28. rasa/cli/project_templates/finance/actions/cards/list_cards.py +22 -0
  29. rasa/cli/project_templates/finance/actions/contacts/__init__.py +0 -0
  30. rasa/cli/project_templates/finance/actions/contacts/add_contact.py +30 -0
  31. rasa/cli/project_templates/finance/actions/contacts/list_contacts.py +22 -0
  32. rasa/cli/project_templates/finance/actions/contacts/remove_contact.py +35 -0
  33. rasa/cli/project_templates/finance/actions/db.py +117 -0
  34. rasa/cli/project_templates/finance/actions/transfers/check_transfer_funds.py +27 -0
  35. rasa/cli/project_templates/finance/actions/transfers/check_transfer_limit.py +36 -0
  36. rasa/cli/project_templates/finance/actions/transfers/execute_recurrent_payment.py +20 -0
  37. rasa/cli/project_templates/finance/actions/transfers/execute_transfer.py +45 -0
  38. rasa/cli/project_templates/finance/actions/transfers/list_transactions.py +32 -0
  39. rasa/cli/project_templates/finance/config.yml +6 -0
  40. rasa/cli/project_templates/finance/credentials.yml +7 -6
  41. rasa/cli/project_templates/finance/data/accounts/check_balance.yml +3 -4
  42. rasa/cli/project_templates/finance/data/accounts/download_statements.yml +26 -0
  43. rasa/cli/project_templates/finance/data/bills/bill_pay_reminder.yml +25 -0
  44. rasa/cli/project_templates/finance/data/cards/activate_card.yml +35 -0
  45. rasa/cli/project_templates/finance/data/cards/block_card.yml +37 -58
  46. rasa/cli/project_templates/finance/data/cards/list_cards.yml +14 -0
  47. rasa/cli/project_templates/finance/data/cards/replace_card.yml +16 -0
  48. rasa/cli/project_templates/finance/data/cards/replace_eligible_card.yml +29 -0
  49. rasa/cli/project_templates/finance/data/contacts/add_contact.yml +33 -0
  50. rasa/cli/project_templates/finance/data/contacts/list_contacts.yml +14 -0
  51. rasa/cli/project_templates/finance/data/contacts/remove_contact.yml +31 -0
  52. rasa/cli/project_templates/finance/data/data.md +6 -3
  53. rasa/cli/project_templates/finance/data/general/agent_details.yml +6 -0
  54. rasa/cli/project_templates/finance/data/general/hello.yml +1 -2
  55. rasa/cli/project_templates/finance/data/general/human_handoff.yml +1 -1
  56. rasa/cli/project_templates/finance/data/transfers/check_transfer_limit.yml +18 -0
  57. rasa/cli/project_templates/finance/data/transfers/list_transactions.yml +46 -0
  58. rasa/cli/project_templates/finance/data/transfers/move_money_between_accounts.yml +51 -0
  59. rasa/cli/project_templates/finance/data/transfers/transfer_money.yml +29 -62
  60. rasa/cli/project_templates/finance/data/transfers/transfer_money_to_a_third_party.yml +175 -0
  61. rasa/cli/project_templates/finance/db/cards.json +18 -0
  62. rasa/cli/project_templates/finance/db/contacts.json +10 -0
  63. rasa/cli/project_templates/finance/db/my_account.json +6 -0
  64. rasa/cli/project_templates/finance/db/transactions.json +22 -0
  65. rasa/cli/project_templates/finance/docs/docs.md +8 -0
  66. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/account_features/budgeting_analytics.txt +22 -0
  67. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/account_features/multi_currency_accounts.txt +19 -0
  68. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/account_features/premium_benefits.txt +19 -0
  69. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/card_management/contactless_limits.txt +16 -0
  70. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/card_management/freeze_unfreeze_card.txt +16 -0
  71. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/card_management/lost_stolen_card.txt +19 -0
  72. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/money_transfers/instant_payments.txt +19 -0
  73. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/money_transfers/international_transfers.txt +19 -0
  74. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/security_fraud/fraud_protection.txt +22 -0
  75. rasa/cli/project_templates/finance/docs/fenlo_banking_faq/security_fraud/secure_payments.txt +22 -0
  76. rasa/cli/project_templates/finance/domain/_system/patterns/pattern_session_start.yml +11 -0
  77. rasa/cli/project_templates/finance/domain/accounts/check_balance.yml +9 -5
  78. rasa/cli/project_templates/finance/domain/accounts/download_statements.yml +40 -0
  79. rasa/cli/project_templates/finance/domain/bills/bill_pay_reminder.yml +49 -0
  80. rasa/cli/project_templates/finance/domain/cards/activate_card.yml +24 -0
  81. rasa/cli/project_templates/finance/domain/cards/block_card.yml +33 -90
  82. rasa/cli/project_templates/finance/domain/cards/list_cards.yml +16 -0
  83. rasa/cli/project_templates/finance/domain/cards/replace_card.yml +43 -0
  84. rasa/cli/project_templates/finance/domain/cards/shared.yml +15 -0
  85. rasa/cli/project_templates/finance/domain/contacts/add_contact.yml +37 -0
  86. rasa/cli/project_templates/finance/domain/contacts/list_contacts.yml +16 -0
  87. rasa/cli/project_templates/finance/domain/contacts/remove_contact.yml +32 -0
  88. rasa/cli/project_templates/finance/domain/domain.md +9 -1
  89. rasa/cli/project_templates/finance/domain/general/_shared.yml +53 -0
  90. rasa/cli/project_templates/finance/domain/general/agent_details.yml +19 -0
  91. rasa/cli/project_templates/finance/domain/general/cannot_handle.yml +5 -2
  92. rasa/cli/project_templates/finance/domain/general/feedback.yml +0 -3
  93. rasa/cli/project_templates/finance/domain/general/human_handoff.yml +7 -3
  94. rasa/cli/project_templates/finance/domain/general/welcome.yml +5 -2
  95. rasa/cli/project_templates/finance/domain/transfers/check_transfer_limit.yml +32 -0
  96. rasa/cli/project_templates/finance/domain/transfers/list_transactions.yml +44 -0
  97. rasa/cli/project_templates/finance/domain/transfers/shared.yml +17 -0
  98. rasa/cli/project_templates/finance/domain/transfers/transfer_money.yml +203 -61
  99. rasa/cli/project_templates/finance/endpoints.yml +3 -2
  100. rasa/cli/project_templates/finance/prompts/rephraser_demo_personality_prompt.jinja2 +31 -12
  101. rasa/cli/project_templates/telco/data/data.md +1 -1
  102. rasa/cli/project_templates/telco/docs/docs.md +3 -0
  103. rasa/cli/project_templates/telco/domain/domain.md +1 -2
  104. rasa/constants.py +1 -1
  105. rasa/core/actions/direct_custom_actions_executor.py +9 -2
  106. rasa/core/agent.py +2 -3
  107. rasa/core/available_agents.py +8 -6
  108. rasa/core/brokers/broker.py +1 -1
  109. rasa/core/brokers/kafka.py +52 -8
  110. rasa/core/channels/__init__.py +82 -35
  111. rasa/core/channels/inspector/README.md +1 -1
  112. rasa/core/channels/telegram.py +4 -9
  113. rasa/core/channels/voice_stream/twilio_media_streams.py +5 -1
  114. rasa/core/concurrent_lock_store.py +66 -16
  115. rasa/core/iam_credentials_providers/aws_iam_credentials_providers.py +76 -1
  116. rasa/core/iam_credentials_providers/credentials_provider_protocol.py +1 -1
  117. rasa/core/lock_store.py +41 -7
  118. rasa/core/policies/flows/agent_executor.py +632 -0
  119. rasa/core/policies/flows/flow_executor.py +3 -418
  120. rasa/core/policies/flows/mcp_tool_executor.py +35 -14
  121. rasa/core/processor.py +49 -28
  122. rasa/core/run.py +22 -0
  123. rasa/dialogue_understanding/commands/cancel_flow_command.py +1 -1
  124. rasa/dialogue_understanding/commands/chit_chat_answer_command.py +11 -3
  125. rasa/dialogue_understanding/commands/clarify_command.py +11 -3
  126. rasa/dialogue_understanding/commands/knowledge_answer_command.py +11 -3
  127. rasa/dialogue_understanding/generator/prompt_templates/agent_command_prompt_v2_claude_3_5_sonnet_20240620_template.jinja2 +3 -3
  128. rasa/dialogue_understanding/generator/prompt_templates/agent_command_prompt_v2_gpt_4o_2024_11_20_template.jinja2 +3 -3
  129. rasa/dialogue_understanding/generator/prompt_templates/agent_command_prompt_v3_claude_3_5_sonnet_20240620_template.jinja2 +3 -3
  130. rasa/dialogue_understanding/generator/prompt_templates/agent_command_prompt_v3_gpt_4o_2024_11_20_template.jinja2 +3 -3
  131. rasa/dialogue_understanding/generator/single_step/single_step_based_llm_command_generator.py +2 -0
  132. rasa/dialogue_understanding/processor/command_processor.py +70 -0
  133. rasa/dialogue_understanding/stack/dialogue_stack.py +0 -25
  134. rasa/engine/loader.py +12 -0
  135. rasa/engine/recipes/default_components.py +111 -82
  136. rasa/engine/recipes/default_recipe.py +79 -22
  137. rasa/engine/runner/dask.py +8 -5
  138. rasa/graph_components/validators/default_recipe_validator.py +59 -19
  139. rasa/model_manager/warm_rasa_process.py +13 -3
  140. rasa/model_training.py +0 -14
  141. rasa/nlu/classifiers/logistic_regression_classifier.py +1 -22
  142. rasa/nlu/classifiers/mitie_intent_classifier.py +3 -0
  143. rasa/nlu/classifiers/sklearn_intent_classifier.py +1 -3
  144. rasa/nlu/extractors/crf_entity_extractor.py +9 -10
  145. rasa/nlu/extractors/mitie_entity_extractor.py +3 -0
  146. rasa/nlu/extractors/spacy_entity_extractor.py +3 -0
  147. rasa/nlu/featurizers/dense_featurizer/mitie_featurizer.py +2 -0
  148. rasa/nlu/featurizers/dense_featurizer/spacy_featurizer.py +3 -0
  149. rasa/nlu/featurizers/sparse_featurizer/count_vectors_featurizer.py +4 -2
  150. rasa/nlu/featurizers/sparse_featurizer/lexical_syntactic_featurizer.py +4 -0
  151. rasa/nlu/tokenizers/jieba_tokenizer.py +3 -4
  152. rasa/nlu/tokenizers/mitie_tokenizer.py +3 -2
  153. rasa/nlu/tokenizers/spacy_tokenizer.py +3 -2
  154. rasa/nlu/utils/mitie_utils.py +3 -0
  155. rasa/nlu/utils/spacy_utils.py +3 -2
  156. rasa/shared/agents/auth/agent_auth_manager.py +6 -3
  157. rasa/shared/agents/auth/auth_strategy/oauth2_auth_strategy.py +13 -5
  158. rasa/shared/core/constants.py +5 -1
  159. rasa/shared/utils/mcp/server_connection.py +1 -1
  160. rasa/telemetry.py +63 -0
  161. rasa/utils/log_utils.py +95 -4
  162. rasa/utils/tensorflow/__init__.py +0 -22
  163. rasa/utils/tensorflow/callback.py +17 -7
  164. rasa/utils/tensorflow/layers.py +10 -7
  165. rasa/utils/tensorflow/rasa_layers.py +1 -1
  166. rasa/version.py +1 -1
  167. {rasa_pro-3.14.0.dev9.dist-info → rasa_pro-3.14.0.dev11.dist-info}/METADATA +99 -89
  168. {rasa_pro-3.14.0.dev9.dist-info → rasa_pro-3.14.0.dev11.dist-info}/RECORD +171 -242
  169. rasa/cli/project_templates/finance/actions/accounts/action_ask_account.py +0 -47
  170. rasa/cli/project_templates/finance/actions/accounts/action_check_balance.py +0 -40
  171. rasa/cli/project_templates/finance/actions/action_session_start.py +0 -74
  172. rasa/cli/project_templates/finance/actions/cards/action_ask_card.py +0 -48
  173. rasa/cli/project_templates/finance/actions/cards/action_check_card_existence.py +0 -36
  174. rasa/cli/project_templates/finance/actions/cards/action_update_card_status.py +0 -54
  175. rasa/cli/project_templates/finance/actions/database.py +0 -277
  176. rasa/cli/project_templates/finance/actions/transfers/action_add_payee.py +0 -52
  177. rasa/cli/project_templates/finance/actions/transfers/action_ask_account_from.py +0 -51
  178. rasa/cli/project_templates/finance/actions/transfers/action_check_payee_existence.py +0 -40
  179. rasa/cli/project_templates/finance/actions/transfers/action_check_sufficient_funds.py +0 -40
  180. rasa/cli/project_templates/finance/actions/transfers/action_list_payees.py +0 -46
  181. rasa/cli/project_templates/finance/actions/transfers/action_remove_payee.py +0 -49
  182. rasa/cli/project_templates/finance/actions/transfers/action_schedule_payment.py +0 -19
  183. rasa/cli/project_templates/finance/actions/transfers/action_validate_payment_date.py +0 -36
  184. rasa/cli/project_templates/finance/csvs/accounts.csv +0 -8
  185. rasa/cli/project_templates/finance/csvs/advisors.csv +0 -7
  186. rasa/cli/project_templates/finance/csvs/appointments.csv +0 -211
  187. rasa/cli/project_templates/finance/csvs/branches.csv +0 -10
  188. rasa/cli/project_templates/finance/csvs/cards.csv +0 -11
  189. rasa/cli/project_templates/finance/csvs/payees.csv +0 -11
  190. rasa/cli/project_templates/finance/csvs/transactions.csv +0 -71
  191. rasa/cli/project_templates/finance/csvs/users.csv +0 -4
  192. rasa/cli/project_templates/finance/data/cards/select_card.yml +0 -12
  193. rasa/cli/project_templates/finance/data/general/bot_identity.yml +0 -6
  194. rasa/cli/project_templates/finance/data/system/patterns/pattern_chitchat.yml +0 -5
  195. rasa/cli/project_templates/finance/data/system/source/accounts.json +0 -51
  196. rasa/cli/project_templates/finance/data/system/source/advisors.json +0 -44
  197. rasa/cli/project_templates/finance/data/system/source/appointments.json +0 -1474
  198. rasa/cli/project_templates/finance/data/system/source/branches.json +0 -47
  199. rasa/cli/project_templates/finance/data/system/source/cards.json +0 -72
  200. rasa/cli/project_templates/finance/data/system/source/payees.json +0 -74
  201. rasa/cli/project_templates/finance/data/system/source/transactions.json +0 -492
  202. rasa/cli/project_templates/finance/data/system/source/users.json +0 -29
  203. rasa/cli/project_templates/finance/data/transfers/add_payee.yml +0 -29
  204. rasa/cli/project_templates/finance/data/transfers/list_payees.yml +0 -5
  205. rasa/cli/project_templates/finance/data/transfers/remove_payee.yml +0 -21
  206. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/block_card/consequences_of_blocking_card.txt +0 -8
  207. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/block_card/reasons_to_block_card.txt +0 -8
  208. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/block_card/recovering_from_card_fraud.txt +0 -8
  209. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/block_card/tips_for_card_security.txt +0 -8
  210. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/block_card/what_to_do_if_card_is_lost.txt +0 -8
  211. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/check_balance/account_balance_security.txt +0 -7
  212. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/check_balance/common_balance_inquiries.txt +0 -8
  213. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/check_balance/methods_to_check_balance.txt +0 -8
  214. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/check_balance/understanding_balance_updates.txt +0 -8
  215. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/check_balance/what_to_do_if_balance_is_incorrect.txt +0 -8
  216. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/manage_payees/benefits_of_authorised_payees.txt +0 -8
  217. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/manage_payees/common_issues_with_payees.txt +0 -8
  218. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/manage_payees/general_payee_information.txt +0 -8
  219. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/manage_payees/payee_management_tips.txt +0 -8
  220. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/manage_payees/understanding_payee_types.txt +0 -8
  221. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/transfer_money/common_transfer_errors.txt +0 -8
  222. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/transfer_money/fees_for_transfers.txt +0 -8
  223. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/transfer_money/general_transfer_information.txt +0 -8
  224. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/transfer_money/security_tips_for_transfers.txt +0 -8
  225. rasa/cli/project_templates/finance/docs/bank_of_rasa_faq/transfer_money/transfer_processing_times.txt +0 -8
  226. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part1.txt +0 -50
  227. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part10.txt +0 -50
  228. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part11.txt +0 -48
  229. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part12.txt +0 -50
  230. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part13.txt +0 -50
  231. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part14.txt +0 -47
  232. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part15.txt +0 -50
  233. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part16.txt +0 -50
  234. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part17.txt +0 -47
  235. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part18.txt +0 -50
  236. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part19.txt +0 -50
  237. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part2.txt +0 -50
  238. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part20.txt +0 -47
  239. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part21.txt +0 -50
  240. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part22.txt +0 -50
  241. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part23.txt +0 -47
  242. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part24.txt +0 -50
  243. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part25.txt +0 -50
  244. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part26.txt +0 -47
  245. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part27.txt +0 -50
  246. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part28.txt +0 -50
  247. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part29.txt +0 -47
  248. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part3.txt +0 -47
  249. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part30.txt +0 -50
  250. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part31.txt +0 -50
  251. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part32.txt +0 -47
  252. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part33.txt +0 -50
  253. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part34.txt +0 -50
  254. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part35.txt +0 -47
  255. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part36.txt +0 -50
  256. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part37.txt +0 -50
  257. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part38.txt +0 -47
  258. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part39.txt +0 -50
  259. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part4.txt +0 -50
  260. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part40.txt +0 -50
  261. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part41.txt +0 -47
  262. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part42.txt +0 -50
  263. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part43.txt +0 -50
  264. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part44.txt +0 -47
  265. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part45.txt +0 -50
  266. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part46.txt +0 -50
  267. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part47.txt +0 -47
  268. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part48.txt +0 -50
  269. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part49.txt +0 -50
  270. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part5.txt +0 -50
  271. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part50.txt +0 -47
  272. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part51.txt +0 -50
  273. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part52.txt +0 -50
  274. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part53.txt +0 -47
  275. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part54.txt +0 -50
  276. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part55.txt +0 -50
  277. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part56.txt +0 -47
  278. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part57.txt +0 -50
  279. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part58.txt +0 -50
  280. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part59.txt +0 -47
  281. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part6.txt +0 -47
  282. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part60.txt +0 -50
  283. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part61.txt +0 -50
  284. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part7.txt +0 -50
  285. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part8.txt +0 -50
  286. rasa/cli/project_templates/finance/docs/huggingface_alpaca_dataset/questions_part9.txt +0 -47
  287. rasa/cli/project_templates/finance/domain/cards/select_card.yml +0 -12
  288. rasa/cli/project_templates/finance/domain/general/bot_identity.yml +0 -5
  289. rasa/cli/project_templates/finance/domain/general/defaults.yml +0 -24
  290. rasa/cli/project_templates/finance/domain/general/goodbye.yml +0 -7
  291. rasa/cli/project_templates/finance/domain/general/help.yml +0 -5
  292. rasa/cli/project_templates/finance/domain/general/utils.yml +0 -13
  293. rasa/cli/project_templates/finance/domain/transfers/add_payee.yml +0 -47
  294. rasa/cli/project_templates/finance/domain/transfers/list_payees.yml +0 -4
  295. rasa/cli/project_templates/finance/domain/transfers/remove_payee.yml +0 -16
  296. {rasa_pro-3.14.0.dev9.dist-info → rasa_pro-3.14.0.dev11.dist-info}/NOTICE +0 -0
  297. {rasa_pro-3.14.0.dev9.dist-info → rasa_pro-3.14.0.dev11.dist-info}/WHEEL +0 -0
  298. {rasa_pro-3.14.0.dev9.dist-info → rasa_pro-3.14.0.dev11.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
- logger.info(f"Loading model {model_tar}...")
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
- logger.debug(
370
- f"Starting a new session for conversation ID '{tracker.sender_id}'."
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
- logger.debug(
603
- f"Predicted next action '{action.name()}' with confidence "
604
- f"{prediction.max_confidence:.2f}."
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
- logger.debug(
655
- f"Canceled reminder because it is outdated ({reminder_event})."
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
- logger.debug(
1055
- f"Logged UserUtterance - tracker now has {len(tracker.events)} events."
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
- logger.warning(
1171
- "Circuit breaker tripped. Stopped predicting "
1172
- f"more actions for sender '{tracker.sender_id}'."
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
- logger.debug(
1181
- f"An end-to-end prediction was made which has triggered the 2nd "
1182
- f"execution of the default action '{ACTION_EXTRACT_SLOTS}'."
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
- logger.debug(
1399
- f"A `UserUttered` event was returned by executing "
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
- logger.debug(
1521
- f"The latest session for conversation ID '{tracker.sender_id}' has "
1522
- f"expired."
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
- logger.error(
1549
- f"Trying to run unknown follow-up action '{followup_action}'. "
1550
- "Instead of running that, Rasa Pro will ignore the action "
1551
- "and predict the next action."
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.flow_executor import (
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
- {% if active_agent %} * `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 %}
16
- {% if completed_agents %}* `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 %}
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
- {% if active_agent %} * `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 %}
24
- {% if completed_agents %}* `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 %}
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
- {% if active_agent %} * `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 %}
14
- {% if completed_agents %}* `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 %}
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
- {% if active_agent %} * `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 %}
22
- {% if completed_agents %}* `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 %}
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
 
@@ -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,