Commit Graph

1036 Commits

Author SHA1 Message Date
YH_KIM
5b0ca460a5 Support numeric values in inputs and enhance image generation configs
Updated `SelectInput` and `OptionInput` to allow `value` as `string | number`. Extended image generation configurations with new features, including `cfg_rescale`, `noise_schedule`, and vibe data handling. Improved the setup for reference images and added support for mnemonist dependency in the package manager.
2025-05-03 16:38:04 +09:00
kwaroran
ce24497bad fix v2StopPromptSending 2025-04-14 15:36:59 +09:00
kwaroran
666e1f71b0 refactor: regex caching (#803)
# 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

### Since this PR affects both editRequest mode and editDisplay mode, I
recommend reviewing #812 first for context.

This PR aims to:

1. Fix an issue where the current regex caching is incompatible with
modules.
2. Slightly modify the hashing structure to handle non-deterministic
regex with cbs. Verified that this correctly handles expressions like
`{{#if A}}`.

Thanks for your time.
2025-04-14 14:12:22 +09:00
kwaroran
c7db37664e fix: Lua factory init failure under concurrent display editing (#812)
# 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?
- [x] Have you added type definitions?

# Description
This PR addresses an issue where `luaFactory` fails to initialize
correctly in 'editDisplay' mode under specific conditions.

## Problem Reproduction:
The initialization failure can be reliably reproduced under the
following conditions:
1. Disable all modules.
2. Select any chatbot with 'editDisplay' in trigger lua.
3. Select or make chat with length of 2 or more.
4. Restart app and revisit the chatbot

## Changes:
1. Guaranteed `luaFactory` initialization completes successfully during
concurrent calls.
2. Added `Promise Map` to ensure only one Lua engine instance is created
per mode, preventing redundant initializations.
3. Moved variable updates within mutex scope to prevent potential issues
during concurrent operations.
4.  Resolved merge conflicts with another PR. During the resolution:
* Removed logic related to caching or updating methods for Global Vars.
* **Reasoning:** Since Global Vars are stored directly in the database
and are not chat-specific, I believe caching/updating these methods to
be unnecessary, so I've simply made it calls exported one directly
without frequently re-cache itself.
* **Verification:** Re-validated that this change does not negatively
impact functionality.
* **Note:** Please let me know if anyone has concerns about this
approach to conflict resolution.
2025-04-14 14:12:03 +09:00
kwaroran
947738046c fix: improve error handling in HypaV3 (#808)
# 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
This PR introduces following:
- fix: check empty summarization result in HypaV3
- fix: handle similarity search error in HypaV3
2025-04-14 14:07:25 +09:00
YH_KIM
d11bff3f80 Add support for NAI v4 model configuration and inputs 2025-04-14 04:38:47 +09:00
YH_KIM
834e1b7a2e Merge remote-tracking branch 'origin/main' 2025-04-12 23:34:20 +09:00
YH_KIM
668b8d171c Add support for NovelAI V4 model and configuration settings 2025-04-12 23:29:45 +09:00
bangonicdd
2d50935079 fix: makes more concise by removing one-used var 2025-04-09 18:09:02 +09:00
bangonicdd
dc753adf1f fix: Lua factory init failure under concurrent display editing 2025-04-09 01:45:06 +09:00
Inha Hwang
31a480643b feat: luascript getGlobal(Chat)Var support
setGlobal(Chat)Var needs to be studied too.
2025-04-08 06:01:12 +09:00
Bo26fhmC5M
e8b93dba41 fix: handle similarity search error in HypaV3 2025-04-05 17:01:19 +09:00
Bo26fhmC5M
cf48e56082 fix: check empty summarization result in HypaV3 2025-04-05 16:24:16 +09:00
bangonicdd
2f425b7084 fix: code readability slightly 2025-04-05 05:38:41 +09:00
bangonicdd
20e3e9297d fix: change cache timing after lua trigger 2025-04-05 04:59:46 +09:00
bangonicdd
1867ea473d fix: increase regex cache size 2025-04-03 11:52:50 +09:00
bangonicdd
df4f83eaa7 refactor: regex caching 2025-04-02 14:30:23 +09:00
kwaroran
9e00c9b17a Add gettokens API 2025-03-27 19:21:31 +09:00
kwaroran
58f1cb4fcc Add tokenize trigger 2025-03-27 19:19:59 +09:00
kwaroran
02401d4d09 Add igp prompt 2025-03-27 19:13:10 +09:00
kwaroran
605489143d Add abortsignal to request 2025-03-26 20:43:34 +09:00
kwaroran
50842d5829 Add abort signal handling to request functions 2025-03-24 17:02:42 +09:00
kwaroran
669d677efd Add targ.key 2025-03-24 16:58:24 +09:00
kwaroran
cd9d81e405 Add da fallback 2025-03-24 16:53:39 +09:00
kwaroran
fe88f0ddb7 Add nullish operator to cohere 2025-03-24 16:47:48 +09:00
Kwaroran
6bd0794a4d Add new vertex providers 2025-03-23 16:47:52 +09:00
Kwaroran
1640157801 Fix customurl 2025-03-23 16:42:41 +09:00
Kwaroran
1d40c9aeac Enhance reverse_proxy handling to support custom model parameters 2025-03-23 16:36:46 +09:00
Kwaroran
3535c29c10 Add custommodel 2025-03-23 15:21:31 +09:00
Kwaroran
a717510d07 Fix fallbackmodel 2025-03-23 14:02:34 +09:00
Kwaroran
9ed6d20994 Add array fallback 2025-03-22 21:18:59 +09:00
Kwaroran
e895900376 Merge branch 'main' of https://github.com/kwaroran/RisuAI 2025-03-22 19:09:47 +09:00
kwaroran
ad4f52239b Add OAI response API 2025-03-20 12:08:34 +09:00
kwaroran
fff4ec74af Add preview mode error handling and update build target configuration 2025-03-17 22:32:45 +09:00
kwaroran
859a086b79 Fix budget thinking 2025-03-17 22:15:01 +09:00
kwaroran
15eb4de1ea fix: treating unary minus in calcString (#784)
# 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
It has been reported that calcString incorrectly calculates expressions
when a negative number appears on the right-hand side. This pull request
addresses this issue.
2025-03-17 16:02:22 +09:00
kwaroran
480576bad5 fix: add custom embedding model name as suffix to hypaVector storage keys (#789)
# 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
This PR introduces following:
- Add custom embedding model name as suffix to hypaVector storage keys
when using custom embedding models to prevent vector dimension mismatch
errors.
2025-03-17 15:53:51 +09:00
kwaroran
e3b1f257c9 fix: update plugin docs with abortSignal support (#790)
# 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
This PR introduces following:
- Add setArg function to plugin docs
- Add abortSignal parameter to addProvider function
2025-03-17 15:52:53 +09:00
kwaroran
88c04975fe fix: Chat trigger on start (#788)
# 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
This PR aims to fix the following issues:
1. Fixed an issue where chat array changes caused by the 'start' mode
trigger were not being applied correctly. (This problem occurs in both
block type and Lua type.)
2. Occasionally, there was a problem with scriptstate desync in Lua
triggers, so I've changed to update method on every call.
2025-03-17 15:52:38 +09:00
kwaroran
b6d0fab4b8 Add claudeRetrivalCaching option 2025-03-17 15:27:00 +09:00
kwaroran
bf4f27d0e5 Add seperate models 2025-03-17 14:30:29 +09:00
kwaroran
5c53e16b85 Add preview request data 2025-03-16 19:24:59 +09:00
Bo26fhmC5M
cacad3600e fix: update plugin docs with abortSignal support
- Add setArg function to plugin docs
- Add abortSignal parameter to addProvider function
2025-03-15 01:13:30 +09:00
Bo26fhmC5M
825bcaf63e fix: add custom embedding model name as suffix to hypaVector storage keys
- Add custom embedding model name as suffix to hypaVector storage keys when using custom embedding models to prevent vector dimension mismatch errors.
2025-03-14 23:58:01 +09:00
bangonicdd
6446d4aa07 fix: Chat trigger on start 2025-03-14 15:58:22 +09:00
Kwaroran
480d33a673 Remove debug logging from image processing in requestGoogleCloudVertex function 2025-03-13 20:21:45 +09:00
kwaroran
20087a09b2 Merge branch 'main' of https://github.com/kwaroran/RisuAI 2025-03-13 16:38:41 +09:00
kwaroran
da2ca7099f fix: lua chat functions (#782)
# 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
The community have reported an issue where chat array-related effects
malfunction when using modules using Lua alongside modules using blocks.
It appears that my previous PR, #639, may be the cause of this problem.
This PR included the following changes:

1. Reverted a previous change to allow Lua triggers to cycle correctly
within the trigger pipeline.
2. After that, the issue that the previous PR attempted to fix has
(understandably) resurfaced. To address this, I've taken a different
approach: To prevent a situation where a created Lua mutex would
eternally reference a single chat object if not initialized again, I've
added a chat variable to the `luaEngineState` interface and updated it
on every call.
3. I noticed that the `removeChat` function was included twice in the
Lua bindings. I've removed one. (Or was this intentional?)
4. Modified the `getFullChat` function to also return the creation time
of the chat.

Just in case, I've also attached a link to the bot card with Lua trigger
I used for testing: https://files.catbox.moe/ujqt3o.jpeg
2025-03-13 16:37:32 +09:00
kwaroran
de788bc16c Add fallbacks 2025-03-13 16:36:54 +09:00
kwaroran
7d7cef4a69 Add gemini image response 2025-03-13 14:18:05 +09:00