diff --git a/backend/open_webui/apps/retrieval/main.py b/backend/open_webui/apps/retrieval/main.py index a2c1250fd..10d6ff9a7 100644 --- a/backend/open_webui/apps/retrieval/main.py +++ b/backend/open_webui/apps/retrieval/main.py @@ -598,7 +598,9 @@ async def update_rag_config(form_data: ConfigUpdateForm, user=Depends(get_admin_ app.state.config.BRAVE_SEARCH_API_KEY = ( form_data.web.search.brave_search_api_key ) - app.state.config.MOJEEK_SEARCH_API_KEY = form_data.web.search.mojeek_search_api_key + app.state.config.MOJEEK_SEARCH_API_KEY = ( + form_data.web.search.mojeek_search_api_key + ) app.state.config.SERPSTACK_API_KEY = form_data.web.search.serpstack_api_key app.state.config.SERPSTACK_HTTPS = form_data.web.search.serpstack_https app.state.config.SERPER_API_KEY = form_data.web.search.serper_api_key diff --git a/backend/open_webui/apps/retrieval/web/mojeek.py b/backend/open_webui/apps/retrieval/web/mojeek.py index 46a6526c7..f257c92aa 100644 --- a/backend/open_webui/apps/retrieval/web/mojeek.py +++ b/backend/open_webui/apps/retrieval/web/mojeek.py @@ -22,7 +22,7 @@ def search_mojeek( headers = { "Accept": "application/json", } - params = {"q": query, "api_key": api_key, 'fmt': 'json', 't': count} + params = {"q": query, "api_key": api_key, "fmt": "json", "t": count} response = requests.get(url, headers=headers, params=params) response.raise_for_status() @@ -32,10 +32,9 @@ def search_mojeek( if filter_list: results = get_filtered_results(results, filter_list) - return [ SearchResult( link=result["url"], title=result.get("title"), snippet=result.get("desc") ) for result in results - ] \ No newline at end of file + ]