diff --git a/application/api/internal/routes.py b/application/api/internal/routes.py index 80759593..70c62877 100755 --- a/application/api/internal/routes.py +++ b/application/api/internal/routes.py @@ -47,6 +47,8 @@ def upload_index_files(): type = secure_filename(request.form["type"]) remote_data = request.form["remote_data"] if "remote_data" in request.form else None sync_frequency = secure_filename(request.form["sync_frequency"]) if "sync_frequency" in request.form else None + + original_file_path = request.form.get("original_file_path") storage = StorageCreator.get_storage() index_base_path = f"indexes/{id}" @@ -85,6 +87,7 @@ def upload_index_files(): "retriever": retriever, "remote_data": remote_data, "sync_frequency": sync_frequency, + "file_path": original_file_path, } }, ) @@ -102,6 +105,7 @@ def upload_index_files(): "retriever": retriever, "remote_data": remote_data, "sync_frequency": sync_frequency, + "file_path": original_file_path, ## relative path to the original file, for the storage referrence } ) return {"status": "ok"} diff --git a/application/worker.py b/application/worker.py index 285b13af..a73bd8f3 100755 --- a/application/worker.py +++ b/application/worker.py @@ -290,6 +290,7 @@ def ingest_worker( "retriever": retriever, "id": str(id), "type": "local", + "original_file_path": source_file_path, # Pass the original file path } upload_index(vector_store_path, file_data)