Commit Graph

3186 Commits

Author SHA1 Message Date
poroyo
8ba4417065 feat: add prompt comparison feature 2025-01-05 14:20:20 +09:00
kwaroran
bf8bf02e2f fix: backup size limit (#702)
## Issue track
Previously, the backup loading was depending on ArrayBuffer. In chromium
based browsers, ArrayBuffer's size is limited to 2GB, and anything more
will fail to read the data.

This affects Tauri too, as Tauri uses Edge webview2 which also is based
on chromium.

The proposed change uses file stream instead of ArrayBuffer, effectively
ignoring forced file size limit of 2GB.

# PR Checklist
- [ ] Have you checked if it works normally in all models? *Ignore this
if it doesn't use models.*
- [x] Have you checked if it works normally in all web, local, and node
hosted versions? If it doesn't, have you blocked it in those versions?
- [ ] Have you added type definitions?

# Description
Have to revise, if possible. But really didn't changed that much logic
and since it is only a typescript file change, it will work on most
cases.

Worked on node hosted chrome environment with 2.25GB of binary backup
file.
2025-01-03 18:58:26 +09:00
LightningHyperBlaze45654
48b377b1ad fix: backup size limit
## Issue track
Previously, the backup loading was depending on ArrayBuffer. In chromium based browsers, ArrayBuffer's size is limited to 2GB, and anything more will fail to read the data.

This affects Tauri too, as Tauri uses Edge webview2 which also is based on chromium.

The proposed change uses file stream instead of ArrayBuffer, effectively ignoring file size limit/
2025-01-02 11:52:32 -08:00
Kwaroran
821ba1812f Merge branch 'main' of https://github.com/kwaroran/RisuAI 2025-01-02 03:03:03 +09:00
Kwaroran
866996ba1e chore: update version to 145.3.0 2025-01-02 03:02:54 +09:00
kwaroran
e97715843b Add Custom Character Folder Image Feature Using Global Module Assets (#697)
# PR Checklist
- [ ] Have you checked if it works normally in all models? *Ignore this
if it doesn't use models.*
- [x] Have you checked if it works normally in all web, local, and node
hosted versions? If it doesn't, have you blocked it in those versions?
- [x] Have you added type definitions?

# Description
This PR adds a new feature that allows users to add custom images to
character folders. Instead of uploading images directly, this feature
utilizes the existing image pool from **the global module**. Users can
either select from existing images in the global module or upload new
images to the module.

The users can use a context menu on a folder to update its image.

## Why Use the Global Module?

The global module was chosen for several reasons:  
1. It allows the reuse of existing functions and code, minimizing the
need for new implementations.
2. Users can easily select existing images without re-uploading them.  
3. The global module provides reliable support for image upload and
deletion.
4. Images uploaded via the global module are accessible across all
platforms where the shared data is available.

## Note

To retrieve the list of assets from the global module, I used the
following code:

```typescript
let assetPaths: { [key: string]: { path: string } } = {};

const moduleAssets = getModuleAssets();
if (moduleAssets.length > 0) {
  for (const asset of moduleAssets) {
    const assetPath = await getFileSrc(asset[1]);
    assetPaths[asset[0].toLocaleLowerCase()] = {
      path: assetPath,
    };
  }
}
```

I reused the `parseAdditionalAssets` code from
`/src/ts/parser.svelte.ts` because it seemed simple and practical for
this feature. I thought about refactoring it into a shared function but
decided to keep it simple for now. I’m not sure if this is the best
approach, but it can always be changed later if needed.

---

If you are already working on a similar feature, find any issues with
this code, or feel this PR does not align with the project's direction,
I fully understand if this PR is not accepted.

Thank you!

---

One last note: With *transparent background images* and the existing
folder color functionality, users can differentiate categories even when
using the same image by applying different colors!
2025-01-02 02:56:49 +09:00
kwaroran
0c5aab06f7 Fix: Token counting fix (#699)
# PR Checklist
- [ ] Have you checked if it works normally in all models? *Ignore this
if it doesn't use models.*
- [ ] Have you checked if it works normally in all web, local, and node
hosted versions? If it doesn't, have you blocked it in those versions?
- [ ] Have you added type definitions?

# Description

Emergency fix of PR #680, #696 


Source of problem: Every time when a chat is sent with HypaV2 active, it
always appended HypaAllocatedToken amount of tokens to the
currentTokens.

This did not get subtracted at the end, even though this is nothing more
than a virtual limit like the output tokens.
2025-01-02 02:56:10 +09:00
LightningHyperBlaze45654
d2042116aa Fix: Token counting fix 2024-12-31 21:52:13 -08:00
poroyo
2730e40b3b Refactor char folder image upload process to use direct upload method 2024-12-30 07:31:40 +09:00
poroyo
b83cb444b9 Add functionality to update char folder images 2024-12-29 07:28:04 +09:00
Kwaroran
b80f15f885 chore: update version to 145.2.0 in configuration files 2024-12-29 04:04:25 +09:00
Kwaroran
cd092a5a01 feat: add translation feature and ban character set functionality 2024-12-29 04:03:21 +09:00
kwaroran
03acfdc306 Bugfix on hypaV2 (#696)
# PR Checklist
- [ ] Have you checked if it works normally in all models? *Ignore this
if it doesn't use models.*
- [ ] Have you checked if it works normally in all web, local, and node
hosted versions? If it doesn't, have you blocked it in those versions?
- [ ] Have you added type definitions?

# Description
When chat imported from json, it breaks
Fixed by changing the list back to set

Need to check if there is any bug on token counting(unknown issue, so
currently re-calculating the token accurately)
2024-12-28 05:36:22 +09:00
kwaroran
4ecf67417e Fix TTS TypeError issue when using gptsovits TTS by adding missing break statement (#695)
# PR Checklist
- [ ] Have you checked if it works normally in all models? *Ignore this
if it doesn't use models.*
- [x] Have you checked if it works normally in all web, local, and node
hosted versions? If it doesn't, have you blocked it in those versions?
- [ ] Have you added type definitions?

# Description
This pull request resolves a `TypeError` that occurred specifically when
executing TTS with the `gptsovits` model.

In Edge browsers, this manifested as:

`TTS Error: TypeError: Cannot read properties of undefined (reading
'model')`

While the TTS functionality itself was working, a missing `break`
statement in the `gptsovits` case of the `sayTTS` function caused this
error during runtime. This PR adds the necessary `break` statement to
prevent this `TypeError`.
2024-12-28 05:36:11 +09:00
kwaroran
b1e915d4cb Fixed example code error in plugin docs (#694)
# PR Checklist
- [ ] Have you checked if it works normally in all models? *Ignore this
if it doesn't use models.*
- [ ] Have you checked if it works normally in all web, local, and node
hosted versions? If it doesn't, have you blocked it in those versions?
- [ ] Have you added type definitions?

It's just a docs change.

# Description
Fixed example code in the plugin docs to match with Plugin Syntax.
2024-12-28 05:36:01 +09:00
kwaroran
663f89617a fix: add missing api definition (#693)
# PR Checklist
- [ ] Have you checked if it works normally in all models? *Ignore this
if it doesn't use models.*
- [ ] Have you checked if it works normally in all web, local, and node
hosted versions? If it doesn't, have you blocked it in those versions?
- [ ] Have you added type definitions?

# Description
In plugins.ts methods `addRisuScriptHandler` and
`removeRisuScriptHandler` are implemented but not defined (exported).
Thanks for your time.
2024-12-28 05:35:41 +09:00
HyperBlaze
9c1f65e518 Merge branch 'kwaroran:main' into main 2024-12-26 23:53:59 -08:00
LightningHyperBlaze45654
e51ec6c739 bugfix(read desc)
need to check if the token count is still bugged.
2024-12-26 23:53:05 -08:00
Kwaroran
ebdcd5ffcd Add new catagory 2024-12-27 16:16:36 +09:00
Kwaroran
4e2f5c24da chore: update version to 145.1.0 in configuration files 2024-12-27 16:00:20 +09:00
Kwaroran
828f612ed6 feat: add maxThoughtTagDepth property to preset configuration 2024-12-27 15:58:12 +09:00
Kwaroran
cc223dfefa feat: limit thoughts extraction based on maxThoughtTagDepth setting 2024-12-27 15:56:48 +09:00
Kwaroran
191be6d5c1 feat: add image translation feature and enhance regex list functionality 2024-12-27 15:51:29 +09:00
Do-hyun Ko
c841538c51 Fix semantic meaning error 2024-12-27 05:09:32 +09:00
Do-hyun Ko
98ddb3fc0f Fixed example code error in plugin docs 2024-12-27 04:06:03 +09:00
poroyo
823541af40 Fix sayTTS missing break in gptsovits case 2024-12-27 04:00:19 +09:00
bangonicdd
58755abd8d fix: add missing api definition 2024-12-26 22:19:00 +09:00
Kwaroran
c5f5786af7 fix: update image source reference in bot presets to use preset.image 2024-12-26 07:44:18 +09:00
Kwaroran
96de87f629 chore: update version to 145.0.1 in configuration files 2024-12-26 07:40:20 +09:00
Kwaroran
7fab5aaf90 feat: add image property to bot presets during save operation 2024-12-26 07:40:01 +09:00
Kwaroran
103b6fddb2 style: enhance loading state UI with improved layout and text visibility 2024-12-26 06:03:25 +09:00
Kwaroran
259181bbe2 Merge branch 'main' of https://github.com/kwaroran/RisuAI 2024-12-26 06:00:24 +09:00
Kwaroran
fe47f58c61 Add LoadingStatusState and improve tokenizer functionality 2024-12-26 06:00:07 +09:00
kwaroran
b874ed42ed HypaV2 context deletion safety (#680)
# PR Checklist
- [x] 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? <<
Checked on browser only, works fine
- [x] Did you added a type def?

# Description
HypaV2 data's large type definition update.
```ts
    mainChunks: { // summary itself
        id: number;
        text: string;
        chatMemos: Set<string>; // UUIDs of summarized chats
        lastChatMemo: string;
    }[];
    chunks: { // split mainChunks for retrieval or something. Although quite uncomfortable logic, so maybe I will delete it soon.
        mainChunkID: number;
        text:string;
    }[];
```
With this, ensure that mainChunks is relevant on chat context change by
deletion

If there is no UUID in the chat context, but it exists on chatMemos on
certain mainChunk, removes it.

Changed index.svelte.ts to update args on each call to ensure hypav2 to
stay adaptive on this change without refreshing the page

Also changed mainChunks to be pushed instead of unshifted
2024-12-26 05:02:33 +09:00
kwaroran
46065ebe13 fix: add missing definitions of plugin APIs (#690)
# PR Checklist
- [ ] Did you check if it works normally in all models? *ignore this
when it doesn't use models*
  - It doesn't use 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?
  - Only checked on the browser
- [ ] Did you add a type def?
  - It does nothing with types
# Description
In plugins.ts methods `addRisuReplacer` and `removeRisuReplacer` are
implemented but not defined (exported).
I thought that the definitions were simply missing. So I added only two
lines.
2024-12-26 04:56:08 +09:00
kwaroran
14cd6aa9b8 ✏️ Fix typos and tones of the pr template (#691)
# 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?

- It's just a change in the document (native language).

# Description
Fixed typo & changed the tone of the PR template, with the help of
Copilot.
2024-12-26 04:55:50 +09:00
Kwaroran
575eb0505e Bump version to 145.0.0 in configuration and related files 2024-12-26 04:55:12 +09:00
Kwaroran
2672195d92 Add preset related features 2024-12-26 04:29:14 +09:00
Kwaroran
c6cc258a50 Refactor preset handling and improve database snapshot logic 2024-12-26 03:18:00 +09:00
Do-hyun Ko
e7f509b51e ✏️ Fix typos and tones of the pr template 2024-12-25 22:27:48 +09:00
Do-hyun Ko
47cf303d1f fix: add missing definitions of plugin APIs 2024-12-25 22:17:48 +09:00
Kwaroran
d7f376b8db Change Plugin.md and version 2024-12-25 21:09:12 +09:00
Kwaroran
28d8bfdd22 Fix nativeFetch and comfy 2024-12-25 21:06:52 +09:00
Kwaroran
1c51afc626 Enhance plugin functionality by adding optional provider parameters and improving thoughts extraction regex 2024-12-25 04:55:05 +09:00
Kwaroran
8b6fc5bc8b Add max_tokens parameter to plugin documentation and request function 2024-12-25 00:31:28 +09:00
Kwaroran
7d9649b87e Merge branch 'main' of https://github.com/kwaroran/RisuAI 2024-12-25 00:22:54 +09:00
Kwaroran
0587f513f1 Bump version to 144.3.1 in configuration and related files 2024-12-25 00:19:40 +09:00
Kwaroran
b612d28f1b Refactor loadV2Plugin to use database plugins instead of passed plugins 2024-12-25 00:19:03 +09:00
kwaroran
98ca1736ab Fix thoughts extraction regex for multiline content handling (#687)
# PR Checklist
- [x] Did you check if it works normally in all models? *ignore this
when it dosen't uses models*
- [x] 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

This PR updates the regex used for extracting <Thoughts> content to
handle multiline cases reliably. The previous regex (.+?) had
limitations when processing text spanning multiple lines, as it could
not match content with line breaks.
2024-12-24 23:16:20 +09:00
Kwaroran
29c9f0ad15 Bump version to 144.3.0 in configuration and related files 2024-12-24 23:15:10 +09:00