Spaces:
Running
Running
main.py
CHANGED
|
@@ -144,7 +144,7 @@ def search(payload: SearchRequest) -> Dict[str, Any]:
|
|
| 144 |
query_embeddings=[query_embedding],
|
| 145 |
n_results=payload.k,
|
| 146 |
where=where_filter,
|
| 147 |
-
include=["distances", "metadatas"
|
| 148 |
)
|
| 149 |
except Exception as exc: # noqa: BLE001
|
| 150 |
print(f"Filtered query failed ({exc}); falling back to vector-only.")
|
|
@@ -154,7 +154,7 @@ def search(payload: SearchRequest) -> Dict[str, Any]:
|
|
| 154 |
results = collection.query(
|
| 155 |
query_embeddings=[query_embedding],
|
| 156 |
n_results=payload.k,
|
| 157 |
-
include=["distances", "metadatas"
|
| 158 |
)
|
| 159 |
|
| 160 |
ids: List[str] = results.get("ids", [[]])[0]
|
|
|
|
| 144 |
query_embeddings=[query_embedding],
|
| 145 |
n_results=payload.k,
|
| 146 |
where=where_filter,
|
| 147 |
+
include=["distances", "metadatas"],
|
| 148 |
)
|
| 149 |
except Exception as exc: # noqa: BLE001
|
| 150 |
print(f"Filtered query failed ({exc}); falling back to vector-only.")
|
|
|
|
| 154 |
results = collection.query(
|
| 155 |
query_embeddings=[query_embedding],
|
| 156 |
n_results=payload.k,
|
| 157 |
+
include=["distances", "metadatas"],
|
| 158 |
)
|
| 159 |
|
| 160 |
ids: List[str] = results.get("ids", [[]])[0]
|