Skip to content

Commit

Permalink
fix/get_response_session
Browse files Browse the repository at this point in the history
"skill.converse.get_response.enable/disable" messages should already include the new utterance_state in their emitted session

this PR updates the session before message is emitted to account for this, ensuring the updated session is present all the way
  • Loading branch information
JarbasAl committed Nov 21, 2023
1 parent a732233 commit 6b4dd2f
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 @@ -1694,6 +1694,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 @@ -1735,6 +1737,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 6b4dd2f

Please sign in to comment.