fix: remove unnecessary files

This commit is contained in:
Boris Arzentar 2024-03-13 17:28:52 +01:00
parent d5391f903c
commit 2a7a545dcc
20 changed files with 44 additions and 27 deletions

BIN
.DS_Store vendored

Binary file not shown.

2
.gitignore vendored
View file

@ -165,3 +165,5 @@ cython_debug/
.vscode/
database/data/
cognee/data/
.DS_Store

View file

@ -68,6 +68,30 @@
"graph_url = await render_graph(graph, graph_type = \"networkx\")\n",
"print(graph_url)\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "6edb9cac",
"metadata": {},
"outputs": [],
"source": [
"from cognee.infrastructure.databases.graph.get_graph_client import get_graph_client\n",
"from cognee.shared.data_models import GraphDBType\n",
"from cognee import search, SearchType\n",
"\n",
"graph_client = get_graph_client(GraphDBType.NETWORKX)\n",
"await graph_client.load_graph_from_file()\n",
"\n",
"graph = graph_client.graph\n",
"\n",
"query_params = {\n",
" SearchType.SIMILARITY: {'query': 'nacin vrsenja kontrole tehnicke dokumentacije'}\n",
"}\n",
"\n",
"results = await search(graph, query_params)\n",
"print(results)"
]
}
],
"metadata": {
@ -91,4 +115,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}

BIN
cognee/.DS_Store vendored

Binary file not shown.

View file

@ -1,4 +1,4 @@
from .api.v1.add.add import add
from .api.v1.cognify.cognify import cognify
from .api.v1.list_datasets.list_datasets import list_datasets
from .api.v1.search import search
from .api.v1.search.search import search, SearchType

View file

@ -35,7 +35,7 @@ aclient = instructor.patch(OpenAI())
USER_ID = "default_user"
async def cognify(dataset_name: str):
async def cognify(dataset_name: str = "root"):
"""This function is responsible for the cognitive processing of the content."""
db = DuckDBAdapter()

View file

