mirror of
https://github.com/open-webui/open-webui
synced 2025-04-22 23:35:26 +00:00
chore: add additional headers only for Openrouter
This commit is contained in:
parent
6671e5f170
commit
bd82334647
@ -116,9 +116,9 @@ async def speech(request: Request, user=Depends(get_verified_user)):
|
|||||||
headers = {}
|
headers = {}
|
||||||
headers["Authorization"] = f"Bearer {app.state.OPENAI_API_KEYS[idx]}"
|
headers["Authorization"] = f"Bearer {app.state.OPENAI_API_KEYS[idx]}"
|
||||||
headers["Content-Type"] = "application/json"
|
headers["Content-Type"] = "application/json"
|
||||||
|
if "openrouter.ai" in app.state.OPENAI_API_BASE_URLS[idx]:
|
||||||
headers['HTTP-Referer'] = "https://openwebui.com/"
|
headers['HTTP-Referer'] = "https://openwebui.com/"
|
||||||
headers['X-Title'] = "Open WebUI"
|
headers['X-Title'] = "Open WebUI"
|
||||||
|
|
||||||
r = None
|
r = None
|
||||||
try:
|
try:
|
||||||
r = requests.post(
|
r = requests.post(
|
||||||
|
Loading…
Reference in New Issue
Block a user