This commit is contained in:
Timothy Jaeryang Baek committed 2026-04-02 02:50:05 -05:00
1 parent 4632f200a9
commit 60e4d75174
4 files changed
+379 -221

No files matched your search

+35 -3
View File
@@ -161,13 +161,42 @@ export const getModelHistory = async (token: string = '', modelId: string, days:
return res;
};
export const getFeedbackItems = async (token: string = '', orderBy, direction, page) => {
export const getFeedbackModelIds = async (token: string = '') => {
let error = null;
const res = await fetch(`${WEBUI_API_BASE_URL}/evaluations/feedbacks/models`, {
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, modelId: string = '') => {
let error = null;
const searchParams = new URLSearchParams();
if (orderBy) searchParams.append('order_by', orderBy);
if (direction) searchParams.append('direction', direction);
if (page) searchParams.append('page', page.toString());
if (modelId) searchParams.append('model_id', modelId);
const res = await fetch(
`${WEBUI_API_BASE_URL}/evaluations/feedbacks/list?${searchParams.toString()}`,
@@ -200,10 +229,13 @@ export const getFeedbackItems = async (token: string = '', orderBy, direction, p
return res;
};
export const exportAllFeedbacks = async (token: string = '') => {
export const exportAllFeedbacks = async (token: string = '', modelId: string = '') => {
let error = null;
const res = await fetch(`${WEBUI_API_BASE_URL}/evaluations/feedbacks/all/export`, {
const searchParams = new URLSearchParams();
if (modelId) searchParams.append('model_id', modelId);
const res = await fetch(`${WEBUI_API_BASE_URL}/evaluations/feedbacks/all/export?${searchParams.toString()}`, {
method: 'GET',
headers: {
Accept: 'application/json',