teceash1 / taurus Goto Github PK
View Code? Open in Web Editor NEWAn AI Discord Bot leveraging Googles Gemini 1.5 Model & Prodia!
License: GNU General Public License v3.0
An AI Discord Bot leveraging Googles Gemini 1.5 Model & Prodia!
License: GNU General Public License v3.0
I am not able to use any slash commands (also is my console normal or do i have to rebuild as instructed?)
for me to get slash commands
running startbot.bat
I added my own commands to the bot to make the /image command premium users only included /addpremium, /removepremium, /gencode, /redeem. But whenever i run them it throws an error
Run as normal
start.bat
The bot is replying when the user replies to another user
It should only reply when the user replies to the bot.
Reply to another user
To fix this we can add a check in the Taurus events file in the message.reference() statement to check if the message the user replies to is the bot or not. The issue is that this is being done in the utils file so is not returning out of the statement before.
AI
Users should have the option to fine tune/parse in their own model ID.
They should be able to fine tune the model in Google AI Studio and use it in the bot. Or potentially fine tune directly from the bot using the REST API.
AI
API's:
https://mrfakename-melotts.hf.space/ | TTS
https://surn-unlimitedmusicgen.hf.space/ | Music Gen
https://bytedance-animatediff-lightning.hf.space/ | Video Gen
Information
At the moment all of the values are managed in config.json
and are not able to be updated live with the bot. To resolve this we can store files in a settings.sqlite
file in /utils
using quick db.
The settings
panel can house different options to customise settings as seen below:
(The donation system along with safety enabling/disabling has not been implemented)
π΄ Failing
π’ Success
Loading
Webhooks - A request would be sent to see if it contains: {"message": "Invalid Webhook Token", "code": 50027}
or not
Gemini - A request would be sent to the listmodels
endpoint to check if its working
Prodia - A request would be sent to the listloras
endpoint to check if its working
NSFW Image Restrictions - Boolean (True/False) checking
Gemini Safety Restrictions - Boolean (True/False) checking
The settings embed will have a set of action rows below, for each category, with buttons. These buttons would only appear once checking has been completed. For non-boolean value settings, an accessible modal will open up, allowing the user to edit the setting.
After they have submitted the new value it will be checked, if it is valid the settings embed will update with π’, and the database will be updated. If it is invalid the embed will remain the same, along with the database.
The implementation of this would make the config.json
file only dedicated to the:
This command would be emepheral and only accessible to the userIDs of the Owners array.
This update should also bring a modification to the button handler to allow multiple ids to be specified by separating them with a comma
AI
Allow support for images/files to be passed to model along with text.
This is possible because of Googles Gemini Pro 1.5 Model
Discord supports all of the mime types and fetching them for images. It is specified under content in attachments in the message object. Some mime types are different between Gemini and Discord so a converter will need to be made.
This update should add support to unlock all of Gemini 1.5s Multimodal capabilities:
At the moment the bot cannot great the user as they donβt have the correct ID so the mention blocker kicks in.
I expected it to ping the user with a greeting successfully.
Open up the context menu command and try reply to another user. The bot will not be able to greet that user.
This should be resolved by giving the bot both the user and interaction user id. Or just the user id.
At the moment most of the TaurusAI commands contain similar code, this code is mostly duplicated versions of each other.
A utils.js file should be added and the code should be put in there and exported as async functions which can be reused in the other files.
This can also be applied for the image files (such as fetching the models)
AI
Taurus/functions/other/utils.js
Lines 16 to 33 in e8cb489
There should be an option in /settings
that allows the user to disable the default safety settings, hence setting all of them to BLOCK_NONE
. (Obviously the core model safety features set by Google will still apply)
AI
There should be an optional parameter added to the /image
command that allows the user to upscale the image by 2 or 4 times. It should be optional.
Prodia supports this, the relevant docs are here
The ability to select the upscaling model should maybe be an option, however, it is also likely that it will cause confusion, so could be best not to include it.
Currently a channelID and serverID is required to log the personality when it is changed.
This should be changed to work with a webhook instead if possible.
At the moment the restart script pulls from Github, however, if there are any package changes to go with the code it can cause fatal errors.
This should be resolved by running pnpm i
every time the bot is restarted via the cli
Currently, the Taurus context menu command does not give the bot info on the past reply threads history.
Whilst context menu commands don't have the message.reference()
value to retrieve the initial users' message as normal. The information from the original embed that the bot sends in response to the context command could be retrieved and passed into history.
If past message has embed containing reply to user... split where the \n new line character is and get the rest of the content
The utils file is currently in the main directory
It should be moved to the /functions
folder for ease of use and centrality.
Only developers/owners can currently change the bots personality via the /personality
command.
There should be a global personality and a per-server personality. The server owner should be able to change the per-server personality, and the bot developers/owners should be able to change the global personality. The per-server personality should be secondary to the global one, or maybe overwrite it.
There should be an option to disable per-server personalities and block specific serverIDs so owners from there cannot change the personality in case.
Database structure:
database/
default_personality.txt
users/
[USERID].txt // Example user files
[USERID2].txt // (content specific to each user)
servers/
[SERVERID1].txt // Example server files
[SERVERID2].txt // (content specific to each server)
Only SD models are supported
Add SDXL models for more advanced image generation options
The loading timer/dots do not work as intended.
They should load whilst the model is loading the response
Chat with Taurus.
To resolve this issue we can add a new interval loader in the 'utils.js' file in the handleResponse()
function instead of making an interval before.
Information
Monitor if the personality file path is changed using the fs.watch() function and log it like it would be if the /personality
command was used.
The watch function may just replace the current feature where only if the file is updated via the /personality
command it will be logged.
The /image
command currently checks for a specific string, doesn't provide any set preview options. This makes it difficult for users.
It should be modified to use discords autocomplete feature to provide a curated set of options based on the models provided by prodia.
At the moment it the token limit is reached the user just receives an error embed saying it.
There should be a countdown section in that embed, and every 5 seconds the bot should resend the users request, once a request is given the bot should reply as usual.
This fix is related to the error caused by the TensorFlow.js library
On some systems you may face this issue, I believe this is a bug in the TensorFlow library, on other systems it is fine. If you encounter the issue please fix it by doing the following:
Move D:\TFJS\node_modules\@tensorflow\tfjs-node\deps\lib\tensorflow.dll
to D:\TFJS\node_modules\@tensorflow\tfjs-node\lib\napi-v8\
Example Error:
node: internal/modules/cjs/loader:1464
at require (node:internal/modules/helpers:179:18)
at Object.<anonymous> (C:\\Users\\Administrator\\Downloads\\Taurus\\node_modules\\.pnpm\\@tensorflow+tfjs-node @4.19.0 [email protected]\\node_modules\\@tensorflow\\tfjs-node\\dist\\index.js:72:16)
}
at Module._compile (node:internal/modules/cjs/loader: 1368:14)
at Module._extensions..js (node:internal/modules/cjs/loader: 1426:10)
at Module.load (node:internal/modules/cjs/loader: 1205:32)
at Module._load (node:internal/modules/cjs/loader:1021:12) {
code: 'ERR_DLOPEN_FAILED'
}
If you know of a different fix, I would appreciate it if you would please file a new issue and let me know!
If a link is embedded and the user replies to the bots response it will not reply back.
No response
Ask the bot for a link with an embed, wait for it to embed and try reply.
This is because of a feature in the utils.js
file
Information
The bot should have proper docker support, to come with this the config.json
file should be migrated to a .env
file. Like in the docker branch.
This updated version should come with a end to end tutorial on how to setup the bot for free on Google Cloud Run
Commands are not shown when the bot is added to the server, they are only shown if it is added to a users account.
Expected slash commands to show up for the server, regardless of if the user has added it to their account or not.
Deauthorise the app from your discord account.
No response
The current feature makes it so that the /help
command shows the names of the commands emboldened
This should be improved with clickable commands using this
Mentioning format: </CMD_NAME:CMD_ID>
The bot is breaking if the user sends a message, the bot replies, then deletes their original message and asks for a response from the bot. Further error handling should be put in place to stop this.
I expected the bot to produce an embed error or work as intended
When using user commands in different servers (above 25 people) the bot produces an error every time.
All commands to work as expected, however as a note this is in BETA at the moment.
Run any command in a different server where the bot is not present
The interaction object is now unable to be directly logged in the console for some reason.
Context commands could not be fixed for guilds as Discord does not support the retrieval of the previous message in those circumstances.
GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-pro-latest:generateContent: [400 Bad Request] Invalid value at 'system_instruction' (type.googleapis.com/google.ai.generativelanguage.v1beta.Content), "You are Sarah!
Please greet the user with a greeting and then their name which is: <@986498137168441364> and limit your responses to 2000 characters or less. The user's status/presence is currently:
mobile: online" [{"@type":"type.googleapis.com/google.rpc.BadRequest","fieldViolations":[{"field":"system_instruction","description":"Invalid value at 'system_instruction' (type.googleapis.com/google.ai.generativelanguage.v1beta.Content), "You are Sarah!\n Please greet the user with a greeting and then their name which is: <@986498137168441364> and limit your responses to 2000 characters or less. The user's status/presence is currently:\nmobile: online""}]}]
work normally
bot.js
Information
I would like to suggest you add command to play music from all platforms like spotify youtube soundcloud etc
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.