Input types in Jovo Model for nlp.js


#1

Hi,
I’m using nlp.js as NLU integration. I have an intent in my Jovo Model that looks like this:

    {

      “name”: “GetHoursIntent”,

      “phrases”: [

          “{hours}”,

          “Ho dormito {hours}”

      ],

      “inputs”: [

        {

          “name”: “hours”,

          “type”: {

            “dialogflow”: “@sys.number”,

            “alexa”: “AMAZON.NUMBER”

          }

        }

      ]

    }

When i trigger the intent, i try to console.log(this.$inputs.hours) but it returns undefined. I think the error is in the Jovo model when i define the type of my hours parameter. I’ve seen here: https://www.jovo.tech/tutorials/lindenbaum-cognitive-voice#adding-an-nlu-service that is used:

"type": {
            "nlpjs": "...."

}

But i can’t find any documentation about the input types of nlpjs, so i dont know what to write after "nlpjs":

Is there something similar to @sys.number or AMAZON.NUMBER for nlpjs?


#2

Hi @Alberto1,

We are going to improve this in v4. Until then, this is a potential workaround: https://github.com/jovotech/jovo-starter-web-standalone/issues/5#issuecomment-866085494


#3

Hi @jan, thanks for the answer, but it doesn’t work anyways :confused:
Is this problem related to the number type, or does it persist even with other types such as time or duration?
I tried to create a custom inputType like this:

    {“name”: “hoursInputType”,
      “values”: [
        {
          “value”: “Ho dormito 5 ore”
        },
        {
          “value”: “3 ore”
        }
      ]
    },

This way, without using your workaround, i surely get my console.log(this.$inputs.hours), but i should add all the possible value combination in my hoursInputType
So is there a problem with the “non-custom” type?
(I’m using Jovo web platform)


#4

Facing the same problem here. I raised that issue on the repo and have since updated it with all the logs and everything I’ve tried. I did get it to work to an extent. There’s a limitation that it doesn’t appear to support more than one slot/parameter of the same type. I also haven’t tried dates yet.