parent
79ec748452
commit
f0cc7709bd
4 changed files with 11 additions and 5 deletions
|
|
@ -65,6 +65,12 @@ class Person(BaseModel):
|
|||
occupation: str | None = Field(..., description="The person's work occupation")
|
||||
|
||||
|
||||
class City(BaseModel):
|
||||
"""A city"""
|
||||
|
||||
country: str | None = Field(..., description='The country the city is in')
|
||||
|
||||
|
||||
class IsPresidentOf(BaseModel):
|
||||
"""Relationship between a person and the entity they are a president of"""
|
||||
|
||||
|
|
@ -92,7 +98,7 @@ async def main(use_bulk: bool = False):
|
|||
await client.add_episode_bulk(
|
||||
raw_episodes,
|
||||
group_id=group_id,
|
||||
entity_types={'Person': Person},
|
||||
entity_types={'Person': Person, 'City': City},
|
||||
edge_types={'IS_PRESIDENT_OF': IsPresidentOf},
|
||||
edge_type_map={('Person', 'Entity'): ['IS_PRESIDENT_OF']},
|
||||
)
|
||||
|
|
@ -109,7 +115,7 @@ async def main(use_bulk: bool = False):
|
|||
reference_time=message.actual_timestamp,
|
||||
source_description='Podcast Transcript',
|
||||
group_id=group_id,
|
||||
entity_types={'Person': Person},
|
||||
entity_types={'Person': Person, 'City': City},
|
||||
edge_types={'IS_PRESIDENT_OF': IsPresidentOf},
|
||||
edge_type_map={('Person', 'Entity'): ['PRESIDENT_OF']},
|
||||
previous_episode_uuids=episode_uuids,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
[project]
|
||||
name = "graphiti-core"
|
||||
description = "A temporal graph building library"
|
||||
version = "0.18.2"
|
||||
version = "0.18.3"
|
||||
authors = [
|
||||
{ name = "Paul Paliychuk", email = "paul@getzep.com" },
|
||||
{ name = "Preston Rasmussen", email = "preston@getzep.com" },
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ async def test_graphiti_init(driver):
|
|||
await graphiti.build_indices_and_constraints()
|
||||
|
||||
search_filter = SearchFilters(
|
||||
node_labels=['Person'],
|
||||
node_labels=['Person', 'City'],
|
||||
created_at=[[DateFilter(date=utc_now(), comparison_operator=ComparisonOperator.less_than)]],
|
||||
)
|
||||
|
||||
|
|
|
|||
2
uv.lock
generated
2
uv.lock
generated
|
|
@ -746,7 +746,7 @@ wheels = [
|
|||
|
||||
[[package]]
|
||||
name = "graphiti-core"
|
||||
version = "0.18.2"
|
||||
version = "0.18.3"
|
||||
source = { editable = "." }
|
||||
dependencies = [
|
||||
{ name = "diskcache" },
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue