aws-solutions/qnabot-on-aws

Response card is not showing when chaining rule is added.

Closed this issue · 8 comments

Describe the bug
When I am adding chaining rule in the Intent, Response Card is not displaying. It only shows Answer section and then displays next intent.

To Reproduce
Steps to reproduce the behavior.

Expected behavior
When the user asks question, bot should display Answer, then response card, then implement chaining rule(move to next intent).

Please complete the following information about the solution:

5.5.0
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".

Region: e.g. us-east-1
Was the solution modified from the version published on this repository? Yes
If the answer to the previous question was yes, are the changes available on GitHub? No
Have you checked your service quotas for the services this solution uses?
Were there any errors in the CloudWatch Logs? No
Screenshots
image
1.Before adding Chaining rule

image
2.After adding chaining rule

Additional context
Add any other context about the problem here.

Hi @preethy-1
This does not give us enough information to help. Can you please use the bug template to submit your issue - see https://github.com/aws-solutions/qnabot-on-aws/blob/main/.github/ISSUE_TEMPLATE/bug_report.md or use the new issue button in the github webpage

Updated the bug.

@preethy-1 I'm attaching an export from a qnabot with three questions that demonstrate chaining to a QID that has a response card with image that works properly. Key notes are that the response card must have a title to work properly. Hope this example helps. Could you export your questions that have the chaining problem and I can take a quick look at them?
test_chain_to_response_card_qna.json

@bobpskier Thanks for your response. I am attaching the export that is what I am looking for.
test_chain_to_response_card_qna.json

@preethy-1 The attached qna.json works correctly with chaining based on your sample. I added a second qid with the utterance "AnythingElse" that the "test response card" will chain to and added markdown to it's answer to facilitate output. The markdown was required in "AnythingElse" as the question performing the chaining also contained markdown with a hyperlink. To support markdown throughout the response chain, each qid must have markdown defined as an alternate answer. Otherwise just the plain text output will be used.

Also you should be using the full standalone version of aws-samples lex-web-ui as the internal version embedded in QnABot is not processing the response correctly. Not sure why but the embedded version always lags behind. To pickup the up-to-date version make sure to install and use https://github.com/aws-samples/aws-lex-web-ui and point this at your qnabot Lex bot. For production, the embedded test client should not be used.

I automate deployment using terraform to install both a QnABot and a LexWebUi together as a pair each time I need a new QnABot. One could also use CDK to wrap the installation of both. Destruction then of all the resources is simply a terraform destroy. Makes my life so much simpler.

Anyway the output using your qna.json will look like:

image

test_response_card_working_qna.json

@bobpskier Thanks for your detailed response. But in my case, "AnythingElse" intent in chaining rule has buttons. I've attached the screenshots above.

@preethy-1 Attached is a qna json file with a response card in AnythingElse that has an image and buttons. It works correctly for me. See screenshot below. Note that only one response card will be used. If the qid which chains to AnythingElse has a response card, it will be replaced with the response card from AnythingElse once chaining completes. Multiple response cards are not merged together. In the case where the AnythingElse does not have a response card, the original response card from the first qid will be used.

image

test_response_card_working_with_image_and_buttons.qna.json

@preethy-1
This is the expected behavior - see https://code.amazon.com/packages/Aws-ai-qna-bot/blobs/mainline/--/source/lambda/es-proxy-layer/lib/fulfillment-event/mergeNext.js
When chaining, qna skips the response card and buttons of the first answer.