Add option to remove punctuation for HypaMemory
This commit is contained in:
@@ -109,6 +109,7 @@ export const languageEnglish = {
|
|||||||
genTimes: "This option is used to set the number of responses to generate on support models. other then first response will be act as cached reroll. this can reduce the cost of the model, but it can also increase the cost if you use it without reroll.",
|
genTimes: "This option is used to set the number of responses to generate on support models. other then first response will be act as cached reroll. this can reduce the cost of the model, but it can also increase the cost if you use it without reroll.",
|
||||||
requestretrys: "This option is used to set the number of request retrys when request fails.",
|
requestretrys: "This option is used to set the number of request retrys when request fails.",
|
||||||
emotionPrompt: "This option is used to set the prompt that is used to detect emotion. if it is blank, it will use the default prompt.",
|
emotionPrompt: "This option is used to set the prompt that is used to detect emotion. if it is blank, it will use the default prompt.",
|
||||||
|
removePunctuationHypa: "If enabled, it will remove punctuation before executing HypaMemory.",
|
||||||
},
|
},
|
||||||
setup: {
|
setup: {
|
||||||
chooseProvider: "Choose AI Provider",
|
chooseProvider: "Choose AI Provider",
|
||||||
@@ -504,4 +505,5 @@ export const languageEnglish = {
|
|||||||
openrouterFallback: "Openrouter Fallback",
|
openrouterFallback: "Openrouter Fallback",
|
||||||
openrouterMiddleOut: "Openrouter Middle Out",
|
openrouterMiddleOut: "Openrouter Middle Out",
|
||||||
geminiApiKey: "Gemini API Key",
|
geminiApiKey: "Gemini API Key",
|
||||||
|
removePunctuationHypa: "Remove Punctuation for HypaMemory",
|
||||||
}
|
}
|
||||||
@@ -92,6 +92,11 @@
|
|||||||
<Help key="chainOfThought"/><Help key="experimental"/>
|
<Help key="chainOfThought"/><Help key="experimental"/>
|
||||||
</Check>
|
</Check>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="flex items-center mt-4">
|
||||||
|
<Check bind:check={$DataBase.removePunctuationHypa} name={language.removePunctuationHypa}>
|
||||||
|
<Help key="removePunctuationHypa"/><Help key="experimental"/>
|
||||||
|
</Check>
|
||||||
|
</div>
|
||||||
<div class="flex items-center mt-4">
|
<div class="flex items-center mt-4">
|
||||||
<Check check={$DataBase.tpo} name="Alpha DevMode" onChange={() => {
|
<Check check={$DataBase.tpo} name="Alpha DevMode" onChange={() => {
|
||||||
// access code is "tendo"
|
// access code is "tendo"
|
||||||
|
|||||||
@@ -142,6 +142,11 @@ export async function supaMemory(
|
|||||||
if(hypaChunks.length > 0){
|
if(hypaChunks.length > 0){
|
||||||
await hypa.addText(hypaChunks.filter((value, index, self) => {
|
await hypa.addText(hypaChunks.filter((value, index, self) => {
|
||||||
return self.indexOf(value) === index;
|
return self.indexOf(value) === index;
|
||||||
|
}).map((value) => {
|
||||||
|
if(db.removePunctuationHypa){
|
||||||
|
value = value.replace(/[\.,\/#!$%\^&\*;:{}=\-_`~()]/g,"")
|
||||||
|
}
|
||||||
|
return value
|
||||||
}))
|
}))
|
||||||
const filteredChat = chats.filter((r) => r.role !== 'system' && r.role !== 'function')
|
const filteredChat = chats.filter((r) => r.role !== 'system' && r.role !== 'function')
|
||||||
const s = await hypa.similaritySearch(stringlizeChat(filteredChat.slice(0, 4), char?.name ?? '', false))
|
const s = await hypa.similaritySearch(stringlizeChat(filteredChat.slice(0, 4), char?.name ?? '', false))
|
||||||
|
|||||||
@@ -592,7 +592,8 @@ export interface Database{
|
|||||||
},
|
},
|
||||||
top_k:number
|
top_k:number
|
||||||
claudeAws:boolean
|
claudeAws:boolean
|
||||||
lastPatchNoteCheckVersion?:string
|
lastPatchNoteCheckVersion?:string,
|
||||||
|
removePunctuationHypa?:boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface customscript{
|
export interface customscript{
|
||||||
|
|||||||
Reference in New Issue
Block a user