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
94ebf027
Unverified
Commit
94ebf027
authored
Jun 03, 2024
by
mindspawn
Committed by
GitHub
Jun 03, 2024
Browse files
Enable http_proxy use for openai calls.
parent
11bb1a6f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
backend/apps/openai/main.py
backend/apps/openai/main.py
+2
-2
No files found.
backend/apps/openai/main.py
View file @
94ebf027
...
...
@@ -186,7 +186,7 @@ async def fetch_url(url, key):
timeout
=
aiohttp
.
ClientTimeout
(
total
=
5
)
try
:
headers
=
{
"Authorization"
:
f
"Bearer
{
key
}
"
}
async
with
aiohttp
.
ClientSession
(
timeout
=
timeout
)
as
session
:
async
with
aiohttp
.
ClientSession
(
timeout
=
timeout
,
trust_env
=
True
)
as
session
:
async
with
session
.
get
(
url
,
headers
=
headers
)
as
response
:
return
await
response
.
json
()
except
Exception
as
e
:
...
...
@@ -462,7 +462,7 @@ async def proxy(path: str, request: Request, user=Depends(get_verified_user)):
streaming
=
False
try
:
session
=
aiohttp
.
ClientSession
()
session
=
aiohttp
.
ClientSession
(
trust_env
=
True
)
r
=
await
session
.
request
(
method
=
request
.
method
,
url
=
target_url
,
...
...
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