![](/img/trans.png)
[英]CloudSQL warning: your action is needed to update your function : context deadline exceeded
[英]Sorry, this action is not available for your app. In the simulator,
我已经创建了一个播放特定医生视频的动作,但是它给出了以下错误,请提出一些解决方案,
当我输入时:播放以下错误消息,播放AK Pancholia医生的视频。
抱歉,此操作不适用于您的应用。 在模拟器中,您只能调用已添加到应用程序中的操作。 有关如何调用您的应用程序的更多信息,请单击此处https://developers.google.com/actions/discovery/explicit
描述::
意图名称:: play_video
训练短语::我想播放Amal Banerjee医生的视频。 我想播放AK Pancholia医生视频播放AK Pancholia医生视频播放Amal Banerjee医生视频。 动作和参数:名称:play参数名称:doctor实体:@doctor提示:您要播放哪个医生视频?
实现:针对意图和广告位填充启用了Webhook调用
实体
实体名称:医生同义词:AK Pancholia,AK Pancholia博士,
Webhook:URL: https ://us-central1-trd-123.cloudfunctions.net/dialogflowFirebaseFulfillment。
Firebase云功能:
// See https://github.com/dialogflow/dialogflow-fulfillment-nodejs
// for Dialogflow fulfillment library docs, samples, and to report issues
'use strict';
const functions = require('firebase-functions');
const {WebhookClient} = require('dialogflow-fulfillment');
const {Card, Suggestion} = require('dialogflow-fulfillment');
process.env.DEBUG = 'dialogflow:debug'; // enables lib debugging statements
exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, response) => {
const agent = new WebhookClient({ request, response });
console.log('Dialogflow Request headers: ' + JSON.stringify(request.headers));
console.log('Dialogflow Request body: ' + JSON.stringify(request.body));
function playVideo(agent) {
agent.add(`responce from input doctor play video`);
}
function fallback(agent) {
agent.add(`I didn't understand`);
agent.add(`I'm sorry, can you try another doctor?`);
}
// // Uncomment and edit to make your own intent handler
// // uncomment `intentMap.set('your intent name here', yourFunctionHandler);`
// // below to get this function to be run when a Dialogflow intent is matched
// function yourFunctionHandler(agent) {
// agent.add(`This message is from Dialogflow's Cloud Functions for Firebase editor!`);
// agent.add(new Card({
// title: `Title: this is a card title`,
// imageUrl: 'https://developers.google.com/actions/images/badges/XPM_BADGING_GoogleAssistant_VER.png',
// text: `This is the body text of a card. You can even use line\n breaks and emoji! 💁`,
// buttonText: 'This is a button',
// buttonUrl: 'https://assistant.google.com/'
// })
// );
// agent.add(new Suggestion(`Quick Reply`));
// agent.add(new Suggestion(`Suggestion`));
// agent.setContext({ name: 'weather', lifespan: 2, parameters: { city: 'Rome' }});
// }
// // Uncomment and edit to make your own Google Assistant intent handler
// // uncomment `intentMap.set('your intent name here', googleAssistantHandler);`
// // below to get this function to be run when a Dialogflow intent is matched
// function googleAssistantHandler(agent) {
// let conv = agent.conv(); // Get Actions on Google library conv instance
// conv.ask('Hello from the Actions on Google client library!') // Use Actions on Google library
// agent.add(conv); // Add Actions on Google library responses to your agent's response
// }
// // See https://github.com/dialogflow/dialogflow-fulfillment-nodejs/tree/master/samples/actions-on-google
// // for a complete Dialogflow fulfillment library Actions on Google client library v2 integration sample
// Run the proper function handler based on the matched Dialogflow intent name
let intentMap = new Map();
intentMap.set('Play_video',playVideo);
intentMap.set('Default Fallback Intent', fallback);
// intentMap.set('your intent name here', yourFunctionHandler);
// intentMap.set('your intent name here', googleAssistantHandler);
agent.handleRequest(intentMap);
});
在Google助手中,“播放”是用于播放音频而不是用于开始动作的触发短语。
您需要使用显式触发短语之一,例如“交谈”或“询问”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.