diff --git a/backend/open_webui/apps/webui/models/chats.py b/backend/open_webui/apps/webui/models/chats.py index 509dff9fe..213872371 100644 --- a/backend/open_webui/apps/webui/models/chats.py +++ b/backend/open_webui/apps/webui/models/chats.py @@ -61,10 +61,12 @@ class ChatModel(BaseModel): class ChatForm(BaseModel): chat: dict + class ChatTitleMessagesForm(BaseModel): title: str messages: list[dict] + class ChatTitleForm(BaseModel): title: str @@ -361,7 +363,7 @@ class ChatTable: with get_db() as db: all_chats = ( db.query(Chat) - .filter_by(user_id=user_id, pinned=True) + .filter_by(user_id=user_id, pinned=True, archived=False) .order_by(Chat.updated_at.desc()) ) return [ChatModel.model_validate(chat) for chat in all_chats] diff --git a/src/lib/components/layout/Sidebar.svelte b/src/lib/components/layout/Sidebar.svelte index ed7107c6f..4ac597bd2 100644 --- a/src/lib/components/layout/Sidebar.svelte +++ b/src/lib/components/layout/Sidebar.svelte @@ -311,6 +311,7 @@ { + await pinnedChats.set(await getPinnedChatList(localStorage.token)); await chats.set(await getChatList(localStorage.token)); }} />