Update app.py
Browse files
app.py
CHANGED
|
@@ -208,7 +208,9 @@ def generate_response(db, query_text, previous_context):
|
|
| 208 |
response_placeholder = st.empty()
|
| 209 |
|
| 210 |
for token in output_stream:
|
| 211 |
-
|
|
|
|
|
|
|
| 212 |
response_placeholder.text(full_response)
|
| 213 |
|
| 214 |
return full_response
|
|
|
|
| 208 |
response_placeholder = st.empty()
|
| 209 |
|
| 210 |
for token in output_stream:
|
| 211 |
+
# Extract the text from the token
|
| 212 |
+
token_text = token.get("choices", [{}])[0].get("text", "")
|
| 213 |
+
full_response += token_text
|
| 214 |
response_placeholder.text(full_response)
|
| 215 |
|
| 216 |
return full_response
|