Remove workaround for adapt one_of intents

This issue was properly fixed in Adapt 0.3.5.
pull/2599/head
Åke Forslund 2020-07-10 08:20:08 +02:00
parent 008ab372fd
commit 917127638b
1 changed files with 0 additions and 19 deletions

View File

@ -28,20 +28,6 @@ class AdaptIntent(IntentBuilder):
super().__init__(name) 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: class ContextManager:
"""Adapt Context Manager """Adapt Context Manager
@ -210,11 +196,6 @@ class AdaptService:
LOG.exception(e) LOG.exception(e)
if best_intent: 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) self.update_context(best_intent)
skill_id = best_intent['intent_type'].split(":")[0] skill_id = best_intent['intent_type'].split(":")[0]
return IntentMatch( return IntentMatch(