Spaces:
Runtime error
Runtime error
v0.1.4
Browse files- src/chromaIntf.py +7 -1
src/chromaIntf.py
CHANGED
@@ -16,6 +16,12 @@ import logging, asyncio
|
|
16 |
|
17 |
logger=logging.getLogger("root")
|
18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
class ChromaIntf():
|
20 |
def __init__(self):
|
21 |
self.db_interface=DbInterface()
|
@@ -117,7 +123,7 @@ class ChromaIntf():
|
|
117 |
self.vectorstore,
|
118 |
self.document_content_description,
|
119 |
self.metadata_field_info,
|
120 |
-
structured_query_translator=
|
121 |
verbose=True
|
122 |
)
|
123 |
|
|
|
16 |
|
17 |
logger=logging.getLogger("root")
|
18 |
|
19 |
+
class myChromaTranslator(ChromaTranslator):
|
20 |
+
allowed_operators = ["$and", "$or"]
|
21 |
+
"""Subset of allowed logical operators."""
|
22 |
+
allowed_comparators = [ "$eq","$ne","$gt","$gte","$lt","$lte",
|
23 |
+
"$contains","$not_contains","$in","$nin"]
|
24 |
+
|
25 |
class ChromaIntf():
|
26 |
def __init__(self):
|
27 |
self.db_interface=DbInterface()
|
|
|
123 |
self.vectorstore,
|
124 |
self.document_content_description,
|
125 |
self.metadata_field_info,
|
126 |
+
structured_query_translator=myChromaTranslator(),
|
127 |
verbose=True
|
128 |
)
|
129 |
|