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-08-24 14:26:16 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
611f0691a0f9c8a2f3d4cec27ab54908856e42e3
611f0691
1 parent
281c5834
At the same time, activate the search function to achieve.
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
60 additions
and
99 deletions
SingleEngineApp/insight_engine_streamlit_app.py
SingleEngineApp/media_engine_streamlit_app.py
SingleEngineApp/query_engine_streamlit_app.py
templates/index.html
SingleEngineApp/insight_engine_streamlit_app.py
View file @
611f069
...
...
@@ -47,42 +47,33 @@ def main():
max_reflections
=
2
max_content_length
=
500000
# Kimi支持长文本
# 主界面
col1
,
col2
=
st
.
columns
([
2
,
1
])
with
col1
:
# 简化的研究查询展示区域
st
.
header
(
"研究查询"
)
# 如果有自动查询,使用它作为默认值
default_query
=
auto_query
if
auto_query
else
""
# 如果有自动查询,使用它作为默认值,否则显示占位符
display_query
=
auto_query
if
auto_query
else
"等待从主页面接收搜索查询..."
query
=
st
.
text_area
(
"请输入您要研究的问题"
,
value
=
default_query
,
placeholder
=
"例如:2025年人工智能发展趋势"
,
height
=
100
# 只读的查询展示区域
st
.
text_area
(
"当前查询"
,
value
=
display_query
,
height
=
100
,
disabled
=
True
,
help
=
"查询内容由主页面的搜索框控制"
)
with
col2
:
st
.
header
(
"状态信息"
)
if
'agent'
in
st
.
session_state
and
hasattr
(
st
.
session_state
.
agent
,
'state'
):
progress
=
st
.
session_state
.
agent
.
get_progress_summary
()
st
.
metric
(
"总段落数"
,
progress
[
'total_paragraphs'
])
st
.
metric
(
"已完成"
,
progress
[
'completed_paragraphs'
])
st
.
progress
(
progress
[
'progress_percentage'
]
/
100
)
else
:
st
.
info
(
"尚未开始研究"
)
# 执行按钮
col1_btn
,
col2_btn
,
col3_btn
=
st
.
columns
([
1
,
1
,
1
])
with
col2_btn
:
start_research
=
st
.
button
(
"开始研究"
,
type
=
"primary"
,
use_container_width
=
True
)
# 自动搜索逻辑
start_research
=
False
query
=
auto_query
if
auto_search
and
auto_query
and
'auto_search_executed'
not
in
st
.
session_state
:
st
.
session_state
.
auto_search_executed
=
True
start_research
=
True
query
=
auto_query
st
.
success
(
f
"🚀 接收到搜索请求:{auto_query}"
)
st
.
info
(
"正在启动研究..."
)
elif
auto_query
and
not
auto_search
:
st
.
info
(
f
"📝 当前查询:{auto_query}"
)
st
.
warning
(
"等待搜索启动信号..."
)
# 验证配置
if
start_research
:
...
...
SingleEngineApp/media_engine_streamlit_app.py
View file @
611f069
...
...
@@ -47,42 +47,33 @@ def main():
max_reflections
=
2
max_content_length
=
20000
# 主界面
col1
,
col2
=
st
.
columns
([
2
,
1
])
with
col1
:
# 简化的研究查询展示区域
st
.
header
(
"研究查询"
)
# 如果有自动查询,使用它作为默认值
default_query
=
auto_query
if
auto_query
else
""
# 如果有自动查询,使用它作为默认值,否则显示占位符
display_query
=
auto_query
if
auto_query
else
"等待从主页面接收搜索查询..."
query
=
st
.
text_area
(
"请输入您要研究的问题"
,
value
=
default_query
,
placeholder
=
"例如:2025年人工智能发展趋势"
,
height
=
100
# 只读的查询展示区域
st
.
text_area
(
"当前查询"
,
value
=
display_query
,
height
=
100
,
disabled
=
True
,
help
=
"查询内容由主页面的搜索框控制"
)
with
col2
:
st
.
header
(
"状态信息"
)
if
'agent'
in
st
.
session_state
and
hasattr
(
st
.
session_state
.
agent
,
'state'
):
progress
=
st
.
session_state
.
agent
.
get_progress_summary
()
st
.
metric
(
"总段落数"
,
progress
[
'total_paragraphs'
])
st
.
metric
(
"已完成"
,
progress
[
'completed_paragraphs'
])
st
.
progress
(
progress
[
'progress_percentage'
]
/
100
)
else
:
st
.
info
(
"尚未开始研究"
)
# 执行按钮
col1_btn
,
col2_btn
,
col3_btn
=
st
.
columns
([
1
,
1
,
1
])
with
col2_btn
:
start_research
=
st
.
button
(
"开始研究"
,
type
=
"primary"
,
use_container_width
=
True
)
# 自动搜索逻辑
start_research
=
False
query
=
auto_query
if
auto_search
and
auto_query
and
'auto_search_executed'
not
in
st
.
session_state
:
st
.
session_state
.
auto_search_executed
=
True
start_research
=
True
query
=
auto_query
st
.
success
(
f
"🚀 接收到搜索请求:{auto_query}"
)
st
.
info
(
"正在启动研究..."
)
elif
auto_query
and
not
auto_search
:
st
.
info
(
f
"📝 当前查询:{auto_query}"
)
st
.
warning
(
"等待搜索启动信号..."
)
# 验证配置
if
start_research
:
...
...
SingleEngineApp/query_engine_streamlit_app.py
View file @
611f069
...
...
@@ -47,42 +47,33 @@ def main():
max_reflections
=
2
max_content_length
=
20000
# 主界面
col1
,
col2
=
st
.
columns
([
2
,
1
])
with
col1
:
# 简化的研究查询展示区域
st
.
header
(
"研究查询"
)
# 如果有自动查询,使用它作为默认值
default_query
=
auto_query
if
auto_query
else
""
# 如果有自动查询,使用它作为默认值,否则显示占位符
display_query
=
auto_query
if
auto_query
else
"等待从主页面接收搜索查询..."
query
=
st
.
text_area
(
"请输入您要研究的问题"
,
value
=
default_query
,
placeholder
=
"例如:2025年人工智能发展趋势"
,
height
=
100
# 只读的查询展示区域
st
.
text_area
(
"当前查询"
,
value
=
display_query
,
height
=
100
,
disabled
=
True
,
help
=
"查询内容由主页面的搜索框控制"
)
with
col2
:
st
.
header
(
"状态信息"
)
if
'agent'
in
st
.
session_state
and
hasattr
(
st
.
session_state
.
agent
,
'state'
):
progress
=
st
.
session_state
.
agent
.
get_progress_summary
()
st
.
metric
(
"总段落数"
,
progress
[
'total_paragraphs'
])
st
.
metric
(
"已完成"
,
progress
[
'completed_paragraphs'
])
st
.
progress
(
progress
[
'progress_percentage'
]
/
100
)
else
:
st
.
info
(
"尚未开始研究"
)
# 执行按钮
col1_btn
,
col2_btn
,
col3_btn
=
st
.
columns
([
1
,
1
,
1
])
with
col2_btn
:
start_research
=
st
.
button
(
"开始研究"
,
type
=
"primary"
,
use_container_width
=
True
)
# 自动搜索逻辑
start_research
=
False
query
=
auto_query
if
auto_search
and
auto_query
and
'auto_search_executed'
not
in
st
.
session_state
:
st
.
session_state
.
auto_search_executed
=
True
start_research
=
True
query
=
auto_query
st
.
success
(
f
"🚀 接收到搜索请求:{auto_query}"
)
st
.
info
(
"正在启动研究..."
)
elif
auto_query
and
not
auto_search
:
st
.
info
(
f
"📝 当前查询:{auto_query}"
)
st
.
warning
(
"等待搜索启动信号..."
)
# 验证配置
if
start_research
:
...
...
templates/index.html
View file @
611f069
...
...
@@ -400,32 +400,20 @@
preloadIframes
();
}
// 向所有运行中的应用发送搜索请求(通过
新窗口方式避免刷新现有iframe
)
// 向所有运行中的应用发送搜索请求(通过
刷新iframe传递参数
)
let
totalRunning
=
0
;
const
ports
=
{
insight
:
8501
,
media
:
8502
,
query
:
8503
};
Object
.
keys
(
appStatus
).
forEach
(
app
=>
{
if
(
appStatus
[
app
]
===
'running'
)
{
if
(
appStatus
[
app
]
===
'running'
&&
preloadedIframes
[
app
]
)
{
totalRunning
++
;
// 为每个应用创建一个临时的搜索iframe,避免干扰主iframe
const
searchIframe
=
document
.
createElement
(
'iframe'
);
searchIframe
.
style
.
display
=
'none'
;
searchIframe
.
style
.
position
=
'absolute'
;
searchIframe
.
style
.
top
=
'-9999px'
;
// 构建搜索URL
const
searchUrl
=
`
http
:
//localhost:${ports[app]}?query=${encodeURIComponent(query)}&auto_search=true`;
console
.
log
(
`向
$
{
app
}
发送搜索请求
:
$
{
searchUrl
}
`
);
searchIframe
.
src
=
searchUrl
;
document
.
body
.
appendChild
(
searchIframe
);
// 几秒后移除临时iframe
setTimeout
(()
=>
{
if
(
searchIframe
.
parentNode
)
{
searchIframe
.
parentNode
.
removeChild
(
searchIframe
);
}
},
5000
);
// 直接更新主iframe的src来传递搜索参数
preloadedIframes
[
app
].
src
=
searchUrl
;
}
});
...
...
@@ -436,7 +424,7 @@
}
else
{
button
.
disabled
=
false
;
button
.
innerHTML
=
'搜索'
;
showMessage
(
`
已向
$
{
totalRunning
}
个应用发送搜索请求
`
,
'success'
);
showMessage
(
`
搜索请求已发送到
$
{
totalRunning
}
个应用,页面将刷新以开始研究
`
,
'success'
);
}
}
...
...
Please
register
or
login
to post a comment