Skip to content

Commit

Permalink
refactor/simplify_session (#364)
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl authored Oct 3, 2023
1 parent 96174a3 commit 517be83
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
1 change: 1 addition & 0 deletions ovos_core/intent_services/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ def _validate_session(self, message, lang):
else:
sess.lang = lang
SessionManager.update(sess)
sess.touch()
return sess

def handle_utterance(self, message):
Expand Down
6 changes: 0 additions & 6 deletions ovos_core/intent_services/converse_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ def deactivate_skill(self, skill_id, source_skill=None, message=None):
session = SessionManager.get(message)
if session.is_active(skill_id):
# update converse session
if message:
session.update_history(message)
session.deactivate_skill(skill_id)

# keep message.context
Expand All @@ -96,8 +94,6 @@ def activate_skill(self, skill_id, source_skill=None, message=None):
if self._activate_allowed(skill_id, source_skill):
# update converse session
session = SessionManager.get(message)
if message:
session.update_history(message)
session.activate_skill(skill_id)

# keep message.context
Expand Down Expand Up @@ -263,7 +259,6 @@ def converse(self, utterances, skill_id, lang, message):

state = session.utterance_states.get(skill_id, UtteranceState.INTENT)
if state == UtteranceState.RESPONSE:
session.update_history(message)
converse_msg = message.reply("skill.converse.get_response",
{"skill_id": skill_id,
"utterances": utterances,
Expand All @@ -272,7 +267,6 @@ def converse(self, utterances, skill_id, lang, message):
return True

if self._converse_allowed(skill_id):
session.update_history(message)
converse_msg = message.reply("skill.converse.request",
{"skill_id": skill_id,
"utterances": utterances,
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ combo-lock>=0.2.2, <0.3
padacioso~=0.2, >=0.2.1a8
adapt-parser>=1.0.0, <2.0.0

ovos-bus-client<0.1.0, >=0.0.6a9
ovos-bus-client<0.1.0, >=0.0.6a10
ovos-utils<0.1.0, >=0.0.36a8
ovos-plugin-manager<0.1.0, >=0.0.24a9
ovos-config~=0.0,>=0.0.11a13
Expand Down

0 comments on commit 517be83

Please sign in to comment.