-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactored and added tests to policy
- Loading branch information
Showing
13 changed files
with
1,212 additions
and
988 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from rasa.dialogue_understanding.stack.dialogue_stack import DialogueStack | ||
from rasa.shared.exceptions import RasaException | ||
|
||
|
||
class FlowException(RasaException): | ||
"""Exception that is raised when there is a problem with a flow.""" | ||
|
||
pass | ||
|
||
|
||
class FlowCircuitBreakerTrippedException(FlowException): | ||
"""Exception that is raised when the flow circuit breaker tripped. | ||
The circuit breaker gets tripped when a flow seems to be stuck in | ||
executing steps and does not make any progress.""" | ||
|
||
def __init__( | ||
self, dialogue_stack: DialogueStack, number_of_steps_taken: int | ||
) -> None: | ||
"""Creates a `FlowCircuitBreakerTrippedException`. | ||
Args: | ||
dialogue_stack: The dialogue stack. | ||
number_of_steps_taken: The number of steps that were taken. | ||
""" | ||
super().__init__( | ||
f"Flow circuit breaker tripped after {number_of_steps_taken} steps. " | ||
"There appears to be an infinite loop in the flows." | ||
) | ||
self.dialogue_stack = dialogue_stack | ||
self.number_of_steps_taken = number_of_steps_taken |
Oops, something went wrong.