🎨 chore(*): run black to format the code

This commit is contained in:
2023-08-19 14:17:16 +02:00
parent 3a955d4379
commit 775f8758b7
8 changed files with 150 additions and 47 deletions

View File

@@ -3,24 +3,22 @@ from random import randint
class SQLConnection:
def __init__(self,connection):
def __init__(self, connection):
self.connection = connection
def __enter__(self):
return self.connection
def __exit__(self,exc_type,exc_val,exc_tb):
def __exit__(self, exc_type, exc_val, exc_tb):
self.connection.commit()
self.connection.close()
class _sql:
@property
def mainDb(self):
s = connect('./database/data.db')
s = connect("./database/data.db")
return SQLConnection(s)
sql: _sql = _sql()
sql: _sql = _sql()

View File

@@ -1,5 +1,6 @@
from discord import AutocompleteContext
class models:
matchingDict = {
"chatGPT (default - free)": "gpt-3.5-turbo",
@@ -10,11 +11,13 @@ class models:
reverseMatchingDict = {v: k for k, v in matchingDict.items()}
default = list(matchingDict.keys())[0]
openaimodels = ["gpt-3.5-turbo", "text-davinci-003"]
@classmethod
async def autocomplete(cls, ctx: AutocompleteContext) -> list[str]:
modls = cls.matchingDict.keys()
return [model for model in modls if model.find(ctx.value.lower()) != -1]
class characters:
matchingDict = {
"Botator (default - free)": "botator",
@@ -22,16 +25,21 @@ class characters:
}
reverseMatchingDict = {v: k for k, v in matchingDict.items()}
default = list(matchingDict.keys())[0]
@classmethod
async def autocomplete(cls, ctx: AutocompleteContext) -> list[str]:
chars = characters = cls.matchingDict.keys()
return [character for character in chars if character.find(ctx.value.lower()) != -1]
return [
character for character in chars if character.find(ctx.value.lower()) != -1
]
class apis:
matchingDict = {
"OpenAI": "openai",
}
@classmethod
async def autocomplete(cls, ctx: AutocompleteContext) -> list[str]:
apiss = cls.matchingDict.keys()
return [api for api in apiss if api.find(ctx.value.lower()) != -1]
return [api for api in apiss if api.find(ctx.value.lower()) != -1]