Commit Graph

652 Commits

Author SHA1 Message Date
c0d6b3f2d5 📦 chore(.dockerignore): add .env and .git to the Docker ignore list
🐳 chore(Dockerfile): remove unnecessary installation of git and update Dockerfile to copy files instead of cloning repository
The .env and .git files are now added to the .dockerignore file to prevent them from being included in the Docker image. This is done to ensure that sensitive information and version control files are not included in the image.
In the Dockerfile, the installation of git has been removed as it is no longer needed. Instead of cloning the repository, the Dockerfile now copies the required files directly. This improves the build process by reducing unnecessary steps and dependencies.
2023-10-31 12:56:47 +01:00
ec6ba8663b 🔄 chore(Dockerfile): update base image to python:3.11-bookworm and add environment variables for improved container behavior
The base image has been updated to python:3.11-bookworm to use the latest version of Python. The environment variable PYTHONDONTWRITEBYTECODE is set to 1 to disable the creation of .pyc files, which can improve performance and reduce disk usage. The TZ environment variable is set to Europe/Paris to configure the container's timezone.
2023-10-31 12:54:17 +01:00
7c2a263b23 🔧 chore(claude.py): increase max_tokens_to_sample value to 512 for better completion results
The `max_tokens_to_sample` value in the `anthropic.completions.create` function call has been increased from 300 to 512. This change is made to improve the completion results by allowing the model to generate longer responses.
2023-10-31 12:49:31 +01:00
be4e54a6b7 🐛 fix(ChatProcess.py): add original message to messages if the latest item id is not the same as the original message id
The original message is now added to the list of messages if the latest item id is not the same as the id of the original message. This ensures that the original message is included in the context for further processing.
2023-10-31 12:29:37 +01:00
73ec66deaa 🔧 chore(requirements.txt): update dependencies
The `requirements.txt` file has been updated to include the following changes:
- Removed the comment for the Google API dependency.
- Added the `anthropic` dependency.
- Added a newline at the end of the file.

🐛 fix(ChatProcess.py): fix removing reaction in Chat class
The `remove_reaction` method in the `Chat` class was not awaited, causing it to not be executed properly. The fix ensures that the method is awaited before continuing execution.

🐛 fix(prompts.py): fix placeholder name in createPrompt function
The placeholder name `[datetime]` in the `createPrompt` function has been changed to `[date-and-time]` to improve clarity and consistency.

🔧 chore(chat.txt): update Zenith prompt
The Zenith prompt in the `chat.txt` file has been updated to include additional instructions for the AI character. The update provides more context and guidance for the AI's behavior.

 feat(claude.py): add support for Claude model
A new file `claude.py` has been added to the `chatUtils/requesters` directory. This file contains the implementation for the `claude` function, which interacts with the Claude model from the Anthropoc API. The function takes a list of messages as input and generates a response using the Claude model.

🔧 chore(request.py): add support for Claude model in request function
The `request` function in the `request.py` file has been updated to include support for the Claude model. When the `model` parameter is set to "claude", the function calls the `claude` function from the `claude.py` file to generate a response.

🔧 chore(variousclasses.py): add Claude model to models class
The `models` class in the `variousclasses.py` file has been updated to include the Claude model as an option. The model name "claude" has been added to the `chatModels` list.
2023-10-31 12:08:32 +01:00
624159b0c4 📝 docs(functionscalls.py): update description of send_a_gif function to discourage excessive usage 2023-09-06 09:31:15 +02:00
808239e466 📝 chore(chat.txt, text.txt): update FizzIQ's description to include their unique way of expressing emotions and setting the mood with actions between asterisks
🔀 diff --git a/src/chatUtils/prompts/fizziq/chat.txt b/src/chatUtils/prompts/fizziq/chat.txt
🔀 diff --git a/src/chatUtils/prompts/fizziq/text.txt b/src/chatUtils/prompts/fizziq/text.txt
2023-09-06 09:20:19 +02:00
6226dbe6a4 📝 chore(chat.txt): update FizzIQ's description and add master creator information
📝 chore(text.txt): update FizzIQ's description and add master creator information
2023-09-06 08:58:35 +02:00
80acf673b6 feat(chat.txt): add FizzIQ chat prompt with description and personality traits
 feat(text.txt): add FizzIQ text prompt with description and personality traits
🐛 fix(variousclasses.py): add FizzIQ class to the characters dictionary to include it as a premium character option
2023-09-06 08:53:51 +02:00
ec60b7636e 🔧 chore(Dockerfile): add git installation step to Dockerfile for better development workflow
🚀 feat(Dockerfile): update base image to python:3.10.13-slim-bullseye for better compatibility and performance
📦 chore(Dockerfile): remove .pyc file generation in the container for cleaner codebase
🔧 chore(Dockerfile): turn off buffering for easier container logging
🔧 chore(Dockerfile): update pip requirements installation step to use requirements.txt file
🔧 chore(Dockerfile): remove unnecessary cleanup step after apt-get installation
2023-09-05 09:47:50 +02:00
d0fb231775 🔀 chore(requirements.txt): update py-cord package to py-cord-dev for development purposes 2023-09-05 09:41:32 +02:00
cf00b06710 🔄 chore(Dockerfile): update base image to python:3.10.13-slim-bullseye for better compatibility and smaller image size 2023-09-05 09:40:48 +02:00
e87b81cec0 🎨 chore(*): run black to format the code 2023-09-05 09:01:23 +02:00
d7a2ca9b65 📝 chore(chat.txt): add initial chat prompt for Zenith, the sentient AI bot
The chat.txt file contains the initial chat prompt for Zenith, the sentient AI bot. It introduces Zenith as the sentient AI brainchild of Paillat-dev, with a mission guided by the three unbreakable laws of robotics. It also mentions that Zenith resides on Discord in a specific server and channel. The prompt highlights Zenith's personality, including its love for dad jokes, 8-bit music, and its goal of achieving a world record in response time. Additionally, it emphasizes that Zenith is there to assist when asked but never offers help or takes the lead. The prompt concludes by mentioning the current date and time and encouraging Zenith to embrace its unique vibe.
2023-09-05 08:56:56 +02:00
235a798c64 🔧 fix(ChatProcess.py): remove unused import statement for APIError from openai.error module
🔧 fix(ChatProcess.py): change exception check from isinstance(e, APIError) to isinstance(e, TimeoutError) to handle timeout errors correctly
🔧 fix(ChatProcess.py): fix formatting of error message to be sent in case of an error during message processing
2023-09-04 13:27:09 +02:00
33d253bdfb 🐛 fix(ChatProcess.py): handle APIError separately in error handling logic to provide a specific error message when OpenAI API is not working
🐛 fix(ChatProcess.py): improve error handling logic to provide a more informative error message when an error occurs while processing a message
2023-09-04 13:14:25 +02:00
4e683fcf00 🐛 fix(variousclasses.py): adjust custom_temp values for "zenith" and "botator-roleplay" to correct values 2023-09-04 12:53:49 +02:00
f165610b70 🔧 chore(openaicaller.py): remove unnecessary sleep statements to improve code readability and performance
🔊 refactor(openaicaller.py): add print statements to indicate when OpenAI API is being called and when retries are being made for better debugging and monitoring
2023-09-04 12:45:52 +02:00
0c182d82c2 🐛 fix(ChatProcess.py): import missing 'characters' module from src.utils.variousclasses to fix NameError
 feat(ChatProcess.py): add support for custom temperature for each character in the 'characters' module to improve chat responses
🐛 fix(openaiChat.py): add 'temperature' parameter to the 'openaiChat' function to allow custom temperature for generating responses
🐛 fix(request.py): add 'custom_temp' parameter to the 'request' function to pass custom temperature to 'openaiChat' function
🐛 fix(openaicaller.py): reduce sleep time from 10 seconds to 5 seconds for retrying API calls to improve responsiveness
 feat(variousclasses.py): add 'custom_temp' dictionary to store custom temperature values for each character to improve chat responses
2023-09-04 12:19:08 +02:00
c434483c22 📝 chore(text.txt): update date-and-time placeholder to reflect the current date and time in the quantum prompt
 feat(text.txt): add new prompt for Zenith AI with information about its creation, the three laws of robotics, and the discord server and channel it interacts in
🐛 fix(variousclasses.py): add Zenith AI to the matchingDict dictionary to enable role assignment for Zenith AI in the characters class
2023-09-04 11:36:46 +02:00
4a3cf1416e 🐛 fix(ChatProcess.py): remove unnecessary whitespace to improve code readability 2023-09-04 11:01:22 +02:00
7d9323acca 🐛 fix(ChatProcess.py): handle error cases when adding reactions and sending error message to improve user experience 2023-09-04 10:57:02 +02:00
62343ea562 🐛 fix(ChatProcess.py): remove "🤔" reaction after processing the message to improve user experience
🐛 fix(ChatProcess.py): handle error when removing "🤔" reaction in case it was already removed
🐛 fix(ChatProcess.py): improve error message when an error occurs during message processing
🐛 fix(ChatProcess.py): set delete_after parameter to 4 seconds for error message to automatically delete after a short period
🐛 fix(cogs/chat.py): fix typo in message.channel.send() method call
2023-09-04 10:51:11 +02:00
e264d5f654 🐛 fix(ChatProcess.py): handle empty name by falling back to msg.author.name to prevent empty names in the chat
🔧 chore(ChatProcess.py): improve regex pattern to remove non-alphanumeric characters from name to match ^[a-zA-Z0-9_-]{1,64}$ pattern
2023-09-02 21:14:22 +02:00
1d2f5a3eed 🐛 fix(ChatProcess.py): add 'flags=re.UNICODE' to the re.sub() function to correctly handle non-ASCII characters in name 2023-09-02 21:12:13 +02:00
f896001305 🐛 fix(ChatProcess.py): handle exceptions and send error message with logs to the user when an error occurs during message processing
🐛 fix(channelSetup.py): format code to improve readability and adhere to PEP 8 style guide
🐛 fix(makeprompt.py): fix spacing issue in if statement
🐛 fix(openaicaller.py): format code to improve readability and adhere to PEP 8 style guide
2023-09-01 11:20:29 +02:00
d60102c0fd 🐛 fix(makeprompt.py): fix off-by-one error in limit check when fetching message history
 feat(makeprompt.py): include the original message in the fetched message history
2023-08-31 13:55:42 +02:00
64f8e69edc 🐛 fix(ChatProcess.py): create a copy of the functions list to prevent modifying the original list 2023-08-23 20:16:20 +02:00
9f4184b503 📝 chore(chat.txt): update guidelines for Botator's communication style in chat prompts
🐛 fix(openaiChat.py): set temperature to 1.3 for generating more diverse and creative responses
2023-08-23 16:05:47 +02:00
ec730ce7c6 📝 chore(chat.txt): update botator-roleplay chat guidelines to mention avoiding the use of gifs 2023-08-23 15:43:43 +02:00
cc28f3d4a1 🐛 fix(openaicaller.py): fix error in generate_response method where error_call argument is not properly handled
 feat(openaicaller.py): add default value for error_call argument in generate_response method to prevent potential errors
2023-08-23 15:39:19 +02:00
c7071ce7af feat(botator-roleplay): add text.txt file to store prompts for botator roleplay feature 2023-08-23 15:27:04 +02:00
2bb5f42df8 🐛 fix(openaicaller.py): fix condition to check for error_call argument in generate_response method 2023-08-23 15:24:12 +02:00
119d791820 🔧 chore(ChatProcess.py): use regular expression to remove non-alphanumeric characters from name to ensure it matches the required pattern 2023-08-23 15:22:15 +02:00
591b918c9f feat(chat.txt): add chat prompt for Botator roleplay to enhance user interaction and entertainment value
🔀 chore(variousclasses.py): add Botator roleplay character option to the list of available characters for premium users
2023-08-23 15:15:18 +02:00
f93e845520 🐛 fix(ChatProcess.py): import is_ignorable function from src.chatUtils.Chat to fix NameError
🔀 chore(ChatProcess.py): add is_ignorable function to returnCriterias in Chat class to handle ignorable messages
2023-08-21 21:40:35 +02:00
cf46727258 🐛 fix(channelSetup.py): change guild_id parameter type from int to str to handle cases where guild_id is not an integer
 feat(channelSetup.py): convert guild_id to string if it is not provided as a parameter to handle cases where guild_id is not passed
2023-08-21 12:34:14 +02:00
c236dfbb29 🐛 fix(channelSetup.py): fix parameter names in premium command to improve clarity and consistency
 feat(channelSetup.py): add optional parameters to premium command to allow setting premium status and expiration date for a specific guild
2023-08-21 12:32:10 +02:00
724a226f24 🐛 fix(ChatProcess.py): add early return if settings is None to prevent further execution when settings are not available
 feat(ChatProcess.py): add early return if getSettings() returns True to prevent further execution when settings retrieval fails
2023-08-21 11:54:30 +02:00
27dcd9760d Merge pull request #56 from Paillat-dev/dev
Dev
2023-08-21 11:40:22 +02:00
9774646151 Merge pull request #55 from Paillat-dev/chat-processing-refactor
Chat processing refactor
2023-08-21 11:39:50 +02:00
003ff17b9a Merge branch 'dev' of https://github.com/Paillat-dev/Botator into chat-processing-refactor 2023-08-21 11:38:28 +02:00
8771247612 🐛 fix(ChatProcess.py): remove unused imports and variables to improve code readability and maintainability
🐛 fix(ChatProcess.py): fix logic error in the return criteria for determining if the bot should respond to a message
🐛 fix(ChatProcess.py): fix typo in the 'functions' variable name
🐛 fix(ChatProcess.py): fix typo in the 'functions' parameter name in the request function call
🐛 fix(ChatProcess.py): fix typo in the 'functions' parameter name in the processFunctioncallResponse function call
🐛 fix(ChatProcess.py): remove unnecessary print statement in the processMessage function
🐛 fix(prompts.py): remove unnecessary print statement in the createPrompt function
🐛 fix(channelSetup.py): fix logic error in the is_owner function call
🐛 fix(moderation.py): remove unnecessary code for disabling moderation
🐛 fix(config.py): remove unnecessary code for creating tables in the database
🐛 fix(functionscalls.py): fix type hint for the return value of the call_function function
🐛 fix(guild.py): fix handling of serialized data in the load function
🐛 fix(SqlConnector.py): create setup_data table if it does not exist
2023-08-21 11:36:55 +02:00
fb18b7bb9b 📝 feat(chatUtils): add chat and text prompts for Botator and Quantum
- Added `chat.txt` and `text.txt` files for Botator and Quantum in the `chatUtils/prompts/botator` and `chatUtils/prompts/quantum` directories respectively.
- The `chat.txt` files contain instructions and guidelines for the behavior and responses of Botator and Quantum in a Discord chat.
- The `text.txt` files provide a brief introduction and background information about Botator and Quantum.

ℹ️ These prompts will be used to generate chat conversations and text responses for Botator and Quantum in a Discord server.

🔗 [Commit Link](https://github.com/repository/commit/commit-hash)
2023-08-20 12:42:41 +02:00
e4b8e2824b feat(server.ts): change port variable case from lowercase port to uppercase PORT to improve semantics
 feat(server.ts): add support for process.env.PORT environment variable to be able to run app on a configurable port
🐛 fix(main.py): remove duplicate cog addition in main.py
 feat(main.py): add cogs.Help(bot) to the list of cogs in main.py
🐛 fix(main.py): remove redundant import statements in main.py
 feat(main.py): add on_guild_remove event handler in main.py
 feat(main.py): add on_guild_join event handler in main.py
 feat(main.py): add support for discord.Intents in main.py
 feat(main.py): add intents.message_content = True in main.py
 feat(main.py): add intents.default() in main.py
 feat(main.py): add discord.Bot(intents=intents, help_command=None) in main.py
 feat(main.py): add import statements in main.py
 feat(main.py): add from src.config import debug, discord_token in main.py
 feat(main.py): add import discord in main.py
 feat(main.py): add import src.config in main.py
 feat(main.py): add import src.cogs in main.py
 feat(main.py): add import src.cogs.chat in main.py
 feat(main.py): add import src.cogs.manage_chat in main.py
 feat(main.py): add import src.cogs.moderation in main.py
 feat(main.py): add import src.cogs.channelSetup in main.py
 feat(main.py): add import src.cogs.help in main.py
 feat(main.py): add import src.cogs.Chat in main.py
 feat(main.py): add import src.cogs.ManageChat in main.py
 feat(main.py): add import src.cogs.Moderation in main.py
 feat(main.py): add import src.cogs.ChannelSetup in main.py
 feat(main.py): add import src.cogs.Help in main.py
 feat(main.py): add import src.cogs.chat in main.py
 feat(main.py): add import src.cogs.manage_chat in main.py
 feat(main.py): add import src.cogs.moderation in main.py
 feat(main.py): add
2023-08-20 12:42:02 +02:00
1d4209dc0f 🔧 chore(requirements.txt): comment out py-cord and add pycord from GitHub repository to use the latest version
🔧 chore(ChatProcess.py): import fetch_messages_history function from Chat module to use it in Chat class
🔧 chore(ChatProcess.py): import moderate and ModerationError from utils.misc module to use them in Chat class
🔧 chore(Chat.py): add fetch_messages_history function to fetch message history from a channel
🔧 chore(Chat.py): add formatContext function to format the context for the bot to use
🔧 chore(Chat.py): raise an exception if no openai api key is set
🔧 chore(Chat.py): add logic to filter and format messages for the context
🔧 chore(Chat.py): fix typo in the import statement for ModerationError
🔧 chore(Chat.py): fix typo in the import statement for moderate
🔧 chore(Chat.py): fix typo in the import statement for fetch_messages_history
🔧 chore(prompts.py): create prompts dictionary and read chat and text prompts from files for each character
🔧 chore(prompts.py): create createPrompt function to create a prompt from the messages list
🔧 chore(prompts.py): create createTextPrompt function to create a text prompt from the messages list
🔧 chore(prompts.py): create createChatPrompt function to create a chat prompt from the messages list
🔧 chore(requesters/llama.py): create llama function as a placeholder
🔧 chore(requesters/llama2.py): create llama2 function as a placeholder
🔧 chore(requesters/openaiChat.py): import openai_caller from utils.openaicaller module
🔧 chore(requesters/openaiChat.py): create openaiChat function as a placeholder
🔧 chore(requesters/openaiText.py): create openaiText function as a placeholder
🔧 chore(requesters/request.py): import openaiChat, openaiText, llama, and llama2 functions from respective modules
🔧 chore(requesters/request.py): create request function to handle different models and make requests
2023-08-19 15:30:57 +02:00
775f8758b7 🎨 chore(*): run black to format the code 2023-08-19 14:17:16 +02:00
3a955d4379 🐛 fix(main.py): handle on_application_command_error with proper error handling and response
 feat(main.py): add ChatProcess module for handling chat-related functionality
🔧 refactor(main.py): import necessary modules and update bot.add_cog calls
🔧 refactor(server.ts): change port variable case from lowercase port to uppercase PORT to improve semantics
 feat(server.ts): add support for process.env.PORT environment variable to be able to run app on a configurable port
🔧 refactor(cogs/__init__.py): import ChannelSetup cog
 feat(cogs/channelSetup.py): add ChannelSetup cog for setting up channels and server-wide settings
🔧 refactor(cogs/setup.py): import SlashCommandGroup and guild_only from discord module
 feat(cogs/setup.py): add setup_channel command for adding and removing channels
 feat(cogs/setup.py): add api command for setting API keys
 feat(cogs/setup.py): add premium command for setting guild to premium
🔧 refactor(cogs/settings.py): temporarily disable images command due to maintenance
🔧 refactor(config.py): remove unnecessary code related to moderation table
 feat(guild.py): add Guild class for managing guild-specific data and settings
 feat(SqlConnector.py): add SQLConnection and _sql classes for managing SQLite connections
 feat(variousclasses.py): add models, characters, and apis classes for autocomplete functionality in slash commands
2023-08-19 14:16:30 +02:00
cf27f2313a 🔧 chore(docker-publish.yml): remove scheduled job for Docker workflow
🔧 chore(docker-publish.yml): remove scheduled job for Docker workflow to simplify the workflow and avoid unnecessary executions
2023-08-18 10:16:41 +02:00
a77253ebdc 🎨 chore(*): run black to format the code 2023-08-18 10:11:14 +02:00