mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-10 04:20:44 +02:00
fix: handle list-shape data in Firecrawl /search response (#24712)
Firecrawl /search returns either `{"data": [...]}` (flat list — v1, and
what frost19k reported on #23966) or `{"data": {"web": [...]}}` (v2,
current production). The parser only handled the dict shape:
data = response.get('data') or {}
results = data.get('web') or []
On a list-shape response, `data.get('web')` raised AttributeError,
caught by the function's outer try/except, and `search_firecrawl`
silently returned []. Web search worked against v2 endpoints but is one
upstream-format-change away from failing closed again. Accept either.
This commit is contained in:
@@ -197,8 +197,11 @@ def search_firecrawl(
|
||||
},
|
||||
timeout=count * 3 + 10,
|
||||
)
|
||||
# Firecrawl /search has historically returned both `{"data": [...]}`
|
||||
# (flat list, what v1 did and what frost19k reported under #23966)
|
||||
# and `{"data": {"web": [...]}}` (current v2). Accept either.
|
||||
data = response.get('data') or {}
|
||||
results = data.get('web') or []
|
||||
results = data if isinstance(data, list) else (data.get('web') or [])
|
||||
|
||||
if filter_list:
|
||||
from open_webui.retrieval.web.main import get_filtered_results
|
||||
|
||||
Reference in New Issue
Block a user