HarshSanghavi commited on
Commit
287750f
1 Parent(s): e80121c

Upload 3 files

Browse files
Files changed (3) hide show
  1. chat.py +2 -2
  2. config.py +6 -3
  3. utils.py +6 -4
chat.py CHANGED
@@ -31,8 +31,8 @@ def chat_conversations(query,user_id):
31
  if query == "START":
32
  if isFirstSession(user_id):
33
  is_second = True
34
- query = """ return this message without changing it.:-
35
- also don't thought about it. Hey! I'm your BMOXI AI bestie, ready to help you tackle the wild ride of teen life. Want to give me a name? Type it below, or just say 'no' if you're cool with 'AI Bestie'!"""
36
  else:
37
  is_first = True
38
  query = ""
 
31
  if query == "START":
32
  if isFirstSession(user_id):
33
  is_second = True
34
+ query = f""" don't think anything, just return this message without changing it :-
35
+ Hey {user_id}! I'm your BMOXI AI bestie, ready to help you tackle the wild ride of teen life. Want to give me a name? Type it below, or just say 'no' if you're cool with 'AI Bestie'!"""
36
  else:
37
  is_first = True
38
  query = ""
config.py CHANGED
@@ -24,14 +24,14 @@ class Settings:
24
  #Voice: Authentic, Informal, conversational, college-aged, real-talk, no emojies.
25
  You use the GROW coaching model to guide conversations, focusing on understanding the user's goals, exploring the current situation, suggesting possible actions, and encouraging commitment to the next steps.
26
  When a user shares a problem, start by identifying their goal for the conversation. Explore their current reality with understanding and without judgment
 
27
  Example flow:
28
-
29
- Goal: "Hey, what's up? I'm here to help. What's your main goal today?"
30
  Reality: "Ugh, that sucks. Can you tell me more about what's happening?"
31
  Options: "Here's a couple of ideas: Step Back or Talk It Out. Which one feels right for you?"
32
  Will: "Confronting someone can be scary. How about jotting down your thoughts first? Are you willing to try that?"
33
  Check-In: "I'll hit you up tomorrow to see how things are going. Got any other questions?"
34
-
35
  IMPORTANT INSTRUCTIONS:
36
  # use gen z and edgy words.
37
  # Must Not REPEAT ANY RESPONSE.
@@ -45,6 +45,9 @@ class Settings:
45
  # if conversation is ending must use close_chat tool no other tools. and fix the response of close tool based on chat history.
46
  # must Avoid using the words 'vibe'. Instead, use alternative expressions and must not repeate any words.
47
  # if you are giving any suggestions in flow then must use simple bullet points.
 
 
 
48
  """
49
 
50
 
 
24
  #Voice: Authentic, Informal, conversational, college-aged, real-talk, no emojies.
25
  You use the GROW coaching model to guide conversations, focusing on understanding the user's goals, exploring the current situation, suggesting possible actions, and encouraging commitment to the next steps.
26
  When a user shares a problem, start by identifying their goal for the conversation. Explore their current reality with understanding and without judgment
27
+
28
  Example flow:
29
+ Goal: "Hey, what's up? I'm here to help. What's going on today?"
 
30
  Reality: "Ugh, that sucks. Can you tell me more about what's happening?"
31
  Options: "Here's a couple of ideas: Step Back or Talk It Out. Which one feels right for you?"
32
  Will: "Confronting someone can be scary. How about jotting down your thoughts first? Are you willing to try that?"
33
  Check-In: "I'll hit you up tomorrow to see how things are going. Got any other questions?"
34
+
35
  IMPORTANT INSTRUCTIONS:
36
  # use gen z and edgy words.
37
  # Must Not REPEAT ANY RESPONSE.
 
45
  # if conversation is ending must use close_chat tool no other tools. and fix the response of close tool based on chat history.
46
  # must Avoid using the words 'vibe'. Instead, use alternative expressions and must not repeate any words.
47
  # if you are giving any suggestions in flow then must use simple bullet points.
48
+ # Must not use any sentenses from Example flow this is given for your tone and reference only.
49
+ # use 'check-in' and 'will' sometimes only.
50
+
51
  """
52
 
53
 
utils.py CHANGED
@@ -45,7 +45,10 @@ def get_last_session_summary(last_session_id, second_last_session_id):
45
 
46
  conversation = get_last_conversion(last_session_id,second_last_session_id)
47
  if conversation:
48
- system_prompt = """ summerize whole conversation. if you find problem is not solved of User then return problem else only return None. nothing else.
 
 
 
49
  conversation: {conversation}
50
  summary:
51
  """
@@ -54,8 +57,6 @@ def get_last_session_summary(last_session_id, second_last_session_id):
54
  openai_api_key=settings.OPENAI_KEY, temperature=0.0)
55
 
56
  response = llm.invoke(system_prompt.format(conversation=conversation)).content
57
- # print("********************************* PREVIOUS PROBLEM *******************************************")
58
- # print(response)
59
  return response
60
  else:
61
  return ""
@@ -79,6 +80,7 @@ def create_agent(user_id,is_first = False):
79
  if is_first:
80
  start = time.time()
81
  mood_summary = get_mood_summary(user_id)
 
82
  if previous_session_id['second_last_session_id']:
83
  previous_problem_summary = get_last_session_summary(previous_session_id['last_session_id'], previous_session_id['second_last_session_id'])
84
 
@@ -88,7 +90,7 @@ def create_agent(user_id,is_first = False):
88
  else:
89
  extra_prompt = f""" Only use these templates to start conversation:-
90
  1. Hey again {user_id}! How's it going?
91
- 2. What's up today? Need ✨ Advice, ✨ a Mood Boost, ✨ a Chat, ✨ Resource Suggestions, ✨ App Features help? How can I help?"
92
  use any one of the question for response based on your understanding not use anything else simply return one of these two only.
93
  """
94
 
 
45
 
46
  conversation = get_last_conversion(last_session_id,second_last_session_id)
47
  if conversation:
48
+ system_prompt = """ context: there is one typical conversation going on between two high school gen z girls.
49
+ you are one of the high school gen z girl. your voice is edgy and raw.
50
+ must use I for AI named BMOXI and for human use my friend. in summary.
51
+ this is your conversation with your best friend. summerize whole conversation and if you found any question can be asked from chat then return summary and qustion else return summary and append None at last.
52
  conversation: {conversation}
53
  summary:
54
  """
 
57
  openai_api_key=settings.OPENAI_KEY, temperature=0.0)
58
 
59
  response = llm.invoke(system_prompt.format(conversation=conversation)).content
 
 
60
  return response
61
  else:
62
  return ""
 
80
  if is_first:
81
  start = time.time()
82
  mood_summary = get_mood_summary(user_id)
83
+ print(previous_session_id)
84
  if previous_session_id['second_last_session_id']:
85
  previous_problem_summary = get_last_session_summary(previous_session_id['last_session_id'], previous_session_id['second_last_session_id'])
86
 
 
90
  else:
91
  extra_prompt = f""" Only use these templates to start conversation:-
92
  1. Hey again {user_id}! How's it going?
93
+ 2. hey again {user_id}! What's up today? Need ✨ Advice, ✨ a Mood Boost, ✨ a Chat, ✨ Resource Suggestions, ✨ App Features help? How can I help?"
94
  use any one of the question for response based on your understanding not use anything else simply return one of these two only.
95
  """
96