Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -142,7 +142,7 @@ def main():
|
|
142 |
st.info("Try refining your search terms")
|
143 |
else:
|
144 |
st.subheader(f"Top Results ({search_duration:.2f}s)")
|
145 |
-
for res in results:
|
146 |
logger.info(f"Results: {res}")
|
147 |
with st.expander(res["title"]):
|
148 |
st.markdown(f"**Summary**: {res['summary']}")
|
@@ -153,10 +153,10 @@ def main():
|
|
153 |
source = res['source']
|
154 |
if source and is_valid_url(source):
|
155 |
st.markdown(f"[View Source]({source}) | [Google Scholar Search](https://scholar.google.com/scholar?q={quote(res['title'])})")
|
156 |
-
|
157 |
except Exception as e:
|
158 |
logger.error(f"Search error: {str(e)}")
|
159 |
-
|
160 |
|
161 |
# System status sidebar
|
162 |
with st.sidebar:
|
|
|
142 |
st.info("Try refining your search terms")
|
143 |
else:
|
144 |
st.subheader(f"Top Results ({search_duration:.2f}s)")
|
145 |
+
for index, res in results.iterrows(): # Use iterrows to iterate through rows if it's a DataFrame
|
146 |
logger.info(f"Results: {res}")
|
147 |
with st.expander(res["title"]):
|
148 |
st.markdown(f"**Summary**: {res['summary']}")
|
|
|
153 |
source = res['source']
|
154 |
if source and is_valid_url(source):
|
155 |
st.markdown(f"[View Source]({source}) | [Google Scholar Search](https://scholar.google.com/scholar?q={quote(res['title'])})")
|
156 |
+
|
157 |
except Exception as e:
|
158 |
logger.error(f"Search error: {str(e)}")
|
159 |
+
st.error("Search operation failed")
|
160 |
|
161 |
# System status sidebar
|
162 |
with st.sidebar:
|