diff --git a/config-template.py b/config-template.py index 59e83a0e..6207fe29 100644 --- a/config-template.py +++ b/config-template.py @@ -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] diff --git a/pkg/qqbot/cmds/funcs/func.py b/pkg/qqbot/cmds/funcs/func.py index f33efd15..93b31844 100644 --- a/pkg/qqbot/cmds/funcs/func.py +++ b/pkg/qqbot/cmds/funcs/func.py @@ -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'])