dialogflow-es - Dialogflow - 未获得在 Fulfillment Inline Editor 中配置的响应
问题描述
我正在关注以下教程:https ://dialogflow.com/docs/getting-started/integrate-services-actions-on-google
我已经设置了“名称”意图,配置了几个训练短语,以及一个响应。见下文。
训练用语:
- 你有名字吗?
- 你叫什么名字?
回复:我的名字是 Dialogflow!
然后,我转到 Fulfillment 部分并启用内联编辑器并粘贴以下代码:
/**
* Copyright 2018 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
const functions = require('firebase-functions')
const { dialogflow } = require('actions-on-google')
const app = dialogflow()
app.intent('Default Welcome Intent', conv => {
conv.ask('Welcome to my agent!')
})
app.intent('Default Fallback Intent', conv => {
conv.ask(`I didn't understand`)
conv.ask(`I'm sorry, can you try again?`)
})
app.intent('Name', conv => {
conv.ask('My name is Dialogflowwwww!')
})
exports.dialogflowFirebaseFulfillment = functions.https.onRequest(app)
然后点击部署。
然后转到“名称”意图,向下滚动到“履行”部分并启用“为此意图启用 webhook 调用”。
再次转到 Fulfillment 并单击 Deploy。
现在,在测试聊天窗口中,当我输入“你叫什么名字?”时,我得到了意图的响应——即——“我的名字是 Dialogflow!”
但是,我期待来自 Fulfillment 内联编辑器代码的回复 - 即 - “我的名字是 Dialogflowwwww!”。
这里可能是什么问题?
解决方案
在“Actions for Google 控制台”中尝试此操作,方法是单击所示图片中的“谷歌助手”链接。
这是因为您使用了 Google 助手的“Actions on google”客户端库。
https://github.com/actions-on-google/actions-on-google-nodejs
推荐阅读
- javascript - React 组件不会随着 redux 状态的变化而更新
- python - 卷积网络模型不适用于非常简单的数据
- unit-testing - 将单元测试集成到活动的 Vuetify 2 项目时遇到问题,SASS 出错(Mocha-webpack / Vue 单元测试工具)
- javascript - 使用 mvc 根据值更改图标颜色
- powershell - 脚本提取用户所属的 AD 组列表
- django - 可以使用 d3.json 获取后端自定义错误消息吗?
- c# - 为什么计时器 Elapsed 需要 += EventHandler?
- python - 如何根据常用词对文本进行分类
- java - 无法使用硒启动 chorme?
- mysql - 为什么我不能从 bash 中的 fifo 读取管道 sql 的结果?