def respond_from_waiting(self, message, tags): if emotion_word_found(message): # print(str(emotion_word_found(message)) + "\nfunction stuff: "+detect_emotion_phrase(message)) self.emotion_response = detect_emotion_phrase(message) return self.go_to_state('emotion_detection') elif 'hi' in tags: if len(message) < 20: return self.go_to_state('hi') else: if emotion_word_found(message): self.emotion_response = detect_emotion_phrase(message) return self.go_to_state('emotion_detection') elif 'bye' in tags: return self.finish('success') else: return self.finish_confused()
def respond_from_emotion_detection(self, message, tags): if 'idk' in tags: return self.go_to_state('anecdote') elif emotion_word_found(message): # print(str(emotion_word_found(message)) + "\nfunction stuff: "+detect_emotion_phrase(message)) self.emotion_response = detect_emotion_phrase(message) return self.go_to_state('emotion_detection') else: return self.go_to_state('tell_me_more')
def respond_from_suggestion(self, message, tags): if 'adv' in tags: return self.go_to_state('advice') elif emotion_word_found(message): self.emotion_response = detect_emotion_phrase(message) return self.go_to_state('emotion_detection') elif 'thanks' in tags: return self.finish('thanks') else: return self.go_to_state('feel_better_question')
def respond_from_tell_me_more(self, message, tags): if 'idk' in tags: return self.go_to_state('anecdote') elif 'adv' in tags: return self.go_to_state('advice') elif emotion_word_found(message): self.emotion_response = detect_emotion_phrase(message) return self.go_to_state('emotion_detection') else: return self.go_to_state('tell_me_more')