aws-amplify / amplify-js

A declarative JavaScript library for application development using cloud services.
https://docs.amplify.aws/lib/q/platform/js
Apache License 2.0
9.42k stars 2.12k forks source link

For Interactions, AWSLexProvider.ts should send more information to the onComplete() callback #1166

Closed danilop closed 2 years ago

danilop commented 6 years ago

Do you want to request a feature or report a bug?

This is a feature request, to improve the usability of Interactions with Amazon Lex.

What is the current behavior?

For Interactions, the AWSLexProvider.ts is only reporting back data.slots to the callback function, but there is much more info that is returned by the Amazon Lex postText API, such as intentName and sessionAttributes. This is especially useful for fulfillment that not invoke a Lambda function, but return parameters to the client. In that case, currently, you only see the slots and have no way to understand which intent was selected by Amazon Lex.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than AWS Amplify.

What is the expected behavior?

I would suggest giving back to the onComplete callback all the information returned by the postText API, and not just the slots.

Which versions of Amplify, and which browser / OS are affected by this issue? Did this work in previous versions?

This behavior is in the master branch now, I am planning to propose a PR to have the expected behavior described earlier.

You can turn on the debug mode to provide more info for us by setting window.LOG_LEVEL = 'DEBUG'; in your app.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

asmiki commented 4 years ago

How can we send session variables to the interaction message? I need to pass a user id to handle a database call through lambda, but there is no way it can be done. PostText command of Amazon Lex Runtime obviously supports session variables, but that part is omitted from AWSLexProvider.ts https://docs.aws.amazon.com/lex/latest/dg/API_runtime_PostText.html

Any workaround?

asmiki commented 4 years ago

@danilop were you able to work around this?

howdyhyber commented 3 years ago

Any updates about this?

ashwinkumar6 commented 2 years ago

Hi @danilop @asmiki this feature has been merged and released. Please try out this our in the latest version and let us know