Added graph intefrace, added neo4j + networkx structure and updates to the notebook
This commit is contained in:
parent
48698c547e
commit
279c7a0789
7 changed files with 81 additions and 2 deletions
|
|
@ -4556,8 +4556,6 @@
|
|||
"def find_relevant_chunks(query,unique_layer_uuids):\n",
|
||||
" out = []\n",
|
||||
" for id in unique_layer_uuids:\n",
|
||||
" print(id)\n",
|
||||
" print(query)\n",
|
||||
" result = qdrant_search(id, query)\n",
|
||||
"\n",
|
||||
" if result:\n",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,69 @@
|
|||
from typing import List
|
||||
from abc import abstractmethod
|
||||
from typing import Protocol
|
||||
|
||||
class GraphDBInterface(Protocol):
|
||||
""" Graphs """
|
||||
@abstractmethod
|
||||
async def create_graph(
|
||||
self,
|
||||
graph_name: str,
|
||||
graph_config: object
|
||||
): raise NotImplementedError
|
||||
|
||||
@abstractmethod
|
||||
async def update_graph(
|
||||
self,
|
||||
collection_name: str,
|
||||
collection_config: object
|
||||
): raise NotImplementedError
|
||||
|
||||
# @abstractmethod
|
||||
# async def delete_collection(
|
||||
# self,
|
||||
# collection_name: str
|
||||
# ): raise NotImplementedError
|
||||
|
||||
# @abstractmethod
|
||||
# async def create_vector_index(
|
||||
# self,
|
||||
# collection_name: str,
|
||||
# vector_index_config: object
|
||||
# ): raise NotImplementedError
|
||||
|
||||
# @abstractmethod
|
||||
# async def create_data_index(
|
||||
# self,
|
||||
# collection_name: str,
|
||||
# vector_index_config: object
|
||||
# ): raise NotImplementedError
|
||||
|
||||
""" Data points """
|
||||
@abstractmethod
|
||||
async def create_data_points(
|
||||
self,
|
||||
collection_name: str,
|
||||
data_points: List[any]
|
||||
): raise NotImplementedError
|
||||
|
||||
# @abstractmethod
|
||||
# async def get_data_point(
|
||||
# self,
|
||||
# collection_name: str,
|
||||
# data_point_id: str
|
||||
# ): raise NotImplementedError
|
||||
|
||||
# @abstractmethod
|
||||
# async def update_data_point(
|
||||
# self,
|
||||
# collection_name: str,
|
||||
# data_point_id: str,
|
||||
# payload: object
|
||||
# ): raise NotImplementedError
|
||||
|
||||
# @abstractmethod
|
||||
# async def delete_data_point(
|
||||
# self,
|
||||
# collection_name: str,
|
||||
# data_point_id: str
|
||||
# ): raise NotImplementedError
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
from databases.graph.graph_db_interface import GraphDBInterface
|
||||
|
||||
|
||||
|
||||
|
||||
class Neo4jDB(GraphDBInterface):
|
||||
pass
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
from databases.graph.graph_db_interface import GraphDBInterface
|
||||
|
||||
|
||||
class NetworXDB(GraphDBInterface):
|
||||
pass
|
||||
Loading…
Add table
Reference in a new issue