doc gpt V0.2

This commit is contained in:
archer
2023-02-19 14:35:25 +08:00
parent cc5cf99e7a
commit 0ecf576e4e
124 changed files with 11780 additions and 573 deletions

View File

@@ -0,0 +1,21 @@
import { ChatItemType } from '../types/chat';
export const chatWindows = new Map<string, ChatItemType[]>();
/**
* 获取聊天窗口信息
*/
export const getWindowMessages = (id: string) => {
return chatWindows.get(id) || [];
};
export const pushWindowMessage = (id: string, prompt: ChatItemType) => {
const messages = chatWindows.get(id) || [];
messages.push(prompt);
chatWindows.set(id, messages);
return messages;
};
export const deleteWindow = (id: string) => {
chatWindows.delete(id);
};