aws-solutions / qnabot-on-aws

AWS QnABot is a multi-channel, multi-language conversational interface (chatbot) that responds to your customer's questions, answers, and feedback. The solution allows you to deploy a fully functional chatbot across multiple channels including chat, voice, SMS and Amazon Alexa.
https://aws.amazon.com/solutions/implementations/aws-qnabot
Apache License 2.0
391 stars 251 forks source link

Adds a session attribute to count missed utterances #732

Open richhaase opened 4 months ago

richhaase commented 4 months ago

Issue #, if available:

Description of changes:

This PR adds a session attribute that counts the number of consecutive missed utterances. This information allows us to exhibit different behavior depending on how many times a user asks a question that the QnA Bot is unable to answer.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

abhirpat commented 3 months ago

Thank you for your submission @richhaase. Could you please elaborate where and how you are using this information ? Have you had a chance to explore OpenSearch Dashboards for chat usage information like No Hits response satisfy your requirements?

abhirpat commented 2 months ago

Hi @richhaase, following-up on my previous message. Currently, no_hits are displayed in OpenSearch Dashboards > QnABot Dashboard > No hits. If you're still needing this, please elaborate the use-case.

israelias commented 2 months ago

You can also just consider adding a lambda to the no_hits module that does the same thing plus more, in case you're trying to timeout and/or super-error-handle false on qnabot_gotanswer. But also consider how/why/when you would clear the count in case Kendra fallback is plugged to play as a feature on tie breaker, where every answer is not a hit -- to name one potential side effect to drill through. In any case I think your numerics have to be set as string values for sessionAttributes