Commit Graph

32 Commits

Author SHA1 Message Date
c8997ab418 🎨 chore(*): run black to format the code 2023-08-16 09:46:28 +02:00
ee825be892 🐛 fix(makeprompt.py): import Hasher class from src.utils.misc to resolve NameError
🔒 chore(makeprompt.py): add user hashing to prevent abuse and enable user banning if necessary
2023-08-16 09:44:01 +02:00
a02bfb5cbc 🐛 fix(makeprompt.py): await the moderate function call to properly handle moderation before increasing depth 2023-08-16 09:31:00 +02:00
9f257b4126 🐛 fix(makeprompt.py): import ModerationError from src.utils.misc to handle moderation errors in chatgpt_process function
🐛 fix(makeprompt.py): raise ModerationError with message "Too many recursive messages" when answering recursively in chatgpt_process function
2023-08-16 09:26:03 +02:00
303d3c07ac 🐛 fix(chat.py): fix typo in message.channel.send() method call
🔒 chore(chat.py): add moderation check for message content in call_function() to prevent sending blocked messages
🔒 chore(chat.py): add moderation check for query in call_function() to prevent sending blocked queries
🔒 chore(makeprompt.py): add moderation check for content in chatgpt_process() to prevent sending blocked content
🔒 chore(makeprompt.py): add depth check to prevent recursive answering in chatgpt_process()
2023-08-16 09:20:29 +02:00
f2e1b2ffe3 🔧 chore(makeprompt.py): refactor prepare_messages and chatgpt_process functions to accept an error_call function for error handling
🔧 chore(makeprompt.py): refactor chat_process function to use the error_call function for error handling
2023-08-15 18:53:22 +02:00
d057fc7a78 🎨 chore(*): run black to format the code 2023-08-15 14:22:05 +02:00
be771f7c22 🐛 fix(makeprompt.py): add missing 'depth' parameter to recursive function call to prevent infinite recursion 2023-08-15 14:15:57 +02:00
f79bdd2086 🐛 fix(makeprompt.py): import FuntionCallError from src.functionscalls to fix NameError
 feat(makeprompt.py): add depth parameter to chatgpt_process function to limit recursive function calls and raise FuntionCallError if exceeded
2023-08-15 14:15:35 +02:00
4b8070b413 🔧 chore(requirements.txt): add 'simpleeval' package for math expression evaluation
🔧 chore(functionscalls.py): add 'evaluate_math' function to evaluate math expressions
🔧 chore(makeprompt.py): refactor 'chatgpt_process' to use 'prepare_messages' function for message preparation
2023-08-15 14:11:21 +02:00
6de23a1a33 🔇 chore(makeprompt.py): remove debug print statements for messages and response variables 2023-08-15 12:48:00 +02:00
7bc5f03e14 🔧 fix(functionscalls.py): fix typo in FunctionCallError class name
 feat(functionscalls.py): add call_function function to handle function calls with name and arguments
🔧 fix(makeprompt.py): remove individual function imports from functionscalls and use call_function instead
2023-08-15 12:42:18 +02:00
88d65e9f79 🎨 chore(*): run black to format the code 2023-08-15 12:38:47 +02:00
456e147785 🐛 fix(functionscalls.py): fix typo in FunctionCallError class name
 feat(functionscalls.py): add error handling for missing arguments in function calls
🐛 fix(makeprompt.py): fix typo in function_call variable name
🔀 chore(gpt-3.5-turbo.txt): update instructions to only use provided functions
2023-08-15 12:38:37 +02:00
68ff639f27 🐛 fix(makeprompt.py): reverse the order of fetched messages to ensure correct chronological order
🔥 chore(makeprompt.py): remove unnecessary oldest_first parameter in channel.history() calls
2023-08-15 11:33:29 +02:00
cc5fd3aa7a 🐛 fix(makeprompt.py): refactor condition to check if message is ignorable using a separate function for better readability and maintainability 2023-08-15 11:05:52 +02:00
f04a04801b 🎨 chore(*): run black to format the code 2023-08-15 11:04:33 +02:00
8486453d18 🐛 fix(makeprompt.py): refactor message history fetching logic into a separate function for better code organization and reusability
 feat(makeprompt.py): add `is_ignorable` function to check if a message content is ignorable based on certain conditions
 feat(makeprompt.py): add `fetch_messages_history` function to fetch message history from a channel with optional limit and original message parameters
2023-08-15 11:03:23 +02:00
f0f160429d 🔥 refactor(makeprompt.py): remove unnecessary code that deletes the message after sending an embed 2023-08-15 10:50:10 +02:00
52ad105e06 🐛 fix(makeprompt.py): fix prompt generation logic for DM channels
 feat(makeprompt.py): add support for generating prompt with server and channel names, date and time, and pretend-to-be value
2023-08-15 10:46:54 +02:00
b139e40f8a 🐛 fix(config.py): add missing newline at the end of the file
🐛 fix(makeprompt.py): remove unnecessary file close statement after reading prompt file
 feat(config.py): add gpt_3_5_turbo_prompt variable to store the content of the prompt file
 feat(makeprompt.py): use gpt_3_5_turbo_prompt variable instead of reading the prompt file again
2023-08-15 10:44:13 +02:00
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
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
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
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
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
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
41b2fde1e6 Fixed error with textchannel ony function and deprecated some comands 2023-07-16 22:43:18 +02:00
Paillat
6c404c3803 FIxed stuff 2023-07-16 17:11:24 +02:00
Paillat
4f9a7eb0a6 Added function calling and lots of other stuff 2023-07-15 12:20:38 +02:00