in lambda/src/gather_symptom_bot.py [0:0]
def no_symptom(intent_request):
session_attributes = helper.get_attribute(intent_request, 'sessionAttributes')
symptoms = helper.get_list_from_session(session_attributes, SYMPTOM_ATTR)
current_intent = helper.get_attribute(intent_request, 'currentIntent')
slots = helper.get_attribute(current_intent, 'slots')
confirmation_status = helper.get_attribute(current_intent, 'confirmationStatus')
intent_name = helper.get_attribute(current_intent, 'name')
if confirmation_status == helper.ConfirmationStatus.NONE.value:
if len(symptoms) == 0:
# add confirmation for no symptoms
return helper.confirm_intent(session_attributes, intent_name, slots,
message_content=msg_strings.get('NO_SYMPTOM_CONFIRM'))
elif confirmation_status == helper.ConfirmationStatus.DENIED.value:
return helper.elicit_slot(session_attributes,
INTENT_REPORT_SYMPTOM, slots, SLOT_SYMPTOM_ONE,
message_content=msg_strings.get('ASK_SYMPTOM_DETAIL'))
# ready to log symptoms
user = helper.lookup_user(session_attributes)
local_time_reported = get_current_time_for_user(user)
unknown_symptoms = helper.get_list_from_session(session_attributes, UNKNOWN_SYMPTOM_ATTR)
symptom_reporter.report(user.uid, local_time_reported, symptoms, unknown_symptoms)
update_survey_completion(user.uid, local_time_reported, BOT_SYMPTOM_NAME)
session_attributes['NextBot'] = get_next_survey_bot(user.uid, local_time_reported)
return helper.close(session_attributes, helper.FulfillmentState.FULFILLED,
message_content=msg_strings.get('FINISH_SYMPTOM_REPORT'))