Skip to content

Commit

Permalink
add tests for default action
Browse files Browse the repository at this point in the history
  • Loading branch information
ancalita committed Sep 20, 2023
1 parent a55303a commit 5862afe
Show file tree
Hide file tree
Showing 3 changed files with 424 additions and 6 deletions.
6 changes: 3 additions & 3 deletions rasa/core/actions/action_run_slot_rejections.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ async def run(
condition = rejection.if_
utterance = rejection.utter

rendered_template = Template(condition).render(current_context)
predicate = Predicate(rendered_template)
try:
rendered_template = Template(condition).render(current_context)
predicate = Predicate(rendered_template)
violation = predicate.evaluate(document)
structlogger.debug(
"collect.predicate.result",
Expand All @@ -87,7 +87,7 @@ async def run(
except (TypeError, Exception) as e:
structlogger.error(
"collect.predicate.error",
predicate=predicate,
predicate=condition,
document=document,
error=str(e),
)
Expand Down
3 changes: 0 additions & 3 deletions rasa/shared/core/flows/flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1000,9 +1000,6 @@ def from_dict(rejection_config: Dict[Text, Any]) -> SlotRejection:
Returns:
The parsed slot rejection.
"""
structlogger.debug(
"flow.slot_rejection.from_dict", rejection_config=rejection_config
)
return SlotRejection(
if_=rejection_config.get("if"),
utter=rejection_config.get("utter"),
Expand Down
Loading

0 comments on commit 5862afe

Please sign in to comment.