Remove workaround for adapt one_of intents
This issue was properly fixed in Adapt 0.3.5.
@@ -28,20 +28,6 @@ class AdaptIntent(IntentBuilder):
super().__init__(name)
-def workaround_one_of_context(best_intent):
- """ Handle Adapt issue with context injection combined with one_of.
-
- For all entries in the intent result where the value is None try to
- populate using a value from the __tags__ structure.
- """
- for key in best_intent:
- if best_intent[key] is None:
- for t in best_intent['__tags__']:
- if key in t:
- best_intent[key] = t[key][0]['entities'][0]['key']
- return best_intent
-
-
class ContextManager:
"""Adapt Context Manager
@@ -210,11 +196,6 @@ class AdaptService:
LOG.exception(e)
if best_intent:
- try:
- best_intent = workaround_one_of_context(best_intent)
- except LookupError:
- LOG.error('Error during workaround_one_of_context')
-
self.update_context(best_intent)
skill_id = best_intent['intent_type'].split(":")[0]
return IntentMatch(
