繁体   English   中英

使用 Google 上的操作 SDK 获取 Dialogflow webhook 路径参数

[英]Getting Dialogflow webhook path parameters using Actions On Google SDK

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

我的 webhook URL 是这样的: https://europe-myexample.cloudfunctions.net/actionHandler/v1

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

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 然后提取参数?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM