fix: use forward reference for Entity type hint

This commit is contained in:
OpenClaw Bot
2026-02-18 18:03:01 +08:00
parent 69cc0a74b4
commit 4d4a6c0345

View File

@@ -439,7 +439,7 @@ def extract_entities_with_llm(text: str) -> tuple[List[dict], List[dict]]:
return [], []
def align_entity(project_id: str, name: str, db, definition: str = "") -> Optional[Entity]:
def align_entity(project_id: str, name: str, db, definition: str = "") -> Optional['Entity']:
"""实体对齐 - Phase 3: 使用 embedding 对齐"""
# 1. 首先尝试精确匹配
existing = db.get_entity_by_name(project_id, name)