Avo-k commited on
Commit
68fbb90
1 Parent(s): a422880

hopefully this time it works

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -46,12 +46,13 @@ def chat(query: str, history: list = [system_template], report_type="All availab
46
  messages.append({"role": "system", "content": "no relevant document available."})
47
  sources = "No environmental report was used to provide this answer."
48
 
49
- response = openai.ChatCompletion.create(model="gpt-3.5-turbo", messages=messages, temperature=0.2,)["choices"][0][
50
- "message"
51
- ]["content"]
52
-
 
 
53
  complete_response = ""
54
-
55
  for chunk in response:
56
  if chunk_message := chunk["choices"][0]["delta"].get("content", None):
57
  complete_response += chunk_message
 
46
  messages.append({"role": "system", "content": "no relevant document available."})
47
  sources = "No environmental report was used to provide this answer."
48
 
49
+ response = openai.ChatCompletion.create(
50
+ model="gpt-3.5-turbo",
51
+ messages=messages,
52
+ temperature=0.2,
53
+ stream=True,
54
+ )
55
  complete_response = ""
 
56
  for chunk in response:
57
  if chunk_message := chunk["choices"][0]["delta"].get("content", None):
58
  complete_response += chunk_message