Iはレックスでボットを作成し、同じボット内の2つのインテントを作成 - 発声get me a taxi now
とI wan a taxi to {Location} on {TravelDate} at {TaxiTime}
とintent1
とintent2
それぞれ(intent1
における最初のものと第二1つはintent2
にある)。両方のインテントは異なるラムダ関数を呼び出し、ラムダ関数の中ではRDSにアクセスしてタクシーの予約情報を追加します。 Lexコンソールからテストすると、データベースレコードが更新されているのを見てもラムダ関数が完全に実行されますが、LexボットテストコンソールではReached second execution of fulfillment lambda on same utterance Lex error
が表示されます。私のコードでは、私はこのラインを持っている:レックスボットコンソール上のエラー - 達し同じ発話で履行ラムダの第二実行
def delegate(session_attributes, slots):
return {
'sessionAttributes': session_attributes,
'dialogAction': {
'type': 'Delegate',
'slots': slots
}
}
def book_taxi(intent_request):
confirmation_status = intent_request['currentIntent']['confirmationStatus']
#bunch of other processing code
logger.debug('Confirmation = {}'.format(confirmation_status))
if confirmation_status == 'Confirmed':
try_ex(lambda: session_attributes.pop('confirmationContext'))
logger.debug('confirmation_context = {}'.format(confirmation_context))
if confirmation_context == 'AutoPopulate':
return elicit_slot(
session_attributes,
intent_request['currentIntent']['name'],
intent_request['currentIntent']['slots']
)
return delegate(session_attributes, intent_request['currentIntent']['slots'])
logger.debug('Booked Taxi at={}'.format(reservation))
私の推測では、上記のコードでdelegate()
呼び出しが私のログファイルに、私は最初の2つの確認されたようにデバッグログおよびなしの値を見ることができるので、問題の原因となったが、最後されていることですlogger.debug()がログファイルにありません。つまり、delegate()が呼び出され、thatsがLexコンソールでエラーを引き起こしています。
このエラーで考えられる問題は何ですか?
チェックアウト[この回答](https://stackoverflow.com/a/48231264/3196845)、ヘルプの可能性があります – sid8491