From 3f7fc1a75a19fc14ba82a25da24d511dc2027989 Mon Sep 17 00:00:00 2001 From: Shirasawa <764798966@qq.com> Date: Wed, 1 Apr 2026 20:01:25 +0800 Subject: [PATCH] fix: Fix the error that occurs when the task model does not exist (#23169) --- backend/open_webui/utils/task.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/open_webui/utils/task.py b/backend/open_webui/utils/task.py index 203c429d2..15213b1f0 100644 --- a/backend/open_webui/utils/task.py +++ b/backend/open_webui/utils/task.py @@ -19,7 +19,7 @@ def get_task_model_id(default_model_id: str, task_model: str, task_model_externa # Set the task model task_model_id = default_model_id # Check if the user has a custom task model and use that model - if models[task_model_id].get('connection_type') == 'local': + if models.get(task_model_id, {}).get('connection_type') == 'local': if task_model and task_model in models: task_model_id = task_model else: