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

@@ -13,6 +13,10 @@ from rasa.dialogue_understanding.commands.command_syntax_manager import (
13
13
  )
14
14
  from rasa.dialogue_understanding.commands.utils import extract_cleaned_options
15
15
  from rasa.dialogue_understanding.patterns.clarify import ClarifyPatternFlowStackFrame
16
+ from rasa.dialogue_understanding.stack.frames.flow_stack_frame import (
17
+ AgentStackFrame,
18
+ AgentState,
19
+ )
16
20
  from rasa.shared.core.events import Event
17
21
  from rasa.shared.core.flows import FlowsList
18
22
  from rasa.shared.core.trackers import DialogueStateTracker
@@ -85,6 +89,12 @@ class ClarifyCommand(Command):
85
89
  if flow is not None
86
90
  ]
87
91
 
92
+ # if the top stack frame is an agent stack frame, we need to
93
+ # update the state to INTERRUPTED
94
+ if top_stack_frame := stack.top():
95
+ if isinstance(top_stack_frame, AgentStackFrame):
96
+ top_stack_frame.state = AgentState.INTERRUPTED
97
+
88
98
  stack.push(ClarifyPatternFlowStackFrame(names=names))
89
99
  return tracker.create_stack_updated_events(stack)
90
100
 
@@ -16,6 +16,7 @@ from rasa.dialogue_understanding.stack.frames.flow_stack_frame import (
16
16
  )
17
17
  from rasa.shared.core.events import AgentStarted, Event
18
18
  from rasa.shared.core.flows import FlowsList
19
+ from rasa.shared.core.flows.steps import CallFlowStep
19
20
  from rasa.shared.core.trackers import DialogueStateTracker
20
21
 
21
22
 
@@ -66,7 +67,9 @@ class RestartAgentCommand(Command):
66
67
  agent_flow_id = self._get_agent_flow(original_tracker)
67
68
 
68
69
  # create a new agent stack frame to restart the agent
69
- restart_agent_frame = self.create_restart_agent_stack_frame(agent_flow_id)
70
+ restart_agent_frame = self.create_restart_agent_stack_frame(
71
+ all_flows, agent_flow_id
72
+ )
70
73
 
71
74
  # if the stack contains an agent stack frame with status
72
75
  # "waiting for input" update the status to "interrupted"
@@ -115,15 +118,28 @@ class RestartAgentCommand(Command):
115
118
  mapper[CommandSyntaxManager.get_default_syntax_version()],
116
119
  )
117
120
 
118
- def create_restart_agent_stack_frame(self, agent_flow_id: str) -> AgentStackFrame:
119
- # Create a new AgentStackFrame for restarting the agent
120
- return AgentStackFrame(
121
- frame_id=f"restart_agent_{self.agent_id}",
122
- flow_id=agent_flow_id,
123
- step_id=f"call_{self.agent_id}",
124
- agent_id=self.agent_id,
125
- state=AgentState.WAITING_FOR_INPUT,
126
- )
121
+ def create_restart_agent_stack_frame(
122
+ self, all_flows: FlowsList, agent_flow_id: str
123
+ ) -> AgentStackFrame:
124
+ # get the agent flow
125
+ agent_flow = all_flows.flow_by_id(agent_flow_id)
126
+ if not agent_flow:
127
+ raise ValueError(f"Agent flow {agent_flow_id} not found")
128
+
129
+ # find the call flow step for the agent
130
+ # set the state to "waiting for input" so that the agent can process
131
+ # the latest user message
132
+ for step in agent_flow.steps:
133
+ if isinstance(step, CallFlowStep) and step.call == self.agent_id:
134
+ return AgentStackFrame(
135
+ frame_id=f"restart_agent_{self.agent_id}",
136
+ flow_id=agent_flow_id,
137
+ step_id=step.id,
138
+ agent_id=self.agent_id,
139
+ state=AgentState.WAITING_FOR_INPUT,
140
+ )
141
+
142
+ raise ValueError(f"Call step in agent flow {agent_flow_id} not found")
127
143
 
128
144
  def update_agent_stack_frames_on_stack(self, stack: DialogueStack) -> None:
129
145
  for frame in stack.frames:
rasa/version.py CHANGED
@@ -1,3 +1,3 @@
1
1
  # this file will automatically be changed,
2
2
  # do not add anything but the version number here!
3
- __version__ = "3.14.0.dev1"
3
+ __version__ = "3.14.0.dev2"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: rasa-pro
3
- Version: 3.14.0.dev1
3
+ Version: 3.14.0.dev2
4
4
  Summary: State-of-the-art open-core Conversational AI framework for Enterprises that natively leverages generative AI for effortless assistant development.
5
5
  Keywords: nlp,machine-learning,machine-learning-library,bot,bots,botkit,rasa conversational-agents,conversational-ai,chatbot,chatbot-framework,bot-framework
6
6
  Author: Rasa Technologies GmbH
@@ -400,7 +400,7 @@ rasa/dialogue_understanding/commands/can_not_handle_command.py,sha256=SeQysshRJi
400
400
  rasa/dialogue_understanding/commands/cancel_flow_command.py,sha256=ciHjrv6od9EWbgxdsCEwLFG5baE7fEVphawhpgCAfIs,8604
401
401
  rasa/dialogue_understanding/commands/change_flow_command.py,sha256=NnD9PM0B9o4oxTtYdcb-lDBC0-oQkbAQRB-55iYCkng,2409
