mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-11 03:38:02 +00:00
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:
parent
9d888fbd52
commit
e0b0edfeb0
1 changed files with 2 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue