fix: apply AIOHTTP_CLIENT_TIMEOUT to embeddings endpoint (#21558)
This commit is contained in:
@@ -1194,7 +1194,10 @@ async def embeddings(request: Request, form_data: dict, user):
|
||||
request, url, key, api_config, user=user
|
||||
)
|
||||
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}/embeddings",
|
||||
@@ -1421,7 +1424,10 @@ async def proxy(path: str, request: Request, user=Depends(get_verified_user)):
|
||||
else:
|
||||
request_url = f"{url}/{path}"
|
||||
|
||||
session = aiohttp.ClientSession(trust_env=True)
|
||||
session = aiohttp.ClientSession(
|
||||
trust_env=True,
|
||||
timeout=aiohttp.ClientTimeout(total=AIOHTTP_CLIENT_TIMEOUT),
|
||||
)
|
||||
r = await session.request(
|
||||
method=request.method,
|
||||
url=request_url,
|
||||
|
||||
Reference in New Issue
Block a user