mirror of
https://github.com/Paillat-dev/Botator.git
synced 2026-01-02 09:16:19 +00:00
🎨 chore(*): run black to format the code
This commit is contained in:
@@ -16,12 +16,15 @@ async def moderate(api_key, text, recall_func=None):
|
||||
class ModerationError(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class hasher:
|
||||
def __init__(self):
|
||||
self.hashes = {}
|
||||
|
||||
def __call__(self, text: str) -> str:
|
||||
if self.hashes.get(text, None) is None:
|
||||
self.hashes[text] = hashlib.sha256(text.encode()).hexdigest()
|
||||
return self.hashes[text]
|
||||
|
||||
Hasher = hasher()
|
||||
|
||||
Hasher = hasher()
|
||||
|
||||
Reference in New Issue
Block a user