mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-20 20:52:23 -05:00
refactor: remove unused GET /evaluations/feedbacks/all endpoint (#24778)
GET /evaluations/feedbacks/all returned the entire feedback table in a single response (flagged as a Medium OOM risk for admins in open-webui#22206). Its only frontend wrapper, getAllFeedbacks in src/lib/apis/evaluations/index.ts, is dead: nothing imports or calls it anywhere in the codebase. The endpoint is a redundant view-only twin of GET /evaluations/feedbacks/all/export, which is what the admin Feedbacks UI actually uses. Removes the endpoint, the now-unused FeedbackResponse import in the evaluations router, and the dead getAllFeedbacks frontend wrapper. The shared Feedbacks.get_all_feedbacks data-layer method is kept, since the live /feedbacks/all/export endpoint still uses it. Ref: open-webui#22206 Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
557df60c3b
commit
92e727b1fc
@@ -10,7 +10,6 @@ from open_webui.models.feedbacks import (
|
||||
FeedbackIdResponse,
|
||||
FeedbackListResponse,
|
||||
FeedbackModel,
|
||||
FeedbackResponse,
|
||||
Feedbacks,
|
||||
FeedbackUserResponse,
|
||||
LeaderboardFeedbackData,
|
||||
@@ -295,12 +294,6 @@ async def get_feedback_model_ids(user=Depends(get_admin_user), db: AsyncSession
|
||||
return await Feedbacks.get_distinct_model_ids(db=db)
|
||||
|
||||
|
||||
@router.get('/feedbacks/all', response_model=list[FeedbackResponse])
|
||||
async def get_all_feedbacks(user=Depends(get_admin_user), db: AsyncSession = Depends(get_async_session)):
|
||||
feedbacks = await Feedbacks.get_all_feedbacks(db=db)
|
||||
return feedbacks
|
||||
|
||||
|
||||
@router.get('/feedbacks/all/ids', response_model=list[FeedbackIdResponse])
|
||||
async def get_all_feedback_ids(user=Depends(get_admin_user), db: AsyncSession = Depends(get_async_session)):
|
||||
return await Feedbacks.get_all_feedback_ids(db=db)
|
||||
|
||||
@@ -62,37 +62,6 @@ export const updateConfig = async (token: string, config: object) => {
|
||||
return res;
|
||||
};
|
||||
|
||||
export const getAllFeedbacks = async (token: string = '') => {
|
||||
let error = null;
|
||||
|
||||
const res = await fetch(`${WEBUI_API_BASE_URL}/evaluations/feedbacks/all`, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
'Content-Type': 'application/json',
|
||||
authorization: `Bearer ${token}`
|
||||
}
|
||||
})
|
||||
.then(async (res) => {
|
||||
if (!res.ok) throw await res.json();
|
||||
return res.json();
|
||||
})
|
||||
.then((json) => {
|
||||
return json;
|
||||
})
|
||||
.catch((err) => {
|
||||
error = err.detail;
|
||||
console.error(err);
|
||||
return null;
|
||||
});
|
||||
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
return res;
|
||||
};
|
||||
|
||||
export const getLeaderboard = async (token: string = '', query: string = '') => {
|
||||
let error = null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user