yymaxapi 1.0.53 → 1.0.55
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
CHANGED
|
@@ -3397,44 +3397,55 @@ async function switchModel(paths) {
|
|
|
3397
3397
|
return;
|
|
3398
3398
|
}
|
|
3399
3399
|
|
|
3400
|
-
|
|
3401
|
-
const
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
'heibai': 'MAXAPI (按量)',
|
|
3405
|
-
};
|
|
3400
|
+
const claudeApiConfig = API_CONFIG.claude;
|
|
3401
|
+
const codexApiConfig = API_CONFIG.codex;
|
|
3402
|
+
const claudeProviderName = claudeApiConfig.providerName;
|
|
3403
|
+
const codexProviderName = codexApiConfig.providerName;
|
|
3406
3404
|
|
|
3407
|
-
//
|
|
3405
|
+
// 从预设模型列表构建选项(确保始终展示最新可用模型)
|
|
3408
3406
|
const choices = [];
|
|
3409
|
-
|
|
3410
|
-
const label = PROVIDER_LABELS[providerName] || providerName;
|
|
3411
|
-
const models = providerConfig.models || [];
|
|
3412
|
-
if (models.length === 0) continue;
|
|
3407
|
+
const listedKeys = new Set();
|
|
3413
3408
|
|
|
3414
|
-
|
|
3415
|
-
|
|
3409
|
+
if (CLAUDE_MODELS.length > 0) {
|
|
3410
|
+
choices.push(new inquirer.Separator(' -- Claude --'));
|
|
3411
|
+
for (const m of CLAUDE_MODELS) {
|
|
3412
|
+
const providerName = providers[claudeProviderName] ? claudeProviderName : Object.keys(providers)[0];
|
|
3416
3413
|
const modelKey = `${providerName}/${m.id}`;
|
|
3417
3414
|
const isCurrent = modelKey === primary;
|
|
3418
3415
|
choices.push({
|
|
3419
|
-
name: isCurrent ? `${m.name
|
|
3416
|
+
name: isCurrent ? `${m.name} (当前)` : m.name,
|
|
3420
3417
|
value: modelKey,
|
|
3421
3418
|
});
|
|
3419
|
+
listedKeys.add(modelKey);
|
|
3422
3420
|
}
|
|
3423
3421
|
}
|
|
3424
3422
|
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3423
|
+
if (CODEX_MODELS.length > 0) {
|
|
3424
|
+
choices.push(new inquirer.Separator(' -- GPT --'));
|
|
3425
|
+
for (const m of CODEX_MODELS) {
|
|
3426
|
+
const providerName = providers[codexProviderName] ? codexProviderName : Object.keys(providers)[0];
|
|
3427
|
+
const modelKey = `${providerName}/${m.id}`;
|
|
3428
|
+
const isCurrent = modelKey === primary;
|
|
3429
|
+
choices.push({
|
|
3430
|
+
name: isCurrent ? `${m.name} (当前)` : m.name,
|
|
3431
|
+
value: modelKey,
|
|
3432
|
+
});
|
|
3433
|
+
listedKeys.add(modelKey);
|
|
3434
|
+
}
|
|
3435
|
+
}
|
|
3436
|
+
|
|
3437
|
+
// 补上配置文件中已有但不在预设列表里的模型
|
|
3438
|
+
for (const [providerName, providerConfig] of Object.entries(providers)) {
|
|
3439
|
+
for (const m of (providerConfig.models || [])) {
|
|
3440
|
+
const modelKey = `${providerName}/${m.id}`;
|
|
3441
|
+
if (listedKeys.has(modelKey)) continue;
|
|
3442
|
+
const isCurrent = modelKey === primary;
|
|
3443
|
+
choices.push({
|
|
3444
|
+
name: isCurrent ? `${m.name || m.id} (当前)` : (m.name || m.id),
|
|
3445
|
+
value: modelKey,
|
|
3446
|
+
});
|
|
3447
|
+
listedKeys.add(modelKey);
|
|
3448
|
+
}
|
|
3438
3449
|
}
|
|
3439
3450
|
|
|
3440
3451
|
if (choices.filter(c => c.value).length === 0) {
|
|
@@ -24,15 +24,12 @@
|
|
|
24
24
|
],
|
|
25
25
|
"models": {
|
|
26
26
|
"claude": [
|
|
27
|
-
{ "id": "claude-opus-4-6", "name": "Claude Opus 4.6" },
|
|
28
|
-
{ "id": "claude-opus-4-6-Thinking", "name": "Claude Opus 4.6 Thinking" },
|
|
29
27
|
{ "id": "claude-sonnet-4-6", "name": "Claude Sonnet 4.6" },
|
|
30
|
-
{ "id": "claude-
|
|
31
|
-
{ "id": "claude-haiku-4-5", "name": "Claude Haiku 4.5" }
|
|
28
|
+
{ "id": "claude-opus-4-6", "name": "Claude Opus 4.6 (待恢复)" }
|
|
32
29
|
],
|
|
33
30
|
"codex": [
|
|
34
|
-
{ "id": "gpt-5.
|
|
35
|
-
{ "id": "gpt-5.
|
|
31
|
+
{ "id": "gpt-5.4", "name": "GPT 5.4" },
|
|
32
|
+
{ "id": "gpt-5.4-pro", "name": "GPT 5.4 Pro (待支持)" }
|
|
36
33
|
]
|
|
37
34
|
},
|
|
38
35
|
"apiConfig": {
|
|
@@ -46,8 +43,8 @@
|
|
|
46
43
|
"codex": {
|
|
47
44
|
"urlSuffix": "/codex",
|
|
48
45
|
"api": "openai-responses",
|
|
49
|
-
"contextWindow":
|
|
50
|
-
"maxTokens":
|
|
46
|
+
"contextWindow": 1050000,
|
|
47
|
+
"maxTokens": 128000,
|
|
51
48
|
"providerName": "yunyi"
|
|
52
49
|
}
|
|
53
50
|
}
|
|
@@ -89,6 +86,6 @@ npx yymaxapi@latest
|
|
|
89
86
|
|
|
90
87
|
**注意事项:**
|
|
91
88
|
- `base_url` 不要加 `/v1`,平台会自动拼接 `/v1/messages`
|
|
92
|
-
- 可用模型:`claude-
|
|
89
|
+
- 可用模型:`claude-sonnet-4-6`、`claude-opus-4-6`
|
|
93
90
|
- 已验证环境:腾讯云 OpenCloudOS,OpenClaw `2026.2.3-1`
|
|
94
91
|
- 参考文档:https://cloud.tencent.com/developer/article/2624003
|