From c7802555b6b67e0df35c0697b90dc033225bd594 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Mon, 12 Oct 2026 17:47:00 +0400 Subject: [PATCH] refac --- backend/open_webui/models/apps.py | 2 +- backend/open_webui/utils/apps.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/open_webui/models/apps.py b/backend/open_webui/models/apps.py index 9f41ce7201..4646d08694 100644 --- a/backend/open_webui/models/apps.py +++ b/backend/open_webui/models/apps.py @@ -82,7 +82,7 @@ class AppChannelMessage(StrictModel): parent_id: str | None = None -class AppReply(AppChannelMessage): +class AppChannelReply(AppChannelMessage): type: Literal['message', 'update', 'deferred', 'download', 'error'] = 'message' visibility: Literal['private', 'channel'] = 'private' title: str = Field(default='', max_length=200) diff --git a/backend/open_webui/utils/apps.py b/backend/open_webui/utils/apps.py index 85e6076de9..51532e2361 100644 --- a/backend/open_webui/utils/apps.py +++ b/backend/open_webui/utils/apps.py @@ -22,7 +22,7 @@ from fastapi import Depends, Header, HTTPException, status from open_webui.env import WEBUI_SECRET_KEY from open_webui.internal.db import get_async_db, get_async_session from open_webui.models.access_grants import AccessGrants -from open_webui.models.apps import AppChannelMessage, AppModel, AppReply, Apps +from open_webui.models.apps import AppChannelMessage, AppChannelReply, AppModel, Apps from open_webui.models.channels import ChannelModel, Channels from open_webui.models.config import Config from open_webui.models.messages import MessageForm, Messages @@ -496,7 +496,7 @@ async def generate_app_response( if not user: raise HTTPException(403, 'Actor is unavailable') try: - reply = AppReply.model_validate(raw) + reply = AppChannelReply.model_validate(raw) except Exception: raise HTTPException(502, 'App returned an invalid response') from None await check_app_invocation_access(app, channel_id, user, db=db)