Connecting Alexa to my own NodeJS back-end - node.js

I'm back again with a question about NLP. I made my own back-end, which on one side can connect to websites, the Google Assistant and Facebook Messenger, and on the other end to Dialogflow. On the side, is logs interactions and does some other database stuff.
Now, I'm trying to connect this back-end to Alexa. I made a project which calls my endpoint. This project has one intent, which has a paramater which should get the raw user input, send it to my back-end, process it, parse and send the response to get back. I feel like there is not a real way to collect and send the raw user input, so I can process it myself (on Dialogflow) instead of using the Amazon way of mapping intents and such.
I know Dialogflow can export to Alexa, but this is not an option for me. I really hope one of you can point me in the right direction.
I just need a way to collect the raw user input, and respond in an Alexa accepted response format.
For Actions on Google for example, I'm using a Custom Project Action Package.
Thanks a lot in advace!

To accept or get any user input, you can use sys.any in google assistant and AMAZON.SearchQuery in AMAZON ALEXA.
In Alexa, You have to add the carrier phrase to use AMAZON.SearchQuery. You can't combine any other slot with AMAZON.SearchQuery.
So there are also some limitations. I hope this answer will help you.

Related

Saving and loading facebook instant game multiplayer data of the game

1) Is setting up webhook necessary to save json data of a context shared between players of context?
2) How to validate callback url for webhook on facebook developer console? My game is already live on facebook for single player. (No local testing)
3) Can I use my own personal https url to setup webhook?
No, you do not need to use the webhook to save context data. You can use XMLHttpRequest, fetch or a JavaScript SDK for a service like Playfab or Firebase to store data. In fact, we wouldn't even recommend you use a webhook for saving data because if the player turns off messages from your bot you will not receive any webhook callbacks.
You can validate a callback URL using the developer dashboard, including the "Show Recent Errors" button, which is really useful for spotting any issues. You can also get more information from the Webhooks item on the left nav.
You may need to clarify what you mean by "your own personal https url". As long as Facebook can hit your webhook URL, everything will work. You cannot, for example use a localhost URL.

Google Home: Send email when an intent is invoke

I want to send email through the Google Home when a user invokes a specific intent (using fulfillment).
Please tell me how we can achieve this.
First a clarification - your fulfillment code doesn't run on the Google Home device itself. It runs on a cloud service that you control. Since it is invoked via a web call, we sometimes call this a "webhook".
Exactly how you do this, however, will depend on your specific requirements and the specific platform you are running on. For example - do you want the email to come from the user or have the Reply-to address for the user? Do you want to get the email so you know someone has triggered the Intent so they're sending you info? What server are you running your webhook on - one that you control directly (possibly on AWS or the Google Cloud Platform) or a "serverless" resource such as AWS Lambda or Firebase Cloud Functions or something different? These are things we can't answer for you.
You will need to know how to send email for your scenario on your platform - ignoring the Actions on Google component for now. Once you know how to do that, you can integrate it with your Action.
If you're having problems, post a question with as much information as possible about what you've tried and what isn't working - including error messages or logs if possible.

How to give inputs and output responses not using dialogflow in a chatbot?

I am developing a chatbot using dialogflow for a website.
1)I wanted to know if there is other way to give inputs and output responses not using dailogflow platform , as the login is mine in the dialogflow and the officials want to use that chatbot for their site and put their inputs and outputs.
2)Can the conversation be stored in some mysql database other than storing in the history of dialogflow application?
Dialogflow doesn't "compile" to anything else, so it needs to be run on the Dialogflow servers. You can, however, export the project and the officials can create their own project and import it.
If you are using webhook fulfillment, then you can log anything you wish using the fulfillment's code. If you are just using the responses entered in Dialogflow, then no, you can't do any outside logging.

DialogFlow get data from Firebase

I recently created a smart home application using Actions on Google with DialogFlow and Firebase. A user can set a light on, for example, or lock a door. However, is there anyway I can add implementation in DialogFlow to get statuses? For example, if a user asks "Are my doors locked" to Assistant, it should say either yes or no based on the data in Firebase.
How would I approach this situation? Is this possible through DialogFlow? Any tutorials or guides would be appreciated!
You should not be using Dialogflow as the basis for your smart home application. There is a separate set of APIs which make it easy to implement Smart Home integrations without using Dialogflow or a conversational interface.
With this Smart Home platform, you can set up a webhook and use the webhook to pull this information from Firebase.
Yes, its possible. What you need is a webhook. You can call the Api in webhook to get the data from Firebase.

How to call Google Assistant API from the Dialogflow webhook?

In webhooks from Dialogflow, is there a way to trigger Google Assistant APIs, get back the result and display in Dialogflow?
Thanks.
Short answer: no. The Assistant API currently only takes voice input, and there is no way to get the user's voice in Dialogflow. In theory, you could run it through a TTS, feed that to the API, get the response back, and feed that through STT, but that seems like a pain.
What are you actually trying to do?
Google Assistant webhook will not make your bot more intelligent. You need to create right intents in your Dialogflow Agent to make it intelligent enough to do Natural Language Processing and trigger the right intent. Whatever webhook you create (Google Assistant or other) they will just work as you have coded.
In short, Dialogflow is doing the NLP stuff and making your bot intelligent and webhook will do tasks based on the identified intent or action.
To integrate GA with Dialogflow, best way would be to use NodeJS client for Action-on-Google and add it to your webhook project like require('actions-on-google').DialogflowApp
Follow the documentation and understand how to create a GA webhook for Dialogflow.
It would be better if you can explain exactly what you want to do. That way, the community members can answer your question in a better way.

Resources