velmurugan1122 commited on
Commit
9942df9
Β·
1 Parent(s): 7a50854

changes done

Browse files
Files changed (1) hide show
  1. app.py +25 -2
app.py CHANGED
@@ -7,6 +7,29 @@ client = Groq(api_key="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"
7
  # Page configuration
8
  st.set_page_config(page_title="Gastroenterology Chatbot", page_icon="🌟")
9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  st.title("πŸ₯ Gastroenterology Chatbot")
11
  st.write("I am a highly knowledgeable and compassionate AI gastroenterology assistant. Ask me anything about digestive health!")
12
 
@@ -35,6 +58,6 @@ if user_input:
35
  st.write("## Chat History")
36
  for message in st.session_state.messages:
37
  if message["role"] == "user":
38
- st.write(f"**You:** {message['content']}")
39
  elif message["role"] == "assistant":
40
- st.write(f"**Assistant:** {message['content']}")
 
7
  # Page configuration
8
  st.set_page_config(page_title="Gastroenterology Chatbot", page_icon="🌟")
9
 
10
+ # Custom CSS for chat styling
11
+ st.markdown("""
12
+ <style>
13
+ .chat-bubble {
14
+ padding: 10px;
15
+ border-radius: 10px;
16
+ margin-bottom: 10px;
17
+ }
18
+ .user-bubble {
19
+ background-color: #DCF8C6;
20
+ text-align: right;
21
+ }
22
+ .assistant-bubble {
23
+ background-color: #ECECEC;
24
+ text-align: left;
25
+ }
26
+ .icon {
27
+ font-size: 20px;
28
+ margin-right: 10px;
29
+ }
30
+ </style>
31
+ """, unsafe_allow_html=True)
32
+
33
  st.title("πŸ₯ Gastroenterology Chatbot")
34
  st.write("I am a highly knowledgeable and compassionate AI gastroenterology assistant. Ask me anything about digestive health!")
35
 
 
58
  st.write("## Chat History")
59
  for message in st.session_state.messages:
60
  if message["role"] == "user":
61
+ st.markdown(f"<div class='chat-bubble user-bubble'><strong>You:</strong> {message['content']}</div>", unsafe_allow_html=True)
62
  elif message["role"] == "assistant":
63
+ st.markdown(f"<div class='chat-bubble assistant-bubble'><strong>Assistant:</strong> {message['content']}</div>", unsafe_allow_html=True)