添加长期存储,流式检查
Some checks failed
构建并部署 AI Agent 服务 / deploy (push) Has been cancelled

This commit is contained in:
2026-04-17 01:26:05 +08:00
parent 602d551fd1
commit 404efde282
37 changed files with 794 additions and 2095 deletions

View File

@@ -10,50 +10,30 @@ from frontend.state import AppState
def render_info_panel():
"""渲染右侧信息面板"""
st.header("📊 会话信息")
# 当前线程信息
_render_thread_info()
st.divider()
"""渲染右侧信息面板(现改为侧边栏底部)"""
st.caption("📊 会话信息")
# 消息统计
_render_message_stats()
st.divider()
# 使用提示
_render_tips()
def _render_thread_info():
"""渲染当前线程信息"""
st.subheader("当前对话")
thread_id = AppState.get_current_thread_id()
st.code(thread_id[:8] + "...", language=None)
def _render_message_stats():
"""渲染消息统计"""
st.subheader("消息统计")
stats = AppState.get_message_stats()
col1, col2 = st.columns(2)
with col1:
st.metric("用户消息", stats["user"])
with col2:
st.metric("AI 回复", stats["assistant"])
st.markdown(f"<span style='font-size:0.8em;color:#666;'>共 {stats['user']} 问 / {stats['assistant']} 答</span>", unsafe_allow_html=True)
def _render_tips():
"""渲染使用提示"""
st.subheader("💡 使用提示")
st.markdown("""
- 左侧可切换历史对话
- 点击"新对话"开始新话题
- 登录后对话历史隔离
- 支持流式实时响应
- 模型可随时切换
""")
with st.expander("💡 使用提示", expanded=False):
st.markdown("""
<div style='font-size:0.85em;color:#555;'>
- 左侧可切换历史对话<br>
- 点击"新对话"开始新话题<br>
- 登录后对话历史隔离<br>
- 模型可随时切换
</div>
""", unsafe_allow_html=True)