Я создал экшен для воспроизведения конкретного видеоролика с врачом, но он дает ошибку ниже, пожалуйста, предложите какое-то решение,
когда я вхожу: Воспроизвести видео с доктором AK Pancholia ниже, появляется ошибка.
К сожалению, это действие недоступно для вашего приложения. В симуляторе вы можете вызывать только те действия, которые вы добавили в свое приложение. Для получения дополнительной информации о том, как вызвать ваше приложение, щелкните здесь https://developers.google.com/actions/discovery/explicit
Описание::
Имя намерения :: play_video
Обучающие фразы: Я хочу посмотреть видео доктора Амаль Банерджи. Я хочу сыграть в видео доктора AK Pancholia Слушать видео Doctor AK Pancholia Включи видео доктора Амаль Банерджи. Действие и параметры: Имя: играть Название параметра: доктор Сущность: @doctor Подсказки: видео какого доктора хотите поиграть?
Выполнение: включен вызов веб-перехватчика как для намерения, так и для заполнения слота
Сущности
Имя объекта: доктор синонимы: AK Pancholia, Dr AK Pancholia,
Вебхук: 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.info('Dialogflow Request headers: ' + JSON.stringify(request.headers));
console.info('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 Assistant слово «play» - это триггерная фраза для воспроизведения звука, а не для запуска действия.
Вам необходимо использовать одно из явных триггерные фразы, например «поговорить с» или «спросить».