updated orchestion to handle updating and deleting sessions

This commit is contained in:
Storme-bit
2026-04-13 03:04:29 -07:00
parent f6d538f68a
commit 3c6cfa9bf4
5 changed files with 80 additions and 1 deletions

View File

@@ -142,4 +142,21 @@ export async function fetchModels() {
const res = await fetch(`${BASE_URL}/models`);
if(!res.ok) throw new Error(`Failted to fetch models: ${res.status}`);
return res.json();
}
export async function renameSession(sessionId, name) {
const res = await fetch(`${BASE_URL}/sessions/${sessionId}`, {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ name }),
});
if (!res.ok) throw new Error(`Failed to rename session: ${res.status}`);
return res.json();
}
export async function deleteSession(sessionId) {
const res = await fetch(`${BASE_URL}/sessions/${sessionId}`, {
method: 'DELETE',
});
if (!res.ok) throw new Error(`Failed to delete session: ${res.status}`);
}