【发布时间】:2020-12-01 01:10:06
【问题描述】:
在 previous Stack Overflow question 中,我避免在 Actions on Google 上使用外部网络挂钩 所以我需要回到内联编辑器。我解决了这个问题,但现在我再次感到勇敢。
我已经超越了内联编辑器,并希望能够在我的笔记本电脑上开发我的代码,在 Firebase 中对其进行测试,并发布到我的 webhook 的站点,大概是内联代码编辑器发布到的地方。事实上,我已经编写了 require 函数并从 Firebase 部署了它们。因此,完整的功能已经准备就绪,我只需将其正确连接到 Actions on Google。
我现在在 Actions on Google 内联编辑器中所拥有的更多的是一个存根。我想将该存根合并到我在 Firebase 中拥有的更成熟的逻辑中。这是内联编辑器中的内容:
const { conversation } = require('@assistant/conversation');
const functions = require('firebase-functions');
const app = conversation();
app.handle('intent_a_handler', conv => {
// Implement your code here
conv.add("Here I am in intent A");
});
app.handle('intent_b_handler', conv => {
// Implement your code here
conv.add("Here I am in intent B");
});
exports.ActionsOnGoogleFulfillment = functions.https.onRequest(app);
当我在互联网上搜索时,我从 Dialogflow 的角度看到了讨论,但就像我说的,我在“Actions on Google”中。我想从内联编辑器过渡,以我已经拥有的为基础。有人可以解释我是如何设置的吗?我很高兴在 Google 生态系统的范围内这样做。
【问题讨论】:
标签: firebase google-cloud-functions actions-on-google