feat: add hypav2 button

This commit is contained in:
kwaroran
2024-05-23 07:02:16 +09:00
parent 53b7771ed4
commit 5b7e66723f
4 changed files with 71 additions and 10 deletions

View File

@@ -6,7 +6,7 @@ import { Capacitor } from "@capacitor/core"
import { DataBase, type MessageGenerationInfo } from "./storage/database"
interface alertData{
type: 'error'| 'normal'|'none'|'ask'|'wait'|'selectChar'|'input'|'toast'|'wait2'|'markdown'|'select'|'login'|'tos'|'cardexport'|'requestdata'|'addchar'
type: 'error'| 'normal'|'none'|'ask'|'wait'|'selectChar'|'input'|'toast'|'wait2'|'markdown'|'select'|'login'|'tos'|'cardexport'|'requestdata'|'addchar'|'hypaV2',
msg: string,
submsg?: string
}
@@ -275,4 +275,11 @@ export function alertRequestData(info:AlertGenerationInfoStoreData){
'type': 'requestdata',
'msg': info.genInfo.generationId ?? 'none'
})
}
export function showHypaV2Alert(){
alertStore.set({
'type': 'hypaV2',
'msg': ""
})
}

View File

@@ -145,8 +145,10 @@ export async function hypaMemoryV2(
const processer = new HypaProcesser("nomic")
await processer.addText(data.chunks.map((v) => {
return "search_document: " + v.text
await processer.addText(data.chunks.filter(v => {
return v.text.trim().length > 0
}).map((v) => {
return "search_document: " + v.text.trim()
}))
let scoredResults:{[key:string]:number} = {}