mirror of
https://github.com/open-webui/open-webui
synced 2025-02-06 13:10:16 +00:00
Merge pull request #5541 from kivvi3412/fix-title-generate
[fix] Fix title generate
This commit is contained in:
commit
273787fe78
@ -405,14 +405,19 @@ async def generate_chat_completion(
|
|||||||
"role": user.role,
|
"role": user.role,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
url = app.state.config.OPENAI_API_BASE_URLS[idx]
|
||||||
|
key = app.state.config.OPENAI_API_KEYS[idx]
|
||||||
|
|
||||||
|
# Change max_completion_tokens to max_tokens (Backward compatible)
|
||||||
|
if "api.openai.com" not in url and not payload["model"].lower().startswith("o1-"):
|
||||||
|
if "max_completion_tokens" in payload:
|
||||||
|
payload["max_tokens"] = payload.pop("max_completion_tokens")
|
||||||
|
|
||||||
# Convert the modified body back to JSON
|
# Convert the modified body back to JSON
|
||||||
payload = json.dumps(payload)
|
payload = json.dumps(payload)
|
||||||
|
|
||||||
log.debug(payload)
|
log.debug(payload)
|
||||||
|
|
||||||
url = app.state.config.OPENAI_API_BASE_URLS[idx]
|
|
||||||
key = app.state.config.OPENAI_API_KEYS[idx]
|
|
||||||
|
|
||||||
headers = {}
|
headers = {}
|
||||||
headers["Authorization"] = f"Bearer {key}"
|
headers["Authorization"] = f"Bearer {key}"
|
||||||
headers["Content-Type"] = "application/json"
|
headers["Content-Type"] = "application/json"
|
||||||
|
Loading…
Reference in New Issue
Block a user