From b2ee62646c29ceee4cd2c52a805e82acfec5633c Mon Sep 17 00:00:00 2001 From: Rock Chin <1010553892@qq.com> Date: Wed, 28 Dec 2022 00:14:41 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BF=AE=E6=94=B9=E6=88=90=E7=BE=8E?= =?UTF-8?q?=E5=85=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config-template.py | 1 + pkg/qqbot/process.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config-template.py b/config-template.py index 5fc5e28..adc92ca 100644 --- a/config-template.py +++ b/config-template.py @@ -55,6 +55,7 @@ response_rules = { # 单个api-key的费用警告阈值 # 当使用此api-key进行请求所消耗的费用估算达到此阈值时,会在控制台输出警告并通知管理员 # 若之后还有未使用超过此值的api-key,则会切换到新的api-key进行请求 +# 单位:美元 api_key_fee_threshold = 18.0 # 敏感词过滤开关,以同样数量的*代替敏感词回复 diff --git a/pkg/qqbot/process.py b/pkg/qqbot/process.py index 025ac55..3035151 100644 --- a/pkg/qqbot/process.py +++ b/pkg/qqbot/process.py @@ -117,7 +117,7 @@ def process_message(launcher_type: str, launcher_id: int, text_message: str) -> using_key_name = "" for api_key in api_keys: - reply_str += "{}:\n - {}元 {}%\n".format(api_key, + reply_str += "{}:\n - {}美元 {}%\n".format(api_key, round(pkg.openai.manager.get_inst().key_mgr.get_fee( api_keys[api_key]), 6), round(