Spaces:
Runtime error
Runtime error
Update ui/components.py
Browse files- ui/components.py +8 -15
ui/components.py
CHANGED
|
@@ -100,21 +100,14 @@ def show_chat_history(chat_history):
|
|
| 100 |
st.markdown(chat.get('analysis', ''))
|
| 101 |
st.markdown("---")
|
| 102 |
|
| 103 |
-
def show_follow_up_section(key_suffix=""):
|
| 104 |
-
"""Show the follow-up question section with enhanced UI"""
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
if 'conversation_context' in st.session_state:
|
| 112 |
-
for msg in st.session_state.conversation_context:
|
| 113 |
-
if msg['role'] == 'user':
|
| 114 |
-
st.markdown(f"**You:** {msg['content']}")
|
| 115 |
-
else:
|
| 116 |
-
st.markdown(f"**Assistant:** {msg['content']}")
|
| 117 |
-
st.markdown("---")
|
| 118 |
|
| 119 |
# Input section
|
| 120 |
col1, col2 = st.columns([4, 1])
|
|
|
|
| 100 |
st.markdown(chat.get('analysis', ''))
|
| 101 |
st.markdown("---")
|
| 102 |
|
| 103 |
+
def show_follow_up_section(key_suffix="", previous_response=None):
|
| 104 |
+
"""Show the follow-up question section with enhanced chat UI"""
|
| 105 |
+
# Show previous response if provided
|
| 106 |
+
if previous_response:
|
| 107 |
+
with st.container():
|
| 108 |
+
st.markdown("**Previous Response:**")
|
| 109 |
+
st.markdown(previous_response)
|
| 110 |
+
st.markdown("---")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
|
| 112 |
# Input section
|
| 113 |
col1, col2 = st.columns([4, 1])
|