Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2260,6 +2260,9 @@ def handle_prompt(prompt):
|
|
| 2260 |
"chat_history": st.session_state.chat_history
|
| 2261 |
})
|
| 2262 |
full_response = output["output"]
|
|
|
|
|
|
|
|
|
|
| 2263 |
|
| 2264 |
|
| 2265 |
|
|
@@ -2271,10 +2274,8 @@ def handle_prompt(prompt):
|
|
| 2271 |
trust_tip, suggestion = get_trust_tip_and_suggestion()
|
| 2272 |
|
| 2273 |
# Combine the response text with Trust Tip and Suggestion
|
| 2274 |
-
combined_text = f"{
|
| 2275 |
-
|
| 2276 |
-
escaped_text = combined_text.replace("$", "\$")
|
| 2277 |
-
escaped_text_html = f"<pre>{escaped_text}</pre>"
|
| 2278 |
|
| 2279 |
|
| 2280 |
|
|
@@ -2288,8 +2289,8 @@ def handle_prompt(prompt):
|
|
| 2288 |
|
| 2289 |
|
| 2290 |
#st.write(combined_text,unsafe_allow_html=True)
|
| 2291 |
-
st.session_state.chat_history.append({"role": "assistant", "content":
|
| 2292 |
-
copy_to_clipboard(
|
| 2293 |
|
| 2294 |
|
| 2295 |
except Exception as e:
|
|
|
|
| 2260 |
"chat_history": st.session_state.chat_history
|
| 2261 |
})
|
| 2262 |
full_response = output["output"]
|
| 2263 |
+
import html
|
| 2264 |
+
escaped_text = full_response.replace("$", "\$")
|
| 2265 |
+
|
| 2266 |
|
| 2267 |
|
| 2268 |
|
|
|
|
| 2274 |
trust_tip, suggestion = get_trust_tip_and_suggestion()
|
| 2275 |
|
| 2276 |
# Combine the response text with Trust Tip and Suggestion
|
| 2277 |
+
combined_text = f"{escaped_text}\n\n---\n\n**Trust Tip**: {trust_tip}\n\n**Suggestion**: {suggestion}"
|
| 2278 |
+
|
|
|
|
|
|
|
| 2279 |
|
| 2280 |
|
| 2281 |
|
|
|
|
| 2289 |
|
| 2290 |
|
| 2291 |
#st.write(combined_text,unsafe_allow_html=True)
|
| 2292 |
+
st.session_state.chat_history.append({"role": "assistant", "content": combined_text})
|
| 2293 |
+
copy_to_clipboard(combined_text)
|
| 2294 |
|
| 2295 |
|
| 2296 |
except Exception as e:
|