Docs: Missing documentation about how to create and define `Edge`
Hello eveyone!
I have this "entities" file:
from pydantic import BaseModel, Field
class Person(BaseModel):
"""Individual human person"""
name: str | None = Field(..., description="First name of the person")
lastname: str | None = Field(..., description="Last name of the person")
id: str | None = Field(..., description="National Identity Document number")
birthdate: str | None = Field(..., description="Date of birth")
address: str | None = Field(..., description="Physical address")
class Actor(Person):
"""Party initiating the legal claim"""
pass
class Testigo(Person):
"""Individual providing testimony about the facts"""
pass
class TestigoHasSeenActor(BaseModel):
source: Testigo
target: Actor
descripcion: str = Field(default="Testigo has seen the Actor")
type: str = Field(default="has_seen")
# Entity type mapping for Graphiti
resolution_entity_types = {
"Person": Person,
"Actor": Actor,
"Testigo": Testigo
}
Has you can see, there are 3 entities, and 1 Edge: TestigoHasSeenActor
There is documentation about how to add the 3 entities, which I use in this way:
await graphiti.add_episode(
uuid=file_id,
name=file_type,
episode_body=text,
reference_time=datetime.now(timezone.utc),
source=EpisodeType.text,
source_description=f"Document from user {user_id}",
group_id=user_id,
entity_types=resolution_entity_types
)
But there is no documentation about how to add the Edge
Should I just add TestigoHasSeenActor in resolution_entity_types ?
I'm willing to send a PR adding your answers in https://help.getzep.com/graphiti/graphiti
Thanks!
We plan to add custom edge types. cc @prasmussen15
@danielchalef I think this was implemented in the last version, right? Any documentation about it?
I'm looking for the custom edge types as well. wondering if it's available now @danielchalef ?
neo4j.exceptions.CypherTypeError: {code: Neo.ClientError.Statement.TypeError} {message: Property values can only be of primitive types or arrays thereof..`
I got the above when trying to use the edge_types
@jackaldenryan Popping documenting Edge Types on your TODO list.
Noted, on to do list
@jackaldenryan Could you share a quick code snippet here to show how to use it? We'd really appreciate it!
@jackaldenryan Yeah, would appreciate a short code snippet if the documentation is gonna take some time :)
Try this: https://help.getzep.com/graphiti/graphiti/custom-entity-and-edge-types
Let me know if there are any syntax errors in the provided code here
@andytan0051