私はaws lambda-lexについて勉強していて、node.jsでコーヒーボットのサンプルコードを見つけました。私はPythonラムダハンドラでコールバックパラメータを見つけることができません
// --------------- 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);
}
};
は私がコールバックパラメータを使用したいが、私は実際に両方について
を、
// --------------- Main handler -----------------------
// --------------- in python -----------------------
def lambda_handler(event, context):
dispatch(event)
# >>> this handler doesn't include callback <<<
あなたが必要な場合はPythonでそれを見つける比較することはできません私はこの関数を取得したい(レックスへのメッセージを構築する)
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)
誰も私を助けることができますか?
こんにちは!スタックオーバーフロー時の今後の努力のために、コードの[最小、完全、および検証可能なサンプルを作成する方法](http://stackoverflow.com/help/mcve)をチェックする方が良いでしょう。 - お返事ありがとう – Momin
@Mominと{aUXcoder}が編集してくれてありがとう、おかげです。 –