soyleyicicem commited on
Commit
c6f292a
·
verified ·
1 Parent(s): c2c7198

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -238,7 +238,7 @@ def chat(question, manual, history, liked):
238
  # first_hop_response = chat_gpt(prompt=f"Soru: {question}", history=conv, tools=retrieval_functions)
239
  # conv.append(first_hop_response.choices[-1].message)
240
 
241
- conv = [{"role": "system", "content": f"{first_hop}"}]
242
  first_hop_response = chat_gpt(prompt=f"Soru: {question}", history=conv, tools=retrieval_functions)
243
 
244
  tool_calls = first_hop_response.choices[-1].message.tool_calls
@@ -253,7 +253,7 @@ def chat(question, manual, history, liked):
253
  print(f"Will call {function_name} with arguments {args}")
254
  break
255
  else:
256
- conv = [{"role": "system", "content": f"{first_hop}"}]
257
  first_hop_response = chat_gpt(prompt=f"Soru: {question}", history=conv, tools=retrieval_functions)
258
  print("No tool calls")
259
 
@@ -331,7 +331,6 @@ def chat(question, manual, history, liked):
331
 
332
  Dokümanlarda ve sorunun içinde verilen tüm bilgilere dayanarak, aşağıdaki soruyu kısaca yanıtla: \n
333
  Sorulara cevap verirken sana sağlanan bilgilerdeki uyarılara, tehlikelere vurgu yap. \n
334
- Soru: {question} \n
335
 
336
  Dokümanlar: {documents}
337
  Elde ettiğin bilgiler soru ile ilgili görünmüyorsa cevap veremeyeceğini belirt.
@@ -361,8 +360,9 @@ def chat(question, manual, history, liked):
361
  #}
362
 
363
  #return '', history
364
-
365
- final_response = chat_gpt_nofn(prompt=prompt, history=conv)
 
366
 
367
  partial_response = ""
368
  print("Answer:--- %s seconds ---" % (time.time() - start_time))
@@ -377,7 +377,7 @@ def chat(question, manual, history, liked):
377
  pass
378
 
379
  response = partial_response
380
- conv.append({"role": "user", "content": prompt})
381
  conv.append({"role": "assistant", "content": response})
382
 
383
 
 
238
  # first_hop_response = chat_gpt(prompt=f"Soru: {question}", history=conv, tools=retrieval_functions)
239
  # conv.append(first_hop_response.choices[-1].message)
240
 
241
+ # conv.append({"role": "system", "content": f"{first_hop}"})
242
  first_hop_response = chat_gpt(prompt=f"Soru: {question}", history=conv, tools=retrieval_functions)
243
 
244
  tool_calls = first_hop_response.choices[-1].message.tool_calls
 
253
  print(f"Will call {function_name} with arguments {args}")
254
  break
255
  else:
256
+ # conv = [{"role": "system", "content": f"{first_hop}"}]
257
  first_hop_response = chat_gpt(prompt=f"Soru: {question}", history=conv, tools=retrieval_functions)
258
  print("No tool calls")
259
 
 
331
 
332
  Dokümanlarda ve sorunun içinde verilen tüm bilgilere dayanarak, aşağıdaki soruyu kısaca yanıtla: \n
333
  Sorulara cevap verirken sana sağlanan bilgilerdeki uyarılara, tehlikelere vurgu yap. \n
 
334
 
335
  Dokümanlar: {documents}
336
  Elde ettiğin bilgiler soru ile ilgili görünmüyorsa cevap veremeyeceğini belirt.
 
360
  #}
361
 
362
  #return '', history
363
+ conv.append({"role": "system", "content": f"{prompt}"})
364
+ final_response = chat_gpt_nofn(prompt=f"Soru: {question}", history=conv)
365
+ # final_response = chat_gpt_nofn(prompt=prompt, history=conv)
366
 
367
  partial_response = ""
368
  print("Answer:--- %s seconds ---" % (time.time() - start_time))
 
377
  pass
378
 
379
  response = partial_response
380
+ # conv.append({"role": "user", "content": prompt})
381
  conv.append({"role": "assistant", "content": response})
382
 
383