Resolve the Issue of Search History not Displaying

This commit is contained in:
马一丁
2025-11-22 13:24:31 +08:00
parent 6419d1cc08
commit 1765751347
2 changed files with 18 additions and 7 deletions

View File

@@ -220,11 +220,16 @@ def display_results(agent: DeepSearchAgent, final_report: str):
if all_searches:
for i, search in enumerate(all_searches):
with st.expander(f"搜索 {i + 1}: {search.query}"):
query_label = search.query if search.query else "未记录查询"
with st.expander(f"搜索 {i + 1}: {query_label}"):
preview = search.content or ""
if not isinstance(preview, str):
preview = str(preview)
if len(preview) > 200:
preview = preview[:200] + "..."
st.write("**URL:**", search.url)
st.write("**标题:**", search.title)
st.write("**内容预览:**",
search.content[:200] + "..." if len(search.content) > 200 else search.content)
st.write("**内容预览:**", preview if preview else "无可用内容")
if search.score:
st.write("**相关度评分:**", search.score)