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.
Describe the bug
There is an issue when you query for text passages while having the answer query also enabled.
They should work independently with their specific thresholds and results. However, in the current code, when the query is constructed for the text passages, the answer flag is still active/true. This leads to search results that may have been matched with the answer items instead of just the text passages.
If you have a lower threshold for text passages than for answer items and if the match is better against the answer item, then this leads to an unexpected outcome: the answer is returned to the user instead of letting the normal flow run (text passages to be compared against the threshold and then have the LLM compose the final answer).
Please complete the following information about the solution:
[x] Version: v5.4.5
To get the version of the solution, you can look at the description of the created CloudFormation stack. For example, "(SO0189) QnABot [...] v0.0.1".
[x] Region: us-east-1
[ ] Was the solution modified from the version published on this repository?
[ ] If the answer to the previous question was yes, are the changes available on GitHub?
[x] Have you checked your service quotas for the services this solution uses?
[ ] Were there any errors in the CloudWatch Logs?
Screenshots
If applicable, add screenshots to help explain your problem (please DO NOT include sensitive information).
Additional context
Add any other context about the problem here.
Describe the bug There is an issue when you query for text passages while having the answer query also enabled. They should work independently with their specific thresholds and results. However, in the current code, when the query is constructed for the text passages, the answer flag is still active/true. This leads to search results that may have been matched with the answer items instead of just the text passages. If you have a lower threshold for text passages than for answer items and if the match is better against the answer item, then this leads to an unexpected outcome: the answer is returned to the user instead of letting the normal flow run (text passages to be compared against the threshold and then have the LLM compose the final answer).
Please complete the following information about the solution:
To get the version of the solution, you can look at the description of the created CloudFormation stack. For example, "(SO0189) QnABot [...] v0.0.1".
Screenshots If applicable, add screenshots to help explain your problem (please DO NOT include sensitive information).
Additional context Add any other context about the problem here.