Skip to content

Commit 2bf71f9

Browse files
committed
fix: skip search_web citations if tool result is not a list
1 parent 52c0eb0 commit 2bf71f9

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

backend/open_webui/utils/middleware.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,8 @@ def get_citation_source_from_tool_result(
251251
if tool_name == 'search_web':
252252
# Parse JSON array: [{"title": "...", "link": "...", "snippet": "..."}]
253253
results = tool_result
254+
if not isinstance(results, list):
255+
return []
254256
documents = []
255257
metadata = []
256258

0 commit comments

Comments
 (0)