Skip to content

Commit

Permalink
implemented new flow format
Browse files Browse the repository at this point in the history
  • Loading branch information
tmbo committed Sep 21, 2023
1 parent c9397f9 commit e3f163b
Show file tree
Hide file tree
Showing 8 changed files with 377 additions and 56 deletions.
15 changes: 10 additions & 5 deletions rasa/core/policies/flow_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
from rasa.engine.storage.storage import ModelStorage
from rasa.shared.core.domain import Domain
from rasa.shared.core.generator import TrackerWithCachedStates
from rasa.shared.core.slots import Slot
from rasa.shared.core.trackers import (
DialogueStateTracker,
)
Expand Down Expand Up @@ -340,12 +339,18 @@ def _select_next_step_id(
tracker=tracker,
)
return None
if current.id != END_STEP:
# we've reached the end of the user defined steps in the flow.
# every flow should end with an end step, so we add it here.
if current.id == END_STEP:
# we are already at the very end of the flow. There is no next step.
return None
elif isinstance(current, LinkFlowStep):
# link steps don't have a next step, so we'll return the end step
return END_STEP
else:
# we are already at the very end of the flow. There is no next step.
structlogger.error(
"flow.step.failed_to_select_next_step",
step=current,
tracker=tracker,
)
return None

def _select_next_step(
Expand Down
Loading

0 comments on commit e3f163b

Please sign in to comment.