Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into main
  • Loading branch information
EC2 Default User committed Jun 25, 2021
2 parents c092d03 + 347f23e commit 07255e5
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions server/assistant/Brain.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def get_unrecorded_sentence(self, uid):

def handle_from_skill(self, text):
best_key, best_intent = self.determine_intent(text)
if best_key is not None:
if best_key is not "" or best_key is not None:
cherrypy.log("BEST KEY")
cherrypy.log(best_key)
if len(best_key) > 0:
Expand All @@ -72,7 +72,7 @@ def handle_from_skill(self, text):

latitude=53.2303869
longitude=-4.1299242
if best_intent is not None:
if best_intent is not "" or best_intent is not None:
return self.handle_intent(best_key, best_intent, text, latitude, longitude)


Expand All @@ -84,9 +84,9 @@ def handle(self, text, latitude=0.0, longitude=0.0):
longitude=-4.1299242


if 'activeSkill' not in cherrypy.session or cherrypy.session['activeSkill'] is None:
if 'activeSkill' not in cherrypy.session or cherrypy.session['activeSkill'] == "":
best_key, best_intent = self.determine_intent(text)
if best_key is not None:
if best_key is not "" or best_key is not None:
cherrypy.log(best_key)

if len(best_key) > 0:
Expand All @@ -97,7 +97,7 @@ def handle(self, text, latitude=0.0, longitude=0.0):
cherrypy.log(currentSkill)
best_key, best_intent = self.determine_contextual_intent(text, currentSkill)

if best_intent is not None:
if best_intent is not "" or best_intent is not None:
skill_result=self.handle_intent(best_key, best_intent, text, latitude, longitude)
return best_key, skill_result
else:
Expand Down
6 changes: 3 additions & 3 deletions server/assistant/skills/Menu/Menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,21 @@ def act_on_intent(self, intent, text):
response = f"BITCH BYE!!"

elif intent_type == 'DogMenuIntent':
cherrypy.session["activeSkill"] = None
cherrypy.session["activeSkill"] = ""
cherrypy.session["LastUtteranceCount"] = 0
# trigger menu skill here
menu = intent["MenuKeyword"]
response = "I'm your dog, I'm your therapist, here are your options: I can do a therapy role-play, tell you more about myself, tell you about SOOTHER, or recommend ASMR content."

elif intent_type == 'AlienMenuIntent':
cherrypy.session["activeSkill"] = None
cherrypy.session["activeSkill"] = ""
cherrypy.session["LastUtteranceCount"] = 0
# trigger menu skill here
menu = intent["MenuKeyword"]
response = "I'm an alien, I'm on your head. Here are your options: I can guide you through a role-play, tell you more about myself, tell you about SOOTHER, or recommend ASMR content."

elif intent_type == 'FriendMenuIntent':
cherrypy.session["activeSkill"] = None
cherrypy.session["activeSkill"] = ""
cherrypy.session["LastUtteranceCount"] = 0
# trigger menu skill here
menu = intent["MenuKeyword"]
Expand Down
6 changes: 3 additions & 3 deletions server/assistant/skills/Personality/Personality.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,19 @@ def act_on_intent(self, intent, text):

elif intent_type == 'PlayDogIntent':
cherrypy.session["RolePlayContext"] = "DogContext"
cherrypy.session["activeSkill"] = None
cherrypy.session["activeSkill"] = ""
cherrypy.session["LastUtteranceCount"] = 0
response = "I'm your therapist and I'm a dog! What would you like to do?"

elif intent_type == 'PlayAlienIntent':
cherrypy.session["RolePlayContext"] = "AlienContext"
cherrypy.session["activeSkill"] = None
cherrypy.session["activeSkill"] = ""
cherrypy.session["LastUtteranceCount"] = 0
response = "I'm an alien and I'm sitting on your head. What would you like to do?"

elif intent_type == 'PlayFriendIntent':
cherrypy.session["RolePlayContext"] = "FriendContext"
cherrypy.session["activeSkill"] = None
cherrypy.session["activeSkill"] = ""
cherrypy.session["LastUtteranceCount"] = 0
response = "I'm your friend, I'm lost in time. What would you like to do?"

Expand Down
2 changes: 1 addition & 1 deletion server/assistant/skills/asmr/asmr.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def act_on_intent(self, intent, text):
text = "asmr example video"
r = NewBrain.handle_from_skill(text)
r['response'] = "Here's an example ASMR video."
cherrypy.session["activeSkill"] = None
cherrypy.session["activeSkill"] = ""
response = r
elif intent_type == 'QuitIntent':
self.ContextManager.clear_context()
Expand Down
2 changes: 1 addition & 1 deletion server/assistant/skills/soother/soother.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def act_on_intent(self, intent, text):
text = "asmr example video"
r = NewBrain.handle_from_skill(text)
r['response'] = "Here's an example ASMR video."
cherrypy.session["activeSkill"] = None
cherrypy.session["activeSkill"] = ""
response = r
elif intent_type == 'QuitIntent':
self.ContextManager.clear_context()
Expand Down
4 changes: 2 additions & 2 deletions server/assistant/skills/tea/tea.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def act_on_intent(self, intent, text):

elif intent_type == 'WelcomeIntent':
self.ContextManager.clear_context()
cherrypy.session["activeSkill"] = None
cherrypy.session["activeSkill"] = ""
cherrypy.session["LastUtteranceCount"] = 0
response = f"You're welcome!! Enjoy your {teaType} tea"

Expand All @@ -93,7 +93,7 @@ def act_on_intent(self, intent, text):

elif intent_type == 'MenuIntent':
self.ContextManager.clear_context()
cherrypy.session["activeSkill"] = None
cherrypy.session["activeSkill"] = ""
cherrypy.session["LastUtteranceCount"] = 0
# trigger menu skill here
menu = intent["MenuKeyword"]
Expand Down

0 comments on commit 07255e5

Please sign in to comment.