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
399 stars 252 forks source link

Redirect to different QnA instance in lambda hooks #224

Closed plkmo closed 4 years ago

plkmo commented 4 years ago

Hi,

I can't seem to find the syntax that the lambda function hook should modify in event['res'] object, in order to redirect the user to a specific QID. Can someone point it out please? Thanks.

rstrahan commented 4 years ago

Hi @plkmo - Lambda hooks are intended to be used to modify or replace the matched QID answer programatically.. They don't have a built in mechanism for redirecting to a different QID. However, you can use Document Chaining to match a new QID. A document chaining rule can be implemented as a Lambda function which can modify the event ijust like a Lambda Hook, but which can also redirect to a new QID by modifying event.req.question. See https://aws.amazon.com/blogs/machine-learning/creating-a-question-and-answer-bot-with-amazon-lex-and-amazon-alexa/#chaining

plkmo commented 4 years ago

Hi @rstrahan, thanks for your reply, I will try document chaining lambdas then.