cognee 0.2.3.dev1__py3-none-any.whl → 0.2.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cognee/__main__.py +4 -0
- cognee/api/v1/add/add.py +18 -6
- cognee/api/v1/cognify/code_graph_pipeline.py +7 -1
- cognee/api/v1/cognify/cognify.py +22 -107
- cognee/api/v1/cognify/routers/get_cognify_router.py +11 -3
- cognee/api/v1/datasets/routers/get_datasets_router.py +1 -1
- cognee/api/v1/responses/default_tools.py +4 -0
- cognee/api/v1/responses/dispatch_function.py +6 -1
- cognee/api/v1/responses/models.py +1 -1
- cognee/api/v1/search/search.py +6 -0
- cognee/cli/__init__.py +10 -0
- cognee/cli/_cognee.py +180 -0
- cognee/cli/commands/__init__.py +1 -0
- cognee/cli/commands/add_command.py +80 -0
- cognee/cli/commands/cognify_command.py +128 -0
- cognee/cli/commands/config_command.py +225 -0
- cognee/cli/commands/delete_command.py +80 -0
- cognee/cli/commands/search_command.py +149 -0
- cognee/cli/config.py +33 -0
- cognee/cli/debug.py +21 -0
- cognee/cli/echo.py +45 -0
- cognee/cli/exceptions.py +23 -0
- cognee/cli/minimal_cli.py +97 -0
- cognee/cli/reference.py +26 -0
- cognee/cli/suppress_logging.py +12 -0
- cognee/eval_framework/corpus_builder/corpus_builder_executor.py +2 -2
- cognee/eval_framework/eval_config.py +1 -1
- cognee/infrastructure/databases/graph/get_graph_engine.py +4 -9
- cognee/infrastructure/databases/graph/kuzu/adapter.py +64 -2
- cognee/infrastructure/databases/graph/neo4j_driver/adapter.py +49 -0
- cognee/infrastructure/databases/vector/embeddings/FastembedEmbeddingEngine.py +5 -3
- cognee/infrastructure/databases/vector/embeddings/LiteLLMEmbeddingEngine.py +16 -7
- cognee/infrastructure/databases/vector/embeddings/OllamaEmbeddingEngine.py +5 -5
- cognee/infrastructure/databases/vector/embeddings/config.py +2 -2
- cognee/infrastructure/databases/vector/embeddings/get_embedding_engine.py +6 -6
- cognee/infrastructure/files/utils/get_data_file_path.py +14 -9
- cognee/infrastructure/files/utils/get_file_metadata.py +2 -1
- cognee/infrastructure/llm/LLMGateway.py +14 -5
- cognee/infrastructure/llm/config.py +5 -5
- cognee/infrastructure/llm/structured_output_framework/baml/baml_src/extraction/knowledge_graph/extract_content_graph.py +16 -5
- cognee/infrastructure/llm/structured_output_framework/litellm_instructor/extraction/knowledge_graph/extract_content_graph.py +19 -15
- cognee/infrastructure/llm/structured_output_framework/litellm_instructor/llm/anthropic/adapter.py +3 -3
- cognee/infrastructure/llm/structured_output_framework/litellm_instructor/llm/gemini/adapter.py +3 -3
- cognee/infrastructure/llm/structured_output_framework/litellm_instructor/llm/generic_llm_api/adapter.py +2 -2
- cognee/infrastructure/llm/structured_output_framework/litellm_instructor/llm/get_llm_client.py +14 -8
- cognee/infrastructure/llm/structured_output_framework/litellm_instructor/llm/ollama/adapter.py +6 -4
- cognee/infrastructure/llm/structured_output_framework/litellm_instructor/llm/openai/adapter.py +3 -3
- cognee/infrastructure/llm/tokenizer/Gemini/adapter.py +2 -2
- cognee/infrastructure/llm/tokenizer/HuggingFace/adapter.py +3 -3
- cognee/infrastructure/llm/tokenizer/Mistral/adapter.py +3 -3
- cognee/infrastructure/llm/tokenizer/TikToken/adapter.py +6 -6
- cognee/infrastructure/llm/utils.py +7 -7
- cognee/modules/data/methods/__init__.py +2 -0
- cognee/modules/data/methods/create_authorized_dataset.py +19 -0
- cognee/modules/data/methods/get_authorized_dataset.py +11 -5
- cognee/modules/data/methods/get_authorized_dataset_by_name.py +16 -0
- cognee/modules/data/methods/load_or_create_datasets.py +2 -20
- cognee/modules/graph/methods/get_formatted_graph_data.py +3 -2
- cognee/modules/pipelines/__init__.py +1 -1
- cognee/modules/pipelines/exceptions/tasks.py +18 -0
- cognee/modules/pipelines/layers/__init__.py +1 -0
- cognee/modules/pipelines/layers/check_pipeline_run_qualification.py +59 -0
- cognee/modules/pipelines/layers/pipeline_execution_mode.py +127 -0
- cognee/modules/pipelines/layers/reset_dataset_pipeline_run_status.py +12 -0
- cognee/modules/pipelines/layers/resolve_authorized_user_dataset.py +34 -0
- cognee/modules/pipelines/layers/resolve_authorized_user_datasets.py +55 -0
- cognee/modules/pipelines/layers/setup_and_check_environment.py +41 -0
- cognee/modules/pipelines/layers/validate_pipeline_tasks.py +20 -0
- cognee/modules/pipelines/methods/__init__.py +2 -0
- cognee/modules/pipelines/methods/get_pipeline_runs_by_dataset.py +34 -0
- cognee/modules/pipelines/methods/reset_pipeline_run_status.py +16 -0
- cognee/modules/pipelines/operations/__init__.py +0 -1
- cognee/modules/pipelines/operations/log_pipeline_run_initiated.py +1 -1
- cognee/modules/pipelines/operations/pipeline.py +23 -138
- cognee/modules/retrieval/base_feedback.py +11 -0
- cognee/modules/retrieval/cypher_search_retriever.py +1 -9
- cognee/modules/retrieval/graph_completion_context_extension_retriever.py +9 -2
- cognee/modules/retrieval/graph_completion_cot_retriever.py +13 -6
- cognee/modules/retrieval/graph_completion_retriever.py +89 -5
- cognee/modules/retrieval/graph_summary_completion_retriever.py +2 -0
- cognee/modules/retrieval/natural_language_retriever.py +0 -4
- cognee/modules/retrieval/user_qa_feedback.py +83 -0
- cognee/modules/retrieval/utils/extract_uuid_from_node.py +18 -0
- cognee/modules/retrieval/utils/models.py +40 -0
- cognee/modules/search/methods/search.py +46 -5
- cognee/modules/search/types/SearchType.py +1 -0
- cognee/modules/settings/get_settings.py +2 -2
- cognee/shared/CodeGraphEntities.py +1 -0
- cognee/shared/logging_utils.py +142 -31
- cognee/shared/utils.py +0 -1
- cognee/tasks/graph/extract_graph_from_data.py +6 -2
- cognee/tasks/repo_processor/get_local_dependencies.py +2 -0
- cognee/tasks/repo_processor/get_repo_file_dependencies.py +120 -48
- cognee/tasks/storage/add_data_points.py +33 -3
- cognee/tests/integration/cli/__init__.py +3 -0
- cognee/tests/integration/cli/test_cli_integration.py +331 -0
- cognee/tests/integration/documents/PdfDocument_test.py +2 -2
- cognee/tests/integration/documents/TextDocument_test.py +2 -4
- cognee/tests/integration/documents/UnstructuredDocument_test.py +5 -8
- cognee/tests/{test_deletion.py → test_delete_hard.py} +0 -37
- cognee/tests/test_delete_soft.py +85 -0
- cognee/tests/test_kuzu.py +2 -2
- cognee/tests/test_neo4j.py +2 -2
- cognee/tests/test_search_db.py +126 -7
- cognee/tests/unit/cli/__init__.py +3 -0
- cognee/tests/unit/cli/test_cli_commands.py +483 -0
- cognee/tests/unit/cli/test_cli_edge_cases.py +625 -0
- cognee/tests/unit/cli/test_cli_main.py +173 -0
- cognee/tests/unit/cli/test_cli_runner.py +62 -0
- cognee/tests/unit/cli/test_cli_utils.py +127 -0
- cognee/tests/unit/modules/retrieval/graph_completion_retriever_context_extension_test.py +3 -3
- cognee/tests/unit/modules/retrieval/graph_completion_retriever_cot_test.py +3 -3
- cognee/tests/unit/modules/retrieval/graph_completion_retriever_test.py +3 -3
- cognee/tests/unit/modules/search/search_methods_test.py +2 -0
- {cognee-0.2.3.dev1.dist-info → cognee-0.2.4.dist-info}/METADATA +7 -5
- {cognee-0.2.3.dev1.dist-info → cognee-0.2.4.dist-info}/RECORD +120 -83
- cognee-0.2.4.dist-info/entry_points.txt +2 -0
- cognee/infrastructure/databases/graph/networkx/__init__.py +0 -0
- cognee/infrastructure/databases/graph/networkx/adapter.py +0 -1017
- cognee/infrastructure/pipeline/models/Operation.py +0 -60
- cognee/infrastructure/pipeline/models/__init__.py +0 -0
- cognee/notebooks/github_analysis_step_by_step.ipynb +0 -37
- cognee/tests/tasks/descriptive_metrics/networkx_metrics_test.py +0 -7
- {cognee-0.2.3.dev1.dist-info → cognee-0.2.4.dist-info}/WHEEL +0 -0
- {cognee-0.2.3.dev1.dist-info → cognee-0.2.4.dist-info}/licenses/LICENSE +0 -0
- {cognee-0.2.3.dev1.dist-info → cognee-0.2.4.dist-info}/licenses/NOTICE.md +0 -0
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
from datetime import datetime, timezone
|
|
2
|
-
from sqlalchemy.orm import Mapped, MappedColumn
|
|
3
|
-
from sqlalchemy import Column, DateTime, ForeignKey, Enum, JSON
|
|
4
|
-
from cognee.infrastructure.databases.relational import Base, UUID
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class OperationType(Enum):
|
|
8
|
-
"""
|
|
9
|
-
Define various types of operations for data handling.
|
|
10
|
-
|
|
11
|
-
Public methods:
|
|
12
|
-
- __str__(): Returns a string representation of the operation type.
|
|
13
|
-
|
|
14
|
-
Instance variables:
|
|
15
|
-
- MERGE_DATA: Represents the merge data operation type.
|
|
16
|
-
- APPEND_DATA: Represents the append data operation type.
|
|
17
|
-
"""
|
|
18
|
-
|
|
19
|
-
MERGE_DATA = "MERGE_DATA"
|
|
20
|
-
APPEND_DATA = "APPEND_DATA"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
class OperationStatus(Enum):
|
|
24
|
-
"""
|
|
25
|
-
Represent the status of an operation with predefined states.
|
|
26
|
-
"""
|
|
27
|
-
|
|
28
|
-
STARTED = "OPERATION_STARTED"
|
|
29
|
-
IN_PROGRESS = "OPERATION_IN_PROGRESS"
|
|
30
|
-
COMPLETE = "OPERATION_COMPLETE"
|
|
31
|
-
ERROR = "OPERATION_ERROR"
|
|
32
|
-
CANCELLED = "OPERATION_CANCELLED"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
class Operation(Base):
|
|
36
|
-
"""
|
|
37
|
-
Represents an operation in the system, extending the Base class.
|
|
38
|
-
|
|
39
|
-
This class defines the structure of the 'operation' table, including fields for the
|
|
40
|
-
operation's ID, status, type, associated data, metadata, and creation timestamp. The
|
|
41
|
-
public methods available in this class are inherited from the Base class. Instance
|
|
42
|
-
variables include:
|
|
43
|
-
- id: Unique identifier for the operation.
|
|
44
|
-
- status: The current status of the operation.
|
|
45
|
-
- operation_type: The type of operation being represented.
|
|
46
|
-
- data_id: Foreign key referencing the associated data's ID.
|
|
47
|
-
- meta_data: Additional metadata related to the operation.
|
|
48
|
-
- created_at: Timestamp for when the operation was created.
|
|
49
|
-
"""
|
|
50
|
-
|
|
51
|
-
__tablename__ = "operation"
|
|
52
|
-
|
|
53
|
-
id = Column(UUID, primary_key=True)
|
|
54
|
-
status = Column(Enum(OperationStatus))
|
|
55
|
-
operation_type = Column(Enum(OperationType))
|
|
56
|
-
|
|
57
|
-
data_id = Column(UUID, ForeignKey("data.id"))
|
|
58
|
-
meta_data: Mapped[dict] = MappedColumn(type_=JSON)
|
|
59
|
-
|
|
60
|
-
created_at = Column(DateTime, default=datetime.now(timezone.utc))
|
|
File without changes
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"cells": [
|
|
3
|
-
{
|
|
4
|
-
"cell_type": "code",
|
|
5
|
-
"execution_count": null,
|
|
6
|
-
"id": "initial_id",
|
|
7
|
-
"metadata": {
|
|
8
|
-
"collapsed": true
|
|
9
|
-
},
|
|
10
|
-
"outputs": [],
|
|
11
|
-
"source": [
|
|
12
|
-
""
|
|
13
|
-
]
|
|
14
|
-
}
|
|
15
|
-
],
|
|
16
|
-
"metadata": {
|
|
17
|
-
"kernelspec": {
|
|
18
|
-
"display_name": "Python 3",
|
|
19
|
-
"language": "python",
|
|
20
|
-
"name": "python3"
|
|
21
|
-
},
|
|
22
|
-
"language_info": {
|
|
23
|
-
"codemirror_mode": {
|
|
24
|
-
"name": "ipython",
|
|
25
|
-
"version": 2
|
|
26
|
-
},
|
|
27
|
-
"file_extension": ".py",
|
|
28
|
-
"mimetype": "text/x-python",
|
|
29
|
-
"name": "python",
|
|
30
|
-
"nbconvert_exporter": "python",
|
|
31
|
-
"pygments_lexer": "ipython2",
|
|
32
|
-
"version": "2.7.6"
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
"nbformat": 4,
|
|
36
|
-
"nbformat_minor": 5
|
|
37
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
from cognee.tests.tasks.descriptive_metrics.metrics_test_utils import assert_metrics
|
|
2
|
-
import asyncio
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
if __name__ == "__main__":
|
|
6
|
-
asyncio.run(assert_metrics(provider="networkx", include_optional=False))
|
|
7
|
-
asyncio.run(assert_metrics(provider="networkx", include_optional=True))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|