diff --git a/src/lib/Others/AlertComp.svelte b/src/lib/Others/AlertComp.svelte
index 2fdecee4..f3fd9d15 100644
--- a/src/lib/Others/AlertComp.svelte
+++ b/src/lib/Others/AlertComp.svelte
@@ -17,6 +17,7 @@
import { getFetchData } from 'src/ts/storage/globalApi';
import { CurrentChat } from "src/ts/stores";
import { tokenize } from "src/ts/tokenizer";
+ import TextAreaInput from "../UI/GUI/TextAreaInput.svelte";
let btn
let input = ''
let cardExportType = ''
@@ -77,7 +78,7 @@
- {:else if $alertStore.type !== 'select' && $alertStore.type !== 'requestdata' && $alertStore.type !== 'addchar'}
+ {:else if $alertStore.type !== 'select' && $alertStore.type !== 'requestdata' && $alertStore.type !== 'addchar' && $alertStore.type !== 'hypaV2'}
{$alertStore.msg}
{#if $alertStore.submsg}
{$alertStore.submsg}
@@ -254,6 +255,47 @@
{/if}
{/await}
{/if}
+ {:else if $alertStore.type === 'hypaV2'}
+
+
+
+
+
+ {#if generationInfoMenuIndex === 0}
+
+ {#each $CurrentChat.hypaV2Data.chunks as chunk}
+
+ {/each}
+
+
+
+ {:else}
+ {#each $CurrentChat.hypaV2Data.chunks as chunk, i}
+
+ {#if i === 0}
+ Active
+ {:else}
+ Inactive
+ {/if}
+
+
+ {/each}
+ {/if}
{:else if $alertStore.type === 'addchar'}
diff --git a/src/lib/SideBars/CharConfig.svelte b/src/lib/SideBars/CharConfig.svelte
index d52d8836..dfb9244e 100644
--- a/src/lib/SideBars/CharConfig.svelte
+++ b/src/lib/SideBars/CharConfig.svelte
@@ -7,7 +7,7 @@
import Check from "../UI/GUI/CheckInput.svelte";
import { addCharEmotion, addingEmotion, getCharImage, rmCharEmotion, selectCharImg, makeGroupImage } from "../../ts/characters";
import LoreBook from "./LoreBook/LoreBookSetting.svelte";
- import { alertConfirm, alertNormal, alertSelectChar, alertTOS } from "../../ts/alert";
+ import { alertConfirm, alertNormal, alertSelectChar, alertTOS, showHypaV2Alert } from "../../ts/alert";
import BarIcon from "./BarIcon.svelte";
import { findCharacterbyId, getAuthorNoteDefaultText, selectMultipleFile } from "../../ts/util";
import { onDestroy } from "svelte";
@@ -672,11 +672,6 @@
{language.additionalText}
-
- {#if currentChar.data.chats[currentChar.data.chatPage].supaMemoryData && currentChar.data.chats[currentChar.data.chatPage].supaMemoryData.length > 4 || currentChar.data.supaMemory}
- {language.SuperMemory}
-
- {/if}
{#if $DataBase.showUnrecommended || currentChar.data.personality.length > 3}
{language.personality}
@@ -816,6 +811,21 @@
+ {#if $DataBase.supaMemoryType === 'hypaV2'}
+
+ {:else if currentChar.data.chats[currentChar.data.chatPage].supaMemoryData && currentChar.data.chats[currentChar.data.chatPage].supaMemoryData.length > 4 || currentChar.data.supaMemory}
+ {language.SuperMemory}
+
+ {/if}
+
{#if currentChar.data.license !== 'CC BY-NC-SA 4.0'
&& currentChar.data.license !== 'CC BY-SA 4.0'
&& currentChar.data.license !== 'CC BY-ND 4.0'
diff --git a/src/ts/alert.ts b/src/ts/alert.ts
index ec3cf3e8..62cc23e5 100644
--- a/src/ts/alert.ts
+++ b/src/ts/alert.ts
@@ -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': ""
+ })
}
\ No newline at end of file
diff --git a/src/ts/process/memory/hypav2.ts b/src/ts/process/memory/hypav2.ts
index 710a0b11..7b2f46d4 100644
--- a/src/ts/process/memory/hypav2.ts
+++ b/src/ts/process/memory/hypav2.ts
@@ -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} = {}