Error: Input type must be defined in inputTypes jovo-framework
Error: Input type must be defined in inputTypes jovo-framework
Follow Docs
我尝试按以下行制作自定义实体(开发人员实体):
en-US.json
:
{
"name": "TopicChooseIntent",
"phrases": [
"play {topic} chart",
"{topic} music",
"play {topic} music",
"what's {topic} today",
"what {topic} today"
],
"inputs": [
{
"name": "topic",
"type": {
"dialogflow": "@sys.any"
}
},
{
"name": "city",
"type": "@dev-city"
}
],
"inputTypes": [
{
"name": "@dev-city",
"dialogflow": {
"automatedExpansion": true
},
"values": [
{
"value": "Berlin"
},
{
"value": "New York",
"synonyms": [
"New York City"
]
}
]
}
]
}
,
"dialogflow": {
"intents": [
{
"name": "Default Fallback Intent",
"auto": true,
"webhookUsed": true,
"fallbackIntent": true
},
{
"name": "Default Welcome Intent",
"auto": true,
"webhookUsed": true,
"events": [
{
"name": "WELCOME"
}
]
}
]
}
app.js
app.setHandler({
'TopicChooseIntent': function (topic) {
}
})
当我想通过命令行构建时出现以下错误 jovo build
:
❯ Updating /platforms/googleAction/dialogflow
✔ Updating Dialogflow Agent
✔ agent.json
✔ package.json
❯ Updating Dialogflow Language Model based on Jovo Language Model in /models
✖ en-US
-> Input type "@dev-city" must be defined in inputTypes
{ Error: Input type "@dev-city" must be defined in inputTypes
at DialogFlowAgent.transform (/usr/local/lib/node_modules/jovo-cli/helper/dialogFlowAgent.js:381:35)
at Promise (/usr/local/lib/node_modules/jovo-cli/helper/dialogflowUtil.js:230:21)
at new Promise (<anonymous>)
at Object.buildLanguageModelDialogFlow (/usr/local/lib/node_modules/jovo-cli/helper/dialogflowUtil.js:225:16)
at Task.task (/usr/local/lib/node_modules/jovo-cli/commands/tasks.js:332:38)
at Promise.resolve.then.then.skipped (/usr/local/lib/node_modules/jovo-cli/node_modules/listr/lib/task.js:168:30)
context:
{ locales: [ 'en-US' ],
type: [ 'googleAction' ],
projectId: undefined,
endpoint: 'jovo-webhook',
target: 'all',
src: '/Users/folder/Desktop/GoogleHome/',
stage: '',
askProfile: 'default' } }
其实我也不知道怎么做才正确,
请帮帮我,
非常感谢。
p/s :
- 我完全理解 Developer Entities,因为我能够轻松地在 DialogFlow 上制作自定义实体(Developer Entities)。请查看图片作为示例
- 如果不使用这个开发者实体,我可以运行命令行:
jovo build
jovo deploy --project-id ...
jovo run
我认为问题出在名称上。 Dialogflow Docs for Developer Entities 声明它们应该“ 以字母开头并且可以包含以下内容:A-Z、a-z、0-9、_(下划线)、-(破折号)”。
您是否尝试过删除 @
并仅使用 dev-city
作为实体名称?
目前,我可以避免这个问题。
我知道这个 json
文件我定义不正确。
所以我需要修改以获得正确的结果,如下代码:
en-US.json
"name": "TopicChooseIntent",
"phrases": [
"play {topic} chart",
"{topic} music",
"play {dev-city} music",
"choose {dev-city} music",
"what's {topic} today",
"what {topic} today"
],
"inputs": [
{
"name": "topic",
"type": {
"dialogflow": "@sys.any"
}
}
],
"inputTypes": [
{
"name": "@dev-city",
"dialogflow": {
"automatedExpansion": true
},
"values": [
{
"value": "Berlin"
},
{
"value": "New York",
"synonyms": [
"New York City"
]
}
]
}
]
en-US.json
"dialogflow": {
"intents": [
{
"name": "Default Fallback Intent",
"auto": true,
"webhookUsed": true,
"fallbackIntent": true
},
{
"name": "Default Welcome Intent",
"auto": true,
"webhookUsed": true,
"events": [
{
"name": "WELCOME"
}
]
}
],
"entities": [
{
"name": "dev-city",
"isOverridable": false,
"isEnum": false,
"automatedExpansion": false
}
]
}
Follow Docs 我尝试按以下行制作自定义实体(开发人员实体):
en-US.json
:
{
"name": "TopicChooseIntent",
"phrases": [
"play {topic} chart",
"{topic} music",
"play {topic} music",
"what's {topic} today",
"what {topic} today"
],
"inputs": [
{
"name": "topic",
"type": {
"dialogflow": "@sys.any"
}
},
{
"name": "city",
"type": "@dev-city"
}
],
"inputTypes": [
{
"name": "@dev-city",
"dialogflow": {
"automatedExpansion": true
},
"values": [
{
"value": "Berlin"
},
{
"value": "New York",
"synonyms": [
"New York City"
]
}
]
}
]
}
,
"dialogflow": {
"intents": [
{
"name": "Default Fallback Intent",
"auto": true,
"webhookUsed": true,
"fallbackIntent": true
},
{
"name": "Default Welcome Intent",
"auto": true,
"webhookUsed": true,
"events": [
{
"name": "WELCOME"
}
]
}
]
}
app.js
app.setHandler({
'TopicChooseIntent': function (topic) {
}
})
当我想通过命令行构建时出现以下错误 jovo build
:
❯ Updating /platforms/googleAction/dialogflow
✔ Updating Dialogflow Agent
✔ agent.json
✔ package.json
❯ Updating Dialogflow Language Model based on Jovo Language Model in /models
✖ en-US
-> Input type "@dev-city" must be defined in inputTypes
{ Error: Input type "@dev-city" must be defined in inputTypes
at DialogFlowAgent.transform (/usr/local/lib/node_modules/jovo-cli/helper/dialogFlowAgent.js:381:35)
at Promise (/usr/local/lib/node_modules/jovo-cli/helper/dialogflowUtil.js:230:21)
at new Promise (<anonymous>)
at Object.buildLanguageModelDialogFlow (/usr/local/lib/node_modules/jovo-cli/helper/dialogflowUtil.js:225:16)
at Task.task (/usr/local/lib/node_modules/jovo-cli/commands/tasks.js:332:38)
at Promise.resolve.then.then.skipped (/usr/local/lib/node_modules/jovo-cli/node_modules/listr/lib/task.js:168:30)
context:
{ locales: [ 'en-US' ],
type: [ 'googleAction' ],
projectId: undefined,
endpoint: 'jovo-webhook',
target: 'all',
src: '/Users/folder/Desktop/GoogleHome/',
stage: '',
askProfile: 'default' } }
其实我也不知道怎么做才正确,
请帮帮我,
非常感谢。
p/s :
- 我完全理解 Developer Entities,因为我能够轻松地在 DialogFlow 上制作自定义实体(Developer Entities)。请查看图片作为示例
- 如果不使用这个开发者实体,我可以运行命令行:
jovo build
jovo deploy --project-id ...
jovo run
我认为问题出在名称上。 Dialogflow Docs for Developer Entities 声明它们应该“ 以字母开头并且可以包含以下内容:A-Z、a-z、0-9、_(下划线)、-(破折号)”。
您是否尝试过删除 @
并仅使用 dev-city
作为实体名称?
目前,我可以避免这个问题。
我知道这个 json
文件我定义不正确。
所以我需要修改以获得正确的结果,如下代码:
en-US.json
"name": "TopicChooseIntent",
"phrases": [
"play {topic} chart",
"{topic} music",
"play {dev-city} music",
"choose {dev-city} music",
"what's {topic} today",
"what {topic} today"
],
"inputs": [
{
"name": "topic",
"type": {
"dialogflow": "@sys.any"
}
}
],
"inputTypes": [
{
"name": "@dev-city",
"dialogflow": {
"automatedExpansion": true
},
"values": [
{
"value": "Berlin"
},
{
"value": "New York",
"synonyms": [
"New York City"
]
}
]
}
]
en-US.json
"dialogflow": {
"intents": [
{
"name": "Default Fallback Intent",
"auto": true,
"webhookUsed": true,
"fallbackIntent": true
},
{
"name": "Default Welcome Intent",
"auto": true,
"webhookUsed": true,
"events": [
{
"name": "WELCOME"
}
]
}
],
"entities": [
{
"name": "dev-city",
"isOverridable": false,
"isEnum": false,
"automatedExpansion": false
}
]
}