mirror of
https://github.com/getzep/graphiti.git
synced 2025-06-27 02:00:02 +00:00

* feat: Add real world dates extraction * fix: Linter * fix: 💄 mypy errors * chore: handle invalid dates returned by the llm * chore: Polish prompt * reformat * style: 💄 reformat
24 lines
543 B
Python
24 lines
543 B
Python
import logging
|
|
|
|
from core.edges import EpisodicEdge
|
|
from core.nodes import EntityNode, EpisodicNode
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
def build_episodic_edges(
|
|
entity_nodes: list[EntityNode], episode: EpisodicNode
|
|
) -> list[EpisodicEdge]:
|
|
edges: list[EpisodicEdge] = []
|
|
|
|
for node in entity_nodes:
|
|
edges.append(
|
|
EpisodicEdge(
|
|
source_node_uuid=episode.uuid,
|
|
target_node_uuid=node.uuid,
|
|
created_at=episode.created_at,
|
|
)
|
|
)
|
|
|
|
return edges
|