Skip to content

Commit

Permalink
update episode override (#219)
Browse files Browse the repository at this point in the history
* update episode override

* remove unused import
  • Loading branch information
prasmussen15 authored Dec 2, 2024
1 parent 0fbe5c0 commit e42d3ae
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions graphiti_core/graphiti.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,17 +318,21 @@ async def add_episode_endpoint(episode_data: EpisodeData):
previous_episodes = await self.retrieve_episodes(
reference_time, last_n=RELEVANT_SCHEMA_LIMIT, group_ids=[group_id]
)
episode = EpisodicNode(
name=name,
group_id=group_id,
labels=[],
source=source,
content=episode_body,
source_description=source_description,
created_at=now,
valid_at=reference_time,

episode = (
await EpisodicNode.get_by_uuid(self.driver, uuid)
if uuid is not None
else EpisodicNode(
name=name,
group_id=group_id,
labels=[],
source=source,
content=episode_body,
source_description=source_description,
created_at=now,
valid_at=reference_time,
)
)
episode.uuid = uuid if uuid is not None else episode.uuid

# Extract entities as nodes

Expand Down

0 comments on commit e42d3ae

Please sign in to comment.