2017-12-22 17 views
0

chatbot을 만들려고합니다. Chatbot은 "귀하의 국적은 무엇입니까 (A, B, C)"라는 질문을하고 사용자가 C라고 말하면 "죄송합니다. C는 적용 할 수 없습니다."라고 말하면서 채팅을 즉시 끝내고 싶습니다. A와 B 만 신청할 수 있습니다. " 나는 질문을 한 후에 "필수"체크 박스를 선택 취소해야한다는 것을 알고 있지만 aws lambda에서 입력해야 할 내용을 알기 어렵습니다. 람다 코드에서 필요한 확인란의 선택을 취소 한 후Amazon Lex chatbot slots에 문제가 있습니다

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 question, this question, this question, this documentation 등을 참조 할 수 있습니다 ..

재생과를 그것과 다른 것들에 대한 문서를보고 더 의심에 대해 언급.

희망이 있습니다.

+0

그래,이 문제를 해결할 수있었습니다. 고맙습니다! –