Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2232,9 +2232,15 @@ def handle_prompt(prompt):
|
|
| 2232 |
#cleaned_text = clean_text(full_response)
|
| 2233 |
#formatted_text = clean_and_format_markdown(cleaned_text)
|
| 2234 |
|
| 2235 |
-
|
| 2236 |
-
|
| 2237 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2238 |
with response_placeholder:
|
| 2239 |
with st.chat_message("assistant"):
|
| 2240 |
st.write(combined_text,unsafe_allow_html=True)
|
|
|
|
| 2232 |
#cleaned_text = clean_text(full_response)
|
| 2233 |
#formatted_text = clean_and_format_markdown(cleaned_text)
|
| 2234 |
|
| 2235 |
+
if "Trust Tip" not in full_response and "Suggestion" not in full_response:
|
| 2236 |
+
# Retrieve Trust Tip and Suggestion only if not already present
|
| 2237 |
+
trust_tip, suggestion = get_trust_tip_and_suggestion()
|
| 2238 |
+
|
| 2239 |
+
# Combine the response text with Trust Tip and Suggestion
|
| 2240 |
+
combined_text = f"{full_response}\n\n---\n\n**Trust Tip**: {trust_tip}\n\n**Suggestion**: {suggestion}"
|
| 2241 |
+
else:
|
| 2242 |
+
# If already present, just use the full response
|
| 2243 |
+
combined_text = full_response
|
| 2244 |
with response_placeholder:
|
| 2245 |
with st.chat_message("assistant"):
|
| 2246 |
st.write(combined_text,unsafe_allow_html=True)
|