Follow-up no intent is not working and throwing MalformedResponse - node.js

I'm trying to create Action on Google using the DialogFlow. And using a concept of follow-up intent.
My Intent structure is given below,
default-fallback
default-welcome
invoice-number
|- invoice-number-no
|- invoice-number-yes
|-part-number
|-part-number-yes
|-part-number-no
I think there is no issue with my code(fulfillment) because,
I'm able to reach till "part-number" now I have two option yes and no.
(invoice-number->invoice-number-yes->part-number)
If say yes, it is working perfectly but when I say no, it is not even
calling webhook, and directly throwing MalformedResponse error.
Error:
MalformedResponse Failed to parse DialogFlow response into AppResponse
because of empty speech response.
I compared intents available in DialogFlow and intent implemented in my webhook, and it seems I implemented all intents. Still, let say I forgot to implement intent then I think, action on google lib will throw no matching intent expectation if it trys to find intent which is not implemented. But there is no such error either.
What can be a solution for this?
Thanks in advance

Related

Dialogflow ES fallback not working properly

I hope someone can help me with this one, I'm having a problem with the fallbacks.
I uploaded an image below just to illustrate how is the structure of the bot right now.
For this bot, every single intent must have a corresponding fallback, so that we can control the validation in the backend. Each intent has a parameter controlled by regex.
So the problem is: when I enter the wrong answer for the Intent 3, it should show me the Intent 3 - Fallback message, but instead it is showing me the Intent 2 - Fallback. And this is only happening with this particular intent, with the other 3 intents the fallback is working correctly.
Has anyone ever faced similar issue that can help me?
Thanks,
Chatbot structure image

Dialogflow: following up on quick reply directly to webhook

I am building a simple quiz bot with Dialogflow.
When I detect a "start of quiz", I am able to send a Quick Reply with 3 proposals, thanks to the fulfilment on the Question intent.
However, when the user clicks on one of the proposed answers, I need to have that response back to my backend so I can check the result and finally give a score, for example.
Basically, the "response-check" intent should be automatic right after the quick reply and Dialogflow should not try to understand that response.
Is there any way to easily achieve this?
Using "events" you can directly trigger an intent. Or if you are only using Dialogflow console for training, better to have an output context say "check-answer" as an input context to your answer checking intent and use the same "check-answer" as output context to all your questions intent.

Permission response not handled correctly

Following this command in node.js using the ApiAiApp module:
app.askForPermission('To know what day it is where you are',
app.SupportedPermissions.DEVICE_PRECISE_LOCATION);
I get the following in the Actions on Google Simulator.
It correctly prompts for my response, but then is confused and doesn't recognize my answer! Is there something missing or broken in my API.AI agent? After the askForPermission, there are no other fulfillment calls.
The problem is likely that you need to set an Intent that will be triggered when the permission is granted. You do this by setting the Event to actions_intent_PERMISSION.
This will look something like this:
You can set the Action to whatever makes sense for your webhook, and be sure to enable webhook fulfillment for the Intent as well.
If you need to keep track of where the permission request was initiated from, and handle it through a different Action, you can set a Context and have different handling Intents based on different Context settings.
The Fallback Intent method works because there is no better match at that point since you hadn't specified a regular Intent with actions_intent_PERMISSION. It isn't the best choice, however, since it could match other situations from your user.
The concept that I was missing is mentioned here.
All you have to do is create a child fallback intent for the intent
you are requesting permissions from.
So if you have a few intents that ask for permissions, each of them need their own fallback intent.

Creating Follow Up intent in API.AI

I am trying to create a Chatbot through API.AI. Now my chatbot has a flow and it responds based on the users query. So I have created many Follow up Intents. But my follow up intents are not connecting. It is returning the same respinse for the initial question. Where did i go wrong?
Would help to see what your intent looks like. From what you're saying though, it may be that the previous question is not getting the answer its looking for so it will just continue asking it until it does. Check your entity value under action within your intent.

wit.ai message api call from java

I am making call to wit.ai message API from java. It works and i can get the intent and entities for the message as per my story definition.
However I have doubt - when i will be adding multiple stories to my bot on wit.ai platform, i need to
use the same wit.ai URL. In that case how exactly i will extract the intents and entities from the wit response?
Message from user could be for any story message. For extracting entity value from the
wit.ai response i need to specify entity name (in json response) in my method. Lets say - entities.[0].value
Any idea how can i do that in java? Also am not getting how exactly the custom actions defined in the story has to be implemented and use in java.
I tried sample POC in node.js(by following the messenger.js file) and it works fine for custom actions defined. But am not
getting how to do it in java?
Any help/pointers in this regard greatly appreciated.
Thanks.
Even iam looking for the same. Though in the HTTP API they have given how to call conversation involving actions there is no description how to create actions with Java. It is descriptive in case of node js but not java. Let me know if you make any breakthrough. I have written to the support team yet to hear back

Resources