Skip to content

Commit 49c1935

Browse files
Algorithm5838github-actions[bot]
authored andcommitted
fix: skip search_web citations if tool result is not a list
1 parent 49988ff commit 49c1935

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
@@ -245,6 +245,8 @@ def get_citation_source_from_tool_result(
245245
if tool_name == "search_web":
246246
# Parse JSON array: [{"title": "...", "link": "...", "snippet": "..."}]
247247
results = tool_result
248+
if not isinstance(results, list):
249+
return []
248250
documents = []
249251
metadata = []
250252

0 commit comments

Comments
 (0)