Allowing to clear the turn analyser
This commit is contained in:
@@ -78,3 +78,8 @@ class BaseTurnAnalyzer(ABC):
|
|||||||
EndOfTurnState: The result of the end of turn analysis.
|
EndOfTurnState: The result of the end of turn analysis.
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def clear(self):
|
||||||
|
"""Reset the turn analyzer to its initial state."""
|
||||||
|
pass
|
||||||
|
|||||||
@@ -98,6 +98,9 @@ class BaseSmartTurn(BaseTurnAnalyzer):
|
|||||||
logger.debug(f"End of Turn result: {state}")
|
logger.debug(f"End of Turn result: {state}")
|
||||||
return state, result
|
return state, result
|
||||||
|
|
||||||
|
def clear(self):
|
||||||
|
self._clear(EndOfTurnState.COMPLETE)
|
||||||
|
|
||||||
def _clear(self, turn_state: EndOfTurnState):
|
def _clear(self, turn_state: EndOfTurnState):
|
||||||
# If the state is still incomplete, keep the _speech_triggered as True
|
# If the state is still incomplete, keep the _speech_triggered as True
|
||||||
self._speech_triggered = turn_state == EndOfTurnState.INCOMPLETE
|
self._speech_triggered = turn_state == EndOfTurnState.INCOMPLETE
|
||||||
|
|||||||
Reference in New Issue
Block a user