Can someone help me make this sample work or point out where am I going wrong ??? Cant figure out myself after lots of tries.
I think this final call
agent.handleRequest(intentMap)
is failing somewhere .
let payload ={
"expectUserResponse": true,
"richResponse": {
"items": [
{
"intent": "actions.intent.PERMISSION",
"inputValueData": {
"@type": "type.googleapis.com/google.actions.v2.PermissionValueSpec",
"optContext": "To address you by name and know your location",
"permissions": [
"NAME",
"DEVICE_PRECISE_LOCATION"
]
}
}
]
},
"userStorage": "{\"data\":{}}"
};
agent.add(new Payload(PLATFORMS.ACTIONS_ON_GOOGLE, payload));
@omfd Have you found something ?
I tried to ask Actions permissions by doing :
const conv = agent.conv();
const options = {
context: 'Par raison de s茅curit茅',
permissions: ['NAME', 'DEVICE_COARSE_LOCATION'],
};
conv.ask(new Permission(options));
agent.add(conv);
But it gives me an "[MalformedResponse] expected_inputs[0].input_prompt.rich_initial_prompt: 'item[0]' must not be empty." similar to yours I think.
Returning simple response works perfectly great but as soon as it is more than that, it fails...
(as mentionned in other thread, my actions-on-google version is the same as this one)
@Gillariel currently I am finding the agent.conv() method is not serializing the response object correctly to the standard accepted by actions-on-google library. I am bypassing the step by using custom payloads like above mentioned but they too are giving me slight issue in the case of permissions. Other things are working decently. The MalformedResponse is the issue of incorrect Reponse object
In shorts, I am also stuck with the same issue currently so sorry :(
@omfd Damn it's annoying :/
I've no time to work on this right now so if you find anything, keep me updated !
Thx :)
The proper payload response to ask for user permissions for v2 is:
{
"expectUserResponse": true,
"systemIntent": {
"intent": "actions.intent.PERMISSION",
"data": {
"@type": "type.googleapis.com/google.actions.v2.PermissionValueSpec",
"optContext": "To deliver your order",
"permissions": [
"NAME",
"DEVICE_PRECISE_LOCATION"
]
}
}
}
and for v1 is
{
"expectUserResponse": true,
"systemIntent": {
"intent": "actions.intent.PERMISSION",
"data": {
"@type": "type.googleapis.com/google.actions.v2.PermissionValueSpec",
"optContext": "To deliver your order",
"permissions": [
"NAME",
"DEVICE_PRECISE_LOCATION"
]
}
}
}
You can find JSON examples of Actions on Google payloads here: https://github.com/dialogflow/fulfillment-webhook-json/tree/master/responses
@matthewayne , as mentioned by @omfd here:
currently I am finding the agent.conv() method is not serializing the response object correctly to the standard accepted by actions-on-google library.
Is this a known issue? If not, is there something wrong with the Actions-On-Google Sample that's present here?
@SiddAjmera This was fixed in https://github.com/dialogflow/dialogflow-fulfillment-nodejs/pull/29 and will be published to npm in the next release
Most helpful comment
@Gillariel currently I am finding the agent.conv() method is not serializing the response object correctly to the standard accepted by actions-on-google library. I am bypassing the step by using custom payloads like above mentioned but they too are giving me slight issue in the case of permissions. Other things are working decently. The MalformedResponse is the issue of incorrect Reponse object
In shorts, I am also stuck with the same issue currently so sorry :(