Spaces:
Configuration error
Configuration error
File size: 366 Bytes
6ce9b06 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ```typescript
type Msg = { role: "user" | "assistant" | "system"; content: string };
const mem = new Map<string, Msg[]>();
export function memoryGet(projectId: string): Msg[] {
return mem.get(projectId) ?? [];
}
export function memoryAppend(projectId: string, msg: Msg) {
const arr = mem.get(projectId) ?? [];
arr.push(msg);
mem.set(projectId, arr);
}
``` |