我正在为aws lambda-lex学习,我发现coffee bot示例代码节点.js. 在
// --------------- Main handler -----------------------
// --------------- in node.js -----------------------
// Route the incoming request based on intent.
// The JSON body of the request is provided in the event slot.
exports.handler = (event, context, callback) => {
try {
dispatch(event, (response) => callback(null, response));
} catch (err) {
callback(err);
}
};
我想要使用回调参数,但在python中找不到它
^{pr2}$如果你需要的话,比较一下
实际上我想得到这个函数(构建消息到lex)
callback(elicitSlot(outputSessionAttributes, intentRequest.currentIntent.name, slots, 'BeverageType',
buildMessage('Sorry, but we can only do a mocha or a chai. What kind of beverage would you like?'),
buildResponseCard("Menu", "Today's Menu", menuItem)));
完整的示例代码在这里(https://github.com/awslabs/amz-ai-building-better-bots/blob/master/src/index.js)
有人能帮我吗?在
使用回调是NodeJS中用于管理异步执行的一种模式。在Python中不需要它(对于这个特定的用例)。在
NodeJS中的这个片段。。。在
相当于
^{2}$在Python中。在
相关问题 更多 >
编程相关推荐