fix: ingore intents without responder
@@ -29,6 +29,7 @@ class Responder:
confidence = 0.0
for intent_name, intent_data in utt['annotation']['intent_catcher'].items():
if intent_data['detected'] and intent_data['confidence'] > confidence:
+ if intent_name in self.response_funcs:
response = self.response_funcs[intent_name](utt, self.intent_responses[intent_name])
# Special formatter which used in AWS Lambda to identify what was the intent
while "#+#" in response:
@@ -38,6 +39,8 @@ class Responder:
# todo: we need to know what intent was called
# current workaround is to use only one intent if several were detected
# and to append special token with intent_name
+ else:
+ self.logger.info(f'responder for intent_name: {intent_name} not found')
responses.append(response)
confidences.append(confidence)
return list(zip(responses, confidences))
