refac/fix: feedback leaderboard

This commit is contained in:
Timothy Jaeryang Baek committed 2026-01-09 18:24:09 +04:00
1 parent 3a57233dd4
commit 10838b3654
6 files changed
+425 -526

No files matched your search

+34
View File
@@ -93,6 +93,40 @@ export const getAllFeedbacks = async (token: string = '') => {
return res;
};
export const getLeaderboard = async (token: string = '', query: string = '') => {
let error = null;
const searchParams = new URLSearchParams();
if (query) searchParams.append('query', query);
const res = await fetch(
`${WEBUI_API_BASE_URL}/evaluations/leaderboard?${searchParams.toString()}`,
{
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();
})
.catch((err) => {
error = err.detail;
console.error(err);
return null;
});
if (error) {
throw error;
}
return res;
};
export const getFeedbackItems = async (token: string = '', orderBy, direction, page) => {
let error = null;