Skip to content

Commit

Permalink
1.82.1 (#302)
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 7, 2024
2 parents 40d2365 + 7be4fa7 commit 9490c18
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 17 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.82.0"
"version": "1.82.1"
},
"tauri": {
"allowlist": {
Expand Down
4 changes: 2 additions & 2 deletions src/lib/SideBars/CharConfig.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@
<TextAreaInput margin="both" autocomplete="off" bind:value={currentChar.data.additionalText}></TextAreaInput>


{#if currentChar.data.chats[currentChar.data.chatPage].supaMemoryData && currentChar.data.chats[currentChar.data.chatPage].supaMemoryData.length > 4}
{#if currentChar.data.chats[currentChar.data.chatPage].supaMemoryData && currentChar.data.chats[currentChar.data.chatPage].supaMemoryData.length > 4 || currentChar.data.supaMemory}
<span class="text-textcolor">{language.SuperMemory}</span>
<TextAreaInput margin="both" autocomplete="off" bind:value={currentChar.data.chats[currentChar.data.chatPage].supaMemoryData}></TextAreaInput>
{/if}
Expand Down Expand Up @@ -840,7 +840,7 @@
<RealmUpload bind:char={currentChar.data} close={() => {openHubUpload=false}}/>
{/if}
{:else}
{#if currentChar.data.chats[currentChar.data.chatPage].supaMemoryData && currentChar.data.chats[currentChar.data.chatPage].supaMemoryData.length > 4}
{#if currentChar.data.chats[currentChar.data.chatPage].supaMemoryData && currentChar.data.chats[currentChar.data.chatPage].supaMemoryData.length > 4 || currentChar.data.supaMemory}
<span class="text-textcolor">{language.SuperMemory}</span>
<TextAreaInput margin="both" autocomplete="off" bind:value={currentChar.data.chats[currentChar.data.chatPage].supaMemoryData}></TextAreaInput>
{/if}
Expand Down
8 changes: 7 additions & 1 deletion src/ts/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ type matcherArg = {
tokenizeAccurate?:boolean
consistantChar?:boolean
displaying?:boolean
role?:string
}
const matcher = (p1:string,matcherArg:matcherArg) => {
if(p1.length > 100000){
Expand Down Expand Up @@ -635,6 +636,9 @@ const matcher = (p1:string,matcherArg:matcherArg) => {
case 'axmodel':{
return db.subModel
}
case 'role': {
return matcherArg.role ?? 'role'
}
}
const arra = p1.split("::")
if(arra.length > 1){
Expand Down Expand Up @@ -824,7 +828,8 @@ export function risuChatParser(da:string, arg:{
var?:{[key:string]:string}
tokenizeAccurate?:boolean
consistantChar?:boolean
visualize?:boolean
visualize?:boolean,
role?:string
} = {}):string{
const chatID = arg.chatID ?? -1
const db = arg.db ?? get(DataBase)
Expand Down Expand Up @@ -870,6 +875,7 @@ export function risuChatParser(da:string, arg:{
var: arg.var ?? null,
tokenizeAccurate: arg.tokenizeAccurate ?? false,
displaying: arg.visualize ?? false,
role: arg.role
}
let pef = performance.now()
while(pointer < da.length){
Expand Down
14 changes: 7 additions & 7 deletions src/ts/process/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,13 +431,13 @@ export async function sendChat(chatProcessIndex = -1,arg:{chatAdditonalTokens?:n
let content = card.text

if(card.type2 === 'globalNote'){
content = (risuChatParser(currentChar.replaceGlobalNote?.replaceAll('{{original}}', content) || content, {chara:currentChar}))
content = (risuChatParser(currentChar.replaceGlobalNote?.replaceAll('{{original}}', content) || content, {chara: currentChar, role: card.role}))
}
else if(card.type2 === 'main'){
content = (risuChatParser(content, {chara: currentChar}))
content = (risuChatParser(content, {chara: currentChar, role: card.role}))
}
else{
content = risuChatParser(content, {chara: currentChar})
content = risuChatParser(content, {chara: currentChar, role: card.role})
}

const prompt:OpenAIChat ={
Expand Down Expand Up @@ -537,7 +537,7 @@ export async function sendChat(chatProcessIndex = -1,arg:{chatAdditonalTokens?:n

let index = 0
for(const msg of ms){
let formatedChat = await processScript(nowChatroom,risuChatParser(msg.data, {chara: currentChar, rmVar: true}), 'editprocess')
let formatedChat = await processScript(nowChatroom,risuChatParser(msg.data, {chara: currentChar, rmVar: true, role: msg.role}), 'editprocess')
let name = ''
if(msg.role === 'char'){
if(msg.saying){
Expand Down Expand Up @@ -802,13 +802,13 @@ export async function sendChat(chatProcessIndex = -1,arg:{chatAdditonalTokens?:n
let content = card.text

if(card.type2 === 'globalNote'){
content = (risuChatParser(currentChar.replaceGlobalNote?.replaceAll('{{original}}', content) || content, {chara:currentChar}))
content = (risuChatParser(currentChar.replaceGlobalNote?.replaceAll('{{original}}', content) || content, {chara:currentChar, role: card.role}))
}
else if(card.type2 === 'main'){
content = (risuChatParser(content, {chara: currentChar}))
content = (risuChatParser(content, {chara: currentChar, role: card.role}))
}
else{
content = risuChatParser(content, {chara: currentChar})
content = risuChatParser(content, {chara: currentChar, role: card.role})
}

const prompt:OpenAIChat ={
Expand Down
13 changes: 9 additions & 4 deletions src/ts/process/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1617,12 +1617,17 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
}
break
}

case 'error': {
if(e.data){
text += "Error:" + JSON.parse(e.data).error?.message
controller.enqueue({
"0": text
})
}
break
}
}
}
if(e.type === 'reconnect-interval'){
//TODO: handle reconnect interval
}
})
const reader = res.body.getReader()
while(true){
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.82.0"
export let appVer = "1.82.1"
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.82.0"}
{"version":"1.82.1"}

0 comments on commit 9490c18

Please sign in to comment.