我有一个Dialogflow代理,我正在使用它的内联编辑器(由Cloud Functions for Firebase驱动)。当我尝试使用来获取外部api数据时,request-promise-native我会一直进入Ignoring exception from a finished functionFirebase控制台。
function video(agent) {
agent.add(`You are now being handled by the productivity intent`);
const url = "https://reqres.in/api/users?page=2";
return request.get(url)
.then(jsonBody => {
var body = JSON.parse(jsonBody);
agent.add(body.data[0].first_name)
return Promise.resolve(agent);
});
}
Run Code Online (Sandbox Code Playgroud)