Commit Graph

94 Commits

Author SHA1 Message Date
Kwaroran
665253e404 Merge branch 'main' of https://github.com/kwaroran/RisuAI 2025-05-17 01:42:59 +09:00
Kwaroran
0733554e4d Add styles 2025-05-17 01:42:08 +09:00
Bo26fhmC5M
85753a76ef feat: implement preset and parallel requests for HypaV3 2025-05-16 22:18:13 +09:00
kwaroran
bf55f77e0d Upgrade dep 2025-04-28 16:09:29 +09:00
shirosaki-hana
e0038749a4 Fix: Resolve account login issues in Node.js hosted version
In a previous commit, a new proxy endpoint was added to the backend to resolve CORS errors that occurred when the frontend directly fetched data from Risu Realm.

However, the proxy endpoint handler failed to properly process POST requests, causing account login failures. Additionally, the backend was inefficiently performing complex body processing.

The updated code now directly pipes the original request, providing a more efficient and reliable solution.
2025-04-17 13:14:12 +09:00
kwaroran
cf22306c8c Refactor: Caching tokenize result (#805)
# 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?

# Improved performance

![image](https://github.com/user-attachments/assets/c7fa773f-afbb-4eb6-ac24-35c8451be33d)
The picture above was taken when I sent a chat.
As you can see, the encode function occupies **0.68 seconds** out of 1.8
seconds.
This is **36.5%** of sending time

![image](https://github.com/user-attachments/assets/cd2c4bde-556e-4151-82a9-030d27f2872a)
This is a picture taken after adding a caching function.
encode time Reduced from **0.68 seconds to 0.12 seconds, an improvement
of 27.2%**

Since configuration values are also used as key values in the hash
function,
it is guaranteed that **different results will be produced when the
configuration changes**.
I tested this myself by changing the bot settings

# Implementation
I added the `mnemonist` library to implement this. At first, I used
lru-cache, but that library recommended using this one if performance is
important.
It actually performed better too.

# Integrity Check

![image](https://github.com/user-attachments/assets/ae1272a8-ea95-47ef-85f5-c22dd9f34be7)
Lastly,
the encoding result calculated without caching when sending the first
chat,
the newly calculated value when sending the second chat, and
the result cached when sending the first chat were all the same.
2025-04-14 14:10:24 +09:00
shirosaki-hana
c1d4b4daa3 Fix: Resolve Realm CORS Violation for Node.js Hosted Version
Problem:

The Node.js hosted version of RisuAI encountered an issue where it failed to fetch data from the Risu Realm server when accessed remotely.

RisuAI's frontend directly fetches data from the Realm server (e.g., sv.risuai.xyz). While the official web version did not exhibit CORS errors (potentially due to same-origin deployment or specific server-side CORS configurations), running the Node.js version on a self-hosted server and accessing it remotely resulted in browser CORS policy violations.

Solution:

The fix involves detecting when the frontend runs in the Node.js host environment.

When this environment is detected, instead of requesting Realm data directly from the external server (sv.risuai.xyz), the frontend now directs the request to a new proxy endpoint (`/hub-proxy/*`) on its own backend server.

The backend proxy then fetches the required data (including JSON and images) from the actual Realm server, correctly handles content types and compression, and relays the response back to the frontend.

This ensures that, from the browser's perspective, the frontend is communicating with its same-origin backend, effectively bypassing browser CORS restrictions and resolving the data fetching issue.
2025-04-10 17:16:21 +09:00
sub-hub
c553478a78 Refactor: caching tokenize result 2025-04-02 22:01:01 +09:00
ModMapper
f3ba23bc59 Add Firefox Translations 2025-03-16 19:41:06 +09:00
Kwaroran
1b171cab66 Update version, gemini models, and new progress dialoge, and charxjpeg 2025-02-06 09:48:55 +09:00
Kwaroran
2ec13a4550 Modify some parts of PR 2025-01-06 00:30:33 +09:00
poroyo
8ba4417065 feat: add prompt comparison feature 2025-01-05 14:20:20 +09:00
Kwaroran
dcc48d5cb3 Add subtitle 2024-12-15 19:33:26 +09:00
kwaroran
e0f6c58540 Refactor HypaProcesser instantiation to remove hardcoded model name and add models and others 2024-12-07 00:58:09 +09:00
kwaroran
0e292bd690 aria-role fixes 2024-12-02 04:27:50 +09:00
kwaroran
5f9b79816a Remove packageManager field from package.json 2024-11-17 23:21:00 +09:00
kwaroran
911ff7fd8b Add compression-streams-polyfill and integrate CompressionStream support 2024-11-04 15:26:17 +09:00
kwaroran
4f41461f86 Remove cache only save 2024-11-03 22:06:07 +09:00
kwaroran
18d8bb7bab Refactor package.json and pnpm-lock.yaml to add rfdc dependency 2024-10-26 19:58:52 +09:00
kwaroran
c7330719ad Migrate to svelte 5 2024-10-23 02:31:37 +09:00
kwaroran
891f3e6128 Change pnpm version 2024-10-12 19:31:34 +09:00
Naki
26313c8105 Specify pnpm version 2024-10-10 05:10:38 +09:00
kwaroran
a66f1664ef Add deep linking 2024-10-09 21:19:58 +09:00
kwaroran
5a931d4ba0 Migrate to Tauri V2 2024-10-09 20:07:59 +09:00
kwaroran
6309317945 fix nomodule error 2024-07-10 18:02:52 +09:00
kwaroran
f57cfe4543 chore: Update npm dependencies and remove unused packages 2024-07-02 06:28:05 +09:00
kwaroran
0e8e72e680 Add code block highlighting and new quote marking 2024-07-02 05:51:39 +09:00
kwaroran
f38b88e208 change markdown engine to markdown-lt 2024-07-02 05:04:37 +09:00
kwaroran
5f59349b84 chore: Update svelte and vite dependencies to specific versions 2024-06-24 01:24:56 +09:00
kwaroran
0c10d0c5bc chore: Update svelte dependencies to specific versions 2024-06-24 01:16:03 +09:00
kwaroran
fa322f741a change vite 2024-06-24 01:00:34 +09:00
kwaroran
b53cbba0fa ref: replace browser color picker to svelte-awesome-color-picker 2024-06-10 02:23:13 +09:00
kwaroran
8f43728ec0 chore: Update @swc/core npm dependency to version 1.5.7 2024-05-30 16:08:37 +09:00
kwaroran
b8b00396fa chore: Update @swc/core npm dependency to version 1.5.11 2024-05-30 16:05:46 +09:00
kwaroran
f23371c5fb chore: Update npm dependency to latest stable version 2024-05-30 16:03:37 +09:00
kwaroran
93cba968b5 feat: add syntax highlighting 2024-05-26 08:15:45 +09:00
kwaroran
65fd56c0e4 Add character card v3 import/export 2024-05-25 09:24:35 +09:00
kwaroran
3442bbbd72 feat: Add @risuai/ccardlib dependency and update characterCards.ts 2024-05-13 00:49:52 +09:00
kwaroran
11b1d4d4f3 Replace cloneDeep to native structuredclone and remove unused import 2024-04-25 01:17:14 +09:00
kwaroran
2abd3bf15a Add Harunai Memory 2024-04-23 22:07:44 +09:00
kwaroran
e2e7031210 Update package.json and pnpm-lock.yaml with dependency changes 2024-04-23 17:25:40 +09:00
kwaroran
c9011da053 Add Jinja based formating 2024-04-20 19:27:17 +09:00
dependabot[bot]
bc13f1762c Bump vite from 5.0.11 to 5.0.13
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.0.11 to 5.0.13.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.0.13/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.0.13/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-18 04:46:02 +00:00
kwaroran
4f8477538d add ollama package and support for ollama-hosted model 2024-04-17 21:01:56 +09:00
ModMapper
580cd3e1a7 Add CodeMirror based Highlighted editor 2024-03-23 18:41:36 +09:00
kwaroran
fbde71e271 Update dependencys 2024-03-16 19:51:45 +09:00
kwaroran
fe31610ca0 Add claude streaming & remove unused parameters 2024-03-06 22:14:24 +09:00
kwaroran
66fd70c01a Add postfile function 2024-02-26 23:13:29 +09:00
kwaroran
cb8366ba6a add voice.ts todo 2024-02-24 15:10:01 +09:00
kwaroran
b609793a18 Update dependencies and Vite configuration 2024-01-15 18:36:50 +09:00