Skip to content

Commit

Permalink
1.95.0 (#359)
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 Apr 10, 2024
2 parents c0578fc + 8c0fe0d commit 02e487f
Show file tree
Hide file tree
Showing 28 changed files with 312 additions and 121 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.94.1"
"version": "1.95.0"
},
"tauri": {
"allowlist": {
Expand Down
28 changes: 14 additions & 14 deletions src/etc/patchNote.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
export const patchNote = {
version: "1.94",
version: "1.95",
content:
`
# Update 1.94
- Added "If Value" condition in Trigger Scripts
- Added "Call Trigger" effect in Trigger Scripts
- Added "Stop Sending Prompt" effect in Trigger Scripts
- Added "Run Command" effect in Trigger Scripts
- Added Trigger Scripts' help dialog
- Added "risu-trigger" attribute support to trigger Trigger Scripts in HTML
- Reworked {{button::A::B}} to use with Trigger Scripts
- Trigger Scripts now parses curly braced syntax in attributes
- Fixed Commands not chaining properly
- Fixed Trigger Scripts' variable not saving and syncing properly
- Changed CharacterJS in character to not be shown unless unrecommended option is enabled
- Changed CharacterJS to not be exported in character export
# Update 1.95
- Added New character import screen
- Added Metadata viewer for chat
- Changed default prompt
- Changed High contrast text color
- Changed SupaMemory and HypaMemory to return one chunk instead of multiple
- Made progress circle color to change dynamically depending how the progress is
- Imported flag would be saved when character is imported
- Fixed Realm UI cutoff
- Fixed Realm import not working for new URLs
- Fixed Error message in SupaMemory returning [Object Object]
- Fixed HypaMemory not running even the HypaMemory is enabled
- Fixed HypaMemory and SupaMemory returning same result
`
}

Expand Down
5 changes: 5 additions & 0 deletions src/lang/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -567,4 +567,9 @@ export const languageEnglish = {
antiClaudeOverload: "Anti-Claude Overload",
activeTabChange: "Current tab is inactivated since other tab is active. to activate this tab, click OK",
maxSupaChunkSize: "Max SupaMemory Chunk Size",
addCharacter: "Add Character",
importFromRealm: "Choose from RisuRealm",
importFromRealmDesc: "Choose over 1000 characters in RisuRealm",
random: "Random",
metaData: "Meta Data",
}
5 changes: 4 additions & 1 deletion src/lib/ChatScreens/Chat.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,10 @@
<button class="text-sm p-1 text-textcolor2 border-darkborderc float-end mr-2 my-2
hover:ring-borderc hover:ring rounded-md hover:text-textcolor transition-all flex justify-center items-center"
on:click={() => {
alertRequestData(MessageGenerationInfo)
alertRequestData({
genInfo: MessageGenerationInfo,
idx: idx,
})
}}
>
<BotIcon size={20} />
Expand Down
26 changes: 24 additions & 2 deletions src/lib/ChatScreens/DefaultChatScreen.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import Chat from "./Chat.svelte";
import { DataBase, type Message, type character, type groupChat } from "../../ts/storage/database";
import { getCharImage } from "../../ts/characters";
import { doingChat, sendChat } from "../../ts/process/index";
import { chatProcessStage, doingChat, sendChat } from "../../ts/process/index";
import { findCharacterbyId, messageForm, sleep } from "../../ts/util";
import { language } from "../../lang";
import { isExpTranslator, translate } from "../../ts/translator/translator";
Expand Down Expand Up @@ -439,7 +439,7 @@
{#if $doingChat || doingChatInputTranslate}
<div
class="mr-2 bg-selected flex justify-center items-center text-gray-100 w-12 h-12 rounded-md hover:bg-green-500 transition-colors" on:click={abortChat}>
<div class="loadmove" class:autoload={autoMode}>
<div class="loadmove chat-process-stage-{$chatProcessStage}" class:autoload={autoMode}>
</div>
</div>
{:else}
Expand Down Expand Up @@ -729,6 +729,28 @@
height: 1rem;
border-top: 0.4rem solid var(--risu-theme-borderc);
border-left: 0.4rem solid var(--risu-theme-borderc);
/* transition colors */
transition: border-color 0.5s;
}
.chat-process-stage-1{
border-top: 0.4rem solid #60a5fa;
border-left: 0.4rem solid #60a5fa;
}
.chat-process-stage-2{
border-top: 0.4rem solid #db2777;
border-left: 0.4rem solid #db2777;
}
.chat-process-stage-3{
border-top: 0.4rem solid #34d399;
border-left: 0.4rem solid #34d399;
}
.chat-process-stage-4{
border-top: 0.4rem solid #8b5cf6;
border-left: 0.4rem solid #8b5cf6;
}
.autoload{
Expand Down
114 changes: 105 additions & 9 deletions src/lib/Others/AlertComp.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { getCharImage } from '../../ts/characters';
import { ParseMarkdown } from '../../ts/parser';
import BarIcon from '../SideBars/BarIcon.svelte';
import { User } from 'lucide-svelte';
import { ChevronRightIcon, User } from 'lucide-svelte';
import { hubURL } from 'src/ts/characterCards';
import TextInput from '../UI/GUI/TextInput.svelte';
import { openURL } from 'src/ts/storage/globalApi';
Expand All @@ -15,6 +15,8 @@
import OptionInput from "../UI/GUI/OptionInput.svelte";
import { language } from 'src/lang';
import { getFetchData } from 'src/ts/storage/globalApi';
import { CurrentChat } from "src/ts/stores";
import { tokenize } from "src/ts/tokenizer";
let btn
let input = ''
let cardExportType = ''
Expand Down Expand Up @@ -75,7 +77,7 @@
<div class="text-textcolor">You should accept RisuRealm's <a class="text-green-600 hover:text-green-500 transition-colors duration-200 cursor-pointer" on:click={() => {
openURL('https://sv.risuai.xyz/hub/tos')
}}>Terms of Service</a> to continue</div>
{:else if $alertStore.type !== 'select' && $alertStore.type !== 'requestdata'}
{:else if $alertStore.type !== 'select' && $alertStore.type !== 'requestdata' && $alertStore.type !== 'addchar'}
<span class="text-gray-300">{$alertStore.msg}</span>
{#if $alertStore.submsg}
<span class="text-gray-500 text-sm">{$alertStore.submsg}</span>
Expand Down Expand Up @@ -176,6 +178,9 @@
<Button selected={generationInfoMenuIndex === 0} size="sm" on:click={() => {generationInfoMenuIndex = 0}}>
{language.tokens}
</Button>
<Button selected={generationInfoMenuIndex === 1} size="sm" on:click={() => {generationInfoMenuIndex = 1}}>
{language.metaData}
</Button>
<Button selected={generationInfoMenuIndex === 2} size="sm" on:click={() => {generationInfoMenuIndex = 2}}>
{language.log}
</Button>
Expand All @@ -191,25 +196,49 @@
<div class="w-32 h-32 border-darkborderc border-4 rounded-lg" style:background={
`linear-gradient(0deg,
rgb(59,130,246) 0%,
rgb(59,130,246) ${($alertGenerationInfoStore.inputTokens / $alertGenerationInfoStore.maxContext) * 100}%,
rgb(34 197 94) ${($alertGenerationInfoStore.inputTokens / $alertGenerationInfoStore.maxContext) * 100}%,
rgb(34 197 94) ${(($alertGenerationInfoStore.outputTokens + $alertGenerationInfoStore.inputTokens) / $alertGenerationInfoStore.maxContext) * 100}%,
rgb(156 163 175) ${(($alertGenerationInfoStore.outputTokens + $alertGenerationInfoStore.inputTokens) / $alertGenerationInfoStore.maxContext) * 100}%,
rgb(59,130,246) ${($alertGenerationInfoStore.genInfo.inputTokens / $alertGenerationInfoStore.genInfo.maxContext) * 100}%,
rgb(34 197 94) ${($alertGenerationInfoStore.genInfo.inputTokens / $alertGenerationInfoStore.genInfo.maxContext) * 100}%,
rgb(34 197 94) ${(($alertGenerationInfoStore.genInfo.outputTokens + $alertGenerationInfoStore.genInfo.inputTokens) / $alertGenerationInfoStore.genInfo.maxContext) * 100}%,
rgb(156 163 175) ${(($alertGenerationInfoStore.genInfo.outputTokens + $alertGenerationInfoStore.genInfo.inputTokens) / $alertGenerationInfoStore.genInfo.maxContext) * 100}%,
rgb(156 163 175) 100%)`
}>

</div>
</div>
<div class="grid grid-cols-2 gap-y-2 gap-x-4 mt-4">
<span class="text-blue-500">{language.inputTokens}</span>
<span class="text-blue-500 justify-self-end">{$alertGenerationInfoStore.inputTokens ?? '?'} {language.tokens}</span>
<span class="text-blue-500 justify-self-end">{$alertGenerationInfoStore.genInfo.inputTokens ?? '?'} {language.tokens}</span>
<span class="text-green-500">{language.outputTokens}</span>
<span class="text-green-500 justify-self-end">{$alertGenerationInfoStore.outputTokens ?? '?'} {language.tokens}</span>
<span class="text-green-500 justify-self-end">{$alertGenerationInfoStore.genInfo.outputTokens ?? '?'} {language.tokens}</span>
<span class="text-gray-400">{language.maxContextSize}</span>
<span class="text-gray-400 justify-self-end">{$alertGenerationInfoStore.maxContext ?? '?'} {language.tokens}</span>
<span class="text-gray-400 justify-self-end">{$alertGenerationInfoStore.genInfo.maxContext ?? '?'} {language.tokens}</span>
</div>
<span class="text-textcolor2 text-sm">{language.tokenWarning}</span>
{/if}
{#if generationInfoMenuIndex === 1}
<div class="grid grid-cols-2 gap-y-2 gap-x-4 mt-4">
<span class="text-blue-500">Index</span>
<span class="text-blue-500 justify-self-end">{$alertGenerationInfoStore.idx}</span>
<span class="text-amber-500">Model</span>
<span class="text-amber-500 justify-self-end">{$alertGenerationInfoStore.genInfo.model}</span>
<span class="text-green-500">ID</span>
<span class="text-green-500 justify-self-end">{$CurrentChat.message[$alertGenerationInfoStore.idx].chatId ?? "None"}</span>
<span class="text-red-500">GenID</span>
<span class="text-red-500 justify-self-end">{$alertGenerationInfoStore.genInfo.generationId}</span>
<span class="text-cyan-500">Saying</span>
<span class="text-cyan-500 justify-self-end">{$CurrentChat.message[$alertGenerationInfoStore.idx].saying}</span>
<span class="text-purple-500">Size</span>
<span class="text-purple-500 justify-self-end">{JSON.stringify($CurrentChat.message[$alertGenerationInfoStore.idx]).length} Bytes</span>
<span class="text-yellow-500">Time</span>
<span class="text-yellow-500 justify-self-end">{(new Date($CurrentChat.message[$alertGenerationInfoStore.idx].time ?? 0)).toLocaleString()}</span>
<span class="text-green-500">Tokens</span>
{#await tokenize($CurrentChat.message[$alertGenerationInfoStore.idx].data)}
<span class="text-green-500 justify-self-end">Loading</span>
{:then tokens}
<span class="text-green-500 justify-self-end">{tokens}</span>
{/await}
</div>
{/if}
{#if generationInfoMenuIndex === 2}
{#await getFetchData($alertStore.msg) then data}
{#if !data}
Expand All @@ -225,6 +254,73 @@
{/if}
{/await}
{/if}
{:else if $alertStore.type === 'addchar'}
<div class="w-2xl flex flex-col max-w-full">

<button class="border-darkborderc border py-12 px-8 flex rounded-md hover:ring-2 justify-center items-center" on:click={() => {
alertStore.set({
type: 'none',
msg: 'importFromRealm'
})
}}>
<div class="flex flex-col justify-start items-start">
<span class="text-2xl font-bold">{language.importFromRealm}</span>
<span class="text-textcolor2">{language.importFromRealmDesc}</span>
</div>
<div class="ml-9 float-right flex-1 flex justify-end">
<ChevronRightIcon />
</div>
</button>
<button class="border-darkborderc border py-2 px-8 flex rounded-md hover:ring-2 items-center mt-2" on:click={() => {
alertStore.set({
type: 'none',
msg: 'importCharacter'
})
}}>
<div class="flex flex-col justify-start items-start">
<span>{language.importCharacter}</span>
</div>
<div class="ml-9 float-right flex-1 flex justify-end">
<ChevronRightIcon />
</div>
</button>
<button class="border-darkborderc border py-2 px-8 flex rounded-md hover:ring-2 items-center mt-2" on:click={() => {
alertStore.set({
type: 'none',
msg: 'createfromScratch'
})
}}>
<div class="flex flex-col justify-start items-start">
<span>{language.createfromScratch}</span>
</div>
<div class="ml-9 float-right flex-1 flex justify-end">
<ChevronRightIcon />
</div>
</button>
<button class="border-darkborderc border py-2 px-8 flex rounded-md hover:ring-2 items-center mt-2" on:click={() => {
alertStore.set({
type: 'none',
msg: 'createGroup'
})
}}>
<div class="flex flex-col justify-start items-start">
<span>{language.createGroup}</span>
</div>
<div class="ml-9 float-right flex-1 flex justify-end">
<ChevronRightIcon />
</div>
</button>
<button class="border-darkborderc border py-2 px-8 flex rounded-md hover:ring-2 items-center mt-2" on:click={() => {
alertStore.set({
type: 'none',
msg: 'cancel'
})
}}>
<div class="flex flex-col justify-start items-start">
<span>{language.cancel}</span>
</div>
</button>
</div>
{/if}
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/lib/Setting/Pages/Module/ModuleMenu.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@
</script>

<span class="mt-4 text-xl">{language.basicInfo}</span>
<TextInput bind:value={currentModule.name} additionalClass="mt-1" placeholder={language.name}/>
<TextInput bind:value={currentModule.description} additionalClass="mt-1" placeholder={language.description} size="sm"/>
<TextInput bind:value={currentModule.name} className="mt-1" placeholder={language.name}/>
<TextInput bind:value={currentModule.description} className="mt-1" placeholder={language.description} size="sm"/>
<span class="mt-6 text-xl">{language.moduleContent}</span>
<div class="grid grid-cols-2 border-selected border rounded-md">
<button class={(!Array.isArray(currentModule.lorebook)) ? 'p-4' : "p-4 bg-selected rounded-tl-md"} on:click={toggleLorebook}>
Expand Down
3 changes: 2 additions & 1 deletion src/lib/Setting/botpreset.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import { CopyIcon, DownloadIcon, EditIcon, FolderUpIcon, PlusIcon, TrashIcon, XIcon } from "lucide-svelte";
import { cloneDeep } from "lodash";
import TextInput from "../UI/GUI/TextInput.svelte";
import { prebuiltPresets } from "src/ts/process/templates/templates";
let editMode = false
export let close = () => {}
Expand Down Expand Up @@ -73,7 +74,7 @@
<div class="flex mt-2 items-center">
<button class="text-textcolor2 hover:text-green-500 cursor-pointer mr-1" on:click={() => {
let botPresets = $DataBase.botPresets
let newPreset = cloneDeep(presetTemplate)
let newPreset = cloneDeep(prebuiltPresets.OAI2)
newPreset.name = `New Preset`
botPresets.push(newPreset)

Expand Down
8 changes: 4 additions & 4 deletions src/lib/SideBars/CharConfig.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -624,10 +624,10 @@
{/if}
{#if currentChar.data.ttsMode === 'huggingface'}
<span class="text-textcolor">Model</span>
<TextInput additionalClass="mb-4 mt-2" bind:value={currentChar.data.hfTTS.model} />
<TextInput className="mb-4 mt-2" bind:value={currentChar.data.hfTTS.model} />

<span class="text-textcolor">Language</span>
<TextInput additionalClass="mb-4 mt-2" bind:value={currentChar.data.hfTTS.language} placeholder="en" />
<TextInput className="mb-4 mt-2" bind:value={currentChar.data.hfTTS.language} placeholder="en" />
{/if}
{#if currentChar.data.ttsMode === 'vits'}
{#if currentChar.data.vits}
Expand Down Expand Up @@ -693,8 +693,8 @@

<span class="text-textcolor">{language.depthPrompt}</span>
<div class="flex justify-center items-center">
<NumberInput size="sm" bind:value={currentChar.data.depth_prompt.depth} additionalClass="w-12"/>
<TextInput size="sm" bind:value={currentChar.data.depth_prompt.prompt} additionalClass="flex-1"/>
<NumberInput size="sm" bind:value={currentChar.data.depth_prompt.depth} className="w-12"/>
<TextInput size="sm" bind:value={currentChar.data.depth_prompt.prompt} className="flex-1"/>
</div>

<span class="text-textcolor mt-2">{language.altGreet}</span>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/SideBars/SideChatList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
}
}} class="flex items-center text-textcolor border-solid border-0 border-darkborderc p-2 cursor-pointer rounded-md"class:bg-selected={i === chara.chatPage}>
{#if editMode}
<TextInput bind:value={chara.chats[i].name} additionalClass="flex-grow min-w-0" padding={false}/>
<TextInput bind:value={chara.chats[i].name} className="flex-grow min-w-0" padding={false}/>
{:else}
<span>{chat.name}</span>
{/if}
Expand Down
Loading

0 comments on commit 02e487f

Please sign in to comment.