From 858b7e22f673989a8e87af4e18529abb3ce7e17f Mon Sep 17 00:00:00 2001 From: howard Date: Thu, 15 Dec 2022 02:38:11 +0800 Subject: [PATCH] formatter --- api/chatgpt.py | 10 +++++----- api/index.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/chatgpt.py b/api/chatgpt.py index da7161e..3c95f64 100644 --- a/api/chatgpt.py +++ b/api/chatgpt.py @@ -9,11 +9,11 @@ class ChatGPT: def __init__(self): self.prompt = Prompt() - self.model = os.getenv("OPENAI_MODEL", default="text-davinci-003") - self.temperature = float(os.getenv("OPENAI_TEMPERATURE", default=0)) - self.frequency_penalty = float(os.getenv("OPENAI_FREQUENCY_PENALTY", default=0)) - self.presence_penalty = float(os.getenv("OPENAI_PRESENCE_PENALTY", default=0.6)) - self.max_tokens = int(os.getenv("OPENAI_MAX_TOKENS", default=240)) + self.model = os.getenv("OPENAI_MODEL", default = "text-davinci-003") + self.temperature = float(os.getenv("OPENAI_TEMPERATURE", default = 0)) + self.frequency_penalty = float(os.getenv("OPENAI_FREQUENCY_PENALTY", default = 0)) + self.presence_penalty = float(os.getenv("OPENAI_PRESENCE_PENALTY", default = 0.6)) + self.max_tokens = int(os.getenv("OPENAI_MAX_TOKENS", default = 240)) def get_response(self): response = openai.Completion.create( diff --git a/api/index.py b/api/index.py index 8f9eff6..94bc467 100644 --- a/api/index.py +++ b/api/index.py @@ -8,7 +8,7 @@ line_bot_api = LineBotApi(os.getenv("LINE_CHANNEL_ACCESS_TOKEN")) line_handler = WebhookHandler(os.getenv("LINE_CHANNEL_SECRET")) -working_status = os.getenv("DEFALUT_TALKING", default="true").lower() == "true" +working_status = os.getenv("DEFALUT_TALKING", default = "true").lower() == "true" app = Flask(__name__) chatgpt = ChatGPT()