mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-29 17:55:24 +00:00
doc gpt V0.2
This commit is contained in:
21
src/service/preChatStore.ts
Normal file
21
src/service/preChatStore.ts
Normal 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);
|
||||
};
|
Reference in New Issue
Block a user