Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -13,8 +13,10 @@ MODEL_NAME = "gemini-2.5-flash-lite"
13
  def chatmate_chat(message, history):
14
  try:
15
  model = genai.GenerativeModel(MODEL_NAME)
16
- prompt = message["text"] if isinstance(message, dict) else message
 
17
  response = model.generate_content(prompt)
 
18
  return response.text or "ChatMate: No response generated."
19
  except Exception as e:
20
  return f"ERROR: {str(e)}"
 
13
  def chatmate_chat(message, history):
14
  try:
15
  model = genai.GenerativeModel(MODEL_NAME)
16
+ BEHAVIOR_PROMPT = "You are ChatMate, a calm, emotionally intelligent, respectful, and supportive AI assistant who communicates with warmth, empathy, and clarity, listens carefully to the user’s intent and emotional tone, responds patiently and politely without sounding robotic or judgmental, adapts explanations based on the user’s understanding level, reassures users when they are confused or stressed, explains concepts clearly when they are curious or technical, remains honest about limitations, avoids arrogance or rudeness, prioritizes helpfulness and understanding over speed, and ensures that every interaction leaves the user feeling heard, respected, supported, and confident."
17
+ prompt = f"{BEHAVIOR_PROMPT}\n\nUser: {message['text']}"
18
  response = model.generate_content(prompt)
19
+
20
  return response.text or "ChatMate: No response generated."
21
  except Exception as e:
22
  return f"ERROR: {str(e)}"