From e5cc7cf8eff97b357233a507f97fd044b858d07c Mon Sep 17 00:00:00 2001 From: Lorenzo Maffioli Date: Wed, 8 Apr 2026 13:00:19 +0200 Subject: [PATCH] exclude everything that's not a number --- backend/open_webui/models/feedbacks.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/open_webui/models/feedbacks.py b/backend/open_webui/models/feedbacks.py index 5e2c8e34c4..5fb95c2887 100644 --- a/backend/open_webui/models/feedbacks.py +++ b/backend/open_webui/models/feedbacks.py @@ -89,8 +89,10 @@ class RatingData(BaseModel): def clamp_details_rating(cls, v: Optional[dict]) -> Optional[dict]: if isinstance(v, dict) and 'rating' in v: r = v['rating'] - if isinstance(r, (int, float)): + if isinstance(r, (int, float)) and not isinstance(r, bool): v['rating'] = max(1, min(10, int(r))) + else: + del v['rating'] return v