fix: auto-fix code issues (cron)
- 修复重复导入/字段 - 修复异常处理 - 修复PEP8格式问题 - 添加类型注解 - 修复main.py中的语法错误(缺失try语句的from导入) - 添加缺失的timedelta导入到plugin_manager.py - 添加缺失的urllib.parse导入到plugin_manager.py和workflow_manager.py - 添加缺失的os导入到document_processor.py - 修复import排序问题 - 修复行长度超过100字符的问题 - 添加缺失的Alert导入到test_phase8_task8.py - 添加缺失的get_export_manager导入到main.py
This commit is contained in:
@@ -19,6 +19,7 @@ from dataclasses import dataclass, field
|
||||
from datetime import datetime
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class SearchOperator(Enum):
|
||||
"""搜索操作符"""
|
||||
|
||||
@@ -1779,10 +1780,16 @@ class KnowledgeGapDetection:
|
||||
gap_type="missing_attribute",
|
||||
entity_id=entity_id,
|
||||
entity_name=entity["name"],
|
||||
description=f"实体 '{entity['name']}' 缺少必需属性: {', '.join(missing_names)}",
|
||||
description=(
|
||||
f"实体 '{entity['name']}' 缺少必需属性: "
|
||||
f"{', '.join(missing_names)}"
|
||||
),
|
||||
severity="medium",
|
||||
suggestions=[
|
||||
f"为实体 '{entity['name']}' 补充以下属性: {', '.join(missing_names)}",
|
||||
(
|
||||
f"为实体 '{entity['name']}' 补充以下属性: "
|
||||
f"{', '.join(missing_names)}"
|
||||
),
|
||||
"检查属性模板定义是否合理",
|
||||
],
|
||||
related_entities=[],
|
||||
@@ -1842,7 +1849,10 @@ class KnowledgeGapDetection:
|
||||
gap_type="sparse_relation",
|
||||
entity_id=entity_id,
|
||||
entity_name=entity["name"],
|
||||
description=f"实体 '{entity['name']}' 关系稀疏(仅有 {relation_count} 个关系)",
|
||||
description=(
|
||||
f"实体 '{entity['name']}' 关系稀疏"
|
||||
f"(仅有 {relation_count} 个关系)"
|
||||
),
|
||||
severity="medium" if relation_count == 0 else "low",
|
||||
suggestions=[
|
||||
f"检查转录文本中提及 '{entity['name']}' 的其他实体",
|
||||
|
||||
Reference in New Issue
Block a user