chore: 添加key切换策略配置项

This commit is contained in:
RockChinQ
2023-08-04 15:21:31 +08:00
parent 7ca2aa5e39
commit 382d37d479
2 changed files with 9 additions and 0 deletions

View File

@@ -70,6 +70,11 @@ openai_config = {
"reverse_proxy": None
}
# api-key切换策略
# active每次请求时都会切换api-key
# passive当api-key超额时才会切换api-key
switch_strategy = "active"
# [必需] 管理员QQ号用于接收报错等通知及执行管理员级别指令
# 支持多个管理员可以使用list形式设置例如
# admin_qq = [12345678, 87654321]

View File

@@ -1,6 +1,8 @@
from ..aamgr import AbstractCommandNode, Context
import logging
import json
@AbstractCommandNode.register(
parent=None,
@@ -19,6 +21,8 @@ class FuncCommand(AbstractCommandNode):
reply_str = "当前已加载的内容函数:\n\n"
logging.debug("host.__callable_functions__: {}".format(json.dumps(host.__callable_functions__, indent=4)))
index = 1
for func in host.__callable_functions__:
reply_str += "{}. {}{}:\n{}\n\n".format(index, ("(已禁用) " if not func['enabled'] else ""), func['name'], func['description'])