mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-22 17:25:25 +00:00
refac: ollama web
This commit is contained in:
parent
37085ed42b
commit
d4bd938a77
1 changed files with 4 additions and 1 deletions
|
|
@ -3,7 +3,7 @@ from dataclasses import dataclass
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
from open_webui.retrieval.web.main import SearchResult
|
from open_webui.retrieval.web.main import SearchResult, get_filtered_results
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
@ -36,6 +36,9 @@ def search_ollama_cloud(
|
||||||
results = data.get("results", [])
|
results = data.get("results", [])
|
||||||
log.info(f"Found {len(results)} results")
|
log.info(f"Found {len(results)} results")
|
||||||
|
|
||||||
|
if filter_list:
|
||||||
|
results = get_filtered_results(results, filter_list)
|
||||||
|
|
||||||
return [
|
return [
|
||||||
SearchResult(
|
SearchResult(
|
||||||
link=result.get("url", ""),
|
link=result.get("url", ""),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue