Skip to content

Commit

Permalink
fix/get_response_session (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl authored Nov 21, 2023
1 parent d4216c1 commit dfac136
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ovos_workshop/skills/ovos.py
Original file line number Diff line number Diff line change
Expand Up @@ -1702,6 +1702,8 @@ def get_response(self, dialog: str = '', data: Optional[dict] = None,
data = data or {}

session = SessionManager.get(message)
session.enable_response_mode(self.skill_id)
message.context["session"] = session.serialize()
self.__responses[session.session_id] = []
self.bus.emit(message.forward("skill.converse.get_response.enable",
{"skill_id": self.skill_id}))
Expand Down Expand Up @@ -1743,6 +1745,9 @@ def validator_default(utterance):
# from the killable thread and returns the answer
ans = self._wait_response(is_cancel, validator, on_fail_fn,
num_retries, message)

session.disable_response_mode(self.skill_id)
message.context["session"] = session.serialize()
self.bus.emit(message.forward("skill.converse.get_response.disable",
{"skill_id": self.skill_id}))
return ans
Expand Down

0 comments on commit dfac136

Please sign in to comment.