0
votes

I created a simple bot to test some new resources, but I'm facing an issue with fulfillment responses on some clients. I'm testing with many integrations.

  • ✅ The fulfillment work fine with: Web Demo and Dialogflow Messenger
  • ???? The fulfillment fails with: Facebook Messenger, Slack and Telegram

I wrote two intents to test:

  1. "Hello" - Text Response Intent
  2. "Hi" - Fulfillment Intent answered by node using actions-on-google package.

What happened:

  • "Hello" - intent works on all integrations, like expected.
  • "Hi" - intent works like expected with Dialogflow native integrations (✅ )
  • "Hi" - intent doesn't work with other integrations (????), but it shows "Typing..." while my node backend creates the answer, but the text response is never showed.

  • In debug mode, I see that the request is received, the intent match, and the Response object are like expected.

Node code:

const { dialogflow } = require('actions-on-google');
const app = dialogflow({ debug: true });

... 

app.intent('Hi', conv => {
  console.log('>> Hi Fulfillment reached');
  conv.ask(`Hi! I'm a fulfillment response on node!`);
});

Node response (console output):

>> Hi Fulfillment reached
Response {
  "status": 200,
  "headers": {
    "content-type": "application/json;charset=utf-8"
  },
  "body": {
    "payload": {
      "google": {
        "expectUserResponse": false,
        "richResponse": {
          "items": [
            {
              "simpleResponse": {
                "textToSpeech": "Hi! I'm a fulfillment response on node!"
              }
            }
          ]
        }
      }
    }
  }
}
POST /api/chatBot/ 200 156 - 1419.611 ms

I recorded my screen to show better that behavior.

enter image description here

Any help is appreciated!

1
Just as a heads up, you are building a dialogflow bot for multiple channels using the actions-on-google package. This package is intended for building just google assistant bot with Dialogflow. I know that it is possible to build bots for other platforms like slack and facebook with that library, but it is better to use the Dialogflow fulfillment library, it is ment for building bots accross multiple platforms using Dialogflow: npmjs.com/package/dialogflow-fulfillmentJordi
Thank you @Jordi for the quick answer. I didn't know that actions-on-google package doesn't work with other integrations. I will try your suggestion right now. Thank you.Tiago Gouvêa
It worked @Jordi. But I just realized that my code should handle different agents "manually". The answer with card that works for telegram will not work with assistant. The sessionEntities that works with assistant doesn't work with telegram.. and so on. But ok. Thank you for your help. Really appreciate it.Tiago Gouvêa
Ah okay, I knew it could fix some issues, but I wasn't sure it would also solve this. I'll post it as an answerJordi

1 Answers

1
votes

You are using the actions-on-google nodeJS library. This library is used to build bots on the Actions on Google platform using Dialogflow. You can use it to build some basic things for other integrations, but you might run into limitations as it is build specifically for Google Assistant.

If you want to build bots for multiple integrations of Dialogflow it is better to use the dialogflow fulfillment library. This is ment for building chatbots for multiple integrations for Dialogflow.

https://www.npmjs.com/package/dialogflow-fulfillment