Format Python code with psf/black push

github-actions 2 years ago
parent 3839ff2abe
commit c7271ab525

@ -302,9 +302,7 @@ class Commands(discord.Cog, name="Commands"):
name="prompt", description="The prompt to send to GPT3", required=True name="prompt", description="The prompt to send to GPT3", required=True
) )
@discord.option( @discord.option(
name="private", name="private", description="Will only be visible to you", required=False
description="Will only be visible to you",
required=False
) )
@discord.option( @discord.option(
name="temperature", name="temperature",
@ -346,7 +344,13 @@ class Commands(discord.Cog, name="Commands"):
presence_penalty: float, presence_penalty: float,
): ):
await self.converser_cog.ask_command( await self.converser_cog.ask_command(
ctx, prompt, private, temperature, top_p, frequency_penalty, presence_penalty ctx,
prompt,
private,
temperature,
top_p,
frequency_penalty,
presence_penalty,
) )
@add_to_group("gpt") @add_to_group("gpt")
@ -367,9 +371,7 @@ class Commands(discord.Cog, name="Commands"):
default="", default="",
) )
@discord.option( @discord.option(
name="private", name="private", description="Will only be visible to you", required=False
description="Will only be visible to you",
required=False
) )
@discord.option( @discord.option(
name="temperature", name="temperature",

@ -870,7 +870,9 @@ class GPT3ComCon(discord.Cog, name="GPT3ComCon"):
) )
self.conversation_threads[thread.id] = Thread(thread.id) self.conversation_threads[thread.id] = Thread(thread.id)
self.conversation_threads[thread.id].model = self.model.model if not model else model self.conversation_threads[thread.id].model = (
self.model.model if not model else model
)
# Set the overrides for the conversation # Set the overrides for the conversation
self.conversation_threads[thread.id].set_overrides( self.conversation_threads[thread.id].set_overrides(

@ -33,7 +33,6 @@ from models.openai_model import Model
__version__ = "9.1" __version__ = "9.1"
PID_FILE = Path("bot.pid") PID_FILE = Path("bot.pid")
PROCESS = None PROCESS = None

@ -91,12 +91,9 @@ class Settings_autocompleter:
): ):
"""Gets all models""" """Gets all models"""
return [ return [
value value for value in Models.TEXT_MODELS if value.startswith(ctx.value.lower())
for value in Models.TEXT_MODELS
if value.startswith(ctx.value.lower())
] ]
async def get_value_moderations( async def get_value_moderations(
ctx: discord.AutocompleteContext, ctx: discord.AutocompleteContext,
): # Behaves a bit weird if you go back and edit the parameter without typing in a new command ): # Behaves a bit weird if you go back and edit the parameter without typing in a new command

@ -581,6 +581,7 @@ class Model:
f"Backing off {details['wait']:0.1f} seconds after {details['tries']} tries calling function {details['target']} | " f"Backing off {details['wait']:0.1f} seconds after {details['tries']} tries calling function {details['target']} | "
f"{details['exception'].status}: {details['exception'].message}" f"{details['exception'].status}: {details['exception'].message}"
) )
def backoff_handler_request(details): def backoff_handler_request(details):
print( print(
f"Backing off {details['wait']:0.1f} seconds after {details['tries']} tries calling function {details['target']} | " f"Backing off {details['wait']:0.1f} seconds after {details['tries']} tries calling function {details['target']} | "

Loading…
Cancel
Save