Skip to content

Commit

Permalink
More fallback init troubleshooting
Browse files Browse the repository at this point in the history
  • Loading branch information
NeonDaniel committed Jan 2, 2024
1 parent b447535 commit 544a5d7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion neon_utils/skills/neon_fallback_skill.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,16 @@ class _MetaFB(OVOSSkill):
"""


class NeonFallbackSkill(_MetaFB, FallbackSkillV1, NeonSkill):
class _MutableFallback(type(OVOSSkill)):
""" To override isinstance checks we need to use a metaclass """

def __instancecheck__(self, instance):
if isinstance(instance, FallbackSkillV1):
return True
return super().__instancecheck__(instance)


class NeonFallbackSkill(FallbackSkillV1, NeonSkill, metaclass=_MutableFallback):
"""
Class that extends the NeonSkill and FallbackSkill classes to provide
NeonSkill functionality to any Fallback skill subclassing this class.
Expand Down

0 comments on commit 544a5d7

Please sign in to comment.