Commit Graph

846 Commits

Author SHA1 Message Date
LightningHyperBlaze45654
69f44c03c6 Merge remote-tracking branch 'upstream/main' 2024-12-08 20:08:25 -08:00
LightningHyperBlaze45654
0c51e898f9 fix: bug resolved 2024-12-08 17:24:46 -08:00
LightningHyperBlaze45654
d94581a067 add: unknown bug logging 2024-12-08 10:37:38 -08:00
kwaroran
71ef6099a8 Refactor preset chain name parsing to split by commas and trim whitespace 2024-12-08 22:21:59 +09:00
kwaroran
6d64acb9a9 Improve random selection logic for preset chain names 2024-12-08 22:14:53 +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
8c8c8baf8e Fix Gemini Image Input Functionality (#678)
# PR Checklist
- [ ] 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?
- [x] Did you added a type def?

# Description
This PR fixes the image input functionality for the Gemini model.

### Issue with Existing Code
The previous implementation attempted to process images in the following
way:
1. In the `OpenAIChat` type, if the `memo` field started with
`inlayImage`, the `content` field's value was copied into a variable
called `pendingImage`.
2. Later, if the `chat` role was `'user'` and `pendingImage` was not an
empty string, the code processed the image.

However, it does not seem to work as expected in the current state.

### Update
I updated the image input handling to align with the method used in
RisuAI for handling GPT’s image input. Specifically, the changes
include:

1. In `image.ts`, I explicitly specified the `gemini-exp` model.
2. If the `chat` object has a `multimodals` field and the `role` is
`user`:
- I created an array called `geminiParts` to store `GeminiPart` objects.
- The `chat.content` value is set as the `text` field of the
`GeminiPart` object in the array.
- I then iterated over `chat.multimodals` and created an object for each
`image` type, formatting it to match the Gemini structure, and added it
to the `geminiParts` array.
- After the iteration, the `geminiParts` array is assigned to the
`parts` field of `reformatedChat`.


### Notes
- I removed the previous non-functional code entirely. If this causes
any inconvenience or violates any conventions, I sincerely apologize.
- As the final name of the next-generation Gemini model is currently
unknown, I restricted the functionality to the **gemini-exp** model in
the `image.ts` file for now. This can be updated later when the official
name is confirmed.

The Gemini model is currently very widely used, so I kindly request you
to review the updated code. If you have any feedback or if the changes
are not acceptable, I completely understand if this PR is rejected.

Thank you for your time and consideration! Let me know if there's
anything I can improve or clarify.
2024-12-08 15:49:10 +09:00
kwaroran
0c62b8bbfe Add pools 2024-12-08 15:46:54 +09:00
poroyo
9a1b22eae5 Fix code indentation 2024-12-08 05:28:57 +09:00
poroyo
697201bbb6 Remove unused variable 'pendingImage' 2024-12-08 05:16:13 +09:00
poroyo
94bb79df7e Fix Gemini image input issue 2024-12-08 05:04:06 +09:00
HyperBlaze
3d3e4dd6a1 refactor: logging changes
not so much but just in case:
2024-12-06 20:20:39 -08:00
HyperBlaze
c45eed40af fix: currentChat not being updated 2024-12-06 11:24:45 -08: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
HyperBlaze
f652400a1b Merge branch 'main' of https://github.com/LightningHyperBlaze45654/RisuAI 2024-12-06 09:35:50 -08:00
LightningHyperBlaze45654
56646809a1 add logging 2024-12-06 08:49:00 -08: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
LightningHyperBlaze45654
e4e63dc237 force pushing desktop updates
add log soon
2024-12-05 16:09:06 -08:00
HyperBlaze
b283b4a126 fix: index issues
forgot to commit on my pc, so doing it on laptop
2024-12-05 12:21:58 -08:00
HyperBlaze
ea6d7dada1 bugfix/deleted feature restored
Resolved bug when entire chat context is deleted and hypaV2Data becomes empty, throwing a undefined index error. Also changed it to typescript index.

Hopefully resolved issue where same chat is summarized over and over again by adding another field to mainChunks.
2024-12-04 22:10:16 -08:00
HyperBlaze
2728b9c5f5 Merge branch 'kwaroran:main' into main 2024-12-03 23:28:56 -08:00
LightningHyperBlaze45654
b8bb2330cc feat: validate hypav2 data
# Changelist:
## 1. Types
### MainChunks
Added id(int), and chatMemos(Set<string>)
Id: incremental int starting from 0
chatMemos: A set of UUID, containing which chat has been summarized in it.
### Chunks
mainChunkID: A connection of which mainChunk it has been split from
text: the split text data

## 2. Features
### CleanInvalidChunks
Called every time when chat is updated and Hypamemory is used.

Gets all the memo(UUID)s of current chats, and creates a set.
Then checks if each mainChunk's chatMemos set is subset of the enitre memo set. If not, the summarized part's chat is deleted/edited. The mainChunk is filtered out.
Concurrently, the chunks that are split from that mainChunk is also deleted.
2024-12-03 23:28:18 -08:00
Bo26fhmC5M
ecc2817a7b Add memo to detect supaMemory model requests in the plugin 2024-12-04 13:46:35 +09:00
Bo26fhmC5M
dbd7485c50 Fix hypav2 issue where the 'search_document: ' string is not truncated correctly. 2024-12-03 22:12:53 +09:00
LightningHyperBlaze45654
46502e762b add: gut updates
are you ready?
I hate school
2024-12-01 22:15:19 -08:00
LightningHyperBlaze45654
4ea365a141 refactor: logging 2024-12-01 19:31:23 -08:00
LightningHyperBlaze45654
83b79fa48d fix: chunks not being filtered correctly
need to check if chat.memo is actually a unique uuid4/uuid5 or else it will be broken
2024-12-01 17:40:21 -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
HyperBlaze
835664a7aa Merge branch 'kwaroran:main' into main 2024-12-01 05:35:23 -08:00
kwaroran
8a6cfedcda Add ChatML and Rework display 2024-12-01 17:05:50 +09:00
LightningHyperBlaze45654
68f816bda9 Merge branch 'main' of https://github.com/LightningHyperBlaze45654/RisuAI 2024-11-29 20:33:11 -08:00
Kwaroran
c22cde2c8a Fix systemContentReplacement empty string 2024-11-27 18:00:40 +09:00
Kwaroran
1e96eada22 Handle optional system content replacement in reformater function 2024-11-27 11:10:15 +09:00
Kwaroran
8366acc66c Add abort signal handling to requestGoogleCloudVertex function 2024-11-27 08:04:33 +09:00
Kwaroran
68113cc383 Add system prompt handling to requestGoogleCloudVertex function 2024-11-27 08:03:17 +09:00
Kwaroran
981ec3921e Add plenty of features 2024-11-27 06:01:42 +09:00
Kwaroran
597c8879fc Add systemContentReplacement and Flags 2024-11-27 04:33:12 +09:00
kwaroran
cc8d753dc8 Rework custom API 2024-11-25 23:04:32 +09:00
kwaroran
8274fae180 Refactor model handling 2024-11-25 05:25:58 +09:00
kwaroran
6214388cc6 Add new model options for Mistral Large 2411 and Gemini Exp 1121 and Flash 002, fixes #666 2024-11-22 21:52:39 +09:00
kwaroran
ec03903372 Add OAI prediction 2024-11-21 15:44:14 +09:00
kwaroran
e895008814 Add 4o 1120 2024-11-21 15:38:04 +09:00
kwaroran
ebbb9d9191 Add specific token ban 2024-11-18 20:08:34 +09:00
kwaroran
c2b5177c92 Improve welcome page and add gemini exp 2024-11-17 23:03:22 +09:00
kwaroran
bea14f22c1 Add JSON schema for Claude 2024-11-15 12:44:50 +09:00
kwaroran
4627aacbf9 Refactor script caching functions to include mode parameter and improve background HTML parsing 2024-11-12 21:50:40 +09:00
heshiqi
3bbb2ace7d Fix AWS Support
AWS Claude model calling no longer support direct calling, but support Cross-region inference instead. All Cross-region inference model profile IDs equal to original model name with "us." in the beginning.
Reference: https://us-east-1.console.aws.amazon.com/bedrock/home?region=us-east-1#/inference-profiles
2024-11-08 14:18:37 +08:00