Skip to content

Commit

Permalink
1.80.0 (#296)
Browse files Browse the repository at this point in the history
# PR Checklist
- [ ] Did you check if it works normally in all models? *ignore this
when it dosen't uses models*
- [ ] Did you check if it works normally in all of web, local and node
hosted versions? if it dosen't, did you blocked it in those versions?
- [ ] Did you added a type def?

# Description
  • Loading branch information
kwaroran authored Mar 4, 2024
2 parents d7854d3 + a57399d commit ad5e6ef
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"package": {
"productName": "RisuAI",
"version": "1.79.3"
"version": "1.80.0"
},
"tauri": {
"allowlist": {
Expand Down
3 changes: 2 additions & 1 deletion src/lang/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ export const languageEnglish = {
"description": "Character Description",
'personaPrompt':'Persona Prompt',
'plain': "Plain Prompt",
'memory': "Supa/HypaMemory"
'memory': "Supa/HypaMemory",
'postEverything': "End-Injected Prompts",
},
errors:{
toomuchtoken: 'Error: The minimum required token is greater than the Max Context Size.',
Expand Down
1 change: 1 addition & 0 deletions src/lib/UI/ProomptItem.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
<OptionInput value="authornote">{language.formating.authorNote}</OptionInput>
<OptionInput value="lorebook">{language.formating.lorebook}</OptionInput>
<OptionInput value="memory">{language.formating.memory}</OptionInput>
<OptionInput value="postEverything">{language.formating.postEverything}</OptionInput>
{#if $DataBase.proomptSettings.customChainOfThought}
<OptionInput value="cot">{language.cot}</OptionInput>
{/if}
Expand Down
32 changes: 32 additions & 0 deletions src/ts/process/files/multisend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,28 @@ async function sendTxtFile(arg:sendFileArg) {
return Buffer.from(`<File>\n${message}\n</File>\n`).toString('base64')
}

async function sendXMLFile(arg:sendFileArg) {
const hypa = new HypaProcesser('MiniLM')
let nodeTexts:string[] = []
const parser = new DOMParser();
const xmlDoc = parser.parseFromString(arg.file, "text/xml");
const nodes = xmlDoc.getElementsByTagName('*')
for(const node of nodes){
nodeTexts.push(node.textContent)
}
hypa.addText(nodeTexts)
const result = await hypa.similaritySearch(arg.query)
let message = ''
for(let i = 0; i<result.length; i++){
message += "\n" + result[i]
if(i>5){
break
}
}
console.log(message)
return Buffer.from(`<File>\n${message}\n</File>\n`).toString('base64')
}

type postFileResult = postFileResultImage | postFileResultVoid | postFileResultText

type postFileResultImage = {
Expand Down Expand Up @@ -211,6 +233,16 @@ export async function postChatFile(query:string):Promise<postFileResult>{
name: file.name
}
}
case 'xml':{
return {
type: 'text',
data: await sendXMLFile({
file: BufferToText(file.data),
query: query
}),
name: file.name
}
}
case 'jpg':
case 'jpeg':
case 'png':
Expand Down
16 changes: 13 additions & 3 deletions src/ts/process/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,19 @@ export async function sendChat(chatProcessIndex = -1,arg:{chatAdditonalTokens?:n
let promptTemplate = cloneDeep(db.promptTemplate)
const usingPromptTemplate = !!promptTemplate
if(promptTemplate){
promptTemplate.push({
type: 'postEverything'
})
let hasPostEverything = false
for(const card of promptTemplate){
if(card.type === 'postEverything'){
hasPostEverything = true
break
}
}

if(!hasPostEverything){
promptTemplate.push({
type: 'postEverything'
})
}
}
if(currentChar.utilityBot && (!(usingPromptTemplate && db.proomptSettings.utilOverride))){
promptTemplate = [
Expand Down
2 changes: 1 addition & 1 deletion src/ts/storage/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type { OobaChatCompletionRequestParams } from '../model/ooba';

export const DataBase = writable({} as any as Database)
export const loadedStore = writable(false)
export let appVer = "1.79.3"
export let appVer = "1.80.0"
export let webAppSubVer = ''

export function setDatabase(data:Database){
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"1.79.3"}
{"version":"1.80.0"}

0 comments on commit ad5e6ef

Please sign in to comment.