@ -1,13 +1,12 @@
""" This module contains the search function that is used to search for nodes in the graph."""
import asyncio
from enum import Enum, auto
from typing import Dict, Any, Callable, List
from cognee.infrastructure.databases.graph.get_graph_client import get_graph_client
from cognee.modules.search.graph.search_adjacent import search_adjacent
from cognee.modules.search.vector.search_similarity import search_similarity
from cognee.modules.search.graph.search_categories import search_categories
from cognee.modules.search.graph.search_neighbour import search_neighbour
from cognee.shared.data_models import GraphDBType
class SearchType(Enum):
@ -17,7 +16,7 @@ class SearchType(Enum):
NEIGHBOR = auto()
async def complex_search(graph, query_params: Dict[SearchType, Dict[str, Any]]) -> List:
async def search(graph, query_params: Dict[SearchType, Dict[str, Any]]) -> List:
search_functions: Dict[SearchType, Callable] = {
SearchType.ADJACENT: search_adjacent,
SearchType.SIMILARITY: search_similarity,
@ -47,21 +46,18 @@ async def complex_search(graph, query_params: Dict[SearchType, Dict[str, Any]])
return results
if __name__ == "__main__":
import asyncio
# if __name__ == "__main__":
# import asyncio
# query_params = {
# SearchType.SIMILARITY: {'query': 'your search query here'}
# }
# async def main():
# graph_client = get_graph_client(GraphDBType.NETWORKX)
# await graph_client.load_graph_from_file()
# graph = graph_client.graph
# results = await complex_search(graph, query_params)
# print(results)
query_params = {
SearchType.SIMILARITY: {'query': 'your search query here'}
}
async def main():
graph_client = get_graph_client(GraphDBType.NETWORKX)
await graph_client.load_graph_from_file()
graph = graph_client.graph
results = await complex_search(graph, query_params)
print(results)
asyncio.run(main())
# asyncio.run(main())

View file

@ -1 +0,0 @@
tmp lock file

View file

@ -1 +0,0 @@
{"collections": {"7480d8b3-140d-48d4-a374-1152458cf249": {"vectors": {"content": {"size": 3072, "distance": "Cosine", "hnsw_config": null, "quantization_config": null, "on_disk": null}}, "shard_number": null, "sharding_method": null, "replication_factor": null, "write_consistency_factor": null, "on_disk_payload": null, "hnsw_config": null, "wal_config": null, "optimizers_config": null, "init_from": null, "quantization_config": null, "sparse_vectors": null}, "b1d1fd8a-d890-442d-9e69-6ae5a9b97a0e": {"vectors": {"content": {"size": 3072, "distance": "Cosine", "hnsw_config": null, "quantization_config": null, "on_disk": null}}, "shard_number": null, "sharding_method": null, "replication_factor": null, "write_consistency_factor": null, "on_disk_payload": null, "hnsw_config": null, "wal_config": null, "optimizers_config": null, "init_from": null, "quantization_config": null, "sparse_vectors": null}, "375f689c-92aa-489a-ad35-2655f7017f30": {"vectors": {"content": {"size": 3072, "distance": "Cosine", "hnsw_config": null, "quantization_config": null, "on_disk": null}}, "shard_number": null, "sharding_method": null, "replication_factor": null, "write_consistency_factor": null, "on_disk_payload": null, "hnsw_config": null, "wal_config": null, "optimizers_config": null, "init_from": null, "quantization_config": null, "sparse_vectors": null}, "f0a288e0-48eb-46e2-81da-a7f1da560593": {"vectors": {"content": {"size": 3072, "distance": "Cosine", "hnsw_config": null, "quantization_config": null, "on_disk": null}}, "shard_number": null, "sharding_method": null, "replication_factor": null, "write_consistency_factor": null, "on_disk_payload": null, "hnsw_config": null, "wal_config": null, "optimizers_config": null, "init_from": null, "quantization_config": null, "sparse_vectors": null}, "7b4568f4-1e3f-42f3-8831-6b2d569fb384": {"vectors": {"content": {"size": 3072, "distance": "Cosine", "hnsw_config": null, "quantization_config": null, "on_disk": null}}, "shard_number": null, "sharding_method": null, "replication_factor": null, "write_consistency_factor": null, "on_disk_payload": null, "hnsw_config": null, "wal_config": null, "optimizers_config": null, "init_from": null, "quantization_config": null, "sparse_vectors": null}, "80de74b2-7ef5-4f66-a34d-5ff13ab44882": {"vectors": {"content": {"size": 3072, "distance": "Cosine", "hnsw_config": null, "quantization_config": null, "on_disk": null}}, "shard_number": null, "sharding_method": null, "replication_factor": null, "write_consistency_factor": null, "on_disk_payload": null, "hnsw_config": null, "wal_config": null, "optimizers_config": null, "init_from": null, "quantization_config": null, "sparse_vectors": null}}, "aliases": {}}

Binary file not shown.

File diff suppressed because one or more lines are too long

3
poetry.lock generated
View file

@ -8048,7 +8048,6 @@ notebook = ["overrides"]
parquet = ["pyarrow"]
pinecone = []
postgres = []
qdrant = ["qdrant-client"]
redshift = []
s3 = []
snowflake = []
@ -8058,4 +8057,4 @@ weaviate = []
[metadata]
lock-version = "2.0"
python-versions = "~3.10"
content-hash = "48d8cbd3319b1370abddeb2ff6c32cf6be01bdaff150d466129a1667b8cce94f"
content-hash = "37a0db9a6a86b71a35c91ac5ef86204d76529033260032917906a907bffc8216"

View file

@ -72,7 +72,6 @@ athena = ["pyathena", "pyarrow", "s3fs", "botocore"]
weaviate = ["weaviate-client"]
mssql = ["pyodbc"]
synapse = ["pyodbc", "adlfs", "pyarrow"]
qdrant = ["qdrant-client"]
databricks = ["databricks-sql-connector"]
lancedb = ["lancedb"]
pinecone = ["pinecone-client"]