Format Python code with psf/black push

github-actions 2 years ago
parent 58dc7e19bd
commit e2c7430c24

@ -235,7 +235,6 @@ class Model:
else 5 else 5
) )
def reset_settings(self): def reset_settings(self):
keys = [ keys = [
"temp", "temp",

@ -405,7 +405,10 @@ class EnvService:
openai_token = os.getenv("OPENAI_TOKEN") openai_token = os.getenv("OPENAI_TOKEN")
return openai_token return openai_token
except Exception: 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 @staticmethod
def get_openai_organization(): def get_openai_organization():
try: try:

@ -284,7 +284,10 @@ class TextService:
and ( and (
( (
model is not None 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 ( or (
model is None model is None
@ -293,7 +296,9 @@ class TextService:
) )
) )
delegator = model or converser_cog.model.model 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: if is_chatgpt_conversation:
_prompt_with_history = converser_cog.conversation_threads[ _prompt_with_history = converser_cog.conversation_threads[

Loading…
Cancel
Save