Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -143,7 +143,8 @@ def generate_response(chain, query, context):
|
|
143 |
timeout_seconds = 120
|
144 |
result = run_with_timeout(chain.invoke, ({"question": query, "chat_history": st.session_state.messages},), timeout_seconds)
|
145 |
if result is None:
|
146 |
-
return
|
|
|
147 |
return result
|
148 |
# Sidebar
|
149 |
with st.sidebar:
|
|
|
143 |
timeout_seconds = 120
|
144 |
result = run_with_timeout(chain.invoke, ({"question": query, "chat_history": st.session_state.messages},), timeout_seconds)
|
145 |
if result is None:
|
146 |
+
return result
|
147 |
+
# return "I apologize, but I couldn't generate a response in time. The query might be too complex for me to process quickly. Could you try simplifying your question?"
|
148 |
return result
|
149 |
# Sidebar
|
150 |
with st.sidebar:
|