Files
wehub-resource-sync c889a57b6b
Test Suites / Build CI Environment (push) Has been cancelled
Test Suites / Basic Tests (push) Has been cancelled
Test Suites / End-to-End Tests (push) Has been cancelled
Test Suites / CLI Tests (push) Has been cancelled
Test Suites / Slow End-to-End Tests (push) Has been cancelled
Test Suites / Graph Database Tests (push) Has been cancelled
Test Suites / Vector DB Tests (push) Has been cancelled
Test Suites / Temporal Graph Test (push) Has been cancelled
Test Suites / Search Test on Different DBs (push) Has been cancelled
Test Suites / Example Tests (push) Has been cancelled
Test Suites / Notebook Tests (push) Has been cancelled
Test Suites / OS and Python Tests Ubuntu (push) Has been cancelled
Test Suites / OS and Python Tests Extended (push) Has been cancelled
Test Suites / LLM Test Suite (push) Has been cancelled
Test Suites / S3 File Storage Test (push) Has been cancelled
Test Suites / Run Integration Tests (push) Has been cancelled
Test Suites / MCP Tests (push) Has been cancelled
Test Suites / Docker Compose Test (push) Has been cancelled
Test Suites / Docker CI test (push) Has been cancelled
Test Suites / Relational DB Migration Tests (push) Has been cancelled
Test Suites / Distributed Cognee Test (push) Has been cancelled
Test Suites / DB Examples Tests (push) Has been cancelled
Test Suites / Test Completion Status (push) Has been cancelled
Test Suites / Claude Code Review (push) Has been cancelled
Test Suites / basic checks (push) Has been cancelled
build | Build and Push Cognee MCP Docker Image to dockerhub / docker-build-and-push (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
build | Build and Push Docker Image to dockerhub / docker-build-and-push (push) Has been cancelled
Weighted Edges Tests / Test Weighted Edges Core Functionality (3.11) (push) Has been cancelled
Weighted Edges Tests / Test Weighted Edges Core Functionality (3.12) (push) Has been cancelled
Weighted Edges Tests / Test Weighted Edges with Different Graph Databases (kuzu, kuzu) (push) Has been cancelled
Weighted Edges Tests / Test Weighted Edges with Different Graph Databases (neo4j, neo4j) (push) Has been cancelled
Weighted Edges Tests / Test Weighted Edges Examples (push) Has been cancelled
Weighted Edges Tests / Code Quality for Weighted Edges (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:02:24 +08:00

56 lines
1.8 KiB
Python

from __future__ import annotations
from typing import Union, Optional
from cognee.infrastructure.engine import DataPoint
from cognee.modules.chunking.models import DocumentChunk
from cognee.shared.CodeGraphEntities import CodeFile, CodePart
class GlobalContextSummary(DataPoint):
"""
Summarizes a global context index bucket or dataset root.
"""
text: str
dataset_id: str
level: int
is_root: bool = False
graph_bucket_entity_ids: list[str] | None = None
summarized_in: Optional["GlobalContextSummary"] = None
metadata: dict = {"index_fields": ["text"]}
class TextSummary(DataPoint):
"""
Represent a text summary derived from a document chunk.
This class encapsulates a text summary as well as its associated metadata. The public
instance variables include 'text' for the summary content and 'made_from' which
indicates the source document chunk. The 'metadata' instance variable contains
additional information such as indexed fields.
"""
text: str
made_from: DocumentChunk
source_chunk_id: Optional[str] = None
summarized_in: Optional[GlobalContextSummary] = None
global_context_bucket_id: Optional[str] = None
metadata: dict = {"index_fields": ["text"]}
importance_weight: Optional[float] = 0.5
class CodeSummary(DataPoint):
"""
Summarizes code and its components.
This class inherits from DataPoint and contains a text representation alongside the
summarized content, which can either be a full code file or a part of it. The metadata
dictionary defines index fields for the class's instances, particularly focusing on the
'text' attribute. Public attributes include 'text', 'summarizes', and 'metadata'.
"""
text: str
summarizes: Union[CodeFile, CodePart]
metadata: dict = {"index_fields": ["text"]}