enh: feedback exports

This commit is contained in:
Timothy J. Baek
2024-10-25 21:17:47 -07:00
parent 58d929fd65
commit 8b61b39c75
4 changed files with 114 additions and 28 deletions
+31
View File
@@ -93,6 +93,37 @@ export const getAllFeedbacks = async (token: string = '') => {
return res;
};
export const exportAllFeedbacks = async (token: string = '') => {
let error = null;
const res = await fetch(`${WEBUI_API_BASE_URL}/evaluations/feedbacks/all/export`, {
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.log(err);
return null;
});
if (error) {
throw error;
}
return res;
};
export const createNewFeedback = async (token: string, feedback: object) => {
let error = null;