From b9480c0e8a16aee5ec0919aa973db75389ae5b54 Mon Sep 17 00:00:00 2001 From: hurxxxx Date: Thu, 6 Feb 2025 16:53:04 +0900 Subject: [PATCH] fix : o1 should also be applied --- backend/open_webui/routers/openai.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/open_webui/routers/openai.py b/backend/open_webui/routers/openai.py index 96ed50ceb..afda36237 100644 --- a/backend/open_webui/routers/openai.py +++ b/backend/open_webui/routers/openai.py @@ -622,7 +622,7 @@ async def generate_chat_completion( key = request.app.state.config.OPENAI_API_KEYS[idx] # Fix: o1,o3 does not support the "max_tokens" parameter, Modify "max_tokens" to "max_completion_tokens" - is_o1_o3 = payload["model"].lower().startswith(("o1-", "o3-")) + is_o1_o3 = payload["model"].lower().startswith(("o1", "o3-")) if is_o1_o3: payload = openai_o1_o3_handler(payload) elif "api.openai.com" not in url: