rasa-pro 3.14.0.dev1__py3-none-any.whl → 3.14.0.dev20250818__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 (147) hide show
  1. rasa/api.py +0 -5
  2. rasa/cli/arguments/default_arguments.py +0 -12
  3. rasa/cli/arguments/run.py +0 -2
  4. rasa/cli/dialogue_understanding_test.py +0 -4
  5. rasa/cli/e2e_test.py +0 -4
  6. rasa/cli/inspect.py +0 -3
  7. rasa/cli/llm_fine_tuning.py +0 -5
  8. rasa/cli/run.py +0 -4
  9. rasa/cli/shell.py +0 -3
  10. rasa/constants.py +0 -6
  11. rasa/core/actions/action.py +2 -42
  12. rasa/core/agent.py +0 -16
  13. rasa/core/available_endpoints.py +0 -30
  14. rasa/core/channels/inspector/dist/assets/{arc-2e78c586.js → arc-1ddec37b.js} +1 -1
  15. rasa/core/channels/inspector/dist/assets/{blockDiagram-38ab4fdb-806b712e.js → blockDiagram-38ab4fdb-18af387c.js} +1 -1
  16. rasa/core/channels/inspector/dist/assets/{c4Diagram-3d4e48cf-0745efa9.js → c4Diagram-3d4e48cf-250127a3.js} +1 -1
  17. rasa/core/channels/inspector/dist/assets/channel-59f6d54b.js +1 -0
  18. rasa/core/channels/inspector/dist/assets/{classDiagram-70f12bd4-7bd1082b.js → classDiagram-70f12bd4-c3388b34.js} +1 -1
  19. rasa/core/channels/inspector/dist/assets/{classDiagram-v2-f2320105-d937ba49.js → classDiagram-v2-f2320105-9c893a82.js} +1 -1
  20. rasa/core/channels/inspector/dist/assets/clone-26177ddb.js +1 -0
  21. rasa/core/channels/inspector/dist/assets/{createText-2e5e7dd3-a2a564ca.js → createText-2e5e7dd3-c111213b.js} +1 -1
  22. rasa/core/channels/inspector/dist/assets/{edges-e0da2a9e-b5256940.js → edges-e0da2a9e-812a729d.js} +1 -1
  23. rasa/core/channels/inspector/dist/assets/{erDiagram-9861fffd-e6883ad2.js → erDiagram-9861fffd-fd5051bc.js} +1 -1
  24. rasa/core/channels/inspector/dist/assets/{flowDb-956e92f1-e576fc02.js → flowDb-956e92f1-3287ac02.js} +1 -1
  25. rasa/core/channels/inspector/dist/assets/{flowDiagram-66a62f08-2e298d01.js → flowDiagram-66a62f08-692fb0b2.js} +1 -1
  26. rasa/core/channels/inspector/dist/assets/flowDiagram-v2-96b9c2cf-29c03f5a.js +1 -0
  27. rasa/core/channels/inspector/dist/assets/{flowchart-elk-definition-4a651766-dd7b150a.js → flowchart-elk-definition-4a651766-008376f1.js} +1 -1
  28. rasa/core/channels/inspector/dist/assets/{ganttDiagram-c361ad54-5b79575c.js → ganttDiagram-c361ad54-df330a69.js} +1 -1
  29. rasa/core/channels/inspector/dist/assets/{gitGraphDiagram-72cf32ee-3016f40a.js → gitGraphDiagram-72cf32ee-e03676fb.js} +1 -1
  30. rasa/core/channels/inspector/dist/assets/{graph-3e19170f.js → graph-46fad2ba.js} +1 -1
  31. rasa/core/channels/inspector/dist/assets/{index-3862675e-eb9c86de.js → index-3862675e-a484ac55.js} +1 -1
  32. rasa/core/channels/inspector/dist/assets/index-a003633f.js +1335 -0
  33. rasa/core/channels/inspector/dist/assets/{infoDiagram-f8f76790-b4280e4d.js → infoDiagram-f8f76790-3f9e6ec2.js} +1 -1
  34. rasa/core/channels/inspector/dist/assets/{journeyDiagram-49397b02-556091f8.js → journeyDiagram-49397b02-79f72383.js} +1 -1
  35. rasa/core/channels/inspector/dist/assets/{layout-08436411.js → layout-aad098e5.js} +1 -1
  36. rasa/core/channels/inspector/dist/assets/{line-683c4f3b.js → line-219ab7ae.js} +1 -1
  37. rasa/core/channels/inspector/dist/assets/{linear-cee6d791.js → linear-2cddbe62.js} +1 -1
  38. rasa/core/channels/inspector/dist/assets/{mindmap-definition-fc14e90a-a0bf0b1a.js → mindmap-definition-fc14e90a-1d41ed99.js} +1 -1
  39. rasa/core/channels/inspector/dist/assets/{pieDiagram-8a3498a8-3730d5c4.js → pieDiagram-8a3498a8-cc496ee8.js} +1 -1
  40. rasa/core/channels/inspector/dist/assets/{quadrantDiagram-120e2f19-12a20fed.js → quadrantDiagram-120e2f19-84d32884.js} +1 -1
  41. rasa/core/channels/inspector/dist/assets/{requirementDiagram-deff3bca-b9732102.js → requirementDiagram-deff3bca-c0deb984.js} +1 -1
  42. rasa/core/channels/inspector/dist/assets/{sankeyDiagram-04a897e0-a2e72776.js → sankeyDiagram-04a897e0-b9d7fd62.js} +1 -1
  43. rasa/core/channels/inspector/dist/assets/{sequenceDiagram-704730f1-8b7a76bb.js → sequenceDiagram-704730f1-7d517565.js} +1 -1
  44. rasa/core/channels/inspector/dist/assets/{stateDiagram-587899a1-e65853ac.js → stateDiagram-587899a1-98ef9b27.js} +1 -1
  45. rasa/core/channels/inspector/dist/assets/{stateDiagram-v2-d93cdb3a-6f58a44b.js → stateDiagram-v2-d93cdb3a-cee70748.js} +1 -1
  46. rasa/core/channels/inspector/dist/assets/{styles-6aaf32cf-df25b934.js → styles-6aaf32cf-3f9d1c96.js} +1 -1
  47. rasa/core/channels/inspector/dist/assets/{styles-9a916d00-88357141.js → styles-9a916d00-67471923.js} +1 -1
  48. rasa/core/channels/inspector/dist/assets/{styles-c10674c1-d600174d.js → styles-c10674c1-bd093fb7.js} +1 -1
  49. rasa/core/channels/inspector/dist/assets/{svgDrawCommon-08f97a94-4adc3e0b.js → svgDrawCommon-08f97a94-675794e8.js} +1 -1
  50. rasa/core/channels/inspector/dist/assets/{timeline-definition-85554ec2-42816fa1.js → timeline-definition-85554ec2-0ac67617.js} +1 -1
  51. rasa/core/channels/inspector/dist/assets/{xychartDiagram-e933f94c-621eb66a.js → xychartDiagram-e933f94c-c018dc37.js} +1 -1
  52. rasa/core/channels/inspector/dist/index.html +1 -1
  53. rasa/core/channels/inspector/src/components/DialogueStack.tsx +5 -7
  54. rasa/core/channels/inspector/src/helpers/formatters.ts +3 -24
  55. rasa/core/channels/inspector/src/theme/base/styles.ts +1 -19
  56. rasa/core/channels/inspector/src/types.ts +0 -4
  57. rasa/core/constants.py +0 -4
  58. rasa/core/policies/enterprise_search_policy.py +2 -4
  59. rasa/core/policies/flow_policy.py +2 -2
  60. rasa/core/policies/flows/flow_executor.py +35 -374
  61. rasa/core/processor.py +1 -6
  62. rasa/core/run.py +1 -8
  63. rasa/core/utils.py +1 -21
  64. rasa/dialogue_understanding/commands/__init__.py +0 -8
  65. rasa/dialogue_understanding/commands/cancel_flow_command.py +4 -97
  66. rasa/dialogue_understanding/commands/chit_chat_answer_command.py +0 -11
  67. rasa/dialogue_understanding/commands/knowledge_answer_command.py +0 -11
  68. rasa/dialogue_understanding/commands/start_flow_command.py +8 -129
  69. rasa/dialogue_understanding/commands/utils.py +2 -6
  70. rasa/dialogue_understanding/generator/command_parser.py +0 -4
  71. rasa/dialogue_understanding/generator/llm_based_command_generator.py +12 -50
  72. rasa/dialogue_understanding/generator/single_step/compact_llm_command_generator.py +6 -7
  73. rasa/dialogue_understanding/generator/single_step/search_ready_llm_command_generator.py +6 -7
  74. rasa/dialogue_understanding/generator/single_step/single_step_based_llm_command_generator.py +2 -41
  75. rasa/dialogue_understanding/patterns/continue_interrupted.py +1 -163
  76. rasa/dialogue_understanding/patterns/default_flows_for_patterns.yml +7 -51
  77. rasa/dialogue_understanding/stack/dialogue_stack.py +2 -123
  78. rasa/dialogue_understanding/stack/frames/flow_stack_frame.py +0 -57
  79. rasa/dialogue_understanding/stack/utils.py +2 -3
  80. rasa/dialogue_understanding_test/du_test_runner.py +2 -7
  81. rasa/e2e_test/e2e_test_runner.py +0 -5
  82. rasa/server.py +0 -10
  83. rasa/shared/constants.py +0 -5
  84. rasa/shared/core/constants.py +1 -12
  85. rasa/shared/core/domain.py +5 -5
  86. rasa/shared/core/events.py +0 -319
  87. rasa/shared/core/flows/flows_list.py +2 -2
  88. rasa/shared/core/flows/flows_yaml_schema.json +186 -101
  89. rasa/shared/core/flows/steps/call.py +5 -51
  90. rasa/shared/core/flows/validation.py +7 -45
  91. rasa/shared/core/flows/yaml_flows_io.py +3 -3
  92. rasa/shared/providers/llm/_base_litellm_client.py +7 -39
  93. rasa/shared/providers/llm/litellm_router_llm_client.py +4 -8
  94. rasa/shared/providers/llm/llm_client.py +3 -7
  95. rasa/shared/providers/llm/llm_response.py +0 -49
  96. rasa/shared/providers/llm/self_hosted_llm_client.py +4 -8
  97. rasa/shared/utils/llm.py +5 -28
  98. rasa/shared/utils/schemas/events.py +0 -42
  99. rasa/studio/upload.py +7 -4
  100. rasa/tracing/instrumentation/instrumentation.py +2 -4
  101. rasa/utils/common.py +0 -53
  102. rasa/version.py +1 -1
  103. {rasa_pro-3.14.0.dev1.dist-info → rasa_pro-3.14.0.dev20250818.dist-info}/METADATA +2 -3
  104. {rasa_pro-3.14.0.dev1.dist-info → rasa_pro-3.14.0.dev20250818.dist-info}/RECORD +107 -143
  105. rasa/agents/__init__.py +0 -0
  106. rasa/agents/agent_factory.py +0 -122
  107. rasa/agents/agent_manager.py +0 -162
  108. rasa/agents/constants.py +0 -31
  109. rasa/agents/core/__init__.py +0 -0
  110. rasa/agents/core/agent_protocol.py +0 -108
  111. rasa/agents/core/types.py +0 -70
  112. rasa/agents/exceptions.py +0 -8
  113. rasa/agents/protocol/__init__.py +0 -5
  114. rasa/agents/protocol/a2a/__init__.py +0 -0
  115. rasa/agents/protocol/a2a/a2a_agent.py +0 -51
  116. rasa/agents/protocol/mcp/__init__.py +0 -0
  117. rasa/agents/protocol/mcp/mcp_base_agent.py +0 -697
  118. rasa/agents/protocol/mcp/mcp_open_agent.py +0 -275
  119. rasa/agents/protocol/mcp/mcp_task_agent.py +0 -447
  120. rasa/agents/schemas/__init__.py +0 -6
  121. rasa/agents/schemas/agent_input.py +0 -24
  122. rasa/agents/schemas/agent_output.py +0 -26
  123. rasa/agents/schemas/agent_tool_result.py +0 -51
  124. rasa/agents/schemas/agent_tool_schema.py +0 -112
  125. rasa/agents/templates/__init__.py +0 -0
  126. rasa/agents/templates/mcp_open_agent_prompt_template.jinja2 +0 -15
  127. rasa/agents/templates/mcp_task_agent_prompt_template.jinja2 +0 -13
  128. rasa/agents/utils.py +0 -72
  129. rasa/core/available_agents.py +0 -196
  130. rasa/core/channels/inspector/dist/assets/channel-c436ca7c.js +0 -1
  131. rasa/core/channels/inspector/dist/assets/clone-50dd656b.js +0 -1
  132. rasa/core/channels/inspector/dist/assets/flowDiagram-v2-96b9c2cf-2b2aeaf8.js +0 -1
  133. rasa/core/channels/inspector/dist/assets/index-1bd9135e.js +0 -1353
  134. rasa/core/policies/flows/mcp_tool_executor.py +0 -240
  135. rasa/dialogue_understanding/commands/continue_agent_command.py +0 -91
  136. rasa/dialogue_understanding/commands/restart_agent_command.py +0 -146
  137. rasa/dialogue_understanding/generator/prompt_templates/agent_command_prompt_v2_claude_3_5_sonnet_20240620_template.jinja2 +0 -61
  138. rasa/dialogue_understanding/generator/prompt_templates/agent_command_prompt_v2_gpt_4o_2024_11_20_template.jinja2 +0 -61
  139. rasa/dialogue_understanding/generator/prompt_templates/agent_command_prompt_v3_claude_3_5_sonnet_20240620_template.jinja2 +0 -81
  140. rasa/dialogue_understanding/generator/prompt_templates/agent_command_prompt_v3_gpt_4o_2024_11_20_template.jinja2 +0 -81
  141. rasa/shared/agents/__init__.py +0 -0
  142. rasa/shared/agents/utils.py +0 -35
  143. rasa/shared/utils/mcp/__init__.py +0 -0
  144. rasa/shared/utils/mcp/server_connection.py +0 -157
  145. {rasa_pro-3.14.0.dev1.dist-info → rasa_pro-3.14.0.dev20250818.dist-info}/NOTICE +0 -0
  146. {rasa_pro-3.14.0.dev1.dist-info → rasa_pro-3.14.0.dev20250818.dist-info}/WHEEL +0 -0
  147. {rasa_pro-3.14.0.dev1.dist-info → rasa_pro-3.14.0.dev20250818.dist-info}/entry_points.txt +0 -0
@@ -1,12 +1,10 @@
1
1
  import asyncio
2
2
  import time
3
- from pathlib import Path
4
- from typing import Any, Dict, List, Optional, Union
3
+ from typing import Any, Dict, List, Optional, Text
5
4
 
6
5
  import structlog
7
6
  from tqdm import tqdm
8
7
 
9
- from rasa.core.available_agents import AvailableAgents
10
8
  from rasa.core.available_endpoints import AvailableEndpoints
11
9
  from rasa.core.channels import CollectingOutputChannel, UserMessage
12
10
  from rasa.core.exceptions import AgentNotReady
@@ -54,11 +52,10 @@ class DialogueUnderstandingTestRunner:
54
52
 
55
53
  def __init__(
56
54
  self,
57
- model_path: Optional[str] = None,
55
+ model_path: Optional[Text] = None,
58
56
  model_server: Optional[EndpointConfig] = None,
59
57
  remote_storage: Optional[StorageType] = None,
60
58
  endpoints: Optional[AvailableEndpoints] = None,
61
- sub_agents_path: Optional[Union[Path, str]] = None,
62
59
  ) -> None:
63
60
  """Initializes the Dialogue Understanding test suite runner.
64
61
 
@@ -71,7 +68,6 @@ class DialogueUnderstandingTestRunner:
71
68
  import rasa.core.agent
72
69
 
73
70
  self._check_action_server(endpoints)
74
- sub_agents = AvailableAgents.get_instance(sub_agents_path)
75
71
 
76
72
  self.agent = asyncio.run(
77
73
  rasa.core.agent.load_agent(
@@ -79,7 +75,6 @@ class DialogueUnderstandingTestRunner:
79
75
  model_server=model_server,
80
76
  remote_storage=remote_storage,
81
77
  endpoints=endpoints,
82
- sub_agents=sub_agents,
83
78
  )
84
79
  )
85
80
  if not self.agent.is_ready():
@@ -13,7 +13,6 @@ import structlog
13
13
  from tqdm import tqdm
14
14
 
15
15
  import rasa.shared.utils.io
16
- from rasa.core.available_agents import AvailableAgents
17
16
  from rasa.core.available_endpoints import AvailableEndpoints
18
17
  from rasa.core.channels import CollectingOutputChannel, UserMessage
19
18
  from rasa.core.constants import ACTIVE_FLOW_METADATA_KEY, STEP_ID_METADATA_KEY
@@ -66,7 +65,6 @@ class E2ETestRunner:
66
65
  model_server: Optional[EndpointConfig] = None,
67
66
  remote_storage: Optional[StorageType] = None,
68
67
  endpoints: Optional[AvailableEndpoints] = None,
69
- sub_agents_path: Optional[Text] = None,
70
68
  **kwargs: Any,
71
69
  ) -> None:
72
70
  """Initializes the E2E test suite runner.
