Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2273,12 +2273,7 @@ def handle_prompt(prompt):
|
|
| 2273 |
})
|
| 2274 |
full_response = output["output"]
|
| 2275 |
|
| 2276 |
-
|
| 2277 |
-
html_content = f"""
|
| 2278 |
-
<div style="white-space: pre-wrap; word-break: break-word;">
|
| 2279 |
-
{cleaned_text}
|
| 2280 |
-
</div>
|
| 2281 |
-
"""
|
| 2282 |
|
| 2283 |
# Use Markdown with a styled div to ensure proper word wrapping
|
| 2284 |
|
|
@@ -2289,14 +2284,15 @@ def handle_prompt(prompt):
|
|
| 2289 |
trust_tip, suggestion = get_trust_tip_and_suggestion()
|
| 2290 |
|
| 2291 |
# Combine the response text with Trust Tip and Suggestion
|
| 2292 |
-
combined_text = f"{
|
| 2293 |
|
| 2294 |
else:
|
| 2295 |
# If already present, just use the full response
|
| 2296 |
-
combined_text =
|
| 2297 |
with response_placeholder:
|
| 2298 |
with st.chat_message("assistant"):
|
| 2299 |
-
st.markdown(
|
|
|
|
| 2300 |
|
| 2301 |
#st.write(combined_text,unsafe_allow_html=True)
|
| 2302 |
st.session_state.chat_history.append({"role": "assistant", "content": combined_text})
|
|
|
|
| 2273 |
})
|
| 2274 |
full_response = output["output"]
|
| 2275 |
|
| 2276 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2277 |
|
| 2278 |
# Use Markdown with a styled div to ensure proper word wrapping
|
| 2279 |
|
|
|
|
| 2284 |
trust_tip, suggestion = get_trust_tip_and_suggestion()
|
| 2285 |
|
| 2286 |
# Combine the response text with Trust Tip and Suggestion
|
| 2287 |
+
combined_text = f"{full_response}\n\n---\n\n**Trust Tip**: {trust_tip}\n\n**Suggestion**: {suggestion}"
|
| 2288 |
|
| 2289 |
else:
|
| 2290 |
# If already present, just use the full response
|
| 2291 |
+
combined_text = full_response
|
| 2292 |
with response_placeholder:
|
| 2293 |
with st.chat_message("assistant"):
|
| 2294 |
+
st.markdown(full_response, unsafe_allow_html=True)
|
| 2295 |
+
st.write(full_response)
|
| 2296 |
|
| 2297 |
#st.write(combined_text,unsafe_allow_html=True)
|
| 2298 |
st.session_state.chat_history.append({"role": "assistant", "content": combined_text})
|