Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -107,10 +107,12 @@ app = FastAPI()
|
|
| 107 |
def get_data(query: str):
|
| 108 |
# query = "How much money did the robbers steal?"
|
| 109 |
found_docs = [x.model_dump() for x in qdrant.similarity_search(query)]
|
| 110 |
-
|
| 111 |
-
for
|
| 112 |
-
|
| 113 |
-
|
|
|
|
|
|
|
| 114 |
|
| 115 |
return {
|
| 116 |
"data": found_docs
|
|
|
|
| 107 |
def get_data(query: str):
|
| 108 |
# query = "How much money did the robbers steal?"
|
| 109 |
found_docs = [x.model_dump() for x in qdrant.similarity_search(query)]
|
| 110 |
+
|
| 111 |
+
for doc in found_docs:
|
| 112 |
+
doc.pop("id", None)
|
| 113 |
+
for k,v in doc["metadata"].keys():
|
| 114 |
+
if k[0] == "_":
|
| 115 |
+
doc["metadata"].pop(k)
|
| 116 |
|
| 117 |
return {
|
| 118 |
"data": found_docs
|