@@ -96,15 +94,12 @@ class E2ETestRunner:
96
94
  if endpoints and not are_custom_actions_stubbed:
97
95
  self._action_server_is_reachable(endpoints)
98
96
 
99
- sub_agents = AvailableAgents.get_instance(sub_agents_path)
100
-
101
97
  self.agent = asyncio.run(
102
98
  rasa.core.agent.load_agent(
103
99
  model_path=model_path,
104
100
  model_server=model_server,
105
101
  remote_storage=remote_storage,
106
102
  endpoints=endpoints,
107
- sub_agents=sub_agents,
108
103
  )
109
104
  )
110
105
 
rasa/server.py CHANGED
@@ -44,7 +44,6 @@ import rasa.utils.endpoints
44
44
  import rasa.utils.io
45
45
  from rasa.constants import MINIMUM_COMPATIBLE_VERSION
46
46
  from rasa.core.agent import Agent
47
- from rasa.core.available_agents import AvailableAgents
48
47
  from rasa.core.available_endpoints import AvailableEndpoints
49
48
  from rasa.core.channels.channel import (
50
49
  CollectingOutputChannel,
@@ -694,7 +693,6 @@ def create_app(
694
693
  jwt_private_key: Optional[Text] = None,
695
694
  jwt_method: Text = "HS256",
696
695
  endpoints: Optional[AvailableEndpoints] = None,
697
- sub_agents: Optional[AvailableAgents] = None,
698
696
  is_inspector_enabled: bool = False,
699
697
  ) -> Sanic:
700
698
  """Class representing a Rasa HTTP server."""
@@ -730,7 +728,6 @@ def create_app(
730
728
  user_id="username",
731
729
  )
732
730
 
733
- app.ctx.sub_agents = sub_agents
734
731
  app.ctx.agent = agent
735
732
  # Initialize shared object of type unsigned int for tracking
736
733
  # the number of active training processes
@@ -1466,13 +1463,6 @@ def create_app(
1466
1463
  flows = await processor.get_flows()
1467
1464
  return response.json(flows.as_json_list())
1468
1465
 
1469
- @app.get("/sub-agents")
1470
- @requires_auth(app, auth_token)
1471
- async def get_sub_agents(request: Request) -> HTTPResponse:
1472
- """Get all the sub-agents currently stored by the agent."""
1473
- sub_agents = app.ctx.sub_agents
1474
- return response.json(sub_agents.as_json_list())
1475
-
1476
1466
  @app.get("/domain")
1477
1467
  @requires_auth(app, auth_token)
1478
1468
  @ensure_loaded_agent(app)
rasa/shared/constants.py CHANGED
@@ -345,8 +345,6 @@ PAYLOAD = "payload"
345
345
  # Used for LLM command generation
346
346
  ROLE_USER = "user"
347
347
  ROLE_SYSTEM = "system"
348
- ROLE_ASSISTANT = "assistant"
349
- ROLE_TOOL = "tool"
350
348
 
351
349
  # Used for key values in ValidateSlotPatternFlowStackFrame
352
350
  REFILL_UTTER = "refill_utter"
@@ -361,6 +359,3 @@ FAQ_INPUT_DATA_QUESTION_LINE_PREFIX = "Q:"
361
359
  FAQ_INPUT_DATA_ANSWER_LINE_PREFIX = "A:"
362
360
  FAQ_DOCUMENT_ENTRY_SEPARATOR = "\n\n"
363
361
  FAQ_DOCUMENT_LINE_SEPARATOR = "\n"
364
-
365
- # Constants for the MCP server
366
- KEY_TOOL_CALLS = "tool_calls"
@@ -30,7 +30,6 @@ LOOP_NAME = "name"
30
30
  ACTION_LISTEN_NAME = "action_listen"
31
31
  ACTION_RESTART_NAME = "action_restart"
32
32
  ACTION_SEND_TEXT_NAME = "action_send_text"
33
- ACTION_AGENT_REQUEST_USER_INPUT_NAME = "action_agent_request_user_input"
34
33
  ACTION_SESSION_START_NAME = "action_session_start"
35
34
  ACTION_DEFAULT_FALLBACK_NAME = "action_default_fallback"
36
35
  ACTION_DEACTIVATE_LOOP_NAME = "action_deactivate_loop"
@@ -53,16 +52,10 @@ ACTION_TRIGGER_CHITCHAT = "action_trigger_chitchat"
53
52
  ACTION_RESET_ROUTING = "action_reset_routing"
54
53
  ACTION_HANGUP = "action_hangup"
55
54
  ACTION_REPEAT_BOT_MESSAGES = "action_repeat_bot_messages"
56
- ACTION_CONTINUE_INTERRUPTED_FLOW = "action_continue_interrupted_flow"
57
- ACTION_SET_INTERRUPTED_FLOWS = "action_set_interrupted_flows"
58
- ACTION_CANCEL_INTERRUPTED_FLOW = "action_cancel_interrupted_flow"
59
- ACTION_ASK_INTERRUPTED_FLOW_TO_CONTINUE = "action_ask_interrupted_flow_to_continue"
60
55
 
61
56
  ACTION_METADATA_EXECUTION_SUCCESS = "execution_success"
62
57
  ACTION_METADATA_EXECUTION_ERROR_MESSAGE = "execution_error_message"
63
58
 
64
- ACTION_METADATA_MESSAGE_KEY = "message"
65
- ACTION_METADATA_TEXT_KEY = "text"
66
59
 
67
60
  DEFAULT_ACTION_NAMES = [
68
61
  ACTION_LISTEN_NAME,
@@ -77,7 +70,6 @@ DEFAULT_ACTION_NAMES = [
77
70
  ACTION_UNLIKELY_INTENT_NAME,
78
71
  ACTION_BACK_NAME,
79
72
  ACTION_SEND_TEXT_NAME,
80
- ACTION_AGENT_REQUEST_USER_INPUT_NAME,
81
73
  RULE_SNIPPET_ACTION_NAME,
82
74
  ACTION_EXTRACT_SLOTS,
83
75
  ACTION_CANCEL_FLOW,
@@ -90,10 +82,6 @@ DEFAULT_ACTION_NAMES = [
90
82
  ACTION_RESET_ROUTING,
91
83
  ACTION_HANGUP,
92
84
  ACTION_REPEAT_BOT_MESSAGES,
93
- ACTION_CONTINUE_INTERRUPTED_FLOW,
94
- ACTION_SET_INTERRUPTED_FLOWS,
95
- ACTION_CANCEL_INTERRUPTED_FLOW,
96
- ACTION_ASK_INTERRUPTED_FLOW_TO_CONTINUE,
97
85
  ]
98
86
 
99
87
  ACTION_SHOULD_SEND_DOMAIN = "send_domain"
@@ -148,6 +136,7 @@ DEFAULT_SLOT_NAMES = {
148
136
  FLOW_HASHES_SLOT,
149
137
  }
150
138
 
139
+
151
140
  SLOT_MAPPINGS = "mappings"
152
141
  MAPPING_CONDITIONS = "conditions"
153
142
  KEY_MAPPING_TYPE = "type"
@@ -508,8 +508,8 @@ class Domain:
508
508
  return combined
509
509
 
510
510
  def partial_merge(self, other: Domain) -> Domain:
511
- """Returns a new Domain with intersection-based merging.
512
-
511
+ """
512
+ Returns a new Domain with intersection-based merging:
513
513
  - For each domain section only overwrite items that already exist in self.
514
514
  - Brand-new items in `other` are ignored.
515
515
 
@@ -543,9 +543,9 @@ class Domain:
543
543
  return Domain.from_dict(updated_self)
544
544
 
545
545
  def difference(self, other: Domain) -> Domain:
546
- """Returns a new Domain containing items in `self` that are NOT in `other`.
547
-
548
- Simple using equality checks for dict/list items.
546
+ """
547
+ Returns a new Domain containing items in `self` that are NOT in `other`,
548
+ using simple equality checks for dict/list items.
549
549
 
550
550
  Args:
551
551
  other: The domain to compare with.
@@ -2646,325 +2646,6 @@ class FlowCancelled(SkipEventInMDStoryMixin):
2646
2646
  raise ValueError(f"Failed to parse flow_cancelled event. {e}")
2647
2647
 
2648
2648
 
2649
- class AgentCompleted(SkipEventInMDStoryMixin):
2650
- """Mark the completion of an agent."""
2651
-
2652
- type_name = "agent_completed"
2653
-
2654
- def __init__(
2655
- self,
2656
- agent_id: str,
2657
- flow_id: str,
2658
- status: Optional[str] = None,
2659
- timestamp: Optional[float] = None,
2660
- metadata: Optional[Dict[str, Any]] = None,
2661
- ) -> None:
2662
- self.agent_id = agent_id
2663
- self.flow_id = flow_id
2664
- self.status = status
2665
- super().__init__(timestamp, metadata)
2666
-
2667
- def __repr__(self) -> Text:
2668
- """Returns event as string for debugging."""
2669
- return (
2670
- f"AgentCompleted(agent: {self.agent_id}, flow: {self.flow_id}, "
2671
- f"status: {self.status})"
2672
- )
2673
-
2674
- def __str__(self) -> str:
2675
- """Returns event as human-readable string."""
2676
- return (
2677
- f"{self.__class__.__name__}({self.agent_id}, {self.flow_id}, {self.status})"
2678
- )
2679
-
2680
- def __hash__(self) -> int:
2681
- """Returns unique hash for event."""
2682
- return hash((self.agent_id, self.flow_id, self.status))
2683
-
2684
- def __eq__(self, other: Any) -> bool:
2685
- """Compares object with other object."""
2686
- if not isinstance(other, AgentCompleted):
2687
- return NotImplemented
2688
- return (self.agent_id, self.flow_id, self.status) == (
2689
- other.agent_id,
2690
- other.flow_id,
2691
- other.status,
2692
- )
2693
-
2694
- def as_dict(self) -> Dict[str, Any]:
2695
- """Returns serialized event."""
2696
- serialized = super().as_dict()
2697
- serialized.update(
2698
- {"agent_id": self.agent_id, "flow_id": self.flow_id, "status": self.status}
2699
- )
2700
- return serialized
2701
-
2702
- @classmethod
2703
- def _from_parameters(cls, parameters: Dict[str, Any]) -> "AgentCompleted":
2704
- if "agent_id" not in parameters:
2705
- raise ValueError(
2706
- "Failed to parse agent_completed event: agent_id is required"
2707
- )
2708
- if "flow_id" not in parameters:
2709
- raise ValueError(
2710
- "Failed to parse agent_completed event: flow_id is required"
2711
- )
2712
-
2713
- return AgentCompleted(
2714
- parameters["agent_id"],
2715
- parameters["flow_id"],
2716
- parameters.get("status"),
2717
- parameters.get("timestamp"),
2718
- parameters.get("metadata"),
2719
- )
2720
-
2721
-
2722
- class AgentStarted(SkipEventInMDStoryMixin):
2723
- """Mark the start of an agent."""
2724
-
2725
- type_name = "agent_started"
2726
-
2727
- def __init__(
2728
- self,
2729
- agent_id: str,
2730
- flow_id: str,
2731
- timestamp: Optional[float] = None,
2732
- metadata: Optional[Dict[str, Any]] = None,
2733
- ) -> None:
2734
- self.agent_id = agent_id
2735
- self.flow_id = flow_id
2736
- super().__init__(timestamp, metadata)
2737
-
2738
- def __repr__(self) -> str:
2739
- """Returns event as string for debugging."""
2740
- return f"AgentStarted(agent: {self.agent_id}, flow: {self.flow_id})"
2741
-
2742
- def __str__(self) -> str:
2743
- """Returns event as human-readable string."""
2744
- return f"{self.__class__.__name__}({self.agent_id}, {self.flow_id})"
2745
-
2746
- def __hash__(self) -> int:
2747
- """Returns unique hash for event."""
2748
- return hash((self.agent_id, self.flow_id))
2749
-
2750
- def __eq__(self, other: Any) -> bool:
2751
- """Compares object with other object."""
2752
- if not isinstance(other, AgentStarted):
2753
- return NotImplemented
2754
- return (self.agent_id, self.flow_id) == (other.agent_id, other.flow_id)
2755
-
2756
- def as_dict(self) -> Dict[str, Any]:
2757
- """Returns serialized event."""
2758
- serialized = super().as_dict()
2759
- serialized.update({"agent_id": self.agent_id, "flow_id": self.flow_id})
2760
- return serialized
2761
-
2762
- @classmethod
2763
- def _from_parameters(cls, parameters: Dict[str, Any]) -> "AgentStarted":
2764
- if "agent_id" not in parameters:
2765
- raise ValueError(
2766
- "Failed to parse agent_started event: agent_id is required"
2767
- )
2768
- if "flow_id" not in parameters:
2769
- raise ValueError("Failed to parse agent_started event: flow_id is required")
2770
-
2771
- return AgentStarted(
2772
- parameters["agent_id"],
2773
- parameters["flow_id"],
2774
- parameters.get("timestamp"),
2775
- parameters.get("metadata"),
2776
- )
2777
-
2778
-
2779
- class AgentInterrupted(SkipEventInMDStoryMixin):
2780
- """Mark the interruption of an agent."""
2781
-
2782
- type_name = "agent_interrupted"
2783
-
2784
- def __init__(
2785
- self,
2786
- agent_id: str,
2787
- flow_id: str,
2788
- timestamp: Optional[float] = None,
2789
- metadata: Optional[Dict[str, Any]] = None,
2790
- ) -> None:
2791
- self.agent_id = agent_id
2792
- self.flow_id = flow_id
2793
- super().__init__(timestamp, metadata)
2794
-
2795
- def __repr__(self) -> str:
2796
- """Returns event as string for debugging."""
2797
- return f"AgentInterrupted(agent: {self.agent_id}, flow: {self.flow_id})"
2798
-
2799
- def __str__(self) -> str:
2800
- """Returns event as human-readable string."""
2801
- return f"{self.__class__.__name__}({self.agent_id}, {self.flow_id})"
2802
-
2803
- def __hash__(self) -> int:
2804
- """Returns unique hash for event."""
2805
- return hash((self.agent_id, self.flow_id))
2806
-
2807
- def __eq__(self, other: Any) -> bool:
2808
- """Compares object with other object."""
2809
- if not isinstance(other, AgentInterrupted):
2810
- return NotImplemented
2811
- return (self.agent_id, self.flow_id) == (other.agent_id, other.flow_id)
2812
-
2813
- def as_dict(self) -> Dict[str, Any]:
2814
- """Returns serialized event."""
2815
- serialized = super().as_dict()
2816
- serialized.update({"agent_id": self.agent_id, "flow_id": self.flow_id})
2817
- return serialized
2818
-
2819
- @classmethod
2820
- def _from_parameters(cls, parameters: Dict[str, Any]) -> "AgentInterrupted":
2821
- if "agent_id" not in parameters:
2822
- raise ValueError(
2823
- "Failed to parse agent_interrupted event: agent_id is required"
2824
- )
2825
- if "flow_id" not in parameters:
2826
- raise ValueError(
2827
- "Failed to parse agent_interrupted event: flow_id is required"
2828
- )
2829
-
2830
- return AgentInterrupted(
2831
- parameters["agent_id"],
2832
- parameters["flow_id"],
2833
- parameters.get("timestamp"),
2834
- parameters.get("metadata"),
2835
- )
2836
-
2837
-
2838
- class AgentCancelled(SkipEventInMDStoryMixin):
2839
- """Mark the cancellation of an agent."""
2840
-
2841
- type_name = "agent_cancelled"
2842
-
2843
- def __init__(
2844
- self,
2845
- agent_id: str,
2846
- flow_id: str,
2847
- reason: Optional[str] = None,
2848
- timestamp: Optional[float] = None,
2849
- metadata: Optional[Dict[str, Any]] = None,
2850
- ) -> None:
2851
- self.agent_id = agent_id
2852
- self.flow_id = flow_id
2853
- self.reason = reason
2854
- super().__init__(timestamp, metadata)
2855
-
2856
- def __repr__(self) -> str:
2857
- """Returns event as string for debugging."""
2858
- return (
2859
- f"AgentCancelled(agent: {self.agent_id}, flow: {self.flow_id}, "
2860
- f"reason: {self.reason})"
2861
- )
2862
-
2863
- def __str__(self) -> str:
2864
- """Returns event as human-readable string."""
2865
- return (
2866
- f"{self.__class__.__name__}({self.agent_id}, {self.flow_id}, {self.reason})"
2867
- )
2868
-
2869
- def __hash__(self) -> int:
2870
- """Returns unique hash for event."""
2871
- return hash((self.agent_id, self.flow_id, self.reason))
2872
-
2873
- def __eq__(self, other: Any) -> bool:
2874
- """Compares object with other object."""
2875
- if not isinstance(other, AgentCancelled):
2876
- return NotImplemented
2877
- return (self.agent_id, self.flow_id, self.reason) == (
2878
- other.agent_id,
2879
- other.flow_id,
2880
- other.reason,
2881
- )
2882
-
2883
- def as_dict(self) -> Dict[str, Any]:
2884
- """Returns serialized event."""
2885
- serialized = super().as_dict()
2886
- serialized.update(
2887
- {"agent_id": self.agent_id, "flow_id": self.flow_id, "reason": self.reason}
2888
- )
2889
- return serialized
2890
-
2891
- @classmethod
2892
- def _from_parameters(cls, parameters: Dict[str, Any]) -> "AgentCancelled":
2893
- if "agent_id" not in parameters:
2894
- raise ValueError(
2895
- "Failed to parse agent_cancelled event: agent_id is required"
2896
- )
2897
- if "flow_id" not in parameters:
2898
- raise ValueError(
2899
- "Failed to parse agent_cancelled event: flow_id is required"
2900
- )
2901
-
2902
- return AgentCancelled(
2903
- parameters["agent_id"],
2904
- parameters["flow_id"],
2905
- parameters.get("reason"),
2906
- parameters.get("timestamp"),
2907
- parameters.get("metadata"),
2908
- )
2909
-
2910
-
2911
- class AgentResumed(SkipEventInMDStoryMixin):
2912
- """Mark the resumption of an agent."""
2913
-
2914
- type_name = "agent_resumed"
2915
-
2916
- def __init__(
2917
- self,
2918
- agent_id: str,
2919
- flow_id: str,
2920
- timestamp: Optional[float] = None,
2921
- metadata: Optional[Dict[str, Any]] = None,
2922
- ) -> None:
2923
- self.agent_id = agent_id
2924
- self.flow_id = flow_id
2925
- super().__init__(timestamp, metadata)
2926
-
2927
- def __repr__(self) -> str:
2928
- """Returns event as string for debugging."""
2929
- return f"AgentResumed(agent: {self.agent_id}, flow: {self.flow_id})"
2930
-
2931
- def __str__(self) -> str:
2932
- """Returns event as human-readable string."""
2933
- return f"{self.__class__.__name__}({self.agent_id}, {self.flow_id})"
2934
-
2935
- def __hash__(self) -> int:
2936
- """Returns unique hash for event."""
2937
- return hash((self.agent_id, self.flow_id))
2938
-
2939
- def __eq__(self, other: Any) -> bool:
2940
- """Compares object with other object."""
2941
- if not isinstance(other, AgentResumed):
2942
- return NotImplemented
2943
- return (self.agent_id, self.flow_id) == (other.agent_id, other.flow_id)
2944
-
2945
- def as_dict(self) -> Dict[str, Any]:
2946
- """Returns serialized event."""
2947
- serialized = super().as_dict()
2948
- serialized.update({"agent_id": self.agent_id, "flow_id": self.flow_id})
2949
- return serialized
2950
-
2951
- @classmethod
2952
- def _from_parameters(cls, parameters: Dict[str, Any]) -> "AgentResumed":
2953
- if "agent_id" not in parameters:
2954
- raise ValueError(
2955
- "Failed to parse agent_resumed event: agent_id is required"
2956
- )
2957
- if "flow_id" not in parameters:
2958
- raise ValueError("Failed to parse agent_resumed event: flow_id is required")
2959
-
2960
- return AgentResumed(
2961
- parameters["agent_id"],
2962
- parameters["flow_id"],
2963
- parameters.get("timestamp"),
2964
- parameters.get("metadata"),
2965
- )
2966
-
2967
-
2968
2649
  class SessionEnded(AlwaysEqualEventMixin):
2969
2650
  """Mark the end of a conversation session."""
2970
2651
 
@@ -9,7 +9,7 @@ from rasa.shared.core.flows import Flow
9
9
  from rasa.shared.core.flows.flow_path import FlowPathsList
10
10
  from rasa.shared.core.flows.validation import (
11
11
  DuplicatedFlowIdException,
12
- validate_call_steps,
12
+ validate_called_flows_exists,
13
13
  validate_flow,
14
14
  validate_link_in_call_restriction,
15
15
  validate_linked_flows_exists,
@@ -166,7 +166,7 @@ class FlowsList:
166
166
  validate_flow(flow)
167
167
  validate_nlu_trigger(self.underlying_flows)
168
168
  validate_link_in_call_restriction(self)
169
- validate_call_steps(self)
169
+ validate_called_flows_exists(self)
170
170
  validate_linked_flows_exists(self)
171
171
  validate_patterns_are_not_called_or_linked(self)
172
172
  validate_patterns_are_not_calling_or_linking_other_flows(self)