使用 Google SDK 上的操作获取 Dialogflow 网络钩子路径参数



有没有办法检索由Dialogflow实现webhook设置的路径参数? 我在Google Cloud Function中使用Node.js actions-on-google SDK。

我的网络钩子网址是这样的:https://europe-myexample.cloudfunctions.net/actionHandler/v1

我需要获取v1参数才能在manageWelcomeIntent函数中使用它。

const NLGService = require('./services/NLGService.js');
const {dialogflow} = require('actions-on-google');
const app = dialogflow();
exports.actionHandler = app;
app.intent('welcome_intent', NLGService.manageWelcomeIntent);

你不能例如使用const url = require('url');,或者更简单地说,req.url用于查找您的服务器 URL 然后提取参数?

最新更新