diff --git a/backend/open_webui/constants.py b/backend/open_webui/constants.py index fd61fda228..3ce8d6cf26 100644 --- a/backend/open_webui/constants.py +++ b/backend/open_webui/constants.py @@ -99,7 +99,7 @@ class ERROR_MESSAGES(str, Enum): INVALID_URL = 'The URL you provided is invalid. Please double-check and try again.' - WEB_SEARCH_ERROR = lambda err='': err if err else 'Something went wrong while searching the web.' + WEB_SEARCH_ERROR = 'Something went wrong while searching the web.' OLLAMA_API_DISABLED = 'The Ollama API is disabled. Please enable it to use this feature.' diff --git a/backend/open_webui/routers/retrieval.py b/backend/open_webui/routers/retrieval.py index 97bf35f11b..12d9c23db5 100644 --- a/backend/open_webui/routers/retrieval.py +++ b/backend/open_webui/routers/retrieval.py @@ -2856,7 +2856,7 @@ async def process_web_search(request: Request, form_data: SearchForm, user=Depen log.exception('Web search failed') raise HTTPException( status.HTTP_400_BAD_REQUEST, - detail=ERROR_MESSAGES.DEFAULT(e, ERROR_MESSAGES.WEB_SEARCH_ERROR()), + detail=ERROR_MESSAGES.DEFAULT(e, ERROR_MESSAGES.WEB_SEARCH_ERROR), ) if len(urls) == 0: @@ -2952,7 +2952,7 @@ async def process_web_search(request: Request, form_data: SearchForm, user=Depen log.exception('Web search content loading failed') raise HTTPException( status.HTTP_400_BAD_REQUEST, - detail=ERROR_MESSAGES.DEFAULT(e, ERROR_MESSAGES.WEB_SEARCH_ERROR()), + detail=ERROR_MESSAGES.DEFAULT(e, ERROR_MESSAGES.WEB_SEARCH_ERROR), )