Skip to content

Commit f7a0825

Browse files
committed
fix: skip search_web citations if tool result is not a list
1 parent 8983cc8 commit f7a0825

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
@@ -238,6 +238,8 @@ def get_citation_source_from_tool_result(
238238
if tool_name == 'search_web':
239239
# Parse JSON array: [{"title": "...", "link": "...", "snippet": "..."}]
240240
results = tool_result
241+
if not isinstance(results, list):
242+
return []
241243
documents = []
242244
metadata = []
243245

0 commit comments

Comments
 (0)