File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ name: astrbot_plugin_openai_oauth # 插件唯一识别名,以 astrbot_plugin_
22display_name : OpenAI 订阅登录 # 用于展示的名字
33short_desc : 用 ChatGPT Plus/Pro 订阅额度作为模型 provider(Codex OAuth 登录) # 紧凑 UI 使用的短描述
44desc : |
5- 提供一个 `openai_codex ` 模型 provider:用户通过 Codex OAuth(设备码)登录自己的 ChatGPT 账号,
5+ 提供一个 `OpenAI Subscribe ` 模型 provider:用户通过 Codex OAuth(设备码)登录自己的 ChatGPT 账号,
66 即可在 WebUI 模型配置中选用,AI 调用消耗账号订阅额度,无需 API Key。
77 个人自用场景使用。
88version : 0.1.0
Original file line number Diff line number Diff line change 2525
2626FAILED = []
2727
28- # 与 main.py 的 _PROVIDER_TYPE 保持一致。
28+ # 步骤 1 在导入前就需要该类型名,因此静态声明;步骤 2 导入后会校验与
29+ # module._PROVIDER_TYPE 一致,避免改名后测试静默失联。
2930PROVIDER_TYPE = "OpenAI Subscribe"
3031
3132
@@ -46,6 +47,10 @@ def main() -> int:
4647
4748 module = importlib .import_module ("data.plugins.astrbot_plugin_openai_oauth.main" )
4849 check (module is not None , "data.plugins.astrbot_plugin_openai_oauth.main 导入成功" )
50+ check (
51+ PROVIDER_TYPE == module ._PROVIDER_TYPE ,
52+ f"测试常量与 module._PROVIDER_TYPE 一致({ module ._PROVIDER_TYPE } )" ,
53+ )
4954
5055 print ("\n === 3. provider 已进入注册表 ===" )
5156 check (PROVIDER_TYPE in provider_cls_map , "provider_cls_map 包含 provider" )
You can’t perform that action at this time.
0 commit comments