hopefully this time it works
Browse files
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(
|
50 |
-
"
|
51 |
-
|
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
|