Toggle navigation
Toggle navigation
This project
Loading...
Sign in
万朱浩
/
Venue-Ops
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
马一丁
2025-11-22 13:24:31 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
17657513473f1272d1ebc8a41e5f0735e7903bce
17657513
1 parent
6419d1cc
Resolve the Issue of Search History not Displaying
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
7 deletions
MediaEngine/state/state.py
SingleEngineApp/media_engine_streamlit_app.py
MediaEngine/state/state.py
View file @
1765751
...
...
@@ -58,11 +58,17 @@ class Research:
def
add_search_results
(
self
,
query
:
str
,
results
:
List
[
Dict
[
str
,
Any
]]):
"""批量添加搜索结果"""
for
result
in
results
:
# 防御空值,避免下游展示时报错
url
=
result
.
get
(
"url"
)
or
""
title
=
result
.
get
(
"title"
)
or
""
content
=
result
.
get
(
"content"
)
or
""
if
not
isinstance
(
content
,
str
):
content
=
str
(
content
)
search
=
Search
(
query
=
query
,
url
=
result
.
get
(
"url"
,
""
),
title
=
result
.
get
(
"title"
,
""
),
content
=
result
.
get
(
"content"
,
""
),
query
=
query
or
""
,
url
=
url
,
title
=
title
,
content
=
content
,
score
=
result
.
get
(
"score"
)
)
self
.
add_search
(
search
)
...
...
SingleEngineApp/media_engine_streamlit_app.py
View file @
1765751
...
...
@@ -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
)
...
...
Please
register
or
login
to post a comment