|
@@ -32,7 +32,7 @@ from open_webui.config import (
|
|
)
|
|
)
|
|
|
|
|
|
from open_webui.constants import ERROR_MESSAGES
|
|
from open_webui.constants import ERROR_MESSAGES
|
|
-from open_webui.env import SRC_LOG_LEVELS, DEVICE_TYPE
|
|
|
|
|
|
+from open_webui.env import ENV, SRC_LOG_LEVELS, DEVICE_TYPE
|
|
from fastapi import Depends, FastAPI, File, HTTPException, Request, UploadFile, status
|
|
from fastapi import Depends, FastAPI, File, HTTPException, Request, UploadFile, status
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
from fastapi.responses import FileResponse
|
|
from fastapi.responses import FileResponse
|
|
@@ -47,7 +47,8 @@ MAX_FILE_SIZE = MAX_FILE_SIZE_MB * 1024 * 1024 # Convert MB to bytes
|
|
log = logging.getLogger(__name__)
|
|
log = logging.getLogger(__name__)
|
|
log.setLevel(SRC_LOG_LEVELS["AUDIO"])
|
|
log.setLevel(SRC_LOG_LEVELS["AUDIO"])
|
|
|
|
|
|
-app = FastAPI()
|
|
|
|
|
|
+app = FastAPI(docs_url="/docs" if ENV == "dev" else None, openapi_url="/openapi.json" if ENV == "dev" else None, redoc_url=None)
|
|
|
|
+
|
|
app.add_middleware(
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
CORSMiddleware,
|
|
allow_origins=CORS_ALLOW_ORIGIN,
|
|
allow_origins=CORS_ALLOW_ORIGIN,
|