Chat title generation

This commit is contained in:
2026-02-14 21:27:44 -08:00
parent 7ef2825c16
commit 684d441763
4 changed files with 144 additions and 0 deletions

View File

@@ -178,6 +178,22 @@ export async function getChat(chatId: string) {
return data.chat;
}
export async function updateChatTitle(chatId: string, title: string) {
const data = await api<{ chat: ChatSummary }>(`/v1/chats/${chatId}`, {
method: "PATCH",
body: JSON.stringify({ title }),
});
return data.chat;
}
export async function suggestChatTitle(body: { chatId: string; content: string }) {
const data = await api<{ chat: ChatSummary }>("/v1/chats/title/suggest", {
method: "POST",
body: JSON.stringify(body),
});
return data.chat;
}
export async function deleteChat(chatId: string) {
await api<{ deleted: true }>(`/v1/chats/${chatId}`, { method: "DELETE" });
}