From 42b7beb8a7d1e0b914ff2f6edfd514b4189541b5 Mon Sep 17 00:00:00 2001 From: kahghi Date: Fri, 17 Jan 2025 09:39:59 +0800 Subject: [PATCH] add GCSStorageProvider --- backend/open_webui/storage/provider.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend/open_webui/storage/provider.py b/backend/open_webui/storage/provider.py index 7bfb33ece..248d36856 100644 --- a/backend/open_webui/storage/provider.py +++ b/backend/open_webui/storage/provider.py @@ -14,6 +14,7 @@ from open_webui.config import ( STORAGE_PROVIDER, UPLOAD_DIR, ) +from google.cloud import storage from open_webui.constants import ERROR_MESSAGES @@ -137,6 +138,11 @@ class S3StorageProvider(StorageProvider): # Always delete from local storage LocalStorageProvider.delete_all_files() +class GCSStorageProvider(StorageProvider): + def __init__(self): + self.gcs_client = storage.Client() + self.bucket_name = GCS_BUCKET_NAME + def get_storage_provider(storage_provider: str): if storage_provider == "local":