Jovo platform web - input


#22

Hi Leo

I have the same problem with you. Did you solve this problem “Could not find the route “None” in your handler function.”. I would like a custom input

My model

{ "invocation": "my test app", "intents": [ { "name": "HelloWorldIntent", "phrases": ["hello", "say hello", "say hello world"] }, { "name": "MyNameIsIntent", "phrases": ["{name}", "my name is {name}", "i am {name}", "you can call me {name}"], "inputs": [ { "name": "name", "type": { "alexa": "AMAZON.US_FIRST_NAME", "dialogflow": "@sys.given-name", "nlpjs": "text" } } ] } ], "alexa": { "interactionModel": { "languageModel": { "intents": [ { "name": "AMAZON.CancelIntent", "samples": [] }, { "name": "AMAZON.HelpIntent", "samples": [] }, { "name": "AMAZON.StopIntent", "samples": [] } ] } } }, "dialogflow": { "intents": [ { "name": "Default Fallback Intent", "auto": true, "webhookUsed": true, "fallbackIntent": true }, { "name": "Default Welcome Intent", "auto": true, "webhookUsed": true, "events": [ { "name": "WELCOME" } ] } ] } }

my app.js

`‘use strict’;
const { App } = require(‘jovo-framework’);
const { Alexa } = require(‘jovo-platform-alexa’);
const { GoogleAssistant } = require(‘jovo-platform-googleassistant’);
const { JovoDebugger } = require(‘jovo-plugin-debugger’);
const { FileDb } = require(‘jovo-db-filedb’);
const { WebPlatform } = require(‘jovo-platform-web’);
const { NlpjsNlu } = require(‘jovo-nlu-nlpjs’);
const { BuiltinDefault } = require(’@nlpjs/builtin-default’);
const { LangEn } = require(’@nlpjs/lang-en’);

console.log(‘This template uses an outdated version of the Jovo Framework. We strongly recommend upgrading to Jovo v4. Learn more here: https://www.jovo.tech/docs/migration-from-v3’);

// ------------------------------------------------------------------
// APP INITIALIZATION
// ------------------------------------------------------------------

const webPlatform = new WebPlatform();

const nlpjsNlu = new NlpjsNlu({
// languages:[‘en’],
setupModelCallback: async (handleRequest, nlp) => {
// force entity extraction
nlp.forceNER = true;
// register module for entity extraction
nlp.container.use(BuiltinDefault, ‘extract-builtin’);
// register module for English
nlp.use(LangEn);
// add corpus via path to the models directory
// you might change it to pass an absolute path
nlpjsNlu.addCorpus(’…/models’);
},
});

const app = new App();

webPlatform.use(nlpjsNlu)

app.use(
webPlatform,
new Alexa(),
new GoogleAssistant(),
new JovoDebugger(),
new FileDb(),
);

// ------------------------------------------------------------------
// APP LOGIC
// ------------------------------------------------------------------

app.setHandler({
LAUNCH() {
return this.toIntent(‘HelloWorldIntent’);
},

HelloWorldIntent() {
this.ask(“Hello World! What’s your name?”, ‘Please tell me your name.’);
},

MyNameIsIntent() {
this.tell('Hey ’ + this.$inputs.name.value + ‘, nice to meet you!’);
},
});

module.exports = { app };
`
I add for addCorpus …/models because my model is not in src folder
And

My version of jovo is 3.
@jan and @Simone_Leo can you help me please ?

Thanks