Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1255,9 +1255,13 @@ if retriever:
|
|
| 1255 |
|
| 1256 |
with st.chat_message("assistant"):
|
| 1257 |
try:
|
| 1258 |
-
|
| 1259 |
-
|
|
|
|
|
|
|
|
|
|
| 1260 |
|
|
|
|
| 1261 |
if should_reset:
|
| 1262 |
st.session_state.conversation_id += 1
|
| 1263 |
st.session_state.messages = []
|
|
|
|
| 1255 |
|
| 1256 |
with st.chat_message("assistant"):
|
| 1257 |
try:
|
| 1258 |
+
# Only retrieve documents if NOT conversational
|
| 1259 |
+
if is_conversational_input(prompt):
|
| 1260 |
+
retrieved_docs = None
|
| 1261 |
+
else:
|
| 1262 |
+
retrieved_docs = retriever.invoke(prompt)
|
| 1263 |
|
| 1264 |
+
answer, sources, should_reset, new_follow_up = process_query(prompt, retrieved_docs)
|
| 1265 |
if should_reset:
|
| 1266 |
st.session_state.conversation_id += 1
|
| 1267 |
st.session_state.messages = []
|