mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-07 02:58:21 +00:00
fix: report a web search where no page loaded instead of blaming the embedding settings (#31859)
This commit is contained in:
parent
8e03389de1
commit
2e43d66985
1 changed files with 6 additions and 0 deletions
|
|
@ -3039,6 +3039,12 @@ async def process_web_search(request: Request, form_data: SearchForm, user=Depen
|
|||
'loaded_count': len(docs),
|
||||
}
|
||||
else:
|
||||
if not any(doc.page_content.strip() for doc in docs):
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_404_NOT_FOUND,
|
||||
detail=ERROR_MESSAGES.DEFAULT('None of the web search results could be loaded'),
|
||||
)
|
||||
|
||||
# Create a single collection for all documents
|
||||
# Bind the ephemeral collection to its owner so filter_accessible_collections can scope it per-user.
|
||||
collection_name = f'web-search-{user.id}-{calculate_sha256_string("-".join(form_data.queries))}'[:63]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue