cognee/cognee/tasks/summarization/models.py
alekszievr bfa0f06fb4
Add type to DataPoint metadata (#364)
* Add type to DataPoint metadata

* Add missing index_fields

* Use DataPoint UUID type in pgvector create_data_points

* Make _metadata mandatory everywhere
2024-12-16 16:27:03 +01:00

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"
}