Spaces:
Build error
Build error
XThomasBU
commited on
Commit
·
7a98bd3
1
Parent(s):
7a233a3
Added comments to the base classes
Browse files
code/modules/chat_processor/base.py
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
| 1 |
class ChatProcessorBase:
|
| 2 |
def __init__(self, config):
|
| 3 |
self.config = config
|
| 4 |
|
| 5 |
def process(self, message):
|
|
|
|
|
|
|
|
|
|
| 6 |
raise NotImplementedError("process method not implemented")
|
|
|
|
| 1 |
+
# Template for chat processor classes
|
| 2 |
+
|
| 3 |
+
|
| 4 |
class ChatProcessorBase:
|
| 5 |
def __init__(self, config):
|
| 6 |
self.config = config
|
| 7 |
|
| 8 |
def process(self, message):
|
| 9 |
+
"""
|
| 10 |
+
Processes and Logs the message
|
| 11 |
+
"""
|
| 12 |
raise NotImplementedError("process method not implemented")
|
code/modules/retriever/base.py
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
| 1 |
class BaseRetriever:
|
| 2 |
def __init__(self, config):
|
| 3 |
self.config = config
|
| 4 |
|
| 5 |
def return_retriever(self):
|
|
|
|
|
|
|
|
|
|
| 6 |
raise NotImplementedError
|
|
|
|
| 1 |
+
# template for retriever classes
|
| 2 |
+
|
| 3 |
+
|
| 4 |
class BaseRetriever:
|
| 5 |
def __init__(self, config):
|
| 6 |
self.config = config
|
| 7 |
|
| 8 |
def return_retriever(self):
|
| 9 |
+
"""
|
| 10 |
+
Returns the retriever object
|
| 11 |
+
"""
|
| 12 |
raise NotImplementedError
|
code/modules/vectorstore/base.py
CHANGED
|
@@ -1,17 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
| 1 |
class VectorStoreBase:
|
| 2 |
def __init__(self, config):
|
| 3 |
self.config = config
|
| 4 |
|
| 5 |
def _init_vector_db(self):
|
|
|
|
|
|
|
|
|
|
| 6 |
raise NotImplementedError
|
| 7 |
|
| 8 |
-
def create_database(self
|
|
|
|
|
|
|
|
|
|
| 9 |
raise NotImplementedError
|
| 10 |
|
| 11 |
-
def load_database(self
|
|
|
|
|
|
|
|
|
|
| 12 |
raise NotImplementedError
|
| 13 |
|
| 14 |
def as_retriever(self):
|
|
|
|
|
|
|
|
|
|
| 15 |
raise NotImplementedError
|
| 16 |
|
| 17 |
def __str__(self):
|
|
|
|
| 1 |
+
# template for vector store classes
|
| 2 |
+
|
| 3 |
+
|
| 4 |
class VectorStoreBase:
|
| 5 |
def __init__(self, config):
|
| 6 |
self.config = config
|
| 7 |
|
| 8 |
def _init_vector_db(self):
|
| 9 |
+
"""
|
| 10 |
+
Creates a vector store object
|
| 11 |
+
"""
|
| 12 |
raise NotImplementedError
|
| 13 |
|
| 14 |
+
def create_database(self):
|
| 15 |
+
"""
|
| 16 |
+
Populates the vector store with documents
|
| 17 |
+
"""
|
| 18 |
raise NotImplementedError
|
| 19 |
|
| 20 |
+
def load_database(self):
|
| 21 |
+
"""
|
| 22 |
+
Loads the vector store from disk
|
| 23 |
+
"""
|
| 24 |
raise NotImplementedError
|
| 25 |
|
| 26 |
def as_retriever(self):
|
| 27 |
+
"""
|
| 28 |
+
Returns the vector store as a retriever
|
| 29 |
+
"""
|
| 30 |
raise NotImplementedError
|
| 31 |
|
| 32 |
def __str__(self):
|