402
402
  rasa/dialogue_understanding/commands/chit_chat_answer_command.py,sha256=uqQQ2BDDO9aHzhU8lWXDAC9RVd28Tctnk74jbZpd2xc,3365
403
- rasa/dialogue_understanding/commands/clarify_command.py,sha256=az0nHYoP66fdhBj4TcD1zKBcPYqtNk8KQKyW7BvEYZk,4506
403
+ rasa/dialogue_understanding/commands/clarify_command.py,sha256=F8gJk8E6peMa_QioshlOS_6enZI7LWW7_hPF6hlWivs,4896
404
404
  rasa/dialogue_understanding/commands/command.py,sha256=rhxHmllTMwvb4Uq-pDqmUdlKtu-87y8nqN5DRO-KDwE,2529
405
405
  rasa/dialogue_understanding/commands/command_syntax_manager.py,sha256=2qA2m9Z7SSjG4pFAdgKbkqJCICyanicu4wU5iw5Bs1g,1907
406
406
  rasa/dialogue_understanding/commands/continue_agent_command.py,sha256=f8qxI1oX6xIxWzYKAO-LugQSlR1_blrlF_Ch38MsjhQ,2790
@@ -413,7 +413,7 @@ rasa/dialogue_understanding/commands/knowledge_answer_command.py,sha256=3RZLK1jx
413
413
  rasa/dialogue_understanding/commands/noop_command.py,sha256=aIaLBjSV84qy9X4aGlJfMIYhF57maH5CiKNWL_-giD4,1485
414
414
  rasa/dialogue_understanding/commands/prompt_command.py,sha256=slKQkvtrM353I3gltiett5xrZ7IxQ0omdqJHi6IowGk,2569
415
415
  rasa/dialogue_understanding/commands/repeat_bot_messages_command.py,sha256=skvn6xuLswtg0_LgLQ5UaEmIg3lbnBn6ItIfpvW35G8,3065
416
- rasa/dialogue_understanding/commands/restart_agent_command.py,sha256=7MAHgfqunr3DDXsEbsiqK0jaIdfYApBsjfF9NAMaFvs,5142
416
+ rasa/dialogue_understanding/commands/restart_agent_command.py,sha256=FLghXeAu0C3rfOvr3kvJdxRPIA48jorlgGqLAi6dbg0,5780
417
417
  rasa/dialogue_understanding/commands/restart_command.py,sha256=vvmucwlVtfh6VMgdOn5hZfsP9U5HhfbDeBSG2IndX0Y,1639
418
418
  rasa/dialogue_understanding/commands/session_end_command.py,sha256=ZecUpYZDTX_68_kV1Hv4i317bbeBeVHHyhW_A7r5yzs,1770
419
419
  rasa/dialogue_understanding/commands/session_start_command.py,sha256=FA4yocMnFt5bn2dmXj48S4Pq_yTlEnOBxgK_mq-qAxg,1704
@@ -883,9 +883,9 @@ rasa/utils/train_utils.py,sha256=ClJx-6x3-h3Vt6mskacgkcCUJTMXjFPe3zAcy_DfmaU,212
883
883
  rasa/utils/url_tools.py,sha256=dZ1HGkVdWTJB7zYEdwoDIrEuyX9HE5WsxKKFVsXBLE0,1218
884
884
  rasa/utils/yaml.py,sha256=KjbZq5C94ZP7Jdsw8bYYF7HASI6K4-C_kdHfrnPLpSI,2000
885
885
  rasa/validator.py,sha256=fhRlHQvuBkiup0FnNYmwRmqQwC3QpdCJt0TuvW4jMaI,83125
886
- rasa/version.py,sha256=JzSCxiPPlvDspWQEWEAf62QItZ-CHXRTgpecMGpZgtE,122
887
- rasa_pro-3.14.0.dev1.dist-info/METADATA,sha256=WsC23HQ2UKIwEYi5w4iWY4FM8EdDe2eECh2nIY_Vj1U,10615
888
- rasa_pro-3.14.0.dev1.dist-info/NOTICE,sha256=7HlBoMHJY9CL2GlYSfTQ-PZsVmLmVkYmMiPlTjhuCqA,218
889
- rasa_pro-3.14.0.dev1.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
890
- rasa_pro-3.14.0.dev1.dist-info/entry_points.txt,sha256=ckJ2SfEyTPgBqj_I6vm_tqY9dZF_LAPJZA335Xp0Q9U,43
891
- rasa_pro-3.14.0.dev1.dist-info/RECORD,,
886
+ rasa/version.py,sha256=o7PAS756uUaUQnCkCsu5kbbkl1yiQqVXro0vyS2EXPQ,122
887
+ rasa_pro-3.14.0.dev2.dist-info/METADATA,sha256=q9kbc8p59HGydwrjc0SIxyi-XEfz77lrjCV_bumqWt0,10615
888
+ rasa_pro-3.14.0.dev2.dist-info/NOTICE,sha256=7HlBoMHJY9CL2GlYSfTQ-PZsVmLmVkYmMiPlTjhuCqA,218
889
+ rasa_pro-3.14.0.dev2.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
890
+ rasa_pro-3.14.0.dev2.dist-info/entry_points.txt,sha256=ckJ2SfEyTPgBqj_I6vm_tqY9dZF_LAPJZA335Xp0Q9U,43
891
+ rasa_pro-3.14.0.dev2.dist-info/RECORD,,