mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-17 14:55:23 +00:00
refac
This commit is contained in:
parent
e46e87889e
commit
59324a82e0
2 changed files with 4 additions and 1 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -1738,6 +1738,7 @@
|
||||||
|
|
||||||
history.messages[responseMessageId] = responseMessage;
|
history.messages[responseMessageId] = responseMessage;
|
||||||
history.currentId = responseMessageId;
|
history.currentId = responseMessageId;
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue