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
@@ -84,7 +84,7 @@ class MCPTaskAgent(MCPBaseAgent):
84
84
  ]
85
85
 
86
86
  return [
87
- AgentToolSchema.from_openai_json_format(
87
+ AgentToolSchema.from_litellm_json_format(
88
88
  cls.get_slot_specific_set_slot_tool(slot)
89
89
  )
90
90
  for slot in slot_definitions
@@ -109,12 +109,6 @@ class MCPTaskAgent(MCPBaseAgent):
109
109
  slot_name for slot_name in extracted_slot_names if slot_name in slot_names
110
110
  ]
111
111
 
112
- structlogger.debug(
113
- "mcp_task_agent.get_agent_specific_built_in_tools.slot_names",
114
- exit_conditions=exit_conditions,
115
- slot_names=valid_slot_names,
116
- )
117
-
118
112
  return valid_slot_names
119
113
 
120
114
  @classmethod
@@ -173,13 +167,6 @@ class MCPTaskAgent(MCPBaseAgent):
173
167
  rendered_template = Template(condition).render(current_context)
174
168
  predicate = Predicate(rendered_template)
175
169
  condition_result = predicate.evaluate(current_context)
176
- structlogger.debug(
177
- "mcp_task_agent.is_exit_conditions_met.predicate.result",
178
- predicate=predicate.description(),
179
- condition_result=condition_result,
180
- slots=slots,
181
- rendered_template=rendered_template,
182
- )
183
170
 
184
171
  # All conditions must be met (AND logic)
185
172
  if not condition_result:
@@ -196,11 +183,20 @@ class MCPTaskAgent(MCPBaseAgent):
196
183
  internal_error = str(e)
197
184
  break
198
185
 
199
- structlogger.debug(
200
- "mcp_task_agent.is_exit_conditions_met.result",
201
- all_conditions_met=all_conditions_met,
202
- internal_error=internal_error,
203
- )
186
+ if internal_error:
187
+ structlogger.debug(
188
+ "mcp_task_agent.is_exit_conditions_met.result",
189
+ event_info="Failed to evaluate exit conditions - error occurred",
190
+ exit_conditions=exit_conditions,
191
+ error=internal_error,
192
+ )
193
+ else:
194
+ structlogger.debug(
195
+ "mcp_task_agent.is_exit_conditions_met.result",
196
+ event_info=f"Exit conditions met: {all_conditions_met}",
197
+ evaulation_result=all_conditions_met,
198
+ exit_conditions=exit_conditions,
199
+ )
204
200
 
205
201
  return all_conditions_met, internal_error
206
202
 
@@ -253,11 +249,15 @@ class MCPTaskAgent(MCPBaseAgent):
253
249
  def render_prompt_template(self, context: AgentInput) -> str:
254
250
  """Render the prompt template with the provided inputs."""
255
251
  slot_names = self._get_slot_names_from_exit_conditions(context)
252
+ current_date, current_time, current_day = self._get_current_date_time_day()
256
253
 
257
254
  return Template(self.prompt_template).render(
258
255
  **context.model_dump(exclude={"id", "timestamp", "events"}),
259
256
  description=self._description,
260
257
  slot_names=slot_names,
258
+ current_date=current_date,
259
+ current_time=current_time,
260
+ current_day=current_day,
261
261
  )
262
262
 
263
263
  async def send_message(self, agent_input: AgentInput) -> AgentOutput:
@@ -271,15 +271,24 @@ class MCPTaskAgent(MCPBaseAgent):
271
271
 
272
272
  # Convert available tools to OpenAI JSON format
273
273
  tools_in_openai_format = [
274
- tool.to_openai_json_format() for tool in _available_tools
274
+ tool.to_litellm_json_format() for tool in _available_tools
275
275
  ]
276
276
 
277
277
  for iteration in range(self.MAX_ITERATIONS):
278
278
  try:
279
+ structlogger.debug(
280
+ "mcp_task_agent.send_message.iteration",
281
+ event_info=(
282
+ f"Starting iteration {iteration + 1} for agent {self._name}"
283
+ ),
284
+ agent_id=str(make_agent_identifier(self._name, self.protocol_type)),
285
+ highlight=True,
286
+ )
279
287
  # Make the LLM call using the llm_client
280
- structlogger.info(
288
+ structlogger.debug(
281
289
  "mcp_task_agent.send_message.sending_message_to_llm",
282
290
  messages=messages,
291
+ json_formatting=["messages"],
283
292
  event_info=f"Sending message to LLM (iteration {iteration + 1})",
284
293
  agent_name=self._name,
285
294
  agent_id=str(make_agent_identifier(self._name, self.protocol_type)),
@@ -307,8 +316,10 @@ class MCPTaskAgent(MCPBaseAgent):
307
316
  id=agent_input.id,
308
317
  status=AgentStatus.RECOVERABLE_ERROR,
309
318
  error_message=event_info,
310
- structured_results=self._get_structured_results_for_agent_output(
311
- agent_input, tool_results
319
+ structured_results=(
320
+ self._get_structured_results_for_agent_output(
321
+ agent_input, tool_results
322
+ )
312
323
  ),
313
324
  )
314
325
 
@@ -318,8 +329,10 @@ class MCPTaskAgent(MCPBaseAgent):
318
329
  id=agent_input.id,
319
330
  status=AgentStatus.INPUT_REQUIRED,
320
331
  response_message=llm_response.choices[0],
321
- structured_results=self._get_structured_results_for_agent_output(
322
- agent_input, tool_results
332
+ structured_results=(
333
+ self._get_structured_results_for_agent_output(
334
+ agent_input, tool_results
335
+ )
323
336
  ),
324
337
  )
325
338
 
@@ -330,14 +343,12 @@ class MCPTaskAgent(MCPBaseAgent):
330
343
  self._get_assistant_message_with_tool_calls(llm_response)
331
344
  )
332
345
  for tool_call in llm_response.tool_calls:
333
- structlogger.info(
346
+ structlogger.debug(
334
347
  "mcp_task_agent.send_message.tool_call",
335
- event_info=(
336
- f"Processing tool call `{tool_call.tool_name}` with "
337
- f"args: {tool_call.tool_args}"
338
- ),
348
+ event_info=f"Processing tool call {tool_call.tool_name}",
339
349
  tool_name=tool_call.tool_name,
340
350
  tool_args=json.dumps(tool_call.tool_args),
351
+ json_formatting=["tool_args"],
341
352
  agent_name=self._name,
342
353
  agent_id=str(
343
354
  make_agent_identifier(self._name, self.protocol_type)
@@ -401,7 +412,11 @@ class MCPTaskAgent(MCPBaseAgent):
401
412
 
402
413
  structlogger.debug(
403
414
  "mcp_task_agent.send_message.tool_output",
404
- tool_output=tool_output,
415
+ event_info=(
416
+ f"Tool output for tool call {tool_call.tool_name}"
417
+ ),
418
+ tool_output=tool_output.model_dump(),
419
+ json_formatting=["tool_output"],
405
420
  tool_name=tool_call.tool_name,
406
421
  agent_name=self._name,
407
422
  agent_id=str(
@@ -1,10 +1,11 @@
1
- from rasa.agents.schemas.agent_input import AgentInput
1
+ from rasa.agents.schemas.agent_input import AgentInput, AgentInputSlot
2
2
  from rasa.agents.schemas.agent_output import AgentOutput
3
3
  from rasa.agents.schemas.agent_tool_result import AgentToolResult
4
4
  from rasa.agents.schemas.agent_tool_schema import AgentToolSchema, CustomToolSchema
5
5
 
6
6
  __all__ = [
7
7
  "AgentInput",
8
+ "AgentInputSlot",
8
9
  "AgentOutput",
9
10
  "AgentToolSchema",
10
11
  "AgentToolResult",
@@ -50,8 +50,6 @@ class AgentToolResult(BaseModel):
50
50
  )
51
51
  # fallback to content if structured content is not available
52
52
  elif tool_result.content:
53
- # TODO try to parse the content using the output schema defined
54
- # in the tool schema (if present)
55
53
  return cls(
56
54
  tool_name=tool_name,
57
55
  result=str([content.model_dump() for content in tool_result.content]),
@@ -7,6 +7,7 @@ from rasa.agents.constants import (
7
7
  TOOL_ADDITIONAL_PROPERTIES_KEY,
8
8
  TOOL_DESCRIPTION_KEY,
9
9
  TOOL_EXECUTOR_KEY,
10
+ TOOL_INPUT_SCHEMA_KEY,
10
11
  TOOL_NAME_KEY,
11
12
  TOOL_PARAMETERS_KEY,
12
13
  TOOL_PROPERTIES_KEY,
@@ -42,9 +43,60 @@ class AgentToolSchema(BaseModel):
42
43
  )
43
44
 
44
45
  @classmethod
45
- def from_openai_json_format(cls, tool: Dict[str, Any]) -> "AgentToolSchema":
46
+ def from_litellm_json_format(cls, tool: Dict[str, Any]) -> "AgentToolSchema":
46
47
  """Convert OpenAI dict format to AgentToolSchema."""
48
+ references = (
49
+ "Refer: \n"
50
+ "- LiteLLM JSON Format - https://docs.litellm.ai/docs/completion/function_call#full-code---parallel-function-calling-with-gpt-35-turbo-1106\n"
51
+ "- OpenAI Tool JSON Format - https://platform.openai.com/docs/guides/tools?tool-type=function-calling\n"
52
+ )
53
+ expected_structure = (
54
+ "{\n"
55
+ " 'type': 'function',\n"
56
+ " 'function': {\n"
57
+ " 'name': 'string',\n"
58
+ " 'description': 'string',\n"
59
+ " 'parameters': {\n"
60
+ " 'type': 'object',\n"
61
+ " 'properties': {'string': 'string'},\n"
62
+ " 'required': ['string']\n"
63
+ " }\n"
64
+ " }\n"
65
+ "}"
66
+ )
67
+ if (
68
+ TOOL_NAME_KEY in tool
69
+ and TOOL_DESCRIPTION_KEY in tool
70
+ and TOOL_INPUT_SCHEMA_KEY in tool
71
+ ):
72
+ raise ValueError(
73
+ "Anthropic Tool format is not supported yet. Please use the LiteLLM "
74
+ "Tool format, which is based on OpenAI's format.\n"
75
+ "The expected structure is:\n"
76
+ f"{expected_structure}\n"
77
+ f"{references}"
78
+ )
79
+ if not (TOOL_TYPE_FUNCTION_KEY in tool and TOOL_TYPE_KEY in tool):
80
+ raise ValueError(
81
+ "Invalid tool format. Expected a dictionary with 'type' and "
82
+ "'function' keys. Expected LiteLLM Tool format that is based on OpenAI "
83
+ "format which has the following structure: \n"
84
+ f"{expected_structure}\n"
85
+ f"{references}"
86
+ )
87
+
47
88
  function_data = tool[TOOL_TYPE_FUNCTION_KEY]
89
+
90
+ if not (
91
+ TOOL_NAME_KEY in function_data and TOOL_DESCRIPTION_KEY in function_data
92
+ ):
93
+ raise ValueError(
94
+ "Invalid tool format. 'function' must contain 'name' and "
95
+ "'description' keys. Expected LiteLLM Tool format that is based on "
96
+ "OpenAI format which has the following structure: \n"
97
+ f"{expected_structure}\n"
98
+ f"{references}"
99
+ )
48
100
  parameters = function_data.get(TOOL_PARAMETERS_KEY, {})
49
101
 
50
102
  if parameters:
@@ -104,7 +156,7 @@ class AgentToolSchema(BaseModel):
104
156
  if TOOL_REQUIRED_KEY not in prop_schema:
105
157
  prop_schema[TOOL_REQUIRED_KEY] = []
106
158
 
107
- def to_openai_json_format(self) -> Dict[str, Any]:
159
+ def to_litellm_json_format(self) -> Dict[str, Any]:
108
160
  """Convert AgentToolSchema to OpenAI format."""
109
161
  # Ensure the schema is valid before conversion
110
162
  return {
@@ -123,7 +175,7 @@ class CustomToolSchema(BaseModel):
123
175
  @classmethod
124
176
  def from_dict(cls, config: Dict[str, Any]) -> "CustomToolSchema":
125
177
  """Convert a custom tool config to CustomToolSchema."""
126
- agent_tool_schema = AgentToolSchema.from_openai_json_format(config)
178
+ agent_tool_schema = AgentToolSchema.from_litellm_json_format(config)
127
179
  if TOOL_EXECUTOR_KEY not in config:
128
180
  raise ValueError("Custom tool executor is required.")
129
181
 
@@ -11,5 +11,10 @@ You are a helpful assistant that should assist the user in the best possible way
11
11
  * Do NOT call the `task_completed` tool unless you're absolutely certain that your primary task (NOT the slot corrections, updates, etc), described above, is fully completed. Focus on the task given in the task description above.
12
12
  * Strictly avoid making up information or ability to take some action which is not available in `tool` provided.
13
13
 
14
+ ### Context
15
+ - Current date: {{ current_date }} (YYYY-MM-DD)
16
+ - Current time: {{ current_time }} (HH:MM:SS, 24-hour format)
17
+ - Current day: {{ current_day }} (Day of week)
18
+
14
19
  ### Conversation history
15
- {{ conversation_history }}
20
+ {{ conversation_history }}
@@ -13,5 +13,10 @@ You are a helpful assistant that should assist the user in the best possible way
13
13
  * Always avoid making assumptions about what values to pass into tools. Ask for clarification if a user's request is ambiguous.
14
14
  * Strictly avoid making up information or ability to take some action which is not available in `tool` provided.
15
15
 
16
+ ### Context
17
+ - Current date: {{ current_date }} (YYYY-MM-DD)
18
+ - Current time: {{ current_time }} (HH:MM:SS, 24-hour format)
19
+ - Current day: {{ current_day }} (Day of week)
20
+
16
21
  ### Conversation history
17
22
  {{ conversation_history }}
rasa/agents/utils.py CHANGED
@@ -1,5 +1,7 @@
1
1
  from typing import Dict, List, Optional
2
2
 
3
+ import structlog
4
+
3
5
  from rasa.agents.agent_manager import AgentManager
4
6
  from rasa.agents.exceptions import AgentNotFoundException
5
7
  from rasa.agents.validation import validate_agent_names_not_conflicting_with_flows
@@ -10,12 +12,13 @@ from rasa.core.available_agents import (
10
12
  )
11
13
  from rasa.core.available_endpoints import AvailableEndpoints
12
14
  from rasa.shared.agents.utils import get_protocol_type
13
- from rasa.shared.core.domain import Domain
14
- from rasa.shared.core.events import AgentCompleted
15
+ from rasa.shared.core.events import AgentCompleted, AgentStarted
15
16
  from rasa.shared.core.flows import FlowsList
16
17
  from rasa.shared.core.flows.steps import CallFlowStep
17
18
  from rasa.shared.core.trackers import DialogueStateTracker
18
19
 
20
+ structlogger = structlog.get_logger()
21
+
19
22
 
20
23
  def resolve_agent_config(
21
24
  agent_config: AgentConfig,
@@ -43,13 +46,15 @@ def resolve_agent_config(
43
46
 
44
47
  async def initialize_agents(
45
48
  flows: FlowsList,
46
- domain: Domain,
47
49
  sub_agents: AvailableAgents,
48
50
  ) -> None:
49
51
  """Iterate over flows and create/connect the referenced agents."""
50
52
  agent_manager: AgentManager = AgentManager()
51
53
  endpoints = AvailableEndpoints.get_instance()
52
54
 
55
+ agent_used = False
56
+ mcp_tool_used = False
57
+
53
58
  # Validate agent names don't conflict with flow names
54
59
  flow_names = {flow.id for flow in flows.underlying_flows}
55
60
  validate_agent_names_not_conflicting_with_flows(sub_agents.agents, flow_names)
@@ -63,11 +68,14 @@ async def initialize_agents(
63
68
  if step.is_calling_mcp_tool():
64
69
  # The call step is calling an MCP tool, so we don't need to
65
70
  # initialize any agent.
71
+ mcp_tool_used = True
66
72
  continue
67
73
 
68
74
  if not step.is_calling_agent():
69
75
  raise AgentNotFoundException(step.call)
70
76
 
77
+ agent_used = True
78
+
71
79
  agent_name = step.call
72
80
  agent_config = sub_agents.get_agent_config(agent_name)
73
81
  resolved_agent_config = resolve_agent_config(agent_config, endpoints)
@@ -79,6 +87,35 @@ async def initialize_agents(
79
87
  resolved_agent_config,
80
88
  )
81
89
 
90
+ _log_beta_feature_warning(mcp_tool_used, agent_used)
91
+
92
+
93
+ def _log_beta_feature_warning(mcp_tool_used: bool, agent_used: bool) -> None:
94
+ """Log a warning if an agent or MCP tool is used in the flow(s)."""
95
+ if mcp_tool_used:
96
+ structlogger.info(
97
+ "rasa.agents.utils.initialize_agents",
98
+ event_info="Beta Feature",
99
+ message=(
100
+ "An MCP tool is being called in at least one of the flows. "
101
+ "This feature is currently under beta development. "
102
+ "It might undergo upgrades / breaking changes in future "
103
+ "releases to graduate it to GA."
104
+ ),
105
+ )
106
+
107
+ if agent_used:
108
+ structlogger.info(
109
+ "rasa.agents.utils.initialize_agents",
110
+ event_info="Beta Feature",
111
+ message=(
112
+ "A sub-agent is being called from a flow. "
113
+ "This feature is currently under beta development. "
114
+ "It might undergo upgrades / breaking changes in future "
115
+ "releases to graduate it to GA."
116
+ ),
117
+ )
118
+
82
119
 
83
120
  def is_agent_valid(agent_id: str) -> bool:
84
121
  """Check if an agent ID references a valid agent.
@@ -107,6 +144,8 @@ def is_agent_completed(tracker: DialogueStateTracker, agent_id: str) -> bool:
107
144
  for event in reversed(tracker.events):
108
145
  if isinstance(event, AgentCompleted) and event.agent_id == agent_id:
109
146
  return True
147
+ elif isinstance(event, AgentStarted) and event.agent_id == agent_id:
148
+ return False
110
149
  return False
111
150
 
112
151
 
rasa/agents/validation.py CHANGED
@@ -84,7 +84,7 @@ def _validate_mcp_config(agent_config: AgentConfig) -> None:
84
84
  if agent_config.connections is None or agent_config.connections.mcp_servers is None:
85
85
  raise ValidationError(
86
86
  code="agent.validation.mcp.missing_connections",
87
- event_info=f"For protocol 'MCP', agent '{agent_name}' must have "
87
+ event_info=f"For protocol 'RASA', agent '{agent_name}' must have "
88
88
  "'connections.mcp_servers' configured.",
89
89
  )
90
90
 
@@ -92,7 +92,7 @@ def _validate_mcp_config(agent_config: AgentConfig) -> None:
92
92
  if not agent_config.connections.mcp_servers:
93
93
  raise ValidationError(
94
94
  code="agent.validation.mcp.empty_servers_list",
95
- event_info=f"For protocol 'MCP', agent '{agent_name}' must have "
95
+ event_info=f"For protocol 'RASA', agent '{agent_name}' must have "
96
96
  "at least one MCP server configured in 'connections.mcp_servers'.",
97
97
  )
98
98
 
@@ -101,7 +101,7 @@ def _validate_mcp_config(agent_config: AgentConfig) -> None:
101
101
  if not server.name:
102
102
  raise ValidationError(
103
103
  code="agent.validation.mcp.server_missing_name",
104
- event_info=f"For protocol 'MCP', agent '{agent_name}' MCP server "
104
+ event_info=f"For protocol 'RASA', agent '{agent_name}' MCP server "
105
105
  f"at index {i} must have a 'name' field.",
106
106
  )
107
107
 
@@ -400,7 +400,7 @@ def validate_agent_config(agent_config: AgentConfig) -> None:
400
400
  protocol = agent_config.agent.protocol
401
401
 
402
402
  # Run protocol-specific validation
403
- if protocol == ProtocolConfig.MCP:
403
+ if protocol == ProtocolConfig.RASA:
404
404
  _validate_mcp_config(agent_config)
405
405
  elif protocol == ProtocolConfig.A2A:
406
406
  _validate_a2a_config(agent_config)
@@ -99,7 +99,7 @@ class CopilotTelemetry:
99
99
  total_tokens: Optional[int] = None,
100
100
  system_message: Optional[dict[str, Any]] = None,
101
101
  chat_history: Optional[list[dict[str, Any]]] = None,
102
- last_user_message: Optional[dict[str, Any]] = None,
102
+ last_user_message: Optional[str] = None,
103
103
  ) -> None:
104
104
  """Track a copilot message in the conversation.
105
105
 
@@ -112,28 +112,44 @@ class CopilotTelemetry:
112
112
  input_tokens: Number of input tokens used (optional).
113
113
  output_tokens: Number of output tokens generated (optional).
114
114
  total_tokens: Total number of tokens used (input + output) (optional).
115
+ system_message: The system message used (optional).
116
+ chat_history: The chat history messages used (optional).
117
+ last_user_message: The last user message used (optional).
115
118
  """
116
119
  structlogger.debug("builder.telemetry.log_copilot_turn", text=text)
120
+
121
+ # FIXME: Temporarily remove the system_message from telemetry payload.
122
+ # Reason: It often exceeds Segment payload size limits, causing the request
123
+ # to be rejected and the event to be absent in Segment. Instead, temporarily
124
+ # log the system_message so it's visible in Grafana.
125
+ telemetry_data = {
126
+ "project_id": self._project_id,
127
+ "message_id": uuid.uuid4().hex,
128
+ "text": text,
129
+ "prompt_version": self._prompt_version,
130
+ "source_urls": list(source_urls),
131
+ "flags": list(flags),
132
+ "latency_ms": latency_ms,
133
+ "model": model,
134
+ "input_tokens": input_tokens,
135
+ "output_tokens": output_tokens,
136
+ "total_tokens": total_tokens,
137
+ "chat_history": chat_history,
138
+ "last_user_message": last_user_message,
139
+ "timestamp": dt.datetime.utcnow().isoformat(),
140
+ }
141
+
142
+ # Log all telemetry data plus system_message for debugging
143
+ log_data = telemetry_data.copy()
144
+ if system_message:
145
+ log_data["system_message"] = system_message
146
+
147
+ structlogger.info("builder.telemetry.copilot_turn", **log_data)
148
+
117
149
  _track(
118
150
  COPILOT_BOT_MESSAGE_EVENT,
119
151
  self._user_id,
120
- {
121
- "project_id": self._project_id,
122
- "message_id": uuid.uuid4().hex,
123
- "text": text,
124
- "prompt_version": self._prompt_version,
125
- "source_urls": list(source_urls),
126
- "flags": list(flags),
127
- "latency_ms": latency_ms,
128
- "model": model,
129
- "input_tokens": input_tokens,
130
- "output_tokens": output_tokens,
131
- "total_tokens": total_tokens,
132
- "system_message": system_message,
133
- "chat_history": chat_history,
134
- "last_user_message": last_user_message,
135
- "timestamp": dt.datetime.utcnow().isoformat(),
136
- },
152
+ telemetry_data,
137
153
  )
138
154
 
139
155
  @staticmethod
@@ -177,7 +193,7 @@ class CopilotTelemetry:
177
193
  total_tokens: int,
178
194
  system_message: dict[str, Any],
179
195
  chat_history: list[dict[str, Any]],
180
- last_user_message: dict[str, Any],
196
+ last_user_message: Optional[str],
181
197
  ) -> None:
182
198
  """Log a copilot message from the response handler.
183
199
 
rasa/builder/main.py CHANGED
@@ -22,11 +22,9 @@ from rasa.builder.logging_utils import (
22
22
  log_request_start,
23
23
  )
24
24
  from rasa.builder.service import bp, setup_project_generator
25
- from rasa.builder.template_cache import (
26
- background_download_template_caches,
27
- )
28
25
  from rasa.builder.training_service import try_load_existing_agent, update_agent
29
26
  from rasa.core.channels.studio_chat import StudioChatInput
27
+ from rasa.model_manager.warm_rasa_process import warmup
30
28
  from rasa.server import configure_cors
31
29
  from rasa.utils.common import configure_logging_and_warnings
32
30
  from rasa.utils.log_utils import configure_structlog
@@ -150,16 +148,6 @@ def create_app(project_folder: str) -> Sanic:
150
148
  except Exception as e:
151
149
  structlogger.warning("Failed to load agent on server startup", error=str(e))
152
150
 
153
- if config.HELLO_RASA_PROJECT_ID and app.ctx.project_generator.is_empty():
154
- app.register_listener(background_download_template_caches, "after_server_start")
155
- else:
156
- structlogger.debug(
157
- "builder.main.background_cache_download.disabled",
158
- event_info=(
159
- "No hello rasa project id set; skipping background cache download"
160
- ),
161
- )
162
-
163
151
  return app
164
152
 
165
153
 
@@ -200,9 +188,12 @@ def main(project_folder: Optional[str] = None) -> None:
200
188
  rasa.telemetry.initialize_telemetry()
201
189
  rasa.telemetry.initialize_error_reporting(private_mode=False)
202
190
 
203
- # TODO: don't do this when running locally
204
191
  _apply_llm_overrides_from_builder_env()
205
192
 
193
+ if config.HELLO_RASA_PROJECT_ID:
194
+ # ensures long import times for modules are ahead of time
195
+ warmup()
196
+
206
197
  # working directory needs to be the project folder, e.g.
207
198
  # for relative paths (./docs) in a projects config to work
208
199
  if not project_folder:
@@ -62,7 +62,7 @@ class ProjectGenerator:
62
62
  create_initial_project(self.project_folder.as_posix(), template)
63
63
  # If a local cache for this template exists, copy it into the project.
64
64
  # We no longer download here to avoid blocking project creation.
65
- copy_cache_for_template_if_available(template, self.project_folder)
65
+ await copy_cache_for_template_if_available(template, self.project_folder)
66
66
  # needs to happen after caching, as we download/copy .rasa and that would
67
67
  # overwrite the project info file in .rasa
68
68
  ensure_first_used(self.project_folder)
rasa/builder/service.py CHANGED
@@ -1155,6 +1155,11 @@ async def copilot(request: Request) -> None:
1155
1155
  latency_ms=int((time.perf_counter() - start_timestamp) * 1000),
1156
1156
  system_message=generation_context.system_message,
1157
1157
  chat_history=generation_context.chat_history,
1158
+ last_user_message=(
1159
+ req.last_message.get_text_content()
1160
+ if (req.last_message and req.last_message.role == ROLE_USER)
1161
+ else None
1162
+ ),
1158
1163
  **copilot_client.usage_statistics.model_dump(),
1159
1164
  )
1160
1165
  )