Wajahat698 commited on
Commit
64b019d
·
verified ·
1 Parent(s): 3b5ab51

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -18
app.py CHANGED
@@ -627,24 +627,23 @@ if prompt :
627
 
628
  trust_tip, suggestion = get_trust_tip_and_suggestion()
629
 
630
- st.markdown(cleaned_text)
631
- st.markdown("---") # Add a separator
632
- st.markdown(f"**Trust Tip**: {trust_tip}")
633
- st.markdown(f"**Suggestion**: {suggestion}")
634
-
635
- # Prepare combined text for chat history
636
- combined_text = f"\n\n**Trust Tip**: {trust_tip}\n\n**Suggestion**: {suggestion}"
637
-
 
 
 
638
  except Exception as e:
639
  logger.error(f"Error generating response: {e}")
640
  full_response = "I apologize, but an error occurred while generating the response. Please try again."
641
- st.write(clean_text)
642
-
643
-
644
- # Add AI response to chat history
645
- st.session_state.chat_history.append({
646
- "role": "assistant",
647
- "content": cleaned_text+combined_text,
648
-
649
- })
650
- copy_to_clipboard(cleaned_text)
 
627
 
628
  trust_tip, suggestion = get_trust_tip_and_suggestion()
629
 
630
+ combined_text = f"{cleaned_text}\n\n---\n\n**Trust Tip**: {trust_tip}\n\n**Suggestion**: {suggestion}"
631
+ st.markdown(combined_text, unsafe_allow_html=True)
632
+ #seprtor= st.markdown("---") # Add a separator
633
+ #t_tip= st.markdown(f"**Trust Tip**: {trust_tip}")
634
+ #s_sug- st.markdown(f"**Suggestion**: {suggestion}")
635
+
636
+
637
+
638
+
639
+
640
+
641
  except Exception as e:
642
  logger.error(f"Error generating response: {e}")
643
  full_response = "I apologize, but an error occurred while generating the response. Please try again."
644
+ st.write(full_response)
645
+
646
+ # Add AI response to chat history
647
+
648
+ st.session_state.chat_history.append({"role": "assistant", "content": combined_text})
649
+ copy_to_clipboard(combined_text)