Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /topoteretes_cognee /cognee /infrastructure /engine /models /Edge.py
| from typing import Any | |
| from pydantic import BaseModel | |
| class Edge(BaseModel): | |
| """ | |
| Represents edge metadata for relationships between DataPoints. | |
| This class is used to define edge properties like weight when creating | |
| relationships between DataPoints using tuple syntax: | |
| Example: | |
| # Single weight (backward compatible) | |
| has_items: (Edge(weight=0.5), list[Item]) | |
| # Multiple weights | |
| has_items: (Edge(weights={"strength": 0.8, "confidence": 0.9, "importance": 0.7}), list[Item]) | |
| # Mixed usage | |
| has_items: (Edge(weight=0.5, weights={"confidence": 0.9}), list[Item]) | |
| # With edge_text for rich embedding representation | |
| contains: (Edge(relationship_type="contains", edge_text="This chunk mentions Alice: Alice works at Acme."), Entity) | |
| """ | |
| weight: float | None = None | |
| weights: dict[str, float] | None = None | |
| relationship_type: str | None = None | |
| properties: dict[str, Any] | None = None | |
| edge_text: str | None = None | |
Xet Storage Details
- Size:
- 1.02 kB
- Xet hash:
- 1eb98f5af93ccb3c051cf2c00170a52db0099bc8b12c60c48709646eff6eaa1e
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.