Skip to content

Commit

Permalink
@coderabbitai suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Oct 31, 2024
1 parent f941f4c commit 74e18d2
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions ovos_core/intent_services/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from typing import Tuple, Callable, Union, Dict, List
from collections import defaultdict
from typing import Tuple, Callable, Union

from ocp_pipeline.opm import OCPPipelineMatcher
from ovos_adapt.opm import AdaptPipeline as AdaptService
Expand Down Expand Up @@ -90,7 +91,7 @@ def __init__(self, bus, config=None):
self.bus.on('intent.service.padatious.entities.manifest.get', self.handle_entity_manifest)

# internal, track skills that call self.deactivate to avoid reactivating them again
self._deactivations: Dict[str, List[str]] = {}
self._deactivations = defaultdict(list)
self.bus.on('intent.service.skills.deactivate', self._handle_deactivate)

@property
Expand Down Expand Up @@ -355,10 +356,7 @@ def _handle_deactivate(self, message):
"""
sess = SessionManager.get(message)
skill_id = message.data.get("skill_id")
if sess.session_id not in self._deactivations:
self._deactivations[sess.session_id] = [skill_id]
else:
self._deactivations[sess.session_id].append(skill_id)
self._deactivations[sess.session_id].append(skill_id)

def _emit_match_message(self, match: Union[IntentHandlerMatch, PipelineMatch], message: Message):
"""Update the message data with the matched utterance information and
Expand Down

0 comments on commit 74e18d2

Please sign in to comment.