-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f430bd1
commit f98be96
Showing
7 changed files
with
51 additions
and
5 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
dbgpt/storage/graph_store/community/community_metastore.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
"""Community metastore.""" | ||
from abc import ABC, abstractmethod | ||
from typing import List | ||
|
||
from dbgpt.storage.graph_store.community_store import Community, CommunityStore | ||
from dbgpt.storage.vector_store.pgvector_store import PGVectorStore | ||
|
||
|
||
class CommunityMetastore(ABC): | ||
"""Community metastore class.""" | ||
|
||
@abstractmethod | ||
def get(self, community_id: str) -> Community: | ||
"""Get community.""" | ||
|
||
@abstractmethod | ||
def search(self, query: str) -> List[Community]: | ||
"""search communities relevant to query.""" | ||
|
||
@abstractmethod | ||
def save(self, community: Community): | ||
"""Upsert community.""" | ||
|
||
@abstractmethod | ||
def drop(self, community_id: str): | ||
"""Drop community.""" | ||
|
||
|
||
class PGVectorCommunityMetastore(CommunityMetastore): | ||
"""Community metastore with vector storage.""" | ||
|
||
vectorStore: PGVectorStore | ||
|
||
def get(self, community_id: str) -> Community: | ||
pass | ||
|
||
def search(self, query: str) -> List[Community]: | ||
pass | ||
|
||
def save(self, community: Community): | ||
pass | ||
|
||
def drop(self, community_id: str): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
"""Connector for vector store.""" | ||
"""Graph store factory.""" | ||
import logging | ||
from typing import Tuple, Type | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
"""Graph store base class.""" | ||
"""Graph definition.""" | ||
import itertools | ||
import json | ||
import logging | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
"""Neo4j vector store.""" | ||
"""Neo4j store.""" | ||
import logging | ||
from typing import List, Optional, Tuple, Generator | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters