2026-04-21 11:02:16 +08:00
|
|
|
|
"""
|
2026-04-26 11:14:04 +08:00
|
|
|
|
Graph 子模块 - React 模式增强版(带超时重试)
|
2026-04-21 11:02:16 +08:00
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
from .graph_builder import GraphBuilder
|
2026-04-26 11:14:04 +08:00
|
|
|
|
from .subgraph_builder import build_main_graph, build_react_main_graph
|
|
|
|
|
|
from .react_nodes import (
|
|
|
|
|
|
init_state_node,
|
|
|
|
|
|
react_reason_node,
|
|
|
|
|
|
rag_retrieve_node,
|
|
|
|
|
|
error_handling_node,
|
|
|
|
|
|
final_response_node,
|
|
|
|
|
|
route_by_reasoning
|
|
|
|
|
|
)
|
2026-04-25 18:29:23 +08:00
|
|
|
|
from .state import (
|
|
|
|
|
|
MessagesState,
|
|
|
|
|
|
GraphContext,
|
|
|
|
|
|
MainGraphState,
|
2026-04-26 11:14:04 +08:00
|
|
|
|
CurrentAction,
|
|
|
|
|
|
ErrorRecord,
|
|
|
|
|
|
ErrorSeverity
|
|
|
|
|
|
)
|
|
|
|
|
|
from .retry_utils import (
|
|
|
|
|
|
RetryConfig,
|
|
|
|
|
|
RetryResult,
|
|
|
|
|
|
RetryStrategy,
|
|
|
|
|
|
with_retry,
|
|
|
|
|
|
with_async_retry,
|
|
|
|
|
|
create_retry_wrapper_for_node,
|
|
|
|
|
|
RAG_RETRY_CONFIG,
|
|
|
|
|
|
SUBGRAPH_RETRY_CONFIG
|
2026-04-25 18:29:23 +08:00
|
|
|
|
)
|
2026-04-21 11:02:16 +08:00
|
|
|
|
|
2026-04-25 18:29:23 +08:00
|
|
|
|
__all__ = [
|
2026-04-26 11:14:04 +08:00
|
|
|
|
# 旧版兼容性
|
2026-04-25 18:29:23 +08:00
|
|
|
|
"GraphBuilder",
|
|
|
|
|
|
"build_main_graph",
|
|
|
|
|
|
"MessagesState",
|
|
|
|
|
|
"GraphContext",
|
|
|
|
|
|
"MainGraphState",
|
2026-04-26 11:14:04 +08:00
|
|
|
|
"CurrentAction",
|
|
|
|
|
|
|
|
|
|
|
|
# 新版 React 模式
|
|
|
|
|
|
"build_react_main_graph",
|
|
|
|
|
|
"init_state_node",
|
|
|
|
|
|
"react_reason_node",
|
|
|
|
|
|
"rag_retrieve_node",
|
|
|
|
|
|
"error_handling_node",
|
|
|
|
|
|
"final_response_node",
|
|
|
|
|
|
"route_by_reasoning",
|
|
|
|
|
|
"ErrorRecord",
|
|
|
|
|
|
"ErrorSeverity",
|
|
|
|
|
|
|
|
|
|
|
|
# 超时和重试工具
|
|
|
|
|
|
"RetryConfig",
|
|
|
|
|
|
"RetryResult",
|
|
|
|
|
|
"RetryStrategy",
|
|
|
|
|
|
"with_retry",
|
|
|
|
|
|
"with_async_retry",
|
|
|
|
|
|
"create_retry_wrapper_for_node",
|
|
|
|
|
|
"RAG_RETRY_CONFIG",
|
|
|
|
|
|
"SUBGRAPH_RETRY_CONFIG"
|
2026-04-25 18:29:23 +08:00
|
|
|
|
]
|