Wajahat698 commited on
Commit
fb6636a
·
verified ·
1 Parent(s): dfc7b69

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -18,7 +18,6 @@ from urllib.parse import quote, urlparse
18
  import redis
19
  import aiohttp
20
  import unicodedata
21
-
22
  import serpapi
23
  from serpapi import Client # Assuming serpapi.Client is the correct import
24
 
@@ -2271,17 +2270,20 @@ def handle_prompt(prompt):
2271
 
2272
  # Combine the response text with Trust Tip and Suggestion
2273
  combined_text = f"{full_response}\n\n---\n\n**Trust Tip**: {trust_tip}\n\n**Suggestion**: {suggestion}"
2274
-
 
 
2275
 
2276
 
2277
  with response_placeholder:
2278
  with st.chat_message("assistant"):
2279
 
2280
- st.code(combined_text, language="markdown")
 
2281
 
2282
 
2283
  #st.write(combined_text,unsafe_allow_html=True)
2284
- st.session_state.chat_history.append({"role": "assistant", "content": combined_text})
2285
  copy_to_clipboard(combined_text)
2286
 
2287
 
 
18
  import redis
19
  import aiohttp
20
  import unicodedata
 
21
  import serpapi
22
  from serpapi import Client # Assuming serpapi.Client is the correct import
23
 
 
2270
 
2271
  # Combine the response text with Trust Tip and Suggestion
2272
  combined_text = f"{full_response}\n\n---\n\n**Trust Tip**: {trust_tip}\n\n**Suggestion**: {suggestion}"
2273
+ import html
2274
+ escaped_output = html.escape(combined_text)
2275
+
2276
 
2277
 
2278
  with response_placeholder:
2279
  with st.chat_message("assistant"):
2280
 
2281
+ st.markdown(escaped_output, unsafe_allow_html=True)
2282
+
2283
 
2284
 
2285
  #st.write(combined_text,unsafe_allow_html=True)
2286
+ st.session_state.chat_history.append({"role": "assistant", "content": escaped_output})
2287
  copy_to_clipboard(combined_text)
2288
 
2289