mirror of
https://github.com/open-webui/open-webui
synced 2024-11-26 14:02:29 +00:00
fix: use AIOHTTP_CLIENT_TIMEOUT timeout setting for openai streaming response
This commit is contained in:
parent
f3c1ff9efc
commit
f89fa061e8
@ -25,6 +25,7 @@ from utils.task import prompt_template
|
|||||||
from config import (
|
from config import (
|
||||||
SRC_LOG_LEVELS,
|
SRC_LOG_LEVELS,
|
||||||
ENABLE_OPENAI_API,
|
ENABLE_OPENAI_API,
|
||||||
|
AIOHTTP_CLIENT_TIMEOUT,
|
||||||
OPENAI_API_BASE_URLS,
|
OPENAI_API_BASE_URLS,
|
||||||
OPENAI_API_KEYS,
|
OPENAI_API_KEYS,
|
||||||
CACHE_DIR,
|
CACHE_DIR,
|
||||||
@ -463,7 +464,9 @@ async def generate_chat_completion(
|
|||||||
streaming = False
|
streaming = False
|
||||||
|
|
||||||
try:
|
try:
|
||||||
session = aiohttp.ClientSession(trust_env=True)
|
session = aiohttp.ClientSession(
|
||||||
|
trust_env=True, timeout=aiohttp.ClientTimeout(total=AIOHTTP_CLIENT_TIMEOUT)
|
||||||
|
)
|
||||||
r = await session.request(
|
r = await session.request(
|
||||||
method="POST",
|
method="POST",
|
||||||
url=f"{url}/chat/completions",
|
url=f"{url}/chat/completions",
|
||||||
|
Loading…
Reference in New Issue
Block a user