From d55735dc1e035f6da4c022b2ec6acde6567f6332 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Sun, 30 Mar 2025 21:23:42 -0700 Subject: [PATCH] refac: rm profile image from feedback user object --- backend/open_webui/routers/evaluations.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/routers/evaluations.py b/backend/open_webui/routers/evaluations.py index f0c4a6b06..8597fa286 100644 --- a/backend/open_webui/routers/evaluations.py +++ b/backend/open_webui/routers/evaluations.py @@ -56,8 +56,19 @@ async def update_config( } +class FeedbackUserReponse(BaseModel): + id: str + name: str + email: str + role: str = "pending" + + last_active_at: int # timestamp in epoch + updated_at: int # timestamp in epoch + created_at: int # timestamp in epoch + + class FeedbackUserResponse(FeedbackResponse): - user: Optional[UserModel] = None + user: Optional[FeedbackUserReponse] = None @router.get("/feedbacks/all", response_model=list[FeedbackUserResponse]) @@ -65,7 +76,10 @@ async def get_all_feedbacks(user=Depends(get_admin_user)): feedbacks = Feedbacks.get_all_feedbacks() return [ FeedbackUserResponse( - **feedback.model_dump(), user=Users.get_user_by_id(feedback.user_id) + **feedback.model_dump(), + user=FeedbackUserReponse( + **Users.get_user_by_id(feedback.user_id).model_dump() + ), ) for feedback in feedbacks ]