From e0b0edfeb0afdd24ece0afedca01c85654397a30 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Sat, 10 Oct 2026 17:55:00 +0200 Subject: [PATCH] fix: Kagi web search fails on every search when a domain filter list is set (#32183) With Kagi as the web search engine, any entry in the Domain Filter List made every search fail with "'SearchResult' object has no attribute 'get'", so the model got no search results. The Domain Filter List now works with Kagi the same way it does with the other search engines, and the remaining results reach the model. Fixes #32004 --- backend/open_webui/retrieval/web/kagi.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/backend/open_webui/retrieval/web/kagi.py b/backend/open_webui/retrieval/web/kagi.py index cb35ccbb22..63fd06d7c3 100644 --- a/backend/open_webui/retrieval/web/kagi.py +++ b/backend/open_webui/retrieval/web/kagi.py @@ -27,6 +27,8 @@ def search_kagi(api_key: str, query: str, count: int, filter_list: Optional[list response.raise_for_status() json_response = response.json() search_results = json_response.get('data', {}).get('search', []) + if filter_list: + search_results = get_filtered_results(search_results, filter_list) results = [ SearchResult(link=result['url'], title=result['title'], snippet=result.get('snippet')) @@ -35,7 +37,4 @@ def search_kagi(api_key: str, query: str, count: int, filter_list: Optional[list print(results) - if filter_list: - results = get_filtered_results(results, filter_list) - return results