Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2274,6 +2274,8 @@ def handle_prompt(prompt):
|
|
| 2274 |
combined_text = f"{full_response}\n\n---\n\n**Trust Tip**: {trust_tip}\n\n**Suggestion**: {suggestion}"
|
| 2275 |
import html
|
| 2276 |
escaped_text = combined_text.replace("$", "\$")
|
|
|
|
|
|
|
| 2277 |
|
| 2278 |
|
| 2279 |
|
|
@@ -2281,13 +2283,13 @@ def handle_prompt(prompt):
|
|
| 2281 |
with response_placeholder:
|
| 2282 |
with st.chat_message("assistant"):
|
| 2283 |
|
| 2284 |
-
st.markdown(
|
| 2285 |
|
| 2286 |
|
| 2287 |
|
| 2288 |
#st.write(combined_text,unsafe_allow_html=True)
|
| 2289 |
-
st.session_state.chat_history.append({"role": "assistant", "content":
|
| 2290 |
-
copy_to_clipboard(
|
| 2291 |
|
| 2292 |
|
| 2293 |
except Exception as e:
|
|
|
|
| 2274 |
combined_text = f"{full_response}\n\n---\n\n**Trust Tip**: {trust_tip}\n\n**Suggestion**: {suggestion}"
|
| 2275 |
import html
|
| 2276 |
escaped_text = combined_text.replace("$", "\$")
|
| 2277 |
+
escaped_text_html = f"<pre>{escaped_text}</pre>"
|
| 2278 |
+
|
| 2279 |
|
| 2280 |
|
| 2281 |
|
|
|
|
| 2283 |
with response_placeholder:
|
| 2284 |
with st.chat_message("assistant"):
|
| 2285 |
|
| 2286 |
+
st.markdown(escaped_text_html)
|
| 2287 |
|
| 2288 |
|
| 2289 |
|
| 2290 |
#st.write(combined_text,unsafe_allow_html=True)
|
| 2291 |
+
st.session_state.chat_history.append({"role": "assistant", "content": escaped_text_html})
|
| 2292 |
+
copy_to_clipboard(escaped_text_html)
|
| 2293 |
|
| 2294 |
|
| 2295 |
except Exception as e:
|