teddyllm commited on
Commit
f275dc7
1 Parent(s): 933f3fc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -83,11 +83,11 @@ def chatbot_interface(user_input, chat_history):
83
  def chat_gen(message, history):
84
  history_openai_format = []
85
  context = search_index(message)
86
- prompt = f"{context}\n\nUser: {message}\nAssistant:"
87
-
88
  response = client.chat.completions.create(
89
  model="gpt-4o-mini",
90
- messages=[{"role": "system", "content": "You are a helpful assistant."},
91
  {"role": "user", "content": prompt}],
92
  stream=True,
93
  )
 
83
  def chat_gen(message, history):
84
  history_openai_format = []
85
  context = search_index(message)
86
+ prompt = f"Context: {context}\n\n Question: {message}\nAssistant:"
87
+
88
  response = client.chat.completions.create(
89
  model="gpt-4o-mini",
90
+ messages=[{"role": "system", "content": "You are a helpful assistant. You are assisting students who are studying at DDI program at Assumption University. Answer the questions with the provided context. Do not include based on the context or based on the documents in your answer. Please say you do not know if you do not know or cannot find the information needed."},
91
  {"role": "user", "content": prompt}],
92
  stream=True,
93
  )