This commit is contained in:
@@ -4,12 +4,13 @@
|
||||
"""
|
||||
|
||||
from typing import Dict, Any, Optional
|
||||
from langchain_core.runnables.config import RunnableConfig
|
||||
|
||||
|
||||
async def dispatch_custom_event(
|
||||
event_name: str,
|
||||
data: Dict[str, Any],
|
||||
config: Optional[Dict[str, Any]] = None,
|
||||
config: Optional[RunnableConfig] = None,
|
||||
) -> None:
|
||||
"""
|
||||
安全地发送自定义事件,忽略发送失败
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
错误处理节点 - 处理子图/工具调用错误
|
||||
"""
|
||||
|
||||
from app.main_graph.state import MainGraphState, ErrorSeverity
|
||||
from app.logger import info
|
||||
from ...main_graph.state import MainGraphState, ErrorSeverity
|
||||
from ...logger import info
|
||||
|
||||
|
||||
def error_handling_node(state: MainGraphState) -> MainGraphState:
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"""
|
||||
|
||||
from typing import Optional
|
||||
from langchain_core.runnables.config import RunnableConfig
|
||||
|
||||
from ..state import MainGraphState
|
||||
from ...logger import info, debug
|
||||
@@ -28,7 +29,7 @@ CHITCHAT_KEYWORDS = {
|
||||
|
||||
|
||||
# ========== 闲聊节点 ==========
|
||||
async def fast_chitchat_node(state: MainGraphState, config: Optional[dict] = None) -> MainGraphState:
|
||||
async def fast_chitchat_node(state: MainGraphState, config: Optional[RunnableConfig] = None) -> MainGraphState:
|
||||
"""快速闲聊节点"""
|
||||
state.current_phase = "fast_chitchat"
|
||||
query = state.user_query or ""
|
||||
@@ -69,14 +70,14 @@ def _match_chitchat_template(query: str) -> str:
|
||||
|
||||
|
||||
# ========== 快速 RAG 节点 ==========
|
||||
async def fast_rag_node(state: MainGraphState, config: Optional[dict] = None) -> MainGraphState:
|
||||
async def fast_rag_node(state: MainGraphState, config: Optional[RunnableConfig] = None) -> MainGraphState:
|
||||
"""快速 RAG 节点:只负责 RAG 检索,然后交给 llm_call 生成回答"""
|
||||
state.current_phase = "fast_rag"
|
||||
query = state.user_query or ""
|
||||
info(f"[Fast RAG] 开始处理: {query[:50]}")
|
||||
|
||||
# 获取 RAG 工具
|
||||
from app.main_graph.utils.rag_initializer import get_rag_tool
|
||||
from backend.app.main_graph.utils.rag_initializer import get_rag_tool
|
||||
rag_tool = get_rag_tool()
|
||||
info(f"[Fast RAG] 获取到 rag_tool: {rag_tool is not None}")
|
||||
|
||||
@@ -134,7 +135,7 @@ async def _generate_fast_answer(state: MainGraphState, query: str) -> MainGraphS
|
||||
请给出简洁、准确的回答:"""
|
||||
|
||||
# 使用流式输出
|
||||
from app.main_graph.config import get_stream_writer
|
||||
from backend.app.main_graph.config import get_stream_writer
|
||||
writer = get_stream_writer()
|
||||
|
||||
full_content = ""
|
||||
@@ -164,7 +165,7 @@ async def _generate_fast_answer(state: MainGraphState, query: str) -> MainGraphS
|
||||
|
||||
|
||||
# ========== 快速工具节点 ==========
|
||||
async def fast_tool_node(state: MainGraphState, config: Optional[dict] = None) -> MainGraphState:
|
||||
async def fast_tool_node(state: MainGraphState, config: Optional[RunnableConfig] = None) -> MainGraphState:
|
||||
"""快速工具节点"""
|
||||
state.current_phase = "fast_tool"
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
from typing import Any, Dict
|
||||
|
||||
# 本地模块
|
||||
from app.main_graph.state import MainGraphState
|
||||
from app.utils.logging import log_state_change
|
||||
from app.logger import info, warning
|
||||
from ...main_graph.state import MainGraphState
|
||||
from ...utils.logging import log_state_change
|
||||
from ...logger import info, warning
|
||||
|
||||
from langchain_core.runnables.config import RunnableConfig
|
||||
|
||||
@@ -35,7 +35,7 @@ async def finalize_node(state: MainGraphState, config: RunnableConfig) -> Dict[s
|
||||
|
||||
try:
|
||||
# 获取流式写入器并发送完成事件
|
||||
from app.main_graph.config import get_stream_writer
|
||||
from backend.app.main_graph.config import get_stream_writer
|
||||
writer = get_stream_writer()
|
||||
|
||||
# 只在 writer 存在且不是 noop 时才发送
|
||||
|
||||
@@ -8,6 +8,7 @@ import json
|
||||
from typing import Optional
|
||||
from dataclasses import dataclass, field
|
||||
from datetime import datetime
|
||||
from langchain_core.runnables.config import RunnableConfig
|
||||
|
||||
from ..state import MainGraphState
|
||||
from ...logger import info, debug
|
||||
@@ -157,7 +158,7 @@ def _default_result() -> HybridRouterResult:
|
||||
|
||||
|
||||
# ========== 主路由节点 ==========
|
||||
async def hybrid_router_node(state: MainGraphState, config: Optional[dict] = None) -> MainGraphState:
|
||||
async def hybrid_router_node(state: MainGraphState, config: Optional[RunnableConfig] = None) -> MainGraphState:
|
||||
"""混合路由节点:前置路由,决定走快速路径还是 React 循环"""
|
||||
state.current_phase = "hybrid_router"
|
||||
query = state.user_query or ""
|
||||
|
||||
@@ -9,10 +9,10 @@ from langchain_core.language_models import BaseChatModel
|
||||
from langchain_core.messages import AIMessage
|
||||
|
||||
# 本地模块
|
||||
from app.main_graph.state import MainGraphState
|
||||
from app.agent.prompts import create_system_prompt
|
||||
from app.utils.logging import log_state_change
|
||||
from app.logger import debug, info, error
|
||||
from ...main_graph.state import MainGraphState
|
||||
from ...agent.prompts import create_system_prompt
|
||||
from ...utils.logging import log_state_change
|
||||
from ...logger import debug, info, error
|
||||
|
||||
|
||||
def create_dynamic_llm_call_node(chat_services: Dict[str, BaseChatModel], tools: list):
|
||||
@@ -82,6 +82,12 @@ def create_dynamic_llm_call_node(chat_services: Dict[str, BaseChatModel], tools:
|
||||
try:
|
||||
# 添加上下文到消息
|
||||
messages_with_context = list(state.messages)
|
||||
info(f"[llm_call] 原始消息数量: {len(messages_with_context)}")
|
||||
for i, msg in enumerate(messages_with_context):
|
||||
msg_type = getattr(msg, 'type', 'unknown')
|
||||
msg_content = getattr(msg, 'content', '')[:100] if hasattr(msg, 'content') else str(msg)[:100]
|
||||
info(f"[llm_call] msg[{i}] type={msg_type}, content={repr(msg_content)}")
|
||||
|
||||
if state.rag_context:
|
||||
from langchain_core.messages import SystemMessage
|
||||
rag_system_msg = SystemMessage(content=f"以下是检索到的相关信息:\n{state.rag_context}")
|
||||
@@ -93,11 +99,13 @@ def create_dynamic_llm_call_node(chat_services: Dict[str, BaseChatModel], tools:
|
||||
break
|
||||
if not inserted:
|
||||
messages_with_context.insert(0, rag_system_msg)
|
||||
|
||||
info(f"[llm_call] RAG上下文已添加,长度: {len(state.rag_context)}")
|
||||
|
||||
# 恢复为:手动进行 astream,并将所有的 chunk 拼接成最终的 response 返回。
|
||||
# LangGraph 会自动监听这期间产生的所有 token。
|
||||
chain = prompt | llm_with_tools
|
||||
chunks = []
|
||||
info(f"[llm_call] 开始调用 LLM astream...")
|
||||
async for chunk in chain.astream(
|
||||
{
|
||||
"messages": messages_with_context,
|
||||
@@ -106,7 +114,26 @@ def create_dynamic_llm_call_node(chat_services: Dict[str, BaseChatModel], tools:
|
||||
config=config
|
||||
):
|
||||
chunks.append(chunk)
|
||||
|
||||
|
||||
info(f"[llm_call] LLM astream 完成,共收到 {len(chunks)} 个 chunks")
|
||||
for i, chunk in enumerate(chunks[:10]): # 只打印前10个避免日志过多
|
||||
chunk_type = type(chunk).__name__
|
||||
chunk_content = getattr(chunk, 'content', '') if hasattr(chunk, 'content') else str(chunk)
|
||||
# 打印更多属性
|
||||
additional_kwargs = getattr(chunk, 'additional_kwargs', {}) or {}
|
||||
response_metadata = getattr(chunk, 'response_metadata', {}) or {}
|
||||
# 打印所有属性
|
||||
info(f"[llm_call] chunk[{i}] type={chunk_type}")
|
||||
info(f"[llm_call] chunk[{i}] content长度={len(chunk_content) if chunk_content else 0}, content={repr(chunk_content[:200] if chunk_content else '')}")
|
||||
info(f"[llm_call] chunk[{i}] additional_kwargs={additional_kwargs}")
|
||||
info(f"[llm_call] chunk[{i}] response_metadata keys={list(response_metadata.keys()) if response_metadata else []}")
|
||||
info(f"[llm_call] chunk[{i}] response_metadata={response_metadata}")
|
||||
# 检查是否有其他可能存储内容的属性
|
||||
if hasattr(chunk, 'tool_call_chunks'):
|
||||
info(f"[llm_call] chunk[{i}] tool_call_chunks={chunk.tool_call_chunks}")
|
||||
if hasattr(chunk, 'usage_metadata'):
|
||||
info(f"[llm_call] chunk[{i}] usage_metadata={chunk.usage_metadata}")
|
||||
|
||||
# 将所有 chunk 合并成最终的 AIMessage
|
||||
if chunks:
|
||||
response = chunks[0]
|
||||
@@ -114,6 +141,7 @@ def create_dynamic_llm_call_node(chat_services: Dict[str, BaseChatModel], tools:
|
||||
response = response + chunk
|
||||
else:
|
||||
response = AIMessage(content="")
|
||||
info(f"[llm_call] ⚠️ 警告: 没有收到任何 chunks!")
|
||||
|
||||
elapsed_time = time.time() - start_time
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
from typing import Any, Dict
|
||||
from langchain_core.runnables.config import RunnableConfig
|
||||
from app.main_graph.state import MainGraphState
|
||||
from app.memory.mem0_client import Mem0Client
|
||||
from app.logger import info
|
||||
from ...main_graph.state import MainGraphState
|
||||
from ...memory.mem0_client import Mem0Client
|
||||
from ...logger import info
|
||||
|
||||
|
||||
# 全局变量,在 GraphBuilder 中注入
|
||||
|
||||
@@ -7,16 +7,17 @@ import time
|
||||
import asyncio
|
||||
from typing import Optional
|
||||
from datetime import datetime
|
||||
from langchain_core.runnables.config import RunnableConfig
|
||||
|
||||
from app.main_graph.state import MainGraphState, ErrorRecord, ErrorSeverity
|
||||
from app.main_graph.utils.retry_utils import RAG_RETRY_CONFIG
|
||||
from app.logger import info
|
||||
from ...main_graph.state import MainGraphState, ErrorRecord, ErrorSeverity
|
||||
from ...main_graph.utils.retry_utils import RAG_RETRY_CONFIG
|
||||
from ...logger import info
|
||||
from ._utils import dispatch_custom_event, make_react_event
|
||||
|
||||
|
||||
def _get_rag_tool() -> Optional[callable]:
|
||||
"""获取 RAG 工具"""
|
||||
from app.main_graph.utils.rag_initializer import get_rag_tool
|
||||
from backend.app.main_graph.utils.rag_initializer import get_rag_tool
|
||||
return get_rag_tool()
|
||||
|
||||
|
||||
@@ -35,6 +36,9 @@ async def _rag_retrieve_core(state: MainGraphState, rag_tool: callable) -> MainG
|
||||
# 调用 RAG 工具
|
||||
rag_context = await rag_tool.ainvoke(retrieval_query)
|
||||
info(f"[RAG Core] 获取到 rag_context: {type(rag_context)}, 长度={len(rag_context) if rag_context else 0}")
|
||||
info(f"[RAG Core] ========== RAG 返回的知识内容 ==========")
|
||||
info(f"{rag_context[:500]}..." if len(rag_context) > 500 else rag_context)
|
||||
info(f"[RAG Core] ========================================")
|
||||
|
||||
state.rag_context = rag_context
|
||||
state.rag_docs = [{"source": "rag_retrieval", "content": rag_context}]
|
||||
@@ -47,7 +51,7 @@ async def _rag_retrieve_core(state: MainGraphState, rag_tool: callable) -> MainG
|
||||
|
||||
|
||||
# ========== RAG 检索节点 ==========
|
||||
async def rag_retrieve_node(state: MainGraphState, config: Optional[dict] = None) -> MainGraphState:
|
||||
async def rag_retrieve_node(state: MainGraphState, config: Optional[RunnableConfig] = None) -> MainGraphState:
|
||||
"""RAG 检索节点:带超时和重试"""
|
||||
state.current_phase = "rag_retrieving"
|
||||
start_time = time.time()
|
||||
@@ -156,7 +160,7 @@ async def rag_retrieve_node(state: MainGraphState, config: Optional[dict] = None
|
||||
return state
|
||||
|
||||
|
||||
async def rag_re_retrieve_node(state: MainGraphState, config: Optional[dict] = None) -> MainGraphState:
|
||||
async def rag_re_retrieve_node(state: MainGraphState, config: Optional[RunnableConfig] = None) -> MainGraphState:
|
||||
"""重新检索节点"""
|
||||
state.current_phase = "rag_re_retrieving"
|
||||
|
||||
|
||||
@@ -3,16 +3,17 @@ React 推理节点
|
||||
使用 intent.py 进行意图推理
|
||||
"""
|
||||
|
||||
from typing import Dict, Any, Optional
|
||||
from typing import Optional
|
||||
from datetime import datetime
|
||||
from langchain_core.runnables.config import RunnableConfig
|
||||
|
||||
from app.core.intent import react_reason_async, ReasoningResult
|
||||
from app.main_graph.state import MainGraphState
|
||||
from app.logger import info
|
||||
from ...core.intent import react_reason_async, ReasoningResult
|
||||
from ...main_graph.state import MainGraphState
|
||||
from ...logger import info
|
||||
from ._utils import dispatch_custom_event, make_react_event
|
||||
|
||||
|
||||
async def react_reason_node(state: MainGraphState, config: Optional[Dict[str, Any]] = None) -> MainGraphState:
|
||||
async def react_reason_node(state: MainGraphState, config: Optional[RunnableConfig] = None) -> MainGraphState:
|
||||
"""React 模式推理节点:判断下一步做什么"""
|
||||
state.current_phase = "react_reasoning"
|
||||
state.reasoning_step += 1
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
from typing import Any, Dict
|
||||
|
||||
# 本地模块
|
||||
from app.main_graph.state import MainGraphState
|
||||
from app.memory.mem0_client import Mem0Client
|
||||
from app.utils.logging import log_state_change
|
||||
from app.logger import debug
|
||||
from ...main_graph.state import MainGraphState
|
||||
from ...memory.mem0_client import Mem0Client
|
||||
from ...utils.logging import log_state_change
|
||||
from ...logger import debug
|
||||
|
||||
|
||||
def create_retrieve_memory_node(mem0_client: Mem0Client):
|
||||
@@ -67,10 +67,10 @@ def create_retrieve_memory_node(mem0_client: Mem0Client):
|
||||
else:
|
||||
debug("🔍 [记忆检索] 未找到相关记忆")
|
||||
except Exception as e:
|
||||
from app.logger import warning
|
||||
from backend.app.logger import warning
|
||||
warning(f"⚠️ Mem0 检索失败: {e}")
|
||||
else:
|
||||
from app.logger import warning
|
||||
from backend.app.logger import warning
|
||||
warning("⚠️ Mem0 未初始化,跳过记忆检索")
|
||||
|
||||
memory_context = "\n\n".join(memory_text_parts) if memory_text_parts else "暂无用户信息"
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
from app.core.intent import get_route_by_reasoning, ReasoningAction
|
||||
from app.main_graph.state import MainGraphState
|
||||
from app.logger import info
|
||||
from ...core.intent import get_route_by_reasoning, ReasoningAction
|
||||
from ...main_graph.state import MainGraphState
|
||||
from ...logger import info
|
||||
|
||||
|
||||
# ========== 初始化状态节点 ==========
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
from typing import Any, Dict
|
||||
|
||||
# 本地模块
|
||||
from app.main_graph.state import MainGraphState
|
||||
from app.memory.mem0_client import Mem0Client
|
||||
from app.utils.logging import log_state_change
|
||||
from app.logger import debug, info, error, warning
|
||||
from ...main_graph.state import MainGraphState
|
||||
from ...memory.mem0_client import Mem0Client
|
||||
from ...utils.logging import log_state_change
|
||||
from ...logger import debug, info, error, warning
|
||||
|
||||
|
||||
def create_summarize_node(mem0_client: Mem0Client):
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
import asyncio
|
||||
from typing import Any, Dict
|
||||
from langchain_core.messages import AIMessage, ToolMessage
|
||||
from app.main_graph.config import get_stream_writer
|
||||
from ...main_graph.config import get_stream_writer
|
||||
|
||||
# 本地模块
|
||||
from app.main_graph.state import MainGraphState
|
||||
from app.utils.logging import log_state_change
|
||||
from app.logger import debug, info
|
||||
from ...main_graph.state import MainGraphState
|
||||
from ...utils.logging import log_state_change
|
||||
from ...logger import debug, info
|
||||
|
||||
def create_tool_call_node(tools_by_name: Dict[str, Any]):
|
||||
"""
|
||||
|
||||
@@ -2,14 +2,15 @@
|
||||
联网搜索节点 - 执行搜索并将结果保存到状态
|
||||
"""
|
||||
|
||||
from typing import Dict, Any, Optional
|
||||
from typing import Optional
|
||||
from datetime import datetime
|
||||
from langchain_core.runnables.config import RunnableConfig
|
||||
|
||||
from app.main_graph.state import MainGraphState, ErrorRecord, ErrorSeverity
|
||||
from app.logger import info
|
||||
from ...main_graph.state import MainGraphState, ErrorRecord, ErrorSeverity
|
||||
from ...logger import info
|
||||
|
||||
|
||||
async def web_search_node(state: MainGraphState, config: Optional[Dict[str, Any]] = None) -> MainGraphState:
|
||||
async def web_search_node(state: MainGraphState, config: Optional[RunnableConfig] = None) -> MainGraphState:
|
||||
"""
|
||||
联网搜索节点:执行搜索并将结果保存到状态
|
||||
"""
|
||||
@@ -39,7 +40,7 @@ async def web_search_node(state: MainGraphState, config: Optional[Dict[str, Any]
|
||||
search_query = reasoning_result.metadata.get("search_query", state.user_query) if reasoning_result else state.user_query
|
||||
|
||||
try:
|
||||
from app.core import web_search
|
||||
from backend.app.core import web_search
|
||||
|
||||
print(f"[WebSearch] 搜索: {search_query}")
|
||||
search_result = web_search(search_query, max_results=5)
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
from typing import Dict, Any, Optional
|
||||
from datetime import datetime
|
||||
|
||||
from langchain_core.runnables.config import RunnableConfig
|
||||
|
||||
from .state import MainGraphState, ErrorRecord, ErrorSeverity
|
||||
from ..logger import info
|
||||
|
||||
@@ -19,7 +21,7 @@ def wrap_subgraph_for_error_handling(subgraph, name: str):
|
||||
|
||||
Returns: 包装后的节点函数
|
||||
"""
|
||||
async def wrapped_node(state: MainGraphState, config: Optional[Dict[str, Any]] = None) -> MainGraphState:
|
||||
async def wrapped_node(state: MainGraphState, config: Optional[RunnableConfig] = None) -> MainGraphState:
|
||||
# 发送子图开始事件
|
||||
if config:
|
||||
try:
|
||||
|
||||
@@ -20,7 +20,7 @@ def web_search_tool(query: str, max_results: int = 5) -> str:
|
||||
格式化的搜索结果,包含引用溯源
|
||||
"""
|
||||
try:
|
||||
from app.core import web_search
|
||||
from backend.app.core import web_search
|
||||
return web_search(query, max_results)
|
||||
except Exception as e:
|
||||
return f"联网搜索出错:{str(e)}"
|
||||
@@ -40,7 +40,7 @@ def generate_chart_tool(data_text: str, chart_type: str = "bar") -> str:
|
||||
格式化的图表输出(Mermaid 格式)
|
||||
"""
|
||||
try:
|
||||
from app.core import generate_chart
|
||||
from backend.app.core import generate_chart
|
||||
return generate_chart(data_text, chart_type)
|
||||
except Exception as e:
|
||||
return f"生成图表出错:{str(e)}\n\n请使用格式:标题,标签1:值1,标签2:值2,..."
|
||||
|
||||
@@ -22,13 +22,13 @@ def dictionary_tool(query: str, action: Optional[str] = None) -> str:
|
||||
格式化的结果文本
|
||||
"""
|
||||
try:
|
||||
from app.subgraphs.dictionary import (
|
||||
from backend.app.subgraphs.dictionary import (
|
||||
DictionaryState,
|
||||
DictionaryAction,
|
||||
parse_intent,
|
||||
format_result
|
||||
)
|
||||
from app.subgraphs.dictionary.nodes import (
|
||||
from backend.app.subgraphs.dictionary.nodes import (
|
||||
query_word, translate_text, extract_terms, get_daily_word
|
||||
)
|
||||
|
||||
@@ -87,13 +87,13 @@ def news_analysis_tool(query: str, action: Optional[str] = None) -> str:
|
||||
格式化的结果文本
|
||||
"""
|
||||
try:
|
||||
from app.subgraphs.news_analysis import (
|
||||
from backend.app.subgraphs.news_analysis import (
|
||||
NewsAnalysisState,
|
||||
NewsAction,
|
||||
parse_intent,
|
||||
format_result
|
||||
)
|
||||
from app.subgraphs.news_analysis.nodes import (
|
||||
from backend.app.subgraphs.news_analysis.nodes import (
|
||||
query_news, analyze_url, extract_keywords, generate_report
|
||||
)
|
||||
|
||||
@@ -150,13 +150,13 @@ def contact_tool(query: str, action: Optional[str] = None) -> str:
|
||||
格式化的结果文本
|
||||
"""
|
||||
try:
|
||||
from app.subgraphs.contact import (
|
||||
from backend.app.subgraphs.contact import (
|
||||
ContactState,
|
||||
ContactAction,
|
||||
parse_intent,
|
||||
format_result
|
||||
)
|
||||
from app.subgraphs.contact.nodes import (
|
||||
from backend.app.subgraphs.contact.nodes import (
|
||||
query_contact, add_contact, list_contacts
|
||||
)
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# app/rag_initializer.py
|
||||
from app.rag.tools import create_rag_tool
|
||||
from app.rag.retriever import create_parent_hybrid_retriever
|
||||
from app.model_services import get_embedding_service
|
||||
from app.logger import info, warning
|
||||
from ...rag.tools import create_rag_tool
|
||||
from ...rag.retriever import create_parent_hybrid_retriever
|
||||
from ...model_services import get_embedding_service
|
||||
from ...logger import info, warning
|
||||
import sys
|
||||
|
||||
# 全局 RAG 工具
|
||||
@@ -38,7 +38,7 @@ async def init_rag_tool(force: bool = False):
|
||||
return _rag_tool
|
||||
|
||||
try:
|
||||
from app.model_services.chat_services import get_chat_service
|
||||
from backend.app.model_services.chat_services import get_chat_service
|
||||
|
||||
info("🔄 正在初始化 RAG 检索系统...")
|
||||
embeddings = get_embedding_service()
|
||||
|
||||
@@ -287,7 +287,7 @@ def create_retry_wrapper_for_node(
|
||||
time.sleep(delay)
|
||||
|
||||
# 所有重试都失败,更新状态错误信息
|
||||
from app.main_graph.state import ErrorRecord, ErrorSeverity
|
||||
from backend.app.main_graph.state import ErrorRecord, ErrorSeverity
|
||||
|
||||
error_record = ErrorRecord(
|
||||
error_type=f"{node_name}TimeoutError",
|
||||
|
||||
Reference in New Issue
Block a user