2026-04-25 13:24:50 +08:00
|
|
|
|
"""
|
|
|
|
|
|
公共工具模块
|
|
|
|
|
|
提供可复用的基础组件
|
|
|
|
|
|
|
|
|
|
|
|
导出:
|
2026-04-25 20:46:30 +08:00
|
|
|
|
- formatter.py: 格式化输出工具
|
|
|
|
|
|
- intent.py: 意图理解工具
|
|
|
|
|
|
- human_review.py: 人工审核工具
|
|
|
|
|
|
- state_base.py: 状态基类工具
|
2026-04-25 13:24:50 +08:00
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
from .formatter import (
|
|
|
|
|
|
MarkdownFormatter,
|
|
|
|
|
|
TemplateManager,
|
|
|
|
|
|
OutputRenderer,
|
|
|
|
|
|
PresetTemplates
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
from .intent import (
|
2026-04-26 11:14:04 +08:00
|
|
|
|
# 旧版 API(保持向后兼容)
|
2026-04-25 13:24:50 +08:00
|
|
|
|
IntentType,
|
|
|
|
|
|
Intent,
|
|
|
|
|
|
Entity,
|
|
|
|
|
|
IntentParser,
|
|
|
|
|
|
RuleBasedIntentClassifier,
|
|
|
|
|
|
RuleBasedEntityExtractor,
|
|
|
|
|
|
IntentRegistry,
|
2026-04-26 11:14:04 +08:00
|
|
|
|
create_default_intent_parser,
|
|
|
|
|
|
# 新版 React 模式 API
|
|
|
|
|
|
ReasoningAction,
|
|
|
|
|
|
RetrievalConfig,
|
|
|
|
|
|
ReasoningResult,
|
|
|
|
|
|
BaseIntentReasoner,
|
|
|
|
|
|
RuleBasedReactReasoner,
|
|
|
|
|
|
LLMReactReasoner,
|
|
|
|
|
|
create_react_reasoner,
|
|
|
|
|
|
react_reason,
|
|
|
|
|
|
get_route_by_reasoning
|
2026-04-25 13:24:50 +08:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
from .human_review import (
|
|
|
|
|
|
ReviewStatus,
|
|
|
|
|
|
HumanReview,
|
|
|
|
|
|
HumanReviewStore,
|
|
|
|
|
|
InMemoryReviewStore,
|
|
|
|
|
|
HumanReviewNode,
|
|
|
|
|
|
ReviewManager
|
|
|
|
|
|
)
|
|
|
|
|
|
|
2026-04-25 20:02:20 +08:00
|
|
|
|
from .state_base import (
|
|
|
|
|
|
BaseState,
|
|
|
|
|
|
Phase,
|
|
|
|
|
|
TokenUsage,
|
|
|
|
|
|
StateUtils
|
|
|
|
|
|
)
|
|
|
|
|
|
|
2026-04-25 13:24:50 +08:00
|
|
|
|
__all__ = [
|
|
|
|
|
|
# formatter
|
|
|
|
|
|
"MarkdownFormatter",
|
|
|
|
|
|
"TemplateManager",
|
|
|
|
|
|
"OutputRenderer",
|
|
|
|
|
|
"PresetTemplates",
|
2026-04-26 11:14:04 +08:00
|
|
|
|
# intent - 旧版
|
2026-04-25 13:24:50 +08:00
|
|
|
|
"IntentType",
|
|
|
|
|
|
"Intent",
|
|
|
|
|
|
"Entity",
|
|
|
|
|
|
"IntentParser",
|
|
|
|
|
|
"RuleBasedIntentClassifier",
|
|
|
|
|
|
"RuleBasedEntityExtractor",
|
|
|
|
|
|
"IntentRegistry",
|
|
|
|
|
|
"create_default_intent_parser",
|
2026-04-26 11:14:04 +08:00
|
|
|
|
# intent - 新版 React 模式
|
|
|
|
|
|
"ReasoningAction",
|
|
|
|
|
|
"RetrievalConfig",
|
|
|
|
|
|
"ReasoningResult",
|
|
|
|
|
|
"BaseIntentReasoner",
|
|
|
|
|
|
"RuleBasedReactReasoner",
|
|
|
|
|
|
"LLMReactReasoner",
|
|
|
|
|
|
"create_react_reasoner",
|
|
|
|
|
|
"react_reason",
|
|
|
|
|
|
"get_route_by_reasoning",
|
2026-04-25 13:24:50 +08:00
|
|
|
|
# human_review
|
|
|
|
|
|
"ReviewStatus",
|
|
|
|
|
|
"HumanReview",
|
|
|
|
|
|
"HumanReviewStore",
|
|
|
|
|
|
"InMemoryReviewStore",
|
|
|
|
|
|
"HumanReviewNode",
|
2026-04-25 20:02:20 +08:00
|
|
|
|
"ReviewManager",
|
|
|
|
|
|
# state_base
|
|
|
|
|
|
"BaseState",
|
|
|
|
|
|
"Phase",
|
|
|
|
|
|
"TokenUsage",
|
|
|
|
|
|
"StateUtils"
|
2026-04-25 13:24:50 +08:00
|
|
|
|
]
|