|
|
|
@ -3,12 +3,12 @@ import { ChatEntry } from "../types/types" |
|
|
|
|
export abstract class ChatHistory{ |
|
|
|
|
|
|
|
|
|
private static chatEntries:ChatEntry[] = [] |
|
|
|
|
static queuSize:number = 7 // change the queue size wrt the GPU size
|
|
|
|
|
static queueSize:number = 7 // change the queue size wrt the GPU size
|
|
|
|
|
|
|
|
|
|
public static pushHistory(prompt, result){ |
|
|
|
|
const chat:ChatEntry = [prompt, result] |
|
|
|
|
this.chatEntries.push(chat) |
|
|
|
|
if (this.chatEntries.length > this.queuSize){this.chatEntries.shift()} |
|
|
|
|
if (this.chatEntries.length > this.queueSize){this.chatEntries.shift()} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static getHistory(){ |
|
|
|
@ -18,4 +18,4 @@ export abstract class ChatHistory{ |
|
|
|
|
public static clearHistory(){ |
|
|
|
|
this.chatEntries = [] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|