set content to empty after episode extractions have happened (#191)
* set content to empty after episode extractions have happened * format * bump version
This commit is contained in:
parent
7c15b729a9
commit
194ecf5eb4
3 changed files with 30 additions and 29 deletions
|
|
@ -319,8 +319,6 @@ class Graphiti:
|
||||||
valid_at=reference_time,
|
valid_at=reference_time,
|
||||||
)
|
)
|
||||||
episode.uuid = uuid if uuid is not None else episode.uuid
|
episode.uuid = uuid if uuid is not None else episode.uuid
|
||||||
if not self.store_raw_episode_content:
|
|
||||||
episode.content = ''
|
|
||||||
|
|
||||||
# Extract entities as nodes
|
# Extract entities as nodes
|
||||||
|
|
||||||
|
|
@ -442,6 +440,9 @@ class Graphiti:
|
||||||
episode.entity_edges = [edge.uuid for edge in entity_edges]
|
episode.entity_edges = [edge.uuid for edge in entity_edges]
|
||||||
|
|
||||||
# Future optimization would be using batch operations to save nodes and edges
|
# Future optimization would be using batch operations to save nodes and edges
|
||||||
|
if not self.store_raw_episode_content:
|
||||||
|
episode.content = ''
|
||||||
|
|
||||||
await episode.save(self.driver)
|
await episode.save(self.driver)
|
||||||
await asyncio.gather(*[node.save(self.driver) for node in nodes])
|
await asyncio.gather(*[node.save(self.driver) for node in nodes])
|
||||||
await asyncio.gather(*[edge.save(self.driver) for edge in episodic_edges])
|
await asyncio.gather(*[edge.save(self.driver) for edge in episodic_edges])
|
||||||
|
|
|
||||||
|
|
@ -53,12 +53,12 @@ logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
async def search(
|
async def search(
|
||||||
driver: AsyncDriver,
|
driver: AsyncDriver,
|
||||||
embedder: EmbedderClient,
|
embedder: EmbedderClient,
|
||||||
query: str,
|
query: str,
|
||||||
group_ids: list[str] | None,
|
group_ids: list[str] | None,
|
||||||
config: SearchConfig,
|
config: SearchConfig,
|
||||||
center_node_uuid: str | None = None,
|
center_node_uuid: str | None = None,
|
||||||
) -> SearchResults:
|
) -> SearchResults:
|
||||||
start = time()
|
start = time()
|
||||||
query = query.replace('\n', ' ')
|
query = query.replace('\n', ' ')
|
||||||
|
|
@ -107,13 +107,13 @@ async def search(
|
||||||
|
|
||||||
|
|
||||||
async def edge_search(
|
async def edge_search(
|
||||||
driver: AsyncDriver,
|
driver: AsyncDriver,
|
||||||
embedder: EmbedderClient,
|
embedder: EmbedderClient,
|
||||||
query: str,
|
query: str,
|
||||||
group_ids: list[str] | None,
|
group_ids: list[str] | None,
|
||||||
config: EdgeSearchConfig | None,
|
config: EdgeSearchConfig | None,
|
||||||
center_node_uuid: str | None = None,
|
center_node_uuid: str | None = None,
|
||||||
limit=DEFAULT_SEARCH_LIMIT,
|
limit=DEFAULT_SEARCH_LIMIT,
|
||||||
) -> list[EntityEdge]:
|
) -> list[EntityEdge]:
|
||||||
if config is None:
|
if config is None:
|
||||||
return []
|
return []
|
||||||
|
|
@ -176,13 +176,13 @@ async def edge_search(
|
||||||
|
|
||||||
|
|
||||||
async def node_search(
|
async def node_search(
|
||||||
driver: AsyncDriver,
|
driver: AsyncDriver,
|
||||||
embedder: EmbedderClient,
|
embedder: EmbedderClient,
|
||||||
query: str,
|
query: str,
|
||||||
group_ids: list[str] | None,
|
group_ids: list[str] | None,
|
||||||
config: NodeSearchConfig | None,
|
config: NodeSearchConfig | None,
|
||||||
center_node_uuid: str | None = None,
|
center_node_uuid: str | None = None,
|
||||||
limit=DEFAULT_SEARCH_LIMIT,
|
limit=DEFAULT_SEARCH_LIMIT,
|
||||||
) -> list[EntityNode]:
|
) -> list[EntityNode]:
|
||||||
if config is None:
|
if config is None:
|
||||||
return []
|
return []
|
||||||
|
|
@ -230,12 +230,12 @@ async def node_search(
|
||||||
|
|
||||||
|
|
||||||
async def community_search(
|
async def community_search(
|
||||||
driver: AsyncDriver,
|
driver: AsyncDriver,
|
||||||
embedder: EmbedderClient,
|
embedder: EmbedderClient,
|
||||||
query: str,
|
query: str,
|
||||||
group_ids: list[str] | None,
|
group_ids: list[str] | None,
|
||||||
config: CommunitySearchConfig | None,
|
config: CommunitySearchConfig | None,
|
||||||
limit=DEFAULT_SEARCH_LIMIT,
|
limit=DEFAULT_SEARCH_LIMIT,
|
||||||
) -> list[CommunityNode]:
|
) -> list[CommunityNode]:
|
||||||
if config is None:
|
if config is None:
|
||||||
return []
|
return []
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "graphiti-core"
|
name = "graphiti-core"
|
||||||
version = "0.3.10"
|
version = "0.3.11"
|
||||||
description = "A temporal graph building library"
|
description = "A temporal graph building library"
|
||||||
authors = [
|
authors = [
|
||||||
"Paul Paliychuk <paul@getzep.com>",
|
"Paul Paliychuk <paul@getzep.com>",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue