fix: auto-fix code issues (cron)

- 修复重复导入/字段
- 修复异常处理
- 修复PEP8格式问题
- 添加类型注解
This commit is contained in:
OpenClaw Bot
2026-02-28 03:03:50 +08:00
parent 8c80399c9d
commit 33555642db
39 changed files with 86 additions and 1151 deletions

View File

@@ -15,7 +15,6 @@ 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):
"""推理类型"""
@@ -25,7 +24,6 @@ class ReasoningType(Enum):
COMPARATIVE = "comparative" # 对比推理
SUMMARY = "summary" # 总结推理
@dataclass
class ReasoningResult:
"""推理结果"""
@@ -37,7 +35,6 @@ class ReasoningResult:
related_entities: list[str] # 相关实体
gaps: list[str] # 知识缺口
@dataclass
class InferencePath:
"""推理路径"""
@@ -47,7 +44,6 @@ class InferencePath:
path: list[dict] # 路径上的节点和关系
strength: float # 路径强度
class KnowledgeReasoner:
"""知识推理引擎"""
@@ -484,11 +480,9 @@ class KnowledgeReasoner:
"confidence": 0.5,
}
# Singleton instance
_reasoner = None
def get_knowledge_reasoner() -> KnowledgeReasoner:
global _reasoner
if _reasoner is None: