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
f89fa061
Commit
f89fa061
authored
Jul 01, 2024
by
Fish Lung
Browse files
fix: use AIOHTTP_CLIENT_TIMEOUT timeout setting for openai streaming response
parent
f3c1ff9e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
backend/apps/openai/main.py
backend/apps/openai/main.py
+4
-1
No files found.
backend/apps/openai/main.py
View file @
f89fa061
...
...
@@ -25,6 +25,7 @@ from utils.task import prompt_template
from
config
import
(
SRC_LOG_LEVELS
,
ENABLE_OPENAI_API
,
AIOHTTP_CLIENT_TIMEOUT
,
OPENAI_API_BASE_URLS
,
OPENAI_API_KEYS
,
CACHE_DIR
,
...
...
@@ -463,7 +464,9 @@ async def generate_chat_completion(
streaming
=
False
try
:
session
=
aiohttp
.
ClientSession
(
trust_env
=
True
)
session
=
aiohttp
.
ClientSession
(
trust_env
=
True
,
timeout
=
aiohttp
.
ClientTimeout
(
total
=
AIOHTTP_CLIENT_TIMEOUT
)
)
r
=
await
session
.
request
(
method
=
"POST"
,
url
=
f
"
{
url
}
/chat/completions"
,
...
...
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