This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
export type ChatSummary = {
|
||||
id: string;
|
||||
title: string | null;
|
||||
parentChatId: string | null;
|
||||
titleGenerationPending: boolean;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
starred: boolean;
|
||||
@@ -58,6 +60,8 @@ export type ToolCallEvent = {
|
||||
export type ChatDetail = {
|
||||
id: string;
|
||||
title: string | null;
|
||||
parentChatId: string | null;
|
||||
titleGenerationPending: boolean;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
starred: boolean;
|
||||
@@ -291,6 +295,14 @@ export async function getChat(chatId: string) {
|
||||
return data.chat;
|
||||
}
|
||||
|
||||
export async function forkChat(chatId: string, messageId?: string) {
|
||||
const data = await api<{ chat: ChatSummary }>(`/v1/chats/${chatId}/fork`, {
|
||||
method: "POST",
|
||||
body: JSON.stringify(messageId ? { messageId } : {}),
|
||||
});
|
||||
return data.chat;
|
||||
}
|
||||
|
||||
export async function updateChatTitle(chatId: string, title: string) {
|
||||
const data = await api<{ chat: ChatSummary }>(`/v1/chats/${chatId}`, {
|
||||
method: "PATCH",
|
||||
|
||||
Reference in New Issue
Block a user