Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2233,14 +2233,15 @@ def handle_prompt(prompt):
|
|
| 2233 |
with response_placeholder:
|
| 2234 |
with st.chat_message("assistant"):
|
| 2235 |
st.write(combined_text)
|
|
|
|
|
|
|
| 2236 |
|
| 2237 |
|
| 2238 |
except Exception as e:
|
| 2239 |
logging.error(f"Error generating response: {e}")
|
| 2240 |
st.error("An error occurred while generating the response. Please try again.")
|
| 2241 |
|
| 2242 |
-
|
| 2243 |
-
copy_to_clipboard(combined_text)
|
| 2244 |
st.session_state["handled"] = True # Mark as handled
|
| 2245 |
|
| 2246 |
# Call the function to handle the prompt
|
|
|
|
| 2233 |
with response_placeholder:
|
| 2234 |
with st.chat_message("assistant"):
|
| 2235 |
st.write(combined_text)
|
| 2236 |
+
st.session_state.chat_history.append({"role": "assistant", "content": combined_text})
|
| 2237 |
+
copy_to_clipboard(combined_text)
|
| 2238 |
|
| 2239 |
|
| 2240 |
except Exception as e:
|
| 2241 |
logging.error(f"Error generating response: {e}")
|
| 2242 |
st.error("An error occurred while generating the response. Please try again.")
|
| 2243 |
|
| 2244 |
+
|
|
|
|
| 2245 |
st.session_state["handled"] = True # Mark as handled
|
| 2246 |
|
| 2247 |
# Call the function to handle the prompt
|