From 11f52921dc21c2dc61c03f12bcdf6f19140a350c Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Thu, 26 Mar 2026 17:40:56 -0500 Subject: [PATCH] refac --- backend/open_webui/models/files.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/models/files.py b/backend/open_webui/models/files.py index 9a5b8fa40..7a9f77a3b 100644 --- a/backend/open_webui/models/files.py +++ b/backend/open_webui/models/files.py @@ -87,7 +87,7 @@ class FileModelResponse(BaseModel): filename: str data: Optional[dict] = None - meta: FileMeta + meta: Optional[FileMeta] = None created_at: int # timestamp in epoch updated_at: Optional[int] = None # timestamp in epoch, optional for legacy files @@ -246,7 +246,7 @@ class FilesTable: total = query.count() items = [ - FileModel.model_validate(file) + FileModelResponse.model_validate(file, from_attributes=True) for file in query.order_by(File.updated_at.desc(), File.id.desc()).offset(skip).limit(limit).all() ]