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 2026-10-10 17:55:00 +02:00 • committed by GitHub
parent 9d888fbd52
commit e0b0edfeb0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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