Add configurable Google Drive toggle in the Documents admin section along with necessary config scaffolding

This commit is contained in:
Taylor Wilsdon
2024-12-18 13:25:57 -05:00
parent 5c149c3aa2
commit 0dc75363aa
7 changed files with 23 additions and 4 deletions

View File

@@ -183,6 +183,7 @@ from open_webui.config import (
ENABLE_RAG_LOCAL_WEB_FETCH,
ENABLE_RAG_WEB_LOADER_SSL_VERIFICATION,
ENABLE_RAG_WEB_SEARCH,
ENABLE_GOOGLE_DRIVE,
UPLOAD_DIR,
# WebUI
WEBUI_AUTH,
@@ -234,8 +235,6 @@ from open_webui.config import (
CORS_ALLOW_ORIGIN,
DEFAULT_LOCALE,
OAUTH_PROVIDERS,
GOOGLE_DRIVE_CLIENT_ID,
GOOGLE_DRIVE_API_KEY,
# Admin
ENABLE_ADMIN_CHAT_ACCESS,
ENABLE_ADMIN_EXPORT,
@@ -487,6 +486,7 @@ app.state.config.ENABLE_RAG_WEB_SEARCH = ENABLE_RAG_WEB_SEARCH
app.state.config.RAG_WEB_SEARCH_ENGINE = RAG_WEB_SEARCH_ENGINE
app.state.config.RAG_WEB_SEARCH_DOMAIN_FILTER_LIST = RAG_WEB_SEARCH_DOMAIN_FILTER_LIST
app.state.config.ENABLE_GOOGLE_DRIVE = ENABLE_GOOGLE_DRIVE
app.state.config.SEARXNG_QUERY_URL = SEARXNG_QUERY_URL
app.state.config.GOOGLE_PSE_API_KEY = GOOGLE_PSE_API_KEY
app.state.config.GOOGLE_PSE_ENGINE_ID = GOOGLE_PSE_ENGINE_ID
@@ -939,6 +939,7 @@ async def get_app_config(request: Request):
**(
{
"enable_web_search": app.state.config.ENABLE_RAG_WEB_SEARCH,
"enable_google_drive": app.state.config.ENABLE_GOOGLE_DRIVE,
"enable_image_generation": app.state.config.ENABLE_IMAGE_GENERATION,
"enable_community_sharing": app.state.config.ENABLE_COMMUNITY_SHARING,
"enable_message_rating": app.state.config.ENABLE_MESSAGE_RATING,