This commit is contained in:
Timothy Jaeryang Baek committed 2026-07-14 23:08:41 -04:00
1 parent ea31a3bd61
commit 7a9928ef17
10 files changed
+533 -20

No files matched your search

+33
View File
@@ -1191,6 +1191,39 @@ export const updateChatById = async (token: string, id: string, chat: object) =>
return res;
};
export const compactChatById = async (token: string, id: string, model?: string | null) => {
let error = null;
const res = await fetch(`${WEBUI_API_BASE_URL}/chats/${id}/compact`, {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
...(token && { authorization: `Bearer ${token}` })
},
body: JSON.stringify({ model })
})
.then(async (res) => {
if (!res.ok) throw await res.json();
return res.json();
})
.then((json) => {
return json;
})
.catch((err) => {
error = err;
console.error(err);
return null;
});
if (error) {
throw error;
}
return res;
};
export const deleteChatMessageById = async (token: string, id: string, messageId: string) => {
let error = null;