简体   繁体   English

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

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

Is there a way to retrieve path parameters setted by Dialogflow fulfillment webhook?有没有办法检索由 Dialogflow 实现 webhook 设置的路径参数? I'm using Node.js actions-on-google SDK in a Google Cloud Function.我在 Google Cloud Function 中使用 Node.js actions-on-google SDK。

My webhook URL is something like this: https://europe-myexample.cloudfunctions.net/actionHandler/v1我的 webhook URL 是这样的: https://europe-myexample.cloudfunctions.net/actionHandler/v1

I need to get the v1 param to use it in manageWelcomeIntent function.我需要获取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);

Can't you eg use const url = require('url');你不能例如使用const url = require('url'); , or, even simpler, req.url for finding out your server url and then extracting the param? ,或者更简单, req.url找出您的服务器 url 然后提取参数?

暂无
暂无

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

相关问题 Dialogflow webhook(Google上的操作)。 是否应该使用RichResponse? - Dialogflow webhook (Actions on Google). Should I be using RichResponse or not? 将参数发送到 dialogflow sdk v2 上的 webhook - Send parameters to webhook on dialogflow sdk v2 使用Dialogflow在Google App上的主机操作在自托管HTTPS服务器上使用节点JS(MalformedResponse:Webhook错误(206)) - Host Actions On Google App With Dialogflow Using Node JS on Self Hosted HTTPS Server (MalformedResponse: Webhook error (206)) cMalformedResponse:Webhook错误(206)同时看似有效的Webhook响应-Node.js中对Google Dialogflow应用的操作 - cMalformedResponse: Webhook error (206) whilst a seemingly valid webhook response - Actions on Google Dialogflow app in Node.js 无法访问 Dialogflow webhook 参数 - Unable to access Dialogflow webhook Parameters 在dialogflow的WebhookClient中使用Google上的轮播或列表操作时出错 - Error using actions-on-google Carousel or List with dialogflow's WebhookClient 如何使用 Google Actions Dialogflow 播放实时音频 stream - How to play live audio stream using Google Actions Dialogflow 如何在 dialogflow webhook 中创建上下文并保存参数 - How to create context and save parameters in dialogflow webhook Google上的操作不起作用,但它们在dialogflow中起作用 - actions on google not working but they does in dialogflow 关于dialogflow的意图不会在Google的操作上更新 - Intents on dialogflow not updating on actions on google
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM