Spaces:
Build error
Build error
Commit
·
69983c5
1
Parent(s):
c2c40bf
Update weaviate_utils.py
Browse files- weaviate_utils.py +9 -5
weaviate_utils.py
CHANGED
|
@@ -14,16 +14,20 @@ def hybrid_search_weaviate(client, selected_class, query):
|
|
| 14 |
# Construct the search query
|
| 15 |
search_query = {
|
| 16 |
"path": ["*"],
|
| 17 |
-
"
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
| 19 |
}
|
| 20 |
-
|
| 21 |
-
# Perform the
|
| 22 |
-
results = client.query.get(selected_class, ["*"]
|
| 23 |
|
| 24 |
return results
|
| 25 |
|
| 26 |
|
|
|
|
| 27 |
def convert_to_tapas_format(data):
|
| 28 |
"""
|
| 29 |
Convert the list of dictionaries (from Weaviate) into the format TAPAS expects.
|
|
|
|
| 14 |
# Construct the search query
|
| 15 |
search_query = {
|
| 16 |
"path": ["*"],
|
| 17 |
+
"where": {
|
| 18 |
+
"path": ["*"],
|
| 19 |
+
"operator": "Like",
|
| 20 |
+
"valueString": query
|
| 21 |
+
}
|
| 22 |
}
|
| 23 |
+
|
| 24 |
+
# Perform the search
|
| 25 |
+
results = client.query.get(selected_class, ["*"])
|
| 26 |
|
| 27 |
return results
|
| 28 |
|
| 29 |
|
| 30 |
+
|
| 31 |
def convert_to_tapas_format(data):
|
| 32 |
"""
|
| 33 |
Convert the list of dictionaries (from Weaviate) into the format TAPAS expects.
|