Update chat.ts

pull/5536/head
Skylar Ray 2 months ago committed by Aniket
parent 0f6b971a7d
commit 66d1943ce6
  1. 6
      libs/remix-ai-core/src/prompts/chat.ts

@ -3,12 +3,12 @@ import { ChatEntry } from "../types/types"
export abstract class ChatHistory{ export abstract class ChatHistory{
private static chatEntries:ChatEntry[] = [] 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){ public static pushHistory(prompt, result){
const chat:ChatEntry = [prompt, result] const chat:ChatEntry = [prompt, result]
this.chatEntries.push(chat) 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(){ public static getHistory(){
@ -18,4 +18,4 @@ export abstract class ChatHistory{
public static clearHistory(){ public static clearHistory(){
this.chatEntries = [] this.chatEntries = []
} }
} }

Loading…
Cancel
Save