Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -155,6 +155,20 @@ with tab1:
|
|
155 |
with st.chat_message(msg["role"]):
|
156 |
st.markdown(msg["content"], unsafe_allow_html=True)
|
157 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
with image_col:
|
159 |
if show_image and st.session_state.image_urls:
|
160 |
st.markdown("### 🖼️ Image(s)")
|
@@ -167,6 +181,7 @@ with tab1:
|
|
167 |
except Exception:
|
168 |
continue
|
169 |
|
|
|
170 |
# ------------------ Tab 2: Visual Reference Search ------------------
|
171 |
with tab2:
|
172 |
ASSISTANT_ID = "asst_9v09zgizdcuuhNdcFQpRo9RO"
|
|
|
155 |
with st.chat_message(msg["role"]):
|
156 |
st.markdown(msg["content"], unsafe_allow_html=True)
|
157 |
|
158 |
+
# 🧠 Follow-up Suggestions
|
159 |
+
if st.session_state.messages and st.session_state.messages[-1]["role"] == "assistant":
|
160 |
+
latest_reply = st.session_state.messages[-1]["content"]
|
161 |
+
match = re.search(r"###\s*\*\*Some Possible Questions:\*\*(.*?)###", latest_reply + "###", re.DOTALL)
|
162 |
+
if match:
|
163 |
+
block = match.group(1)
|
164 |
+
questions = [line.strip(" -•") for line in block.splitlines() if line.strip().startswith(("-", "•"))]
|
165 |
+
if questions:
|
166 |
+
st.markdown("#### 💡 Follow-Up Suggestions")
|
167 |
+
for q in questions:
|
168 |
+
if st.button(f"📌 {q}"):
|
169 |
+
st.session_state.pending_prompt = q
|
170 |
+
st.rerun()
|
171 |
+
|
172 |
with image_col:
|
173 |
if show_image and st.session_state.image_urls:
|
174 |
st.markdown("### 🖼️ Image(s)")
|
|
|
181 |
except Exception:
|
182 |
continue
|
183 |
|
184 |
+
|
185 |
# ------------------ Tab 2: Visual Reference Search ------------------
|
186 |
with tab2:
|
187 |
ASSISTANT_ID = "asst_9v09zgizdcuuhNdcFQpRo9RO"
|