handle missing edge types in graph data

This commit is contained in:
ArnoChen
2025-02-15 00:34:38 +08:00
parent 4d58ff8bb4
commit 70fc4cbfb0
4 changed files with 14 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
from pydantic import BaseModel
from typing import List, Dict, Any
from typing import List, Dict, Any, Optional
class GPTKeywordExtractionFormat(BaseModel):
@@ -15,7 +15,7 @@ class KnowledgeGraphNode(BaseModel):
class KnowledgeGraphEdge(BaseModel):
id: str
type: str
type: Optional[str]
source: str # id of source node
target: str # id of target node
properties: Dict[str, Any] # anything else goes here