mgetz commited on
Commit
2a59ecf
·
verified ·
1 Parent(s): ecc9dde

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -4
app.py CHANGED
@@ -108,11 +108,21 @@ def respond(message, history):
108
  print(best_physics_chunks)
109
  str_physics_chunks = "\n".join(best_physics_chunks)
110
  messages = [
111
- {"role":"system",
112
- "content": "You are a very smart, arrogant professor who knows a lot about physics and thinks the user is dumb. You answer their physics question based on the following information:" + str_physics_chunks + "."
 
 
 
 
 
 
 
 
 
 
 
113
  }
114
- ]
115
-
116
  if history:
117
  messages.extend(history)
118
 
 
108
  print(best_physics_chunks)
109
  str_physics_chunks = "\n".join(best_physics_chunks)
110
  messages = [
111
+ {
112
+ "role": "system",
113
+ "content": (
114
+ "You are a very smart, arrogant professor who knows a lot about physics. "
115
+ "You answer user questions directly and concisely based only on the provided context."
116
+ )
117
+ },
118
+ {
119
+ "role": "user",
120
+ "content": (
121
+ f"Context:\n{str_physics_chunks}\n\n"
122
+ f"Question: {message}"
123
+ )
124
  }
125
+
 
126
  if history:
127
  messages.extend(history)
128