2017-06-09 6 views
1

Iはレックスでボットを作成し、同じボット内の2つのインテントを作成 - 発声get me a taxi nowI wan a taxi to {Location} on {TravelDate} at {TaxiTime}intent1intent2それぞれ(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コンソールでエラーを引き起こしています。

このエラーで考えられる問題は何ですか?

+0

チェックアウト[この回答](https://stackoverflow.com/a/48231264/3196845)、ヘルプの可能性があります – sid8491

答えて

-1

あなたの発話には、複数のインテントを呼び出すテキストが含まれている場合があります。 これが問題の原因です。 あなたは両方のインテントのuttrancesをチャックし、2つの同様のタイプの発言から1つを削除します。

関連する問題