How can I manage suicidal intents using actions-on-google npm package - node.js

My setup:
I'm using actions-on-google to create a custom action for google assistant, every intent is a fallback in dialogflow that is then redirected to my server where I check the intent with a custom nlp engine and then respond to it, using the actions-on-google package.
The issue:
But when an intent is suicidal, for example: "I want to kill myself", google stop the action and give a response instead of letting my custom action handle it. Is there a way to avoid this?, it also happens with certain words like "Save" in that case google stop the action and ask me if I want to save an event or whatnot.
Can I override this behavior?

You're running into a "feature" that Google calls "no-match yielding". In some cases, if you're using a Fallback Intent in Dialogflow, and the Google Assistant itself can handle the question - it will do so.
To avoid this you can use regular Intents that match the #sys.any System Entity.
However, if all you're doing for everything is sending it to your NLU, then you don't need to be using Dialogflow at all. You can just use the Actions on Google v2 to send all TEXT Intents to your NLU for processing.

Related

DialogFlow "preview intent" without causing fulfilment

Is there a way to preview the intent response with confidence score without actually triggering parameters to be filled, possible fulfilment web hooks to be called, etc.
I know Amazon Lex has a "preview intent" call that lets you preview what the response might be before actually doing the official call for a response/fulfillment.
I'm trying to be able to filter the the responses from multiple bots and choose the one with the highest confidence score and I don't want to trigger fulfilment for any bot that isn't going to be used in the dialog.
Dialogflow as of today, does not provide an option to predict the response of an intent before it is being triggered.
Dialogflow ES has Intent matching, and you might be able to do something like the next-best-intents solution, if that helps.

Intent clashes with the Google Adapter

Any questions that are general seems to quit the actions and provides a result from the Google Assistant itself. The sample utterances are given below:
Check my calendar / Check my emails / What is covid
Have anyone faced this issue before and have a potential solution?
This is likely because you are handling those questions using a Fallback Intent. A recent change with how Actions on Google works means that the Assistant will close your Action and handle the user statement itself under these conditions:
You are handling it through a Fallback Intent in Dialogflow or through a No Match Intent in Action Builder and
The phrase is one that the Assistant can handle itself
You don't get any indication that it is doing so.
To work around this problem, you should use an Intent that matches a phrase with the the #sys.any type in Dialogflow or an intent that accepts "free form text" using Action Builder.

Dialogflow Show welcome text without user action

I am trying to show welcome text when user initiates the chat i.e. without any action from user. How to achieve this?
I tried NPM dialog flow or #google-cloud/dialogflow to detect intent to trigger the intent using node.js. It is sending the query and showing the fullfillment text in console but not on updating the UI like when user interact with bot.
Thanks.
If you're using Actions on Google, then your welcome Intent will be called when your Action is first invoked. The user wouldn't say anything besides "talk to action name".
Using the Actions on Google test emulator, this is provided as a button.
If you're using the Dialogflow tester on the right side of Dialogflow, you need to enter one of the invocation phrases for the Welcome Intent, but these phrases aren't typically used as part of the Action itself.

Triggering next intent without user input in Dialogflow

I'm building my first chatbot using Dialogflow. During my chat sessions, I would like to move on from one intent to another, without having user input in between. This can be seen in this image on Imgur.
The layout of the chat so far can be seen here.
I'm supposed to move from showing the video or article directly to "allright has your car..." without any user input, but I don't seem to be able to. How do I solve this?
I've tried using in and output contexts, but that didn't seem to work.
Thanks in advance!
Events can be triggered through Dialogflow fulfillment or the
detect intent API. These events can be handled in your Dialogflow agent or in fulfillment.
Check documentation here: Dialogflow Events
This means you will need to programmatically do this

It's possible to create one-shoot app with Actions on Google?

I am completely new to the "Actions on Google" world, but following some tutorials (like this) i have already achieved good results.
My test
With Google Assistant and/or Google Home mini send my commands to a personal nodejs online server.
To do this:
i have created a new project on https://console.actions.google.com/
selected conversational option
selected create action / custom intent option
from Dialogflow i have personalized the Default Welcome Intent and created a new Intent with the Fulfillment option set to Enable webhook call for this intent
And obviously, from Dialogflow > Fulfillment, i have enabled the Webhook option (with the url of my nodejs app), and not the Inline editor.
This procedure works, when my app recognizes my custom intent, the answer is sent to my nodejs app online.
My problem
The procedure works, but i always have to do 2 steps before i can perform my action:
1) Hey Google, talk with "nameofmyapp"
2) Say the command
My goal
Execute my command directly without always having to do this 2 steps.
Absolutely! Google calls this "deep linking". With this, you'll be able to do something like
Hey Google, ask nameof myapp to command
See the documentation for details, but in short you'll
Make sure you have an Intent for the command in Dialogflow, with several possible phrases that can be used to trigger it.
These phrases should be what you'd say under "command" in the example above - you'd omit the "to" part.
Go to the Integrations section in Dialogflow, under the Google Assistant integration.
In the Implicit invocation section, select the Intent that you'd like to allow as a deep-linked Intent.
If the command takes action and then should quit, make sure either you have set this in Dialogflow or your fulfillment calls app.close();

Resources