From e1a85c99ab04191954537bd4149765c4bb632389 Mon Sep 17 00:00:00 2001 From: Michael Poluektov Date: Thu, 21 Nov 2024 17:52:19 +0000 Subject: [PATCH] format --- backend/open_webui/apps/retrieval/main.py | 4 +++- backend/open_webui/apps/retrieval/web/mojeek.py | 5 ++--- 2 files changed, 5 insertions(+), 4 deletions(-) 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 + ]