我在下面的代码中我正在尝试创建一个MediaObject来加载音频文件,我使用的是谷歌here中的确切代码。
我得到的错误是必须设置final_response。即使我按照一个答案[{3}}
的建议使用conv.close设置final_response的实际方法是什么?
function yourFunctionHandler(agent) {
agent.add(`This message is from Dialogflow's Cloud Functions for Firebase editor!`);
let conv = agent.conv();
conv.ask(new Suggestions('Suggestion Chips'));
conv.close(new MediaObject({
name: 'Jazz in Paris',
url: 'https://storage.googleapis.com/automotive-media/Jazz_In_Paris.mp3',
description: 'A funky Jazz tune',
icon: new Image({
url: 'https://storage.googleapis.com/automotive-media/album_art.jpg',
alt: 'Media icon',
}),
}));
conv.ask(new Suggestions(['suggestion 1', 'suggestion 2']));
}