yopablo
yopablo

Reputation: 68

Exception when intergrating DialogflowConversation with Fulfillment SDK

I am using the Node.js Fulfillment SDK (https://github.com/dialogflow/dialogflow-fulfillment-nodejs) and I want to integrate de DialogflowConversation in order to access to the user storage.

I am trying to use this simple code:

let conv = agent.conv();
conv.ask("HEY");
agent.add(conv);

But the server is failing with this exception:

Error: No responses defined for platform: ACTIONS_ON_GOOGLE
    at V2Agent.sendResponses_ (/srv/node_modules/dialogflow-fulfillment/src/v2-agent.js:243:13)
    at WebhookClient.send_ (/srv/node_modules/dialogflow-fulfillment/src/dialogflow-fulfillment.js:505:17)
    at promise.then (/srv/node_modules/dialogflow-fulfillment/src/dialogflow-fulfillment.js:316:38)
    at <anonymous>
    at process._tickDomainCallback (internal/process/next_tick.js:228:7)

I am currently using this libs:

"dependencies": {
    "firebase-admin": "^5.13.1",
    "firebase-functions": "^2.0.2",
    "dialogflow-fulfillment": "^0.6.1",
    "actions-on-google": "^2.5.0",
    "i18n": "^0.8.3"
  }

What am I doing wrong?

Thanks

Upvotes: 1

Views: 815

Answers (2)

Dennis Alund
Dennis Alund

Reputation: 3159

Check the similarly looking issues #151 and #160 in the dialogflow-fulfillment-nodejs github repo. It seems to be addressing your problem. Perhaps you could chime in there and provide insights or temporarily use the branch that might have fixed your issue: https://github.com/dialogflow/dialogflow-fulfillment-nodejs/commit/c5f1555e05d4abbc20dd9b39f6edf88249fe4aa1 (referred to in PR #179)

npm install --save dialogflow/dialogflow-fulfillment-nodejs#c5f155

If you're only planning to support Google Assistant as an integration, it's better to use the actions-on-google SDK. It has a richer support for responses and interactions.

Upvotes: 1

Sairaj Sawant
Sairaj Sawant

Reputation: 1842

I guess this is what you are doing, resulting in the stated error. Try using only actions-on-google.

This should solve your error:

agent.add("HEY");

and for accessing user storage use the actions-on-google library like below:

'use strict';
const {
  dialogflow,
} = require('actions-on-google'); // Import the firebase-functions package for deployment.
const functions = require('firebase-functions'); // Instantiate the Dialogflow client.
const app = dialogflow({
  debug: true
});

app.intent('WELCOME', (conv) => {

  conv.data.count = 1;
  conv.ask('Hi there, what can I help you with today?');

});

Upvotes: 1

Related Questions