yymaxapi 1.0.71 → 1.0.72
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/bin/yymaxapi.js +9 -14
- package/package.json +1 -1
package/bin/yymaxapi.js
CHANGED
|
@@ -1795,23 +1795,18 @@ function ensureGatewaySettings(config) {
|
|
|
1795
1795
|
|
|
1796
1796
|
}
|
|
1797
1797
|
|
|
1798
|
-
//
|
|
1798
|
+
// 只清理 yunyi 相关的 env.vars;其他服务商的不动
|
|
1799
1799
|
function cleanupConflictingEnvVars(config, codexBaseUrl, apiKey) {
|
|
1800
1800
|
if (!config.env?.vars) return;
|
|
1801
1801
|
const vars = config.env.vars;
|
|
1802
|
-
//
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
// 如果 vars 空了,清掉整个 env 节点
|
|
1811
|
-
if (Object.keys(vars).length === 0) {
|
|
1812
|
-
delete config.env.vars;
|
|
1813
|
-
if (config.env && Object.keys(config.env).length === 0) delete config.env;
|
|
1814
|
-
}
|
|
1802
|
+
// 只处理指向 yunyi 的 env vars(过时的 yunyi 配置)
|
|
1803
|
+
const isYunyiUrl = vars.OPENAI_BASE_URL && vars.OPENAI_BASE_URL.includes('yunyi');
|
|
1804
|
+
if (isYunyiUrl) {
|
|
1805
|
+
// yunyi 的 base url 存在,更新为正确值
|
|
1806
|
+
if (codexBaseUrl) vars.OPENAI_BASE_URL = codexBaseUrl;
|
|
1807
|
+
if (vars.OPENAI_API_KEY !== apiKey) vars.OPENAI_API_KEY = apiKey;
|
|
1808
|
+
}
|
|
1809
|
+
// 其他服务商的 OPENAI_API_KEY / OPENAI_BASE_URL 不动
|
|
1815
1810
|
}
|
|
1816
1811
|
|
|
1817
1812
|
function isPortOpen(port, host = '127.0.0.1', timeoutMs = 800) {
|