Spaces:
Paused
Paused
Daniel Marques
commited on
Commit
•
ea4ffd3
1
Parent(s):
9ef164b
feat: add dele folder
Browse files
main.py
CHANGED
@@ -136,14 +136,14 @@ def run_ingest_route():
|
|
136 |
except Exception as e:
|
137 |
raise HTTPException(status_code=500, detail=f"Error occurred: {str(e)}")
|
138 |
|
139 |
-
@api_app.get("/api/
|
140 |
-
def
|
141 |
upload_dir = os.path.join(os.getcwd(), PATH_NAME_SOURCE_DIRECTORY)
|
142 |
files = glob.glob(os.path.join(upload_dir, '*'))
|
143 |
|
144 |
return {"directory": upload_dir, "files": files}
|
145 |
|
146 |
-
@api_app.delete("/api/
|
147 |
def delete_source_route(data: Delete):
|
148 |
filename = data.filename
|
149 |
path_source_documents = os.path.join(os.getcwd(), PATH_NAME_SOURCE_DIRECTORY)
|
|
|
136 |
except Exception as e:
|
137 |
raise HTTPException(status_code=500, detail=f"Error occurred: {str(e)}")
|
138 |
|
139 |
+
@api_app.get("/api/files")
|
140 |
+
def get_files():
|
141 |
upload_dir = os.path.join(os.getcwd(), PATH_NAME_SOURCE_DIRECTORY)
|
142 |
files = glob.glob(os.path.join(upload_dir, '*'))
|
143 |
|
144 |
return {"directory": upload_dir, "files": files}
|
145 |
|
146 |
+
@api_app.delete("/api/delete_document")
|
147 |
def delete_source_route(data: Delete):
|
148 |
filename = data.filename
|
149 |
path_source_documents = os.path.join(os.getcwd(), PATH_NAME_SOURCE_DIRECTORY)
|