Dialogflow wants negative examples for the default fallback intent

dialogflow

#1

I created a jovo project, based on the ‘hello world’ example. After building, and deploying to dialogflow i get validation warnings (see screendump).

Should the negative examples be in the defaultintents? I think they be in the jovo language model? in the language model of the example there are indeed two ‘phrases’: cancel and stop, but they dont seem to end up in dialogflow. (even though they show up in the build file) so i assume format is incorrect (maybe google changed it?)

I also noticed the format dialogflow exports is quite different form what jovo build creates, so can’t really use the dialogflow export as an example of what should be generated at the moment…

so: how do we make sure the negative examples show up in dialogflow?


#2

Hey @robbertw! Welcome to the community forum.

The Jovo Language Model is an abstraction of all platform specific language models (Dialogflow, Alexa, etc.) that we support. The exported language model from Dialogflow looks different, but it can be converted into the Jovo Model with jovo build --reverse

Nevertheless, there are features which can’t be abstracted nicely. The Default Fallback Intent is one of those. Such things can be added in the dialogflow-property in the Jovo Language Model, as you can see after installing our helloworld template. You can add the negative phrases by adding a Dialogflow specific userSays property. Here’s an example:

{
        "name": "Default Fallback Intent",
        "auto": true,
        "webhookUsed": true,
        "fallbackIntent": true,
        "userSays": [
          {
            "data": [
              {
                "text": "foo",
                "userDefined": false
              }
            ],
            "isTemplate": false
          },
          {
            "data": [
              {
                "text": "bar",
                "userDefined": false
              }
            ],
            "isTemplate": false
          }
        ]
      },

in the language model of the example there are indeed two ‘phrases’: cancel and stop, but they dont seem to end up in dialogflow.

What example do you mean?


Google assistant validation errors on entities
#3

Thanks for the clear explanation.

Sorry the example that wasn’t clear: i meant the ‘hello world’ example, it has 2 phrases for Dialogflow’s default fallback intent, but they don’t seem to be imported into dialogflow…

  "dialogflow": {
    "intents": [
      {
        "name": "Default Fallback Intent",
        "auto": true,
        "webhookUsed": true,
        "fallbackIntent": true,
        "phrases": [ "cancel", "stop" ]
      },
      {
        "name": "Default Welcome Intent",
        "auto": true,
        "webhookUsed": true,
        "events": [
          {
            "name": "WELCOME"
          }
        ]
      }
    ]
  }

Your explanation confirms what I was thinking: these Dialogflow specific phrases should be exported / imported to the dialogflow project

I was looking for documentation on the ZIP file format: not much to be found online so far. And the export format - that could be of help - seems quite different from what Jovo is generating (and is working nicely too)

Looks like the ‘phrases’ from the example should be changed to 'userSays’as in your example, do you agree?


#4

Looks like the ‘phrases’ from the example should be changed to 'userSays’as in your example, do you agree?

Yes, but make sure it’s not just a string array.

...
{
            "data": [
              {
                "text": "bar",
                "userDefined": false
              }
            ],
            "isTemplate": false
          }
...

#5

I just tested changing the ‘phrases’ to your ‘userSays’ example, and that seems to work! (although i first forgot to run jovo build, and had to wait for a while and hard refresh the dialogflow page after the jovo deploy)

And no simple string array any more of course :wink:

thanks for your help.


#6

ok. I found the templates in the jovo-templates repo. Looks like the ‘cancel’ and ‘stop’ phrases were not there, so I’m not exactly sure where they came from. Probably i’ve added them myself :wink:

I’d like to create a Pull Request to add those two words for all dialogflow specific configs in all templates. Is this a good idea? If so: is there a way/check/test to keep them all in sync? There are 25 of them, and all in a JS and TS version…


#7

Created pull request: https://github.com/jovotech/jovo-templates/pull/55


#8

Thank you! I posted a reply on Github