From 5d5ec3dbb1ac5c43ffdeddfaee359a584e7940b7 Mon Sep 17 00:00:00 2001 From: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Date: Wed, 1 Feb 2023 15:26:34 +0000 Subject: [PATCH] Format Python code with psf/black push --- cogs/moderations_service_cog.py | 1 - cogs/prompt_optimizer_cog.py | 1 - models/openai_model.py | 3 --- services/moderations_service.py | 3 --- services/text_service.py | 4 ---- 5 files changed, 12 deletions(-) diff --git a/cogs/moderations_service_cog.py b/cogs/moderations_service_cog.py index 7a6e9c7a..9cae7ffb 100644 --- a/cogs/moderations_service_cog.py +++ b/cogs/moderations_service_cog.py @@ -222,7 +222,6 @@ async def restart_moderations_service(self, ctx): ) async def build_moderation_settings_embed(self, category, mod_set): - embed = discord.Embed( title="Moderation Settings", description="The moderation settings for this guild for the type: " diff --git a/cogs/prompt_optimizer_cog.py b/cogs/prompt_optimizer_cog.py index e117ac95..d4eb1ffd 100644 --- a/cogs/prompt_optimizer_cog.py +++ b/cogs/prompt_optimizer_cog.py @@ -188,7 +188,6 @@ def __init__( self.custom_api_key = custom_api_key async def callback(self, interaction: discord.Interaction): - user_id = interaction.user.id interaction_id = interaction.message.id diff --git a/models/openai_model.py b/models/openai_model.py index 03c5d289..fd0d18fd 100644 --- a/models/openai_model.py +++ b/models/openai_model.py @@ -639,7 +639,6 @@ async def send_edit_request( codex=False, custom_api_key=None, ): - # Validate that all the parameters are in a good state before we send the request if len(instruction) < self.prompt_min_length: raise ValueError( @@ -769,7 +768,6 @@ async def send_request( ) -> ( Tuple[dict, bool] ): # The response, and a boolean indicating whether or not the context limit was reached. - # Validate that all the parameters are in a good state before we send the request if len(prompt) < self.prompt_min_length: raise ValueError( @@ -815,7 +813,6 @@ async def send_request( @staticmethod async def send_test_request(api_key): - async with aiohttp.ClientSession() as session: payload = { "model": Models.LOW_USAGE_MODEL, diff --git a/services/moderations_service.py b/services/moderations_service.py index 1c50e3ce..9df6ba72 100644 --- a/services/moderations_service.py +++ b/services/moderations_service.py @@ -155,7 +155,6 @@ def build_admin_moderated_message( @staticmethod def determine_moderation_result(text, response, warn_set, delete_set): - warn_result, flagged_warn = warn_set.moderate(text, response) delete_result, flagged_delete = delete_set.moderate(text, response) @@ -330,7 +329,6 @@ def __init__(self, message, moderation_message, current_num): self.current_num = current_num async def callback(self, interaction: discord.Interaction): - # Remove reactions on the message, delete the moderation message await self.message.clear_reactions() await self.moderation_message[0].delete() @@ -344,7 +342,6 @@ def __init__(self, message, moderation_message, current_num): self.current_num = current_num async def callback(self, interaction: discord.Interaction): - # Get the user await self.message.delete() await interaction.response.send_message( diff --git a/services/text_service.py b/services/text_service.py index 535f1588..7c0c9f0e 100644 --- a/services/text_service.py +++ b/services/text_service.py @@ -217,7 +217,6 @@ async def encapsulated_send( and not from_edit_command and not converser_cog.pinecone_service # This should only happen if we are not doing summarizations. ): - # We don't need to worry about the differences between interactions and messages in this block, # because if we are in this block, we can only be using a message object for ctx if converser_cog.model.summarize_conversations: @@ -545,7 +544,6 @@ async def process_conversation_message( # If the user is in a conversation thread if message.channel.id in converser_cog.conversation_threads: - # Since this is async, we don't want to allow the user to send another prompt while a conversation # prompt is processing, that'll mess up the conversation history! if message.author.id in converser_cog.awaiting_responses: @@ -780,7 +778,6 @@ def __init__(self, converser_cog): self.converser_cog = converser_cog async def callback(self, interaction: discord.Interaction): - # Get the user user_id = interaction.user.id if ( @@ -820,7 +817,6 @@ def __init__( self.custom_api_key = custom_api_key async def callback(self, interaction: discord.Interaction): - # Get the user user_id = interaction.user.id if user_id in self.converser_cog.redo_users and self.converser_cog.redo_users[