8c8c8baf8ebabec9d8be91e4fadc322c30778267
# 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.
RisuAI
RisuAI, or Risu for short, is a cross platform AI chatting software / web application with powerful features such as multiple API support, assets in the chat, regex functions and much more.
Screenshots
| Screenshot 1 | Screenshot 2 |
|---|---|
Features
- Multiple API Supports: Supports OAI, Claude, Ooba, OpenRouter... and More!
- Emotion Images: Display the image of the current character, according to his/her expressions!
- Group Chats: Multiple characters in one chat.
- Plugins: Add your features and providers, and simply share.
- Regex Script: Modify model's output by regex, to make a custom GUI and others
- Powerful Translators: Automatically translate the input/output, so you can roleplay without knowing model's language.
- Lorebook: Also known as world infos or memory book, which can make character memorize more.
- Themes: Choose it from 3 themes, Classic, WaifuLike, WaifuCut.
- Powerful Prompting: Change the prompting order easily, Impersonate inside prompts, Use conditions, variables... and more!
- Customizable, Friendly UI: Great Accessibility and mobile friendly
- TTS: Use TTS to make the output text into voice.
- Additonal Assets: Embed your images, audios and videos to bot, and make it display at chat or background!
- And More!
You can get detailed information on https://github.com/kwaroran/RisuAI/wiki (Work in Progress)
Discord
Installation
- RisuAI Website (Recommended)
- Github Releases
Docker Installation
You can also run RisuAI using Docker. This method is particularly useful for web hosting.
-
Clone the repository:
git clone https://github.com/kwaroran/RisuAI.git cd RisuAI -
Build and run the Docker container:
docker-compose up -d -
Access RisuAI at
http://localhost:6001in your web browser.
Description
Languages
TypeScript
58.9%
Svelte
35.1%
JavaScript
4.4%
Rust
0.5%
Lua
0.3%
Other
0.7%