Commit Graph

1050 Commits

Author SHA1 Message Date
Kwaroran
9fc8978d1d Add GeminiBlockOff 2025-01-07 00:05:20 +09:00
Kwaroran
2ec13a4550 Modify some parts of PR 2025-01-06 00:30:33 +09:00
Kwaroran
c0e1311568 Add branches 2025-01-06 00:24:03 +09:00
kwaroran
7d1e9dc9bd feat: add prompt comparison feature (#704)
# 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 **prompt comparison feature** to the prompt preset
interface. Now, users can compare two different prompts to identify
differences.

## How to Use
1. Open the prompt preset window.
2. Click the diff button (next to the copy button) for the first prompt
to use as the baseline. The button will turn green, indicating
selection.
<img width="487" alt="c"
src="https://github.com/user-attachments/assets/c2dcf5fa-c4ee-4b3f-8e52-3f0866b12bc4"
/>

3. Click the diff button for the second prompt to compare against the
baseline. A diff view will appear.
4. Clicking the same diff button twice will clear the selection.

## Diff Display Details
- Line-level comparison
- Modified lines: blue vertical line.
- Deleted content: red text on red background with red vertical line.
- Added content: green text on light green background with green
vertical line.

<img width="597" alt="b"
src="https://github.com/user-attachments/assets/0d026e9e-a7a0-4a17-9b80-a2b57c74d7f9"
/>


- If the prompt content is identical, the following message will be
displayed at the top

<img width="600" alt="a"
src="https://github.com/user-attachments/assets/dd5f36f2-9e96-4279-9f9f-79a17f9e4c89"
/>


## Implementation Details
1. `handleDiffMode` manages prompt selection and clearing.
2. `checkDiff` compares prompts and uses `highlightChanges` to mark
differences.
3. Special characters are escaped with `escapeHtml` to ensure the text
is displayed as-is.
4. `resultHtml` is rendered via `alertMd`.

## Notes
- This feature uses the `jsdiff` library to compare prompts efficiently.
- The comparison includes the role, type1, and type2 fields (e.g., ##
system; plain; main). Even if the prompts' text is identical,
differences in these fields will be treated as a mismatch.
- The rendering process in `alertMd` appears to sanitize potentially
dangerous content. However, additional escaping is applied to ensure
that the text is displayed as-is.
- `botpreset.svelte` grew significantly due to this feature;
modularization was considered but not implemented.
- The reason for using the "Prompt Preset" window instead of the "Prompt
Preview" feature is that "Prompt Preview" displays the final form with
CBS processing applied. Even if the content in "Prompt Preview" appears
identical, the actual prompts can differ significantly.

If this feature, its implementation, or any other issue doesn't fit the
project's vision, feel free to reject this PR! Thank you for reviewing!
2025-01-06 00:10:51 +09:00
Bo26fhmC5M
bb93e04961 fix: replace unsupported Hrkt unicode property to Hira and Kana 2025-01-05 19:32:31 +09:00
poroyo
495163c9cf style: improve readability for added and removed lines with border-left 2025-01-05 16:11:00 +09:00
poroyo
8ba4417065 feat: add prompt comparison feature 2025-01-05 14:20:20 +09: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
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
cd092a5a01 feat: add translation feature and ban character set functionality 2024-12-29 04:03:21 +09:00
Kwaroran
191be6d5c1 feat: add image translation feature and enhance regex list functionality 2024-12-27 15:51:29 +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
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
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
Kwaroran
28d8bfdd22 Fix nativeFetch and comfy 2024-12-25 21:06:52 +09:00
Kwaroran
027a591424 Remove V1 Plugin 2024-12-24 23:14:49 +09:00
Kwaroran
8f667d6394 Add Saving Icon 2024-12-23 17:07:19 +09:00
HyperBlaze
ea2fc1ad26 Merge branch 'kwaroran:main' into main 2024-12-20 23:36:41 -08:00
Kwaroran
e5e01d0688 Fix error handling in gemini and add dataItem hotkey 2024-12-20 18:11:11 +09:00
Kwaroran
b07a9b9d15 Update version to 143.7.1 and add menu sidebar options 2024-12-19 05:34:09 +09:00
Kwaroran
7c7bf16712 Merge branch 'main' of https://github.com/kwaroran/RisuAI 2024-12-18 03:26:30 +09:00
Kwaroran
5df9e68bae Add o1 and fix some mistakes 2024-12-18 03:26:02 +09:00
kwaroran
4baf3f1d90 Suggestion: disabling regex script (#683)
# 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

![image](https://github.com/user-attachments/assets/efcd778e-82d3-4b23-9eba-3b2843709450)

I propose adding a feature to disable regex scripts instead of deleting
them. In this PR, I opted for the approach that minimizes edits to the
original source code, but I believe it’s worth considering alternatives,
such as using a custom flag or a separate toggle. I’d like to gather
your feedback on this approach and make further adjustments if
necessary.
2024-12-17 02:39:03 +09:00
Kwaroran
9bdd354f7c Add asset max difference setting and update related logic 2024-12-16 07:56:15 +09:00
HyperBlaze
cd3294d529 Merge branch 'kwaroran:main' into main 2024-12-15 14:13:02 -08:00
bangonicdd
943e2738d5 suggestion: disabling regex script 2024-12-15 21:09:31 +09:00
Kwaroran
dcc48d5cb3 Add subtitle 2024-12-15 19:33:26 +09:00
Kwaroran
f4b78480f3 Rework realm and several bug fixes 2024-12-14 19:09:28 +09:00
Kwaroran
a984b823a6 Update inlay syntax to support 'inlayed' type and adjust parsing logic 2024-12-13 00:09:13 +09:00
Kwaroran
a8782dbe76 Add statics 2024-12-12 11:45:06 +09:00
Kwaroran
5174082796 Add Gemini related features 2024-12-12 08:38:33 +09:00
LightningHyperBlaze45654
69f44c03c6 Merge remote-tracking branch 'upstream/main' 2024-12-08 20:08:25 -08:00
kwaroran
15778e7c68 Add help tooltip to preset chain input in AdvancedSettings 2024-12-08 22:16:26 +09:00
kwaroran
40ad42ffe9 Add new asset finder and preset chain 2024-12-08 21:25:57 +09:00
kwaroran
ccebb4d665 Roll back couple of things 2024-12-08 18:36:05 +09:00
kwaroran
0c62b8bbfe Add pools 2024-12-08 15:46:54 +09:00
kwaroran
9d8f239250 Refactor tokenizer 2024-12-07 06:24:33 +09:00
kwaroran
03bdca0958 Remove unused Plugin button from ModelList and update model parameters for Gemini Exp 1206; adjust URL generation logic in request functions. 2024-12-07 03:20:45 +09:00
kwaroran
909e9635d2 Merge branch 'main' of https://github.com/kwaroran/RisuAI 2024-12-07 00:58:13 +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
HyperBlaze
2728b9c5f5 Merge branch 'kwaroran:main' into main 2024-12-03 23:28:56 -08:00
Bo26fhmC5M
6c62580ccb Fix issue with autoTranslateCachedOnly option being ignored when sending messages 2024-12-03 22:38:09 +09:00
kwaroran
50d20bcc3f Add custom flags 2024-12-03 21:34:55 +09:00
LightningHyperBlaze45654
46502e762b add: gut updates
are you ready?
I hate school
2024-12-01 22:15:19 -08:00
LightningHyperBlaze45654
2a35b1f4b2 refactor: accidental usage of wrong comment 2024-12-01 13:06:33 -08:00
LightningHyperBlaze45654
60d4e33893 feat: add validation
Also revoked potentially problematic feature(add hypav2data chunk)
TODO:
1. On mid-context editing, currently that is not considered as deletion. Do have optional editedChatIndex to latter dive in more.
2. re-roll mainChunks(re-summarization) functionalities added, but not able to access it.
2024-12-01 13:00:00 -08:00
kwaroran
18ea5aff4e Add notification feature with permission handling and UI toggle 2024-12-02 04:42:13 +09:00