From 35a91405675aeb47ed134ea3293a67bfb353bcb5 Mon Sep 17 00:00:00 2001 From: Davi Sclifo Zucon <> Date: Mon, 4 Nov 2024 16:21:26 -0300 Subject: [PATCH] Added parameter to: app.state.config.ENABLE_RAG_WEB_LOADER_SSL_VERIFICATION to get_web_loader(verify_ssl). Invert variable value to send to UI , not ENABLE_RAG_WEB_LOADER_SSL_VERIFICATION. --- backend/open_webui/apps/retrieval/main.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/backend/open_webui/apps/retrieval/main.py b/backend/open_webui/apps/retrieval/main.py index 48887f6c6..0ce4a6cde 100644 --- a/backend/open_webui/apps/retrieval/main.py +++ b/backend/open_webui/apps/retrieval/main.py @@ -428,7 +428,7 @@ async def get_rag_config(user=Depends(get_admin_user)): "translation": app.state.YOUTUBE_LOADER_TRANSLATION, }, "web": { - "web_loader_ssl_verification": app.state.config.ENABLE_RAG_WEB_LOADER_SSL_VERIFICATION, + "web_loader_ssl_verification": not app.state.config.ENABLE_RAG_WEB_LOADER_SSL_VERIFICATION, "search": { "enabled": app.state.config.ENABLE_RAG_WEB_SEARCH, "engine": app.state.config.RAG_WEB_SEARCH_ENGINE, @@ -536,8 +536,9 @@ async def update_rag_config(form_data: ConfigUpdateForm, user=Depends(get_admin_ app.state.YOUTUBE_LOADER_TRANSLATION = form_data.youtube.translation if form_data.web is not None: + # if "Bypass SSL verification for Websites" == True then web_loader_ssl_verification = False. app.state.config.ENABLE_RAG_WEB_LOADER_SSL_VERIFICATION = ( - form_data.web.web_loader_ssl_verification + not form_data.web.web_loader_ssl_verification ) app.state.config.ENABLE_RAG_WEB_SEARCH = form_data.web.search.enabled @@ -592,7 +593,7 @@ async def update_rag_config(form_data: ConfigUpdateForm, user=Depends(get_admin_ "translation": app.state.YOUTUBE_LOADER_TRANSLATION, }, "web": { - "web_loader_ssl_verification": app.state.config.ENABLE_RAG_WEB_LOADER_SSL_VERIFICATION, + "web_loader_ssl_verification": not app.state.config.ENABLE_RAG_WEB_LOADER_SSL_VERIFICATION, "search": { "enabled": app.state.config.ENABLE_RAG_WEB_SEARCH, "engine": app.state.config.RAG_WEB_SEARCH_ENGINE, @@ -1229,7 +1230,7 @@ def process_web_search(form_data: SearchForm, user=Depends(get_verified_user)): urls = [result.link for result in web_results] - loader = get_web_loader(urls) + loader = get_web_loader(urls, verify_ssl=app.state.config.ENABLE_RAG_WEB_LOADER_SSL_VERIFICATION) docs = loader.load() save_docs_to_vector_db(docs, collection_name, overwrite=True)