2

I'm working on a very simple Dialogflow with about 15-20 intents. All of these intents use a text response except one. The only intent that does not use a text response is called 'repeat'. The intent (repeat) should be able to repeat whatever was previously said by Google Assistant.

enter image description here

enter image description here

I've tried to set this up using Multivocal but have not been successful. When I type a command into the test simulator I'll get the initial response, but when I follow up with 'repeat' the default response of 'Not available' is returned. The webhook times out when I look at the Diagnostic Info. My sense is that I've configured something wrong because I've read these answers and not been able to solve my problem:

I'm using the inline editor within Dialogflow my index.js looks like:

const Multivocal = require('multivocal');
const conf = {
Local: {
    en: {
      Response: {
        "Action.multivocal.repeat": "Let me try again",
      }
    }
  }
};
new Multivocal.Config.Simple( conf );
exports.webhook = Multivocal.processFirebaseWebhook;
exports.dialogflowFirebaseFulfillment = Multivocal.processFirebaseWebhook;

And my package.json includes the Multivocal dependency:

"multivocal": "^0.15.0"

My understanding based on the above SO questions is that these config values would be enough and I don't need to do any coding, but I'm clearly screwing something (many things?) up. How can I get the prior response in Google Assistant to repeat when a user says 'repeat' or something similar? Multivocal seems like a simple solution, if I can do it that way.

Additional logs:

Fulfillment request (removed project id information):

{
  "responseId": "--",
  "queryResult": {
    "queryText": "repeat",
    "action": "multivocal.repeat",
    "parameters": {},
    "allRequiredParamsPresent": true,
    "fulfillmentMessages": [
      {
        "text": {
          "text": [
            ""
          ]
        }
      }
    ],
    "outputContexts": [
      {
        "name": "project info",
        "parameters": {
          "no-input": 0,
          "no-match": 0
        }
      }
    ],
    "intent": {
      "name": "project info",
      "displayName": "repeat"
    },
    "intentDetectionConfidence": 1,
    "languageCode": "en"
  },
  "originalDetectIntentRequest": {
    "payload": {}
  },
  "session": "project info"
}

Raw API response (removed project and response id)

{
  "responseId": "",
  "queryResult": {
    "queryText": "repeat",
    "action": "multivocal.repeat",
    "parameters": {},
    "allRequiredParamsPresent": true,
    "fulfillmentMessages": [
      {
        "text": {
          "text": [
            ""
          ]
        }
      }
    ],
    "intent": {
      "name": "projects info",
      "displayName": "repeat"
    },
    "intentDetectionConfidence": 1,
    "diagnosticInfo": {
      "webhook_latency_ms": 4992
    },
    "languageCode": "en"
  },
  "webhookStatus": {
    "code": 4,
    "message": "Webhook call failed. Error: DEADLINE_EXCEEDED."
  }
}

My simple intent that I've added based on the recommendation that for repeat to work on an intent it must use fulfillment and not based text response in Dialogflow

enter image description here

Here is my index.js file using the inline editor with suggestion to add text response in the config:

const conf = {
  Local: {
    en: {
      Response: {
        "Intent.help": [ 
          "I'm sorry, I'm not able to help you.",
          "You, John, Paul, George, and Ringo ey?"
        ],
        "Action.multivocal.repeat": "Let me try again"
      }
    }
  }
};

This line at the end of my index.js seems odd to me, but may be unrelated:

exports.webhook = Multivocal.processFirebaseWebhook;
exports.dialogflowFirebaseFulfillment = Multivocal.processFirebaseWebhook;
Nuke
  • 23
  • 6

1 Answers1

2

It sounds like you're triggering the Fallback Intent. You also need an Intent defined in Dialogflow that has an Action set to "multivocal.repeat". That might look something like this:

repeat intent

In the dialogflow directory of the npm package (or on github) you'll find a zip file with this and several other "standard" Intents that you can use with mulivocal.

Additionally, all the other Intents that you want to be repeated must use fulfillment to send the response (the library doesn't know what might be sent unless it can send it itself). The simplest way to do this is to enable fulfillment on each, and move the text responses from their Dialogflow screens into the configuration under an entry such as "Intent.name" (replacing "name" with the name of the Intent) or "Action.name" if you set an action name for them.

So your configuration might be something like

const conf = {
Local: {
    en: {
      Response: {
        "Intent.welcome": [
          "Hello there!",
          "Welcome to my Action!"
        ],
        "Action.multivocal.repeat": [
          "Let me try again"
        ]
      }
    }
  }
};
Prisoner
  • 49,922
  • 7
  • 53
  • 105
  • Thank you for the suggestion. I do have that intent, my apologies for not making that clear initially. I have an intent named 'repeat' with the action and parameter set to multivocal.repeat and fulfillment set to enable webhook call for this intent. I'll add screenshots to the initial question in case I may be missing something simple. Thanks again. – Nuke Jul 17 '20 at 13:21
  • Hmmm... yeah, additional screen shots or any logs will help. (And I'll go see if a bug has crept in that we didn't notice.) – Prisoner Jul 17 '20 at 13:27
  • 1
    I've updated my answer based on your comment in the question "All of these intents use a text response except one. " – Prisoner Jul 17 '20 at 14:18
  • Thanks, that's helpful! Unfortunately, I'm not able to get my intent to respond now. I'll add screenshots of a simple intent as well as my config. Thanks again for the help! – Nuke Jul 17 '20 at 15:06
  • 1
    Got it! I hadn't added the intents to Integrations -> Google Assistant popup within DialogFlow. Then, at least for me, the "Action.multivocal.repeat" : "Let me try again" needs to be within an array: "Action.multivocal.repeat": [ "Let me try again" ] – Nuke Jul 17 '20 at 19:40
  • Thank you for the help! – Nuke Jul 17 '20 at 20:13
  • On a personal note - thank you for trying multivocal, and I'm glad it meets your needs. {: – Prisoner Jul 17 '20 at 20:20