basic llm request stream
This commit is contained in:
1 parent
f74e4d1043
commit
a92cc76a9a
66 files changed
+1496
-158
No files matched your search
@@ -0,0 +1,11 @@
|
||||
import { api } from '../client';
|
||||
import type { Chat, Chunk, ChatRequest, ChatWithMessages } from "$lib/types/api"
|
||||
|
||||
export const chatApi = {
|
||||
createChat: (space: string, data: Partial<ChatRequest>) => api.post<Chat>(`/chat/${space}`, data),
|
||||
createChatMessage: (space: string, id: string, data: Partial<ChatRequest>) => api.postStream<Chunk>(`/chat/${space}/${id}`, data),
|
||||
allChats: (space: string, pageNum: number) => api.get<Chat[]>(`/chat/${space}/all/${pageNum}`),
|
||||
getChat: (space: string, id: string) => api.get<ChatWithMessages>(`/chat/${space}/${id}`),
|
||||
subscribe: (space: string, id: string) => api.get<ChatWithMessages>(`/chat/${space}/${id}/subscribe`),
|
||||
deleteChat: (space: string, id: string) => api.delete(`/chat/${space}/${id}`),
|
||||
};
|
||||
Reference in new issue
Block a user