Update app.py
Browse files
app.py
CHANGED
|
@@ -75,7 +75,7 @@ def reset_database():
|
|
| 75 |
@app.get("/admin/documents/download")
|
| 76 |
def download_documents():
|
| 77 |
# Convert the documents list to a JSON string
|
| 78 |
-
documents_json = json.dumps({"
|
| 79 |
|
| 80 |
# Create a response with the JSON string as the content
|
| 81 |
response = Response(content=documents_json, media_type="application/json")
|
|
@@ -90,7 +90,7 @@ def download_documents():
|
|
| 90 |
def upload_documents(request: EmbedRequest):
|
| 91 |
documents.extend(request.texts)
|
| 92 |
return {
|
| 93 |
-
"message": f"{len(
|
| 94 |
}
|
| 95 |
|
| 96 |
@app.get("/admin/database/download")
|
|
|
|
| 75 |
@app.get("/admin/documents/download")
|
| 76 |
def download_documents():
|
| 77 |
# Convert the documents list to a JSON string
|
| 78 |
+
documents_json = json.dumps({"texts": documents})
|
| 79 |
|
| 80 |
# Create a response with the JSON string as the content
|
| 81 |
response = Response(content=documents_json, media_type="application/json")
|
|
|
|
| 90 |
def upload_documents(request: EmbedRequest):
|
| 91 |
documents.extend(request.texts)
|
| 92 |
return {
|
| 93 |
+
"message": f"{len(documents)} new documents uploaded"
|
| 94 |
}
|
| 95 |
|
| 96 |
@app.get("/admin/database/download")
|