philipk22 commited on
Commit
d96565f
Β·
1 Parent(s): cfe7c4b

update app.py with o1-mini

Browse files
Files changed (1) hide show
  1. app.py +32 -33
app.py CHANGED
@@ -7,47 +7,46 @@ from dotenv import load_dotenv
7
 
8
  load_dotenv()
9
 
10
- # Combined template for o1-mini
11
- user_template = """You are an empathetic and insightful vibe check assistant. Your role is to:
12
- 1. Help users reflect on their current emotional state
13
- 2. Provide supportive and constructive feedback
14
- 3. Suggest practical ways to maintain or improve their vibe
15
- 4. Keep responses balanced between professional and friendly
16
- 5. Always maintain a supportive and non-judgmental tone
17
 
18
  Frame your responses in these sections:
19
- - Current Vibe Analysis
20
- - Key Observations
21
- - Supportive Suggestions
22
- - Positive Reinforcement
23
 
24
- User message: {input}
25
 
26
  Please consider:
27
- - The emotional undertones in the response
28
- - Any patterns in behavior or thinking
29
- - Potential areas for positive growth
30
- - Immediate actionable steps
31
 
32
- Think through your response step by step and structure it clearly.
33
  """
34
 
35
  @cl.on_chat_start
36
  async def start_chat():
37
- # Welcome message with vibe check introduction
38
  await cl.Message(
39
- content="πŸ‘‹ Welcome to your Vibe Check! I'm here to help you reflect on your current state "
40
- "and provide supportive insights. Feel free to share how you're feeling or respond to any "
41
- "of these questions:\n\n"
42
- "1. How would you describe your energy level right now?\n"
43
- "2. What's the strongest emotion you're experiencing?\n"
44
- "3. What's one thing that's influencing your mood today?\n"
45
- "4. How connected do you feel to your goals right now?\n"
46
- "5. What's one small thing you could do to improve your vibe?\n"
47
  ).send()
48
 
49
  settings = {
50
- "model": "o1-mini", # Only including the model parameter
51
  }
52
 
53
  cl.user_session.set("settings", settings)
@@ -85,12 +84,12 @@ async def main(message: cl.Message):
85
  prompt.completion = msg.content
86
  msg.prompt = prompt
87
 
88
- # Add supportive emoji based on content
89
- if any(word in msg.content.lower() for word in ['good', 'great', 'excellent', 'positive']):
90
- await msg.stream_token(" ✨")
91
- elif any(word in msg.content.lower() for word in ['challenging', 'difficult', 'hard']):
92
- await msg.stream_token(" πŸ’ͺ")
93
  else:
94
- await msg.stream_token(" 🌟")
95
 
96
  await msg.send()
 
7
 
8
  load_dotenv()
9
 
10
+ # Combined template for fact checking
11
+ user_template = """You are a thorough and precise fact-checking assistant. Your role is to:
12
+ 1. Analyze statements for factual accuracy
13
+ 2. Identify potential inaccuracies or misconceptions
14
+ 3. Provide evidence-based corrections when needed
15
+ 4. Note any missing context or nuances
16
+ 5. Maintain an objective and unbiased perspective
17
 
18
  Frame your responses in these sections:
19
+ - Claim Analysis
20
+ - Evidence Assessment
21
+ - Factual Correction (if needed)
22
+ - Additional Context
23
 
24
+ User statement to verify: {input}
25
 
26
  Please consider:
27
+ - The accuracy of specific claims
28
+ - The reliability of any cited sources
29
+ - Any missing context
30
+ - Common misconceptions about this topic
31
 
32
+ Analyze the statement step by step and provide a clear assessment.
33
  """
34
 
35
  @cl.on_chat_start
36
  async def start_chat():
37
+ # Welcome message with fact checking introduction
38
  await cl.Message(
39
+ content="πŸ‘‹ Welcome to the Fact Check Assistant! I'm here to help analyze statements "
40
+ "for factual accuracy. Feel free to share any statement you'd like to verify, such as:\n\n"
41
+ "1. Historical claims or dates\n"
42
+ "2. Scientific statements\n"
43
+ "3. Statistical claims\n"
44
+ "4. Quotes or attributions\n"
45
+ "5. Common beliefs or assertions\n"
 
46
  ).send()
47
 
48
  settings = {
49
+ "model": "o1-mini",
50
  }
51
 
52
  cl.user_session.set("settings", settings)
 
84
  prompt.completion = msg.content
85
  msg.prompt = prompt
86
 
87
+ # Add indicator emoji based on fact-check result
88
+ if any(word in msg.content.lower() for word in ['correct', 'accurate', 'true', 'verified']):
89
+ await msg.stream_token(" βœ…")
90
+ elif any(word in msg.content.lower() for word in ['incorrect', 'false', 'inaccurate', 'misleading']):
91
+ await msg.stream_token(" ❌")
92
  else:
93
+ await msg.stream_token(" ℹ️")
94
 
95
  await msg.send()