From a7b5d84a33b4918a51676f444e25e058be9aec10 Mon Sep 17 00:00:00 2001 From: Kaveen Kumarasinghe Date: Wed, 11 Jan 2023 03:12:38 -0500 Subject: [PATCH 1/9] Persistent moderations --- cogs/gpt_3_commands_and_converser.py | 83 ++++++++++++++++++++++------ 1 file changed, 65 insertions(+), 18 deletions(-) diff --git a/cogs/gpt_3_commands_and_converser.py b/cogs/gpt_3_commands_and_converser.py index 7eb4b4b..2434e6b 100644 --- a/cogs/gpt_3_commands_and_converser.py +++ b/cogs/gpt_3_commands_and_converser.py @@ -38,6 +38,17 @@ if USER_INPUT_API_KEYS: USER_KEY_DB = SqliteDict("user_key_db.sqlite") print("Retrieved/created the user key database") +MOD_DB = None +GENERAL_DB = None +try: + print("Attempting to retrieve the General and Moderations DB") + MOD_DB = SqliteDict("main_db.sqlite", tablename="moderations", autocommit=True) + GENERAL_DB = SqliteDict("main_db.sqlite", tablename="general", autocommit=True) + print("Retrieved the General and Moderations DB") +except Exception as e: + print("Failed to retrieve the General and Moderations DB. The bot is terminating.") + raise e + class GPT3ComCon(discord.Cog, name="GPT3ComCon"): def __init__( @@ -80,6 +91,7 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): self.moderation_alerts_channel = EnvService.get_moderations_alert_channel() self.moderation_enabled_guilds = [] self.moderation_tasks = {} + self.moderations_launched = [] self.pinecone_service = pinecone_service try: @@ -203,10 +215,11 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): self.debug_channel = self.bot.get_guild(self.DEBUG_GUILD).get_channel( self.DEBUG_CHANNEL ) - if USER_INPUT_API_KEYS: - print( - "This bot was set to use user input API keys. Doing the required SQLite setup now" - ) + + # Check moderation service for each guild + for guild in self.bot.guilds: + print("Checking moderation service for guild "+guild.name) + await self.check_and_launch_moderations(guild.id) await self.bot.sync_commands( commands=None, @@ -615,6 +628,27 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): self.redo_users[after.author.id].prompt = after.content + + async def check_and_launch_moderations(self, guild_id, alert_channel_override=None): + # Create the moderations service. + print("Checking and attempting to launch moderations service...") + if self.check_guild_moderated(guild_id): + self.moderation_queues[guild_id] = asyncio.Queue() + + moderations_channel = await self.bot.fetch_channel( + self.get_moderated_alert_channel(guild_id) if not alert_channel_override else alert_channel_override + ) + + self.moderation_tasks[guild_id] = asyncio.ensure_future( + Moderation.process_moderation_queue( + self.moderation_queues[guild_id], 1, 1, moderations_channel + ) + ) + print("Launched the moderations service") + self.moderations_launched.append(guild_id) + return moderations_channel + + return None @discord.Cog.listener() async def on_message(self, message): # Get the message from context @@ -1331,29 +1365,26 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): return if status == "on": + # Check if the current guild is already in the database and if so, if the moderations is on + if self.check_guild_moderated(ctx.guild_id): + await ctx.respond("Moderations is already enabled for this guild") + return + # Create the moderations service. - self.moderation_queues[ctx.guild_id] = asyncio.Queue() - if self.moderation_alerts_channel or alert_channel_id: - moderations_channel = await self.bot.fetch_channel( - self.moderation_alerts_channel - if not alert_channel_id - else alert_channel_id - ) - else: - moderations_channel = self.moderation_alerts_channel # None + self.set_guild_moderated(ctx.guild_id) + moderations_channel = await self.check_and_launch_moderations(ctx.guild_id,self.moderation_alerts_channel if not alert_channel_id else alert_channel_id) + self.set_moderated_alert_channel(ctx.guild_id, moderations_channel.id) + - self.moderation_tasks[ctx.guild_id] = asyncio.ensure_future( - Moderation.process_moderation_queue( - self.moderation_queues[ctx.guild_id], 1, 1, moderations_channel - ) - ) await ctx.respond("Moderations service enabled") elif status == "off": # Cancel the moderations service. + self.set_guild_moderated(ctx.guild_id, False) self.moderation_tasks[ctx.guild_id].cancel() self.moderation_tasks[ctx.guild_id] = None self.moderation_queues[ctx.guild_id] = None + self.moderations_launched.remove(ctx.guild_id) await ctx.respond("Moderations service disabled") @add_to_group("gpt") @@ -1463,6 +1494,22 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): # Otherwise, process the settings change await self.process_settings_command(ctx, parameter, value) + def check_guild_moderated(self, guild_id): + return guild_id in MOD_DB and MOD_DB[guild_id]["moderated"] + def get_moderated_alert_channel(self, guild_id): + return MOD_DB[guild_id]["alert_channel"] + + def set_moderated_alert_channel(self, guild_id, channel_id): + MOD_DB[guild_id] = {"moderated": True, "alert_channel": channel_id} + MOD_DB.commit() + + def set_guild_moderated(self, guild_id, status=True): + if guild_id not in MOD_DB: + MOD_DB[guild_id] = {"moderated": status, "alert_channel": 0} + MOD_DB.commit() + return + MOD_DB[guild_id] = {"moderated": status, "alert_channel": self.get_moderated_alert_channel(guild_id)} + MOD_DB.commit() class ConversationView(discord.ui.View): def __init__(self, ctx, converser_cog, id, custom_api_key=None): From 7c3b652a2a0abb3f4c6e4f105d6b99315ebe62da Mon Sep 17 00:00:00 2001 From: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Date: Wed, 11 Jan 2023 08:13:26 +0000 Subject: [PATCH 2/9] Format Python code with psf/black push --- cogs/gpt_3_commands_and_converser.py | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/cogs/gpt_3_commands_and_converser.py b/cogs/gpt_3_commands_and_converser.py index 2434e6b..13976ae 100644 --- a/cogs/gpt_3_commands_and_converser.py +++ b/cogs/gpt_3_commands_and_converser.py @@ -218,7 +218,7 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): # Check moderation service for each guild for guild in self.bot.guilds: - print("Checking moderation service for guild "+guild.name) + print("Checking moderation service for guild " + guild.name) await self.check_and_launch_moderations(guild.id) await self.bot.sync_commands( @@ -628,7 +628,6 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): self.redo_users[after.author.id].prompt = after.content - async def check_and_launch_moderations(self, guild_id, alert_channel_override=None): # Create the moderations service. print("Checking and attempting to launch moderations service...") @@ -636,7 +635,9 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): self.moderation_queues[guild_id] = asyncio.Queue() moderations_channel = await self.bot.fetch_channel( - self.get_moderated_alert_channel(guild_id) if not alert_channel_override else alert_channel_override + self.get_moderated_alert_channel(guild_id) + if not alert_channel_override + else alert_channel_override ) self.moderation_tasks[guild_id] = asyncio.ensure_future( @@ -649,6 +650,7 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): return moderations_channel return None + @discord.Cog.listener() async def on_message(self, message): # Get the message from context @@ -1372,10 +1374,14 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): # Create the moderations service. self.set_guild_moderated(ctx.guild_id) - moderations_channel = await self.check_and_launch_moderations(ctx.guild_id,self.moderation_alerts_channel if not alert_channel_id else alert_channel_id) + moderations_channel = await self.check_and_launch_moderations( + ctx.guild_id, + self.moderation_alerts_channel + if not alert_channel_id + else alert_channel_id, + ) self.set_moderated_alert_channel(ctx.guild_id, moderations_channel.id) - await ctx.respond("Moderations service enabled") elif status == "off": @@ -1496,6 +1502,7 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): def check_guild_moderated(self, guild_id): return guild_id in MOD_DB and MOD_DB[guild_id]["moderated"] + def get_moderated_alert_channel(self, guild_id): return MOD_DB[guild_id]["alert_channel"] @@ -1508,9 +1515,13 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): MOD_DB[guild_id] = {"moderated": status, "alert_channel": 0} MOD_DB.commit() return - MOD_DB[guild_id] = {"moderated": status, "alert_channel": self.get_moderated_alert_channel(guild_id)} + MOD_DB[guild_id] = { + "moderated": status, + "alert_channel": self.get_moderated_alert_channel(guild_id), + } MOD_DB.commit() + class ConversationView(discord.ui.View): def __init__(self, ctx, converser_cog, id, custom_api_key=None): super().__init__(timeout=3600) # 1 hour interval to redo. From 571d65fd379f38ccb3bfdf0fb5b3a04d25f40230 Mon Sep 17 00:00:00 2001 From: Kaveen Kumarasinghe Date: Wed, 11 Jan 2023 03:18:18 -0500 Subject: [PATCH 3/9] revert auto-terminate change, bump version --- cogs/gpt_3_commands_and_converser.py | 4 ---- gpt3discord.py | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/cogs/gpt_3_commands_and_converser.py b/cogs/gpt_3_commands_and_converser.py index 13976ae..de59297 100644 --- a/cogs/gpt_3_commands_and_converser.py +++ b/cogs/gpt_3_commands_and_converser.py @@ -1149,10 +1149,6 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): user = ctx.user prompt = prompt.strip() - # If the prompt isn't empty and the last character isn't a punctuation character, add a period. - if prompt and prompt[-1] not in [".", "!", "?"]: - prompt += "." - user_api_key = None if USER_INPUT_API_KEYS: user_api_key = await GPT3ComCon.get_user_api_key(user.id, ctx) diff --git a/gpt3discord.py b/gpt3discord.py index 8bb2ad0..69dbf21 100644 --- a/gpt3discord.py +++ b/gpt3discord.py @@ -24,7 +24,7 @@ from models.openai_model import Model from models.usage_service_model import UsageService from models.env_service_model import EnvService -__version__ = "5.0.1" +__version__ = "5.1" """ The pinecone service is used to store and retrieve conversation embeddings. From cf2dcd84f0cf428720c7b99fa07a6ea66d044d6a Mon Sep 17 00:00:00 2001 From: Kaveen Kumarasinghe Date: Wed, 11 Jan 2023 03:49:57 -0500 Subject: [PATCH 4/9] housekeeping, bugfixes --- cogs/draw_image_generation.py | 3 +- cogs/gpt_3_commands_and_converser.py | 92 +++++++++++++++------------- cogs/image_prompt_optimizer.py | 9 +++ gpt3discord.py | 2 +- 4 files changed, 61 insertions(+), 45 deletions(-) diff --git a/cogs/draw_image_generation.py b/cogs/draw_image_generation.py index 6498759..19bf0a2 100644 --- a/cogs/draw_image_generation.py +++ b/cogs/draw_image_generation.py @@ -37,8 +37,7 @@ class DrawDallEService(discord.Cog, name="DrawDallEService"): self.message_queue = message_queue self.deletion_queue = deletion_queue self.converser_cog = converser_cog - - print("Draw service init") + print("Draw service initialized") async def encapsulated_send( self, diff --git a/cogs/gpt_3_commands_and_converser.py b/cogs/gpt_3_commands_and_converser.py index de59297..a566060 100644 --- a/cogs/gpt_3_commands_and_converser.py +++ b/cogs/gpt_3_commands_and_converser.py @@ -29,6 +29,9 @@ if sys.platform == "win32": else: separator = "/" +""" +Get the user key service if it is enabled. +""" USER_INPUT_API_KEYS = EnvService.get_user_input_api_keys() USER_KEY_DB = None if USER_INPUT_API_KEYS: @@ -38,6 +41,11 @@ if USER_INPUT_API_KEYS: USER_KEY_DB = SqliteDict("user_key_db.sqlite") print("Retrieved/created the user key database") + +""" +Obtain the Moderation table and the General table, these are two SQLite tables that contain +information about the server that are used for persistence and to auto-restart the moderation service. +""" MOD_DB = None GENERAL_DB = None try: @@ -64,12 +72,23 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): pinecone_service, ): super().__init__() + self.GLOBAL_COOLDOWN_TIME = 0.25 + + # Environment self.data_path = data_path self.debug_channel = None + + # Services and models self.bot = bot - self._last_member_ = None - self.conversation_threads = {} - self.DAVINCI_ROLES = ["admin", "Admin", "GPT", "gpt"] + self.usage_service = usage_service + self.model = model + self.deletion_queue = deletion_queue + + # Data specific to all text based GPT interactions + self.users_to_interactions = defaultdict(list) + self.redo_users = {} + + # Conversations-specific data self.END_PROMPTS = [ "end", "end conversation", @@ -77,21 +96,20 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): "that's all", "that'll be all", ] - self.last_used = {} - self.GLOBAL_COOLDOWN_TIME = 0.25 - self.usage_service = usage_service - self.model = model - self.summarize = self.model.summarize_conversations - self.deletion_queue = deletion_queue - self.users_to_interactions = defaultdict(list) - self.redo_users = {} self.awaiting_responses = [] self.awaiting_thread_responses = [] + self.conversation_threads = {} + self.summarize = self.model.summarize_conversations + + + # Moderation service data self.moderation_queues = {} self.moderation_alerts_channel = EnvService.get_moderations_alert_channel() self.moderation_enabled_guilds = [] self.moderation_tasks = {} self.moderations_launched = [] + + # Pinecone data self.pinecone_service = pinecone_service try: @@ -206,19 +224,15 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): ) await member.send(content=None, embed=welcome_embed) - @discord.Cog.listener() - async def on_member_remove(self, member): - pass - @discord.Cog.listener() async def on_ready(self): self.debug_channel = self.bot.get_guild(self.DEBUG_GUILD).get_channel( self.DEBUG_CHANNEL ) + print("The debug channel was acquired") # Check moderation service for each guild for guild in self.bot.guilds: - print("Checking moderation service for guild " + guild.name) await self.check_and_launch_moderations(guild.id) await self.bot.sync_commands( @@ -230,7 +244,7 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): check_guilds=[], delete_existing=True, ) - print(f"The debug channel was acquired and commands registered") + print(f"Commands synced") @add_to_group("system") @discord.slash_command( @@ -268,7 +282,10 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): for thread in guild.threads: thread_name = thread.name.lower() if "with gpt" in thread_name or "closed-gpt" in thread_name: - await thread.delete() + try: + await thread.delete() + except: + pass await ctx.respond("All conversation threads have been deleted.") # TODO: add extra condition to check if multi is enabled for the thread, stated in conversation_threads @@ -276,8 +293,6 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): cond1 = ( channel_id in self.conversation_threads - # and user_id in self.conversation_thread_owners - # and channel_id == self.conversation_thread_owners[user_id] ) # If the trimmed message starts with a Tilde, then we want to not contribute this to the conversation try: @@ -305,6 +320,9 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): "Only the conversation starter can end this.", delete_after=5 ) return + + # TODO Possible bug here, if both users have a conversation active and one user tries to end the other, it may + # allow them to click the end button on the other person's thread and it will end their own convo. self.conversation_threads.pop(channel_id) if isinstance(ctx, discord.ApplicationContext): @@ -395,6 +413,11 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): value="Optimize an image prompt for use with DALL-E2, Midjourney, SD, etc.", inline=False, ) + embed.add_field( + name="/system moderations", + value="The automatic moderations service", + inline=False, + ) embed.add_field(name="/help", value="See this help text", inline=False) await ctx.respond(embed=embed) @@ -603,9 +626,7 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): await response_message.edit(content="Redoing prompt 🔄...") edited_content = after.content - # If the user is conversing, we need to get their conversation history, delete the last - # ":" message, create a new : section with the new prompt, and then set the prompt to - # the new prompt, then send that new prompt as the new prompt. + if after.channel.id in self.conversation_threads: # Remove the last two elements from the history array and add the new : prompt self.conversation_threads[ @@ -645,7 +666,7 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): self.moderation_queues[guild_id], 1, 1, moderations_channel ) ) - print("Launched the moderations service") + print("Launched the moderations service for guild " + str(guild_id)) self.moderations_launched.append(guild_id) return moderations_channel @@ -653,8 +674,6 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): @discord.Cog.listener() async def on_message(self, message): - # Get the message from context - if message.author == self.bot.user: return @@ -682,9 +701,7 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): await self.end_conversation(message) return - # GPT3 command if conversing: - # Extract all the text after the !g and use it as the prompt. user_api_key = None if USER_INPUT_API_KEYS: user_api_key = await GPT3ComCon.get_user_api_key( @@ -697,9 +714,7 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): await self.check_conversation_limit(message) - # We want to have conversationality functionality. To have gpt3 remember context, we need to append the conversation/prompt - # history to the prompt. We can do this by checking if the user is in the conversating_users dictionary, and if they are, - # we can append their history to the prompt. + # If the user is in a conversation thread if message.channel.id in self.conversation_threads: # Since this is async, we don't want to allow the user to send another prompt while a conversation @@ -799,7 +814,7 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): try: - # This is the EMBEDDINGS CASE + # Pinecone is enabled, we will create embeddings for this conversation. if self.pinecone_service and ctx.channel.id in self.conversation_threads: # The conversation_id is the id of the thread conversation_id = ctx.channel.id @@ -815,8 +830,6 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): ) new_prompt = new_prompt.encode("ascii", "ignore").decode() - # print("Creating embedding for ", prompt) - # Print the current timestamp timestamp = int( str(datetime.datetime.now().timestamp()).replace(".", "") ) @@ -835,7 +848,7 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): ) # Create and upsert the embedding for the conversation id, prompt, timestamp - embedding = await self.pinecone_service.upsert_conversation_embedding( + await self.pinecone_service.upsert_conversation_embedding( self.model, conversation_id, new_prompt, @@ -845,8 +858,7 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): embedding_prompt_less_author = await self.model.send_embedding_request( prompt_less_author, custom_api_key=custom_api_key - ) # Use the version of - # the prompt without the author's name for better clarity on retrieval. + ) # Use the version of the prompt without the author's name for better clarity on retrieval. # Now, build the new prompt by getting the X most similar with pinecone similar_prompts = self.pinecone_service.get_n_similar( @@ -901,7 +913,7 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): tokens = self.usage_service.count_tokens(new_prompt) - # Summarize case + # No pinecone, we do conversation summarization for long term memory instead elif ( id in self.conversation_threads and tokens > self.model.summarize_threshold @@ -1157,10 +1169,6 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): await ctx.defer() - # CONVERSE Checks here TODO - # Send the request to the model - # If conversing, the prompt to send is the history, otherwise, it's just the prompt - await self.encapsulated_send( user.id, prompt, diff --git a/cogs/image_prompt_optimizer.py b/cogs/image_prompt_optimizer.py index ffd1e99..ceb12ba 100644 --- a/cogs/image_prompt_optimizer.py +++ b/cogs/image_prompt_optimizer.py @@ -107,12 +107,21 @@ class ImgPromptOptimizer(discord.Cog, name="ImgPromptOptimizer"): ) return + # If the response_message is > 75 words, concatenate to the last 70th word + # TODO Temporary workaround until prompt is adjusted to make the optimized prompts shorter. + try: + if len(response_text.split()) > 75: + response_text = " ".join(response_text.split()[-70:]) + except: + pass + response_message = await ctx.respond( response_text.replace("Optimized Prompt:", "") .replace("Output Prompt:", "") .replace("Output:", "") ) + self.converser_cog.users_to_interactions[user.id] = [] self.converser_cog.users_to_interactions[user.id].append( response_message.id diff --git a/gpt3discord.py b/gpt3discord.py index 69dbf21..efcec6d 100644 --- a/gpt3discord.py +++ b/gpt3discord.py @@ -24,7 +24,7 @@ from models.openai_model import Model from models.usage_service_model import UsageService from models.env_service_model import EnvService -__version__ = "5.1" +__version__ = "5.1.1" """ The pinecone service is used to store and retrieve conversation embeddings. From 40ddf5a3998080b08ba5ed6d5efb4d56686e6163 Mon Sep 17 00:00:00 2001 From: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Date: Wed, 11 Jan 2023 08:50:38 +0000 Subject: [PATCH 5/9] Format Python code with psf/black push --- cogs/gpt_3_commands_and_converser.py | 6 +----- cogs/image_prompt_optimizer.py | 1 - 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/cogs/gpt_3_commands_and_converser.py b/cogs/gpt_3_commands_and_converser.py index a566060..cd12ecf 100644 --- a/cogs/gpt_3_commands_and_converser.py +++ b/cogs/gpt_3_commands_and_converser.py @@ -101,7 +101,6 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): self.conversation_threads = {} self.summarize = self.model.summarize_conversations - # Moderation service data self.moderation_queues = {} self.moderation_alerts_channel = EnvService.get_moderations_alert_channel() @@ -290,10 +289,7 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"): # TODO: add extra condition to check if multi is enabled for the thread, stated in conversation_threads def check_conversing(self, user_id, channel_id, message_content, multi=None): - cond1 = ( - channel_id - in self.conversation_threads - ) + cond1 = channel_id in self.conversation_threads # If the trimmed message starts with a Tilde, then we want to not contribute this to the conversation try: cond2 = not message_content.strip().startswith("~") diff --git a/cogs/image_prompt_optimizer.py b/cogs/image_prompt_optimizer.py index ceb12ba..476a48e 100644 --- a/cogs/image_prompt_optimizer.py +++ b/cogs/image_prompt_optimizer.py @@ -121,7 +121,6 @@ class ImgPromptOptimizer(discord.Cog, name="ImgPromptOptimizer"): .replace("Output:", "") ) - self.converser_cog.users_to_interactions[user.id] = [] self.converser_cog.users_to_interactions[user.id].append( response_message.id From 4384c7c6c3147957ca0850b5861fb62ed4ede597 Mon Sep 17 00:00:00 2001 From: Kaveen Kumarasinghe Date: Wed, 11 Jan 2023 04:07:24 -0500 Subject: [PATCH 6/9] a bit more housekeeping --- .github/workflows/black-and-deploy.yml | 12 ++++++------ CONTRIBUTING.md | 2 ++ sample.env | 3 +++ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/black-and-deploy.yml b/.github/workflows/black-and-deploy.yml index 2fe0b81..0eb2c4c 100644 --- a/.github/workflows/black-and-deploy.yml +++ b/.github/workflows/black-and-deploy.yml @@ -80,7 +80,7 @@ jobs: host: 104.248.105.234 username: root password: ${{ secrets.SSH_PASS }} - - name: copy file via ssh password + - name: copy file via ssh password (OAI) uses: appleboy/scp-action@master with: host: 104.248.105.234 @@ -89,7 +89,7 @@ jobs: port: 22 source: gpt3discord.py target: /home/gptbotopenai/ - - name: copy file via ssh password + - name: copy file via ssh password (OAI) uses: appleboy/scp-action@master with: host: 104.248.105.234 @@ -98,7 +98,7 @@ jobs: port: 22 source: conversation_starter_pretext.txt target: /home/gptbotopenai/ - - name: copy file via ssh password + - name: copy file via ssh password (OAI) uses: appleboy/scp-action@master with: host: 104.248.105.234 @@ -107,7 +107,7 @@ jobs: port: 22 source: image_optimizer_pretext.txt target: /home/gptbotopenai/ - - name: Copy via ssh + - name: Copy via ssh (OAI) uses: garygrossgarten/github-action-scp@release with: local: cogs @@ -115,7 +115,7 @@ jobs: host: 104.248.105.234 username: root password: ${{ secrets.SSH_PASS }} - - name: Copy via ssh + - name: Copy via ssh (OAI) uses: garygrossgarten/github-action-scp@release with: local: models @@ -123,7 +123,7 @@ jobs: host: 104.248.105.234 username: root password: ${{ secrets.SSH_PASS }} - - name: Copy via ssh + - name: Copy via ssh (OAI) uses: garygrossgarten/github-action-scp@release with: local: openers diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4ffa3fc..968b21e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1 +1,3 @@ Please contribute on your own branch and make a pull request for review. There are not many other guidelines to follow, I'd love to see all of your good ideas. + +Please feel free to pull any issue and work on it! Join our linked server in the README if you want to discuss further! \ No newline at end of file diff --git a/sample.env b/sample.env index 10fb949..3bd1ed1 100644 --- a/sample.env +++ b/sample.env @@ -16,3 +16,6 @@ GPT_ROLES = "openai,gpt" WELCOME_MESSAGE = "Hi There! Welcome to our Discord server. We hope you'll enjoy our server and we look forward to engaging with you!" # This is a fallback message if gpt3 fails to generate a welcome message. USER_INPUT_API_KEYS="False" # If True, users must use their own API keys for OpenAI. If False, the bot will use the API key in the .env file. + +# Moderations Service alert channel, this is where moderation alerts will be sent as a default if enabled +MODERATIONS_ALERT_CHANNEL = "977697652147892304" \ No newline at end of file From 7fa80f5f0baa88549c6156f05bd2f998daf3b5d0 Mon Sep 17 00:00:00 2001 From: Kaveen Kumarasinghe Date: Wed, 11 Jan 2023 04:28:03 -0500 Subject: [PATCH 7/9] update workflow --- .github/workflows/black-and-deploy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/black-and-deploy.yml b/.github/workflows/black-and-deploy.yml index 0eb2c4c..8262bf0 100644 --- a/.github/workflows/black-and-deploy.yml +++ b/.github/workflows/black-and-deploy.yml @@ -3,6 +3,7 @@ on: push: branches: - main + - alpha jobs: build: runs-on: ubuntu-latest From 9c680664fd46b77a8ef142511f56a8ea01575293 Mon Sep 17 00:00:00 2001 From: CrypticHeaven-Lab <69017439+CrypticHeaven-Lab@users.noreply.github.com> Date: Wed, 11 Jan 2023 10:43:45 +0100 Subject: [PATCH 8/9] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 66e3bcc..6c26f64 100644 --- a/README.md +++ b/README.md @@ -172,7 +172,7 @@ The Moderations service still uses the main API key defined in the `.env` file. [**GPT3Discord Guides**](https://github.com/Kav-K/GPT3Discord/tree/main/detailed_guides) -If you follow the link above, you will now get to detailed step-by-step guides that will help you to install and set up your GPT3Discord bot quickly and easily. If you still run into problems or have suggestions for improving the guides, you can join the [**Discord-Server**](https://discord.gg/WvAHXDMS7Q) and we try will help you. Keep in mind that the maintainers are volunteers and will try to help you on their schedule. +If you follow the link above, you will now get to detailed step-by-step guides that will help you to install and set up your GPT3Discord bot quickly and easily. If you still run into problems or have suggestions for improving the guides, you can join the [**Discord-Server**](https://discord.gg/WvAHXDMS7Q) and we try to help you. Keep in mind that the maintainers are volunteers and will try to help you on their schedule. *The number and content of the guides is constantly adapted to current requirements.* From 1271174d329a48a2d8ce2494f3dbb0775b9d4e3d Mon Sep 17 00:00:00 2001 From: CrypticHeaven-Lab <69017439+CrypticHeaven-Lab@users.noreply.github.com> Date: Wed, 11 Jan 2023 10:44:55 +0100 Subject: [PATCH 9/9] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6c26f64..d65116c 100644 --- a/README.md +++ b/README.md @@ -172,7 +172,7 @@ The Moderations service still uses the main API key defined in the `.env` file. [**GPT3Discord Guides**](https://github.com/Kav-K/GPT3Discord/tree/main/detailed_guides) -If you follow the link above, you will now get to detailed step-by-step guides that will help you to install and set up your GPT3Discord bot quickly and easily. If you still run into problems or have suggestions for improving the guides, you can join the [**Discord-Server**](https://discord.gg/WvAHXDMS7Q) and we try to help you. Keep in mind that the maintainers are volunteers and will try to help you on their schedule. +If you follow the link above, you will now get to detailed step-by-step guides that will help you to install and set up your GPT3Discord bot quickly and easily. If you still run into problems or have suggestions for improving the guides, you can join the [**Discord-Server**](https://discord.gg/WvAHXDMS7Q) and we will try to help you. Keep in mind that the maintainers are volunteers and will try to help you on their schedule. *The number and content of the guides is constantly adapted to current requirements.*