This commit is contained in:
Timothy Jaeryang Baek 2025-06-16 13:19:00 +04:00
parent e46e87889e
commit 59324a82e0
2 changed files with 4 additions and 1 deletions

View File

@ -16,6 +16,8 @@ from urllib.parse import urlparse
import aiohttp import aiohttp
from aiocache import cached from aiocache import cached
import requests import requests
from open_webui.models.chats import Chats
from open_webui.models.users import UserModel from open_webui.models.users import UserModel
from open_webui.env import ( from open_webui.env import (
@ -151,8 +153,8 @@ async def send_post_request(
if r.ok is False: if r.ok is False:
try: try:
res = await r.json() res = await r.json()
await cleanup_response(r, session)
if "error" in res: if "error" in res:
log.error(f"Error from server: {res['error']}")
raise HTTPException(status_code=r.status, detail=res["error"]) raise HTTPException(status_code=r.status, detail=res["error"])
except HTTPException as e: except HTTPException as e:
raise e # Re-raise HTTPException to be handled by FastAPI raise e # Re-raise HTTPException to be handled by FastAPI

View File

@ -1738,6 +1738,7 @@
history.messages[responseMessageId] = responseMessage; history.messages[responseMessageId] = responseMessage;
history.currentId = responseMessageId; history.currentId = responseMessageId;
return null; return null;
}); });