Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
fabcbc30
Unverified
Commit
fabcbc30
authored
May 13, 2024
by
Timothy Jaeryang Baek
Committed by
GitHub
May 13, 2024
Browse files
Merge pull request #2211 from arsaboo/header
chore: add HTTP-Referer and X-Title headers for Open WebUI
parents
4f87512b
bd823346
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
backend/apps/openai/main.py
backend/apps/openai/main.py
+3
-1
No files found.
backend/apps/openai/main.py
View file @
fabcbc30
...
@@ -116,7 +116,9 @@ async def speech(request: Request, user=Depends(get_verified_user)):
...
@@ -116,7 +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
[
'X-Title'
]
=
"Open WebUI"
r
=
None
r
=
None
try
:
try
:
r
=
requests
.
post
(
r
=
requests
.
post
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment