集成三个子图到主Agent架构 + 修复前后端字段不匹配问题
Some checks failed
构建并部署 AI Agent 服务 / deploy (push) Has been cancelled
Some checks failed
构建并部署 AI Agent 服务 / deploy (push) Has been cancelled
主要变更: 1. 创建 subgraph_tools.py - 将三个子图包装为 LangChain 工具 2. 更新 graph_tools.py - 删除旧工具,添加子图工具 3. 更新系统提示词 - 介绍三个子系统 + RAG 能力 4. 简化 backend.py - 删除独立子图 API 端点 5. 修复 service.py 字段名不匹配问题 - content -> token 6. 前端界面优化 - 移动子图测试到侧边栏、删除测试审核按钮 7. 添加 pyjwt 依赖到 requirements.txt 8. 更新 docker-compose.yml - 添加前端代码挂载
This commit is contained in:
@@ -187,9 +187,9 @@ class AIAgentService:
|
||||
# 处理思考过程
|
||||
if reasoning_token:
|
||||
processed_event = {
|
||||
"type": "reasoning",
|
||||
"type": "llm_token",
|
||||
"node": node_name,
|
||||
"content": reasoning_token
|
||||
"reasoning_token": reasoning_token
|
||||
}
|
||||
# 处理工具调用
|
||||
elif hasattr(message_chunk, 'tool_calls') and message_chunk.tool_calls:
|
||||
@@ -215,7 +215,8 @@ class AIAgentService:
|
||||
processed_event = {
|
||||
"type": "llm_token",
|
||||
"node": node_name,
|
||||
"content": token_content
|
||||
"token": token_content, # ✅ 改为 token
|
||||
"reasoning_token": reasoning_token
|
||||
}
|
||||
|
||||
elif chunk_type == "updates":
|
||||
@@ -289,7 +290,7 @@ class AIAgentService:
|
||||
yield {
|
||||
"type": "llm_token",
|
||||
"node": "fast_path",
|
||||
"content": char
|
||||
"token": char # ✅ 改为 token
|
||||
}
|
||||
await asyncio.sleep(0.03)
|
||||
|
||||
@@ -303,7 +304,7 @@ class AIAgentService:
|
||||
yield {
|
||||
"type": "llm_token",
|
||||
"node": "fast_path",
|
||||
"content": char
|
||||
"token": char # ✅ 改为 token
|
||||
}
|
||||
await asyncio.sleep(0.03)
|
||||
|
||||
@@ -334,7 +335,7 @@ class AIAgentService:
|
||||
yield {
|
||||
"type": "llm_token",
|
||||
"node": "fast_path",
|
||||
"content": char
|
||||
"token": char # ✅ 改为 token
|
||||
}
|
||||
await asyncio.sleep(0.03)
|
||||
|
||||
@@ -348,7 +349,7 @@ class AIAgentService:
|
||||
yield {
|
||||
"type": "llm_token",
|
||||
"node": "fast_path",
|
||||
"content": char
|
||||
"token": char # ✅ 改为 token
|
||||
}
|
||||
await asyncio.sleep(0.03)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user