修复代码,实现rag测试
All checks were successful
构建并部署 AI Agent 服务 / deploy (push) Successful in 6m11s

This commit is contained in:
2026-05-04 20:31:04 +08:00
parent 0543a4da8b
commit acc8d801f3
5 changed files with 15 additions and 31 deletions

View File

@@ -184,4 +184,4 @@ def create_llm_call_node(llm, tools: list):
log_state_change("llm_call", state, "离开(异常)")
return error_result
return call_llm
return call_llm

View File

@@ -17,6 +17,7 @@ from app.main_graph.utils.retry_utils import (
RAG_RETRY_CONFIG,
create_retry_wrapper_for_node
)
from app.logger import info
# 真正导入和利用已有 RAG 代码
from app.rag.tools import create_rag_tool
@@ -95,7 +96,7 @@ def inject_rag_tool_to_state(state: MainGraphState, rag_tool: Any) -> MainGraphS
return state
# ========== RAG 检索核心逻辑(真正利用已有代码) ==========
# ========== RAG 检索核心逻辑(真正利用已有代码)==========
async def _rag_retrieve_core(state: MainGraphState) -> MainGraphState:
"""
RAG 检索核心逻辑(真正利用 rag/tools.py - 异步版本
@@ -158,7 +159,7 @@ async def _rag_retrieve_core(state: MainGraphState) -> MainGraphState:
raise RuntimeError("RAG 工具未初始化,请先调用 set_global_rag_tool() 或 set_global_rag_pipeline()")
# ========== RAG 检索节点(带超时和重试) ==========
# ========== RAG 检索节点(带超时和重试)==========
async def rag_retrieve_node(state: MainGraphState, config: Optional[Dict[str, Any]] = None) -> MainGraphState:
"""
RAG 检索节点:带超时和重试,真正利用已有 RAG 代码