Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flow branching based on action output - [ENG 372] #12669

Merged
merged 8 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions data/test_trackers/tracker_moodbot.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"rasa_corrected_slots": null,
"rasa_previous_flow": null,
"requested_slot": null,
"return_value": null,
"session_started_metadata": null
},
"latest_input_channel": null,
Expand Down
2 changes: 2 additions & 0 deletions rasa/shared/core/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,14 @@
PREVIOUS_FLOW_SLOT = "rasa_previous_flow"
CANCELLED_FLOW_SLOT = "rasa_cancelled_flow"
CORRECTED_SLOTS_SLOT = "rasa_corrected_slots"
RETURN_VALUE_SLOT = "return_value"

FLOW_SLOT_NAMES = [
FLOW_STACK_SLOT,
PREVIOUS_FLOW_SLOT,
CANCELLED_FLOW_SLOT,
CORRECTED_SLOTS_SLOT,
RETURN_VALUE_SLOT,
]

# slots for knowledge base
Expand Down
3 changes: 3 additions & 0 deletions tests/core/test_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
CANCELLED_FLOW_SLOT,
PREVIOUS_FLOW_SLOT,
CORRECTED_SLOTS_SLOT,
RETURN_VALUE_SLOT,
)
from rasa.shared.core.trackers import DialogueStateTracker
from rasa.shared.exceptions import RasaException
Expand Down Expand Up @@ -249,6 +250,7 @@ async def test_remote_action_runs(
CANCELLED_FLOW_SLOT: None,
CORRECTED_SLOTS_SLOT: None,
PREVIOUS_FLOW_SLOT: None,
RETURN_VALUE_SLOT: None,
},
"events": [],
"latest_input_channel": None,
Expand Down Expand Up @@ -315,6 +317,7 @@ async def test_remote_action_logs_events(
CANCELLED_FLOW_SLOT: None,
CORRECTED_SLOTS_SLOT: None,
PREVIOUS_FLOW_SLOT: None,
RETURN_VALUE_SLOT: None,
},
"events": [],
"latest_input_channel": None,
Expand Down
1 change: 1 addition & 0 deletions tests/shared/core/test_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,7 @@ def test_domain_from_multiple_files():
"rasa_corrected_slots",
"rasa_previous_flow",
"requested_slot",
"return_value",
"session_started_metadata",
]

Expand Down
2 changes: 2 additions & 0 deletions tests/shared/importers/test_rasa.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
PREVIOUS_FLOW_SLOT,
CANCELLED_FLOW_SLOT,
CORRECTED_SLOTS_SLOT,
RETURN_VALUE_SLOT,
)
from rasa.shared.core.domain import Domain
from rasa.shared.core.slots import AnySlot
Expand All @@ -37,6 +38,7 @@ def test_rasa_file_importer(project: Text):
AnySlot(PREVIOUS_FLOW_SLOT, mappings=[{}]),
AnySlot(CANCELLED_FLOW_SLOT, mappings=[{}]),
AnySlot(CORRECTED_SLOTS_SLOT, mappings=[{}]),
AnySlot(RETURN_VALUE_SLOT, mappings=[{}]),
AnySlot(SESSION_START_METADATA_SLOT, mappings=[{}]),
]
assert domain.entities == []
Expand Down
2 changes: 2 additions & 0 deletions tests/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
CANCELLED_FLOW_SLOT,
CORRECTED_SLOTS_SLOT,
PREVIOUS_FLOW_SLOT,
RETURN_VALUE_SLOT,
)
from rasa.shared.core.domain import Domain, SessionConfig
from rasa.shared.core.events import (
Expand Down Expand Up @@ -1124,6 +1125,7 @@ async def test_requesting_non_existent_tracker(rasa_app: SanicASGITestClient):
CANCELLED_FLOW_SLOT: None,
CORRECTED_SLOTS_SLOT: None,
PREVIOUS_FLOW_SLOT: None,
RETURN_VALUE_SLOT: None,
}
assert content["sender_id"] == "madeupid"
assert content["events"] == [
Expand Down
Loading