This commit is contained in:
Timothy Jaeryang Baek committed 2026-07-23 02:55:06 -04:00
1 parent cf887b68ea
commit 73421c5b42
8 files changed
+103 -21

No files matched your search

+41
View File
@@ -920,6 +920,47 @@ export const cloneChatById = async (token: string, id: string, title?: string) =
return res;
};
export const forkChatById = async (token: string, id: string, messageId?: string | null) => {
let error = null;
const res = await fetch(`${WEBUI_API_BASE_URL}/chats/${id}/fork`, {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
...(token && { authorization: `Bearer ${token}` })
},
body: JSON.stringify({
message_id: messageId ?? null
})
})
.then(async (res) => {
if (!res.ok) throw await res.json();
return res.json();
})
.then((json) => {
return json;
})
.catch((err) => {
error = err;
if ('detail' in err) {
error = err.detail;
} else {
error = err;
}
console.error(err);
return null;
});
if (error) {
throw error;
}
return res;
};
export const cloneSharedChatById = async (token: string, id: string) => {
let error = null;