import { api } from '../client'; import type { Chat, Chunk, ChatRequest, ChatWithMessages } from "$lib/types/api" export const chatApi = { createChat: (space: string, data: Partial) => api.post(`/chat/${space}`, data), createChatMessage: (space: string, id: string, data: Partial) => api.postStream(`/chat/${space}/${id}`, data), allChats: (space: string, pageNum: number) => api.get(`/chat/${space}/all/${pageNum}`), getChat: (space: string, id: string) => api.get(`/chat/${space}/${id}`), subscribe: (space: string, id: string) => api.get(`/chat/${space}/${id}/subscribe`), deleteChat: (space: string, id: string) => api.delete(`/chat/${space}/${id}`), };