Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -25,8 +25,9 @@ def predict(message, history):
|
|
25 |
stream=False # Set to False for simplicity in this example
|
26 |
)
|
27 |
|
28 |
-
|
29 |
-
|
|
|
30 |
history.append((message, response_text)) # Update history with the new Q&A pair
|
31 |
return response_text
|
32 |
else:
|
|
|
25 |
stream=False # Set to False for simplicity in this example
|
26 |
)
|
27 |
|
28 |
+
# Ensure response handling is correct
|
29 |
+
if response.choices and response.choices[0].message['content']:
|
30 |
+
response_text = response.choices[0].message['content'].strip()
|
31 |
history.append((message, response_text)) # Update history with the new Q&A pair
|
32 |
return response_text
|
33 |
else:
|