refactor name and icon get
This commit is contained in:
@@ -7,6 +7,7 @@ import { HypaProcesser } from "./hypamemory";
|
||||
import { stringlizeChat } from "../stringlize";
|
||||
import { globalFetch } from "src/ts/storage/globalApi";
|
||||
import { runSummarizer } from "../transformers";
|
||||
import { getUserName } from "src/ts/util";
|
||||
|
||||
export async function supaMemory(
|
||||
chats:OpenAIChat[],
|
||||
@@ -329,7 +330,7 @@ export async function supaMemory(
|
||||
if((chunkSize + tokens) > maxChunkSize){
|
||||
if(stringlizedChat === ''){
|
||||
if(cont.role !== 'function' && cont.role !== 'system'){
|
||||
stringlizedChat += `${cont.role === 'assistant' ? char.type === 'group' ? '' : char.name : db.username}: ${cont.content}\n\n`
|
||||
stringlizedChat += `${cont.role === 'assistant' ? char.type === 'group' ? '' : char.name : getUserName()}: ${cont.content}\n\n`
|
||||
spiceLen += 1
|
||||
currentTokens -= tokens
|
||||
chunkSize += tokens
|
||||
@@ -338,7 +339,7 @@ export async function supaMemory(
|
||||
lastId = cont.memo
|
||||
break
|
||||
}
|
||||
stringlizedChat += `${cont.role === 'assistant' ? char.type === 'group' ? '' : char.name : db.username}: ${cont.content}\n\n`
|
||||
stringlizedChat += `${cont.role === 'assistant' ? char.type === 'group' ? '' : char.name : getUserName()}: ${cont.content}\n\n`
|
||||
spiceLen += 1
|
||||
currentTokens -= tokens
|
||||
chunkSize += tokens
|
||||
|
||||
Reference in New Issue
Block a user