diff --git a/backend/open_webui/apps/openai/main.py b/backend/open_webui/apps/openai/main.py index 70cefb29c..ae84300ee 100644 --- a/backend/open_webui/apps/openai/main.py +++ b/backend/open_webui/apps/openai/main.py @@ -421,6 +421,10 @@ async def generate_chat_completion( if "max_tokens" in payload and "max_completion_tokens" in payload: del payload["max_tokens"] + # openai.com fails if it gets unknown arguments + if 'native_tool_call' in payload: + del payload['native_tool_call'] + # Fix: O1 does not support the "system" parameter, Modify "system" to "user" if is_o1 and payload["messages"][0]["role"] == "system": payload["messages"][0]["role"] = "user"