* Add type to DataPoint metadata * Add missing index_fields * Use DataPoint UUID type in pgvector create_data_points * Make _metadata mandatory everywhere
25 lines
566 B
Python
25 lines
566 B
Python
from cognee.infrastructure.engine import DataPoint
|
|
from cognee.modules.chunking.models import DocumentChunk
|
|
from cognee.shared.CodeGraphEntities import CodeFile
|
|
|
|
|
|
class TextSummary(DataPoint):
|
|
__tablename__ = "text_summary"
|
|
text: str
|
|
made_from: DocumentChunk
|
|
|
|
_metadata: dict = {
|
|
"index_fields": ["text"],
|
|
"type": "TextSummary"
|
|
}
|
|
|
|
|
|
class CodeSummary(DataPoint):
|
|
__tablename__ = "code_summary"
|
|
text: str
|
|
made_from: CodeFile
|
|
|
|
_metadata: dict = {
|
|
"index_fields": ["text"],
|
|
"type": "CodeSummary"
|
|
}
|