fix: auto-fix code issues (cron)
- 修复重复导入/字段 - 修复异常处理 - 修复PEP8格式问题 - 添加类型注解
This commit is contained in:
@@ -178,7 +178,7 @@ class EntityAligner:
|
||||
return best_match
|
||||
|
||||
def _fallback_similarity_match(
|
||||
self, entities: list[object], name: str, exclude_id: str | None = None
|
||||
self, entities: list[object], name: str, exclude_id: str | None = None,
|
||||
) -> object | None:
|
||||
"""
|
||||
回退到简单的相似度匹配(不使用 embedding)
|
||||
@@ -212,7 +212,7 @@ class EntityAligner:
|
||||
return None
|
||||
|
||||
def batch_align_entities(
|
||||
self, project_id: str, new_entities: list[dict], threshold: float | None = None
|
||||
self, project_id: str, new_entities: list[dict], threshold: float | None = None,
|
||||
) -> list[dict]:
|
||||
"""
|
||||
批量对齐实体
|
||||
@@ -232,7 +232,7 @@ class EntityAligner:
|
||||
|
||||
for new_ent in new_entities:
|
||||
matched = self.find_similar_entity(
|
||||
project_id, new_ent["name"], new_ent.get("definition", ""), threshold=threshold
|
||||
project_id, new_ent["name"], new_ent.get("definition", ""), threshold=threshold,
|
||||
)
|
||||
|
||||
result = {
|
||||
|
||||
Reference in New Issue
Block a user