mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-07 02:58:21 +00:00
refac
This commit is contained in:
parent
ce94c41d81
commit
425da8b6cc
2 changed files with 14 additions and 7 deletions
|
|
@ -5,6 +5,10 @@ import shutil
|
|||
from abc import ABC, abstractmethod
|
||||
from typing import BinaryIO, Dict, Tuple
|
||||
|
||||
import boto3
|
||||
from botocore.config import Config
|
||||
from botocore.exceptions import ClientError
|
||||
|
||||
from open_webui.config import (
|
||||
AZURE_STORAGE_CONTAINER_NAME,
|
||||
AZURE_STORAGE_ENDPOINT,
|
||||
|
|
@ -29,12 +33,9 @@ from open_webui.utils.json_codec import JSONCodec
|
|||
from open_webui.env import USE_SLIM
|
||||
|
||||
if not USE_SLIM:
|
||||
import boto3
|
||||
from azure.core.exceptions import ResourceNotFoundError
|
||||
from azure.identity import DefaultAzureCredential
|
||||
from azure.storage.blob import BlobServiceClient
|
||||
from botocore.config import Config
|
||||
from botocore.exceptions import ClientError
|
||||
from google.cloud import storage
|
||||
from google.cloud.exceptions import GoogleCloudError, NotFound
|
||||
|
||||
|
|
@ -338,9 +339,10 @@ class AzureStorageProvider(StorageProvider):
|
|||
|
||||
|
||||
def get_storage_provider(storage_provider: str):
|
||||
if USE_SLIM and storage_provider != 'local':
|
||||
if USE_SLIM and storage_provider not in ('local', 's3'):
|
||||
raise RuntimeError(
|
||||
'Slim requires local file storage. Set STORAGE_PROVIDER=local, or use the standard image to access cloud storage.'
|
||||
'Slim supports local and S3 file storage. Set STORAGE_PROVIDER=local or s3, '
|
||||
'or use the standard image for other storage providers.'
|
||||
)
|
||||
if storage_provider == 'local':
|
||||
Storage = LocalStorageProvider()
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# Slim: external AI services, SQLite/PostgreSQL app data, pgvector, local file storage.
|
||||
# No Playwright, cloud-storage SDKs, or other database clients.
|
||||
# Slim: external AI services, SQLite/PostgreSQL app data, pgvector, Redis, local/S3 file storage.
|
||||
# No Playwright, Azure/GCS storage SDKs, or other database clients.
|
||||
# Keep shared package pins aligned with requirements.txt. NumPy is used for cosine scoring.
|
||||
numpy==2.4.6
|
||||
typer==0.25.1
|
||||
|
|
@ -12,6 +12,8 @@ itsdangerous==2.2.0
|
|||
python-socketio==5.16.2
|
||||
orjson==3.11.9
|
||||
cryptography==48.0.0
|
||||
pyotp==2.9.0
|
||||
qrcode==8.2
|
||||
bcrypt==5.0.0
|
||||
argon2-cffi==25.1.0
|
||||
PyJWT[crypto]==2.13.0
|
||||
|
|
@ -81,6 +83,9 @@ azure-search-documents==12.0.0
|
|||
psycopg2-binary==2.9.12
|
||||
pgvector==0.4.2
|
||||
|
||||
## File storage
|
||||
boto3==1.42.62
|
||||
|
||||
## LDAP
|
||||
ldap3==2.9.1
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue