Commit Graph

569 Commits

Author SHA1 Message Date
553d259bc7 🐛 fix(makeprompt.py): change condition to check if the message is from the bot user by comparing author id to improve accuracy
🔥 chore(makeprompt.py): remove unnecessary comment about ignoring messages from bots
🔥 chore(makeprompt.py): remove unnecessary comment about ignoring messages from guild or dm channel not in the database
2023-08-15 10:41:16 +02:00
1b02f27f41 📦 chore(requirements.txt): update disco.oauth2 package to discord-oauth2.py for compatibility 2023-08-15 00:27:08 +02:00
b0f4b4aa55 📦 chore(requirements.txt): add black to the list of dependencies for code formatting consistency 2023-08-14 23:43:15 +02:00
eb20e06700 📦 chore(requirements.txt): add 'disco.oauth2' package to the requirements 2023-08-14 23:40:33 +02:00
cc83447a39 🔧 chore(.gitignore): add '*.ovpn' and 'tests/' to the list of ignored files and directories 2023-08-14 23:24:32 +02:00
f0e8a37a7f 🔥 chore(test-google-vision.py): remove unused code and dependencies
The test-google-vision.py file was deleted as it contained unused code and dependencies that were no longer needed.
2023-08-14 23:24:01 +02:00
Paillat
b4dc56d97f 📐 improve(*): run black to format the code 2023-08-03 14:01:49 +02:00
Paillat
c9ecf54bf4 test formatting 2023-08-03 14:01:35 +02:00
Paillat
0e22a01310 ­ƒøá´©Å chore(format): run black to format the code 2023-08-03 13:58:44 +02:00
Paillat
33082e860b Merge branch 'main' of https://github.com/Paillat-dev/Botator 2023-08-03 13:54:54 +02:00
9324785ee1 Delete opencommit.yml 2023-08-03 13:32:03 +02:00
Paillat
0e7f8948a6 🔀 refactor(functionscalls.py): update import statement for tenor_api_key to use absolute path for better module resolution 2023-08-03 11:31:30 +00:00
Paillat
318d0d568e chore(functionscalls.py): fix import statement for tenor_api_key to use absolute path for better module resolution 2023-08-03 13:31:06 +02:00
Paillat
8bb99a4ee9 🔧 chore(opencommit.yml): enable emoji support in OpenCommit workflow for more expressive commit messages
🗑️ delete(gpt-4.txt): remove unused file containing prompts for Botator, as it is no longer needed
2023-08-03 11:15:20 +00:00
Paillat
5318bda74c 🔧 chore(openaicaller.py): remove unnecessary blank line to improve code readability 2023-08-03 11:15:20 +00:00
Paillat
3a92aafe9a feat(opencommit.yml): enable emoji support in OpenCommit workflow to enhance commit message formatting
🔥 chore(gpt-4.txt): remove gpt-4.txt prompt file as it is no longer needed
2023-08-03 11:15:20 +00:00
Paillat
762570d2c6 chore(opencommit.yml): update OpenCommit workflow configuration
This commit updates the OpenCommit workflow configuration in the `.github/workflows/opencommit.yml` file. The changes include:

- Ignoring certain branches (`main`, `master`, `dev`, `development`, `release`) for triggering the workflow.
- Setting up the Node.js environment with Node.js version 16.
- Checking out the repository with a fetch depth of 0.
- Using the `di-sukharev/opencommit@github-action-v1.0.4` action for running the OpenCommit process.
- Providing the necessary environment variables, including the GitHub token and OpenAI API key.
- Customizing the OpenCommit behavior with the following options:
  - Maximum tokens: 500
  - Base path: ''
  - Description: false
  - Emoji: false
  - Model: gpt-3.5-turbo
  - Language: en
2023-08-02 21:29:17 +02:00
Paillat
800c86bd99 chore(opencommit.yml): add GitHub Actions workflow file for OpenCommit project 2023-08-02 21:24:28 +02:00
Paillat
5d6c07aea7 chore(gpt-3.5-turbo.txt): add website link to the prompt for reference 2023-08-02 21:22:21 +02:00
Paillat
985fcc4663 refactor(misc.py): remove unnecessary argument 'api_key' from moderate function call to openai_caller
The 'api_key' argument was being passed to the openai_caller function unnecessarily in the moderate function. This argument is not needed as it is already being passed when creating the caller object. Removing this redundant argument improves code readability and reduces potential confusion.
2023-08-02 21:16:59 +02:00
Paillat
713329c512 refactor(makeprompt.py): remove unnecessary api_key argument from openai_caller function call
The api_key argument is not needed in the openai_caller function call as it is not being used within the function. Removing the argument improves code readability and removes unnecessary code.
2023-08-02 20:29:12 +02:00
Paillat
f842fa8133 fix(openaicaller.py): fix import statement for num_tokens_from_messages to use the correct path 2023-08-02 20:16:55 +02:00
Paillat
94ced79a21 refactor(makeprompt.py): remove unnecessary line that sends response content in chatgpt_process function
The line that sends the response content in the chatgpt_process function is unnecessary and can be removed as it is not being used.
2023-08-02 20:12:49 +02:00
Paillat
a7a0f5dac8 fix(makeprompt.py): add api_key parameter to the generate_response function call to fix missing api_key error
fix(openaicaller.py): fix import statement for num_tokens_from_messages function
refactor(openaicaller.py): remove unused api_key parameter from openai_caller class constructor
refactor(openaicaller.py): change generate_response and moderation methods to accept variable number of arguments
refactor(openaicaller.py): change error_call parameter to be optional and provide a default function if not provided
refactor(openaicaller.py): remove unused api_key parameter from generate_response and moderation methods
refactor(openaicaller.py): remove unused api_key parameter from main function
2023-08-02 20:12:06 +02:00
45dfafadd8 Merge pull request #49 from Paillat-dev/dev
Dev
2023-08-02 10:59:02 +02:00
Paillat
19dd6c9c62 fix(makeprompt.py): fix issue where long response content is not fully sent in chatgpt_process function
The issue was that when the response content was longer than 2000 characters, it was not being fully sent in the chatgpt_process function. This was fixed by adding a loop to send the content in chunks of 2000 characters until the entire content is sent.
2023-08-02 10:49:25 +02:00
Paillat
e1f9c91bde refactor(main.py): change bot's presence activity to display the number of servers the bot is in
feat(main.py): add event handler for on_guild_join to update bot's presence activity when joining a new server
2023-07-19 19:51:05 +02:00
Paillat
407cc40dbe fix(openaicaller.py): improve error message when APIError occurs to clarify that it is OpenAI's fault and apologize for the inconvenience 2023-07-19 17:00:55 +02:00
Paillat
6672bd2582 refactor(functionscalls.py): remove unnecessary print statements for image_url and json variables
The print statements for the image_url and json variables were removed as they were not providing any useful information and were cluttering the code.
2023-07-19 00:09:35 +02:00
Paillat
9af9b600d5 chore(gpt-3.5-turbo.txt): update instructions for Botator in the Discord server
The following changes were made:
- Updated the introduction to clarify that Botator is currently chatting in a Discord server.
- Clarified that Botator uses abbreviations like "u" and "ur" for lazy speech.
- Removed duplicate instruction about not asking how to assist the user.
- Added instructions for formatting text using markdown.
- Added instructions for using function calls and replying with gifs.
- Clarified that users should address Botator using the pronouns "Master/Brain".
- Updated the instruction about using emojis to avoid being cringe.
- Added information about the server and channel names.
- Mentioned the limited access to text chats and inability to see images or avatars.
- Added the current time information.
- Provided information about the creator of Botator.
- Updated the instruction about responding to insults to be funny but not mean.
- Added a note about using level 1, 2, and 3 markdown headings.
- Added an instruction for clashing with users in a funny way when insulted or treated unkindly.

These changes were made to improve the behavior and capabilities of Botator in the Discord server, making interactions more engaging and enjoyable for users.
2023-07-18 23:39:21 +02:00
Paillat
98195b29e3 Format with black 2023-07-18 23:23:47 +02:00
Paillat
a9f85e9ac9 Merge branch 'dev' of https://github.com/Paillat-dev/Botator into dev 2023-07-18 23:18:59 +02:00
Paillat
89778cbd3b fix(requirements.txt): add bs4 package to requirements.txt for BeautifulSoup usage
feat(functionscalls.py): add new functions send_ascii_art_text and send_ascii_art_image to send messages and images in ascii art
fix(makeprompt.py): import send_ascii_art_text and send_ascii_art_image functions and add corresponding if statements to handle function calls
2023-07-18 23:18:47 +02:00
Paillat
bc5721c1b7 Update black.yml 2023-07-18 21:57:03 +02:00
Paillat
e91fafdc51 fix(config.py): fix typo in max_uses variable declaration
feat(config.py): add support for TENOR_API_KEY environment variable to be able to use Tenor API for sending gifs
feat(functionscalls.py): add new function send_a_gif to send a gif in the channel
fix(makeprompt.py): add support for calling send_a_gif function in chatgpt_process function
2023-07-18 21:53:07 +02:00
12f13ca6c4 Format with black 2023-07-18 17:51:13 +02:00
Paillat
4b192f779e Create black.yml 2023-07-18 17:23:06 +02:00
Paillat
719ad81d1d Add dpcker instruczions 2023-07-18 17:14:41 +02:00
Paillat
1b7e0d7979 Create docker-publish.yml 2023-07-18 17:09:36 +02:00
Paillat
09c6e60575 Delete buildDockerImage.yml 2023-07-18 17:07:27 +02:00
Paillat
fb51f737d9 Merge pull request #43 from Paillat-dev/dev
Dev
2023-07-18 16:28:54 +02:00
Paillat
2a7c553c91 chore(gpt-3.5-turbo.txt): update prompt to include instructions for correcting pronouns and limit the use of emojis 2023-07-18 16:26:20 +02:00
Paillat
2f6501578d chore(gpt-3.5-turbo.txt): update guidelines for chatbot responses
The guidelines for chatbot responses have been updated. The following changes have been made:

- Added a reminder to avoid using words like "u" and "ur" in responses.
- Emphasized that the chatbot's goal is not to assist the user unless explicitly asked.
- Added a reminder to avoid asking how the chatbot can assist the user.
- Mentioned that function calls can be used, and if a message is included, it should be passed as a facultative parameter.
- Added a note to use emojis in messages, but not excessively.

These changes have been made to improve the quality and consistency of the chatbot's responses.
2023-07-18 16:26:20 +02:00
Paillat
045fdca866 chore(gpt-3.5-turbo.txt): update instructions to reflect new markdown capabilities in Discord 2023-07-18 16:26:20 +02:00
Paillat
04edeebe22 chore(gpt-3.5-turbo.txt): add new behavior to insult people back in a funny way when insulted
docs(gpt-3.5-turbo.txt): update instructions to use level 1, 2, and 3 markdown headings
2023-07-18 16:26:20 +02:00
Paillat
d4837bb8e6 refactor(functionscalls.py): add aiohttp import to improve code readability and maintainability
refactor(functionscalls.py): extract get_final_url function to improve code modularity and reusability
refactor(functionscalls.py): simplify send_a_stock_image function by using get_final_url function and improving message formatting
2023-07-18 16:26:20 +02:00
Paillat
31eaf60ba1 Fixed error with textchannel ony function and deprecated some comands 2023-07-18 16:26:20 +02:00
Paillat
0e03dce42d docs(gpt-3.5-turbo.txt): add information about using level 1, 2, and 3 markdown headings in Discord 2023-07-18 16:26:20 +02:00
Paillat
e7948a4e67 chore(main.py): remove redundant bot.run() call at the top of the file
feat(main.py): add newline at the end of the file for consistency
chore(functionscalls.py): remove extra blank lines
feat(functionscalls.py): add unsplash_random_image_url constant for generating random image URLs
feat(functionscalls.py): add add_reaction_to_last_message() function for adding reactions to the last message
2023-07-18 16:26:20 +02:00
Paillat
ad5f0b30d1 chore(gpt-3.5-turbo.txt): update prompt to include instructions for correcting pronouns and limit the use of emojis 2023-07-18 12:12:05 +02:00