Eric Marchand
commited on
Commit
·
579b50b
1
Parent(s):
3afd61a
add astore.py
Browse files- src/astore.py +39 -0
src/astore.py
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from abc import ABC, abstractmethod
|
2 |
+
|
3 |
+
|
4 |
+
class AStore(ABC):
|
5 |
+
'''
|
6 |
+
Classe abstraite de base pour tous les stores :
|
7 |
+
Chroma
|
8 |
+
Perso
|
9 |
+
...
|
10 |
+
'''
|
11 |
+
|
12 |
+
@abstractmethod
|
13 |
+
def reset(self)->None:
|
14 |
+
pass
|
15 |
+
|
16 |
+
@abstractmethod
|
17 |
+
def print_infos(self)->None:
|
18 |
+
pass
|
19 |
+
|
20 |
+
@abstractmethod
|
21 |
+
def add_to_collection(self, collection_name:str, source:str, vectors:list[list[float]], chunks:list[str])->None:
|
22 |
+
pass
|
23 |
+
|
24 |
+
@abstractmethod
|
25 |
+
def delete_collection(self, name:str)->None:
|
26 |
+
pass
|
27 |
+
|
28 |
+
@abstractmethod
|
29 |
+
def get_similar_vector(self, vector:list[float], collection_name:str)->list[float]:
|
30 |
+
pass
|
31 |
+
|
32 |
+
@abstractmethod
|
33 |
+
def get_similar_chunk(self, query_vector:list[float], collection_name:str)->tuple[str, str]:
|
34 |
+
pass
|
35 |
+
|
36 |
+
@abstractmethod
|
37 |
+
def get_similar_chunks(self, query_vector:list[float], count:int, collection_name:str):
|
38 |
+
pass
|
39 |
+
|