From 7d0d075c67658b7fda73b0bf30c7c62ae5d56f19 Mon Sep 17 00:00:00 2001 From: ER-EPR <38782737+ER-EPR@users.noreply.github.com> Date: Mon, 1 Jun 2026 19:52:33 +0800 Subject: [PATCH] Fix tool_calls retrieval to handle None case --- backend/open_webui/utils/anthropic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/open_webui/utils/anthropic.py b/backend/open_webui/utils/anthropic.py index 0d2ddf3b9c..bb0f64321c 100644 --- a/backend/open_webui/utils/anthropic.py +++ b/backend/open_webui/utils/anthropic.py @@ -422,7 +422,7 @@ def convert_openai_to_anthropic_response(openai_response: dict, model: str = '') content.append({'type': 'text', 'text': msg_content}) # Tool calls → tool_use blocks - tool_calls = message.get('tool_calls', []) + tool_calls = message.get('tool_calls') or [] for tc in tool_calls: func = tc.get('function', {}) try: