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
This commit is contained in:
Classic298 authored and GitHub committed 2026-10-10 19:55:00 +04:00
1 parent 9d888fbd52
commit e0b0edfeb0
1 file changed
+2 -3
+2 -3
View File
@@ -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