From 59324a82e01a47d7d21b8294fb9cc65581ed6754 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Mon, 16 Jun 2025 13:19:00 +0400 Subject: [PATCH] refac --- backend/open_webui/routers/ollama.py | 4 +++- src/lib/components/chat/Chat.svelte | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/open_webui/routers/ollama.py b/backend/open_webui/routers/ollama.py index 346d496073..1353599374 100644 --- a/backend/open_webui/routers/ollama.py +++ b/backend/open_webui/routers/ollama.py @@ -16,6 +16,8 @@ from urllib.parse import urlparse import aiohttp from aiocache import cached import requests + +from open_webui.models.chats import Chats from open_webui.models.users import UserModel from open_webui.env import ( @@ -151,8 +153,8 @@ async def send_post_request( if r.ok is False: try: res = await r.json() + await cleanup_response(r, session) if "error" in res: - log.error(f"Error from server: {res['error']}") raise HTTPException(status_code=r.status, detail=res["error"]) except HTTPException as e: raise e # Re-raise HTTPException to be handled by FastAPI diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 661c002069..229da00022 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -1738,6 +1738,7 @@ history.messages[responseMessageId] = responseMessage; history.currentId = responseMessageId; + return null; });