feat: model evaluation activity chart

This commit is contained in:
Timothy Jaeryang Baek committed 2026-01-09 20:19:51 +04:00
1 parent 636ba171a4
commit 9496e8f7b5
5 files changed
+407 -5

No files matched your search

+38
View File
@@ -127,6 +127,44 @@ export const getLeaderboard = async (token: string = '', query: string = '') =>
return res;
};
export const getModelHistory = async (
token: string = '',
modelId: string,
days: number = 30
) => {
let error = null;
const searchParams = new URLSearchParams();
searchParams.append('days', days.toString());
const res = await fetch(
`${WEBUI_API_BASE_URL}/evaluations/leaderboard/${encodeURIComponent(modelId)}/history?${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;