From e2c7430c24ae64c7a000e378b301655b46a053d0 Mon Sep 17 00:00:00 2001 From: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Date: Wed, 15 Mar 2023 05:45:04 +0000 Subject: [PATCH] Format Python code with psf/black push --- models/openai_model.py | 1 - services/environment_service.py | 5 ++++- services/text_service.py | 9 +++++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/models/openai_model.py b/models/openai_model.py index 48cea17..e5ea5ec 100644 --- a/models/openai_model.py +++ b/models/openai_model.py @@ -235,7 +235,6 @@ class Model: else 5 ) - def reset_settings(self): keys = [ "temp", diff --git a/services/environment_service.py b/services/environment_service.py index c17c709..94d55e8 100644 --- a/services/environment_service.py +++ b/services/environment_service.py @@ -405,7 +405,10 @@ class EnvService: openai_token = os.getenv("OPENAI_TOKEN") return openai_token except Exception: - raise ValueError("OPENAI_TOKEN is not defined properly in the environment file! The bot cannot start without this token.") + raise ValueError( + "OPENAI_TOKEN is not defined properly in the environment file! The bot cannot start without this token." + ) + @staticmethod def get_openai_organization(): try: diff --git a/services/text_service.py b/services/text_service.py index 901538c..9046767 100644 --- a/services/text_service.py +++ b/services/text_service.py @@ -284,7 +284,10 @@ class TextService: and ( ( model is not None - and (model in Models.CHATGPT_MODELS or (model == "chatgpt" or "gpt-4" in model)) + and ( + model in Models.CHATGPT_MODELS + or (model == "chatgpt" or "gpt-4" in model) + ) ) or ( model is None @@ -293,7 +296,9 @@ class TextService: ) ) delegator = model or converser_cog.model.model - is_chatgpt_request = delegator in Models.CHATGPT_MODELS or delegator in Models.GPT4_MODELS + is_chatgpt_request = ( + delegator in Models.CHATGPT_MODELS or delegator in Models.GPT4_MODELS + ) if is_chatgpt_conversation: _prompt_with_history = converser_cog.conversation_threads[