Update app.py
Browse files
app.py
CHANGED
|
@@ -188,26 +188,26 @@ def format_chat_history(history):
|
|
| 188 |
def display_chat_messages():
|
| 189 |
"""Display chat messages in a conversational format."""
|
| 190 |
for message in st.session_state.chat_history:
|
| 191 |
-
# User message - right aligned
|
| 192 |
with st.container():
|
| 193 |
-
col1, col2 = st.columns([6, 4]
|
| 194 |
with col2:
|
| 195 |
st.markdown(f"""
|
| 196 |
<div style='background-color: #007AFF; color: white; padding: 12px 16px;
|
| 197 |
-
border-radius: 15px 15px 0 15px; margin-bottom: 8px; text-align:
|
| 198 |
-
box-shadow: 0 1px 2px rgba(0,0,0,0.1);'>
|
| 199 |
{message['question']}
|
| 200 |
</div>
|
| 201 |
""", unsafe_allow_html=True)
|
| 202 |
|
| 203 |
-
# Assistant message - left aligned
|
| 204 |
with st.container():
|
| 205 |
-
col1, col2 = st.columns([4, 6]
|
| 206 |
with col1:
|
| 207 |
st.markdown(f"""
|
| 208 |
<div style='background-color: #f0f2f6; padding: 12px 16px;
|
| 209 |
border-radius: 15px 15px 15px 0; margin-bottom: 16px;
|
| 210 |
-
box-shadow: 0 1px 2px rgba(0,0,0,0.1);'>
|
| 211 |
{message['answer']}
|
| 212 |
</div>
|
| 213 |
""", unsafe_allow_html=True)
|
|
|
|
| 188 |
def display_chat_messages():
|
| 189 |
"""Display chat messages in a conversational format."""
|
| 190 |
for message in st.session_state.chat_history:
|
| 191 |
+
# User message - right aligned with wider column
|
| 192 |
with st.container():
|
| 193 |
+
col1, col2 = st.columns([2, 8]) # Changed from [6, 4] to [2, 8]
|
| 194 |
with col2:
|
| 195 |
st.markdown(f"""
|
| 196 |
<div style='background-color: #007AFF; color: white; padding: 12px 16px;
|
| 197 |
+
border-radius: 15px 15px 0 15px; margin-bottom: 8px; text-align: left;
|
| 198 |
+
box-shadow: 0 1px 2px rgba(0,0,0,0.1); max-width: 800px;'>
|
| 199 |
{message['question']}
|
| 200 |
</div>
|
| 201 |
""", unsafe_allow_html=True)
|
| 202 |
|
| 203 |
+
# Assistant message - left aligned with wider column
|
| 204 |
with st.container():
|
| 205 |
+
col1, col2 = st.columns([8, 2]) # Changed from [4, 6] to [8, 2]
|
| 206 |
with col1:
|
| 207 |
st.markdown(f"""
|
| 208 |
<div style='background-color: #f0f2f6; padding: 12px 16px;
|
| 209 |
border-radius: 15px 15px 15px 0; margin-bottom: 16px;
|
| 210 |
+
box-shadow: 0 1px 2px rgba(0,0,0,0.1); max-width: 800px;'>
|
| 211 |
{message['answer']}
|
| 212 |
</div>
|
| 213 |
""", unsafe_allow_html=True)
|