mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-13 04:45:19 +00:00
renamed and added gpt-5 to reflect OpenAI updates
This commit is contained in:
parent
b8da4a8cd8
commit
0c40d93da4
1 changed files with 4 additions and 4 deletions
|
|
@ -95,7 +95,7 @@ async def cleanup_response(
|
|||
await session.close()
|
||||
|
||||
|
||||
def openai_o_series_handler(payload):
|
||||
def openai_reasoning_model_handler(payload):
|
||||
"""
|
||||
Handle "o" series specific parameters
|
||||
"""
|
||||
|
|
@ -788,9 +788,9 @@ async def generate_chat_completion(
|
|||
key = request.app.state.config.OPENAI_API_KEYS[idx]
|
||||
|
||||
# Check if model is from "o" series
|
||||
is_o_series = payload["model"].lower().startswith(("o1", "o3", "o4"))
|
||||
if is_o_series:
|
||||
payload = openai_o_series_handler(payload)
|
||||
is_reasoning_model = payload["model"].lower().startswith(("o1", "o3", "o4", "gpt-5"))
|
||||
if is_reasoning_model:
|
||||
payload = openai_reasoning_model_handler(payload)
|
||||
elif "api.openai.com" not in url:
|
||||
# Remove "max_completion_tokens" from the payload for backward compatibility
|
||||
if "max_completion_tokens" in payload:
|
||||
|
|
|
|||
Loading…
Reference in a new issue