@tokenaut/opentoken 1.4.11 → 1.4.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tokenaut/opentoken",
3
- "version": "1.4.11",
3
+ "version": "1.4.12",
4
4
  "description": "OpenToken 一键接入 AI 模型 · https://docs.opentoken.io/",
5
5
  "main": "src/cli.js",
6
6
  "bin": {
@@ -93,11 +93,13 @@ function getCurrentCodexConfig() {
93
93
  data.model_providers && typeof data.model_providers === 'object' && !Array.isArray(data.model_providers)
94
94
  ? data.model_providers
95
95
  : {};
96
+
97
+ const activeKey = data.model_provider != null ? String(data.model_provider) : CODEX_PROVIDER_KEY;
96
98
  const provider =
97
- providers[CODEX_PROVIDER_KEY] &&
98
- typeof providers[CODEX_PROVIDER_KEY] === 'object' &&
99
- !Array.isArray(providers[CODEX_PROVIDER_KEY])
100
- ? providers[CODEX_PROVIDER_KEY]
99
+ providers[activeKey] &&
100
+ typeof providers[activeKey] === 'object' &&
101
+ !Array.isArray(providers[activeKey])
102
+ ? providers[activeKey]
101
103
  : {};
102
104
 
103
105
  return {