2017-12-22 3 views
0

チャットボットを作成しようとしています。 Chatbotは「あなたの国籍は何ですか(A、B、C)」という質問を表示し、ユーザーがCと答えた場合、「申し訳ありませんがCは適用されません。 AとBだけが応募できます。私は、上記の質問の後に "必須"のチェックボックスをオフにしなければならないことを知っているが、私はそれが起こるためにawsラムダで何を入力するか分からない。ラムダコードで必要なチェックボックスをオフにした後Amazon Lexチャットボットスロットのトラブル

enter image description here

答えて

2

は、以下の操作を行います。

# inside dialogcodehook 
slots = intent_request['currentIntent']['slots'] 
nation = slots['nation'] 
if nation == 'C': 
    return close('I am sorry, C is not applicable to apply. Only A and B can apply.') 
# rest of your code 

def close(msg): 
"dialogAction": { 
    "type": "Close", 
    "fulfillmentState": "Fulfilled", 
    "message": { 
     "contentType": "PlainText", 
     "content": msg 
    } 
} 

をあなたはthis questionthis questionthis questionthis documentationなどを参照することもできます。..

はと遊びます他の事柄についての文書を参照し、さらなる疑念についてコメントしてください。

希望します。

+0

うん、これを解決するために管理。ありがとうございました! –