forked from open-webui/open-webui
		
	feat: reset vectordb storage support
This commit is contained in:
		
							parent
							
								
									d4b2578f6e
								
							
						
					
					
						commit
						b37b157638
					
				
					 3 changed files with 63 additions and 2 deletions
				
			
		|  | @ -190,7 +190,7 @@ def reset_vector_db(user=Depends(get_current_user)): | |||
| 
 | ||||
| 
 | ||||
| @app.get("/reset") | ||||
| def reset(user=Depends(get_current_user)): | ||||
| def reset(user=Depends(get_current_user)) -> bool: | ||||
|     if user.role == "admin": | ||||
|         folder = f"{UPLOAD_DIR}" | ||||
|         for filename in os.listdir(folder): | ||||
|  | @ -208,7 +208,7 @@ def reset(user=Depends(get_current_user)): | |||
|         except Exception as e: | ||||
|             print(e) | ||||
| 
 | ||||
|         return {"status": True} | ||||
|         return True | ||||
|     else: | ||||
|         raise HTTPException( | ||||
|             status_code=status.HTTP_403_FORBIDDEN, | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Timothy J. Baek
						Timothy J. Baek