diff --git a/.env-template b/.env-template index 4152b9782..dfa2408e6 100644 --- a/.env-template +++ b/.env-template @@ -1,8 +1,7 @@ -OPENAI_API_KEY= -SELF_HOSTED_MODEL=false +API_KEY= VITE_API_STREAMING=true -#For Azure +#For Azure (you can delete it if you don't use Azure) OPENAI_API_BASE= OPENAI_API_VERSION= AZURE_DEPLOYMENT_NAME= diff --git a/application/api/user/routes.py b/application/api/user/routes.py index 56b020197..02a0876c3 100644 --- a/application/api/user/routes.py +++ b/application/api/user/routes.py @@ -84,13 +84,14 @@ def delete_old(): path = request.args.get("path") dirs = path.split("/") dirs_clean = [] - for i in range(1, len(dirs)): + for i in range(0, len(dirs)): dirs_clean.append(secure_filename(dirs[i])) # check that path strats with indexes or vectors - if dirs[0] not in ["indexes", "vectors"]: + + if dirs_clean[0] not in ["indexes", "vectors"]: return {"status": "error"} - path_clean = "/".join(dirs) - vectors_collection.delete_one({"location": path}) + path_clean = "/".join(dirs_clean) + vectors_collection.delete_one({"name": dirs_clean[-1], 'user': dirs_clean[-2]}) if settings.VECTOR_STORE == "faiss": try: shutil.rmtree(os.path.join(current_dir, path_clean))