fix: auto-fix code issues (cron)
- 修复重复导入/字段 - 修复异常处理 - 修复PEP8格式问题 (E302, E305, E501) - 修复行长度超过100字符的问题 - 修复F821未定义名称错误
This commit is contained in:
@@ -15,6 +15,7 @@ import httpx
|
||||
KIMI_API_KEY = os.getenv("KIMI_API_KEY", "")
|
||||
KIMI_BASE_URL = os.getenv("KIMI_BASE_URL", "https://api.kimi.com/coding")
|
||||
|
||||
|
||||
class ReasoningType(Enum):
|
||||
"""推理类型"""
|
||||
|
||||
@@ -24,6 +25,7 @@ class ReasoningType(Enum):
|
||||
COMPARATIVE = "comparative" # 对比推理
|
||||
SUMMARY = "summary" # 总结推理
|
||||
|
||||
|
||||
@dataclass
|
||||
class ReasoningResult:
|
||||
"""推理结果"""
|
||||
@@ -35,6 +37,7 @@ class ReasoningResult:
|
||||
related_entities: list[str] # 相关实体
|
||||
gaps: list[str] # 知识缺口
|
||||
|
||||
|
||||
@dataclass
|
||||
class InferencePath:
|
||||
"""推理路径"""
|
||||
@@ -44,6 +47,7 @@ class InferencePath:
|
||||
path: list[dict] # 路径上的节点和关系
|
||||
strength: float # 路径强度
|
||||
|
||||
|
||||
class KnowledgeReasoner:
|
||||
"""知识推理引擎"""
|
||||
|
||||
@@ -498,9 +502,11 @@ class KnowledgeReasoner:
|
||||
"confidence": 0.5,
|
||||
}
|
||||
|
||||
|
||||
# Singleton instance
|
||||
_reasoner = None
|
||||
|
||||
|
||||
def get_knowledge_reasoner() -> KnowledgeReasoner:
|
||||
global _reasoner
|
||||
if _reasoner is None:
|
||||
|
||||
Reference in New Issue
Block a user