yymaxapi 1.0.98 → 1.0.99
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
|
@@ -108,7 +108,11 @@ const DEFAULT_CLAUDE_MODELS = [
|
|
|
108
108
|
},
|
|
109
109
|
{
|
|
110
110
|
"id": "claude-opus-4-6",
|
|
111
|
-
"name": "Claude Opus 4.6
|
|
111
|
+
"name": "Claude Opus 4.6"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"id": "claude-opus-4-6-thinking",
|
|
115
|
+
"name": "Claude Opus 4.6 Thinking"
|
|
112
116
|
}
|
|
113
117
|
];
|
|
114
118
|
|
|
@@ -1936,7 +1940,7 @@ const YYMAXAPI_OPENCLAW_GPT_FALLBACK = `${YYMAXAPI_OPENCLAW_GPT_PROVIDER}/gpt-5.
|
|
|
1936
1940
|
const YYMAXAPI_MANAGED_MAIN_NAMES = new Set(['Claude', 'claude', 'yunyi-claude', 'claude-yunyi']);
|
|
1937
1941
|
const YYMAXAPI_MANAGED_GPT_NAMES = new Set(['GPT', 'Codex', 'gpt', 'yunyi-gpt', 'yunyi-codex']);
|
|
1938
1942
|
const YYMAXAPI_MANAGED_MULTIMODAL_MODELS = {
|
|
1939
|
-
claude: new Set(['claude-sonnet-4-6', 'claude-opus-4-6']),
|
|
1943
|
+
claude: new Set(['claude-sonnet-4-6', 'claude-opus-4-6', 'claude-opus-4-6-thinking']),
|
|
1940
1944
|
codex: new Set(['gpt-5.4', 'gpt-5.3-codex'])
|
|
1941
1945
|
};
|
|
1942
1946
|
|
|
@@ -1972,15 +1976,9 @@ function stripManagedYunyiSuffix(baseUrl) {
|
|
|
1972
1976
|
|
|
1973
1977
|
function getManagedYunyiModelCatalog(type) {
|
|
1974
1978
|
if (type === 'claude') {
|
|
1975
|
-
return
|
|
1976
|
-
{ id: 'claude-sonnet-4-6', name: 'Claude Sonnet 4.6' },
|
|
1977
|
-
{ id: 'claude-opus-4-6', name: 'Claude Opus 4.6' }
|
|
1978
|
-
];
|
|
1979
|
+
return CLAUDE_MODELS;
|
|
1979
1980
|
}
|
|
1980
|
-
return
|
|
1981
|
-
{ id: 'gpt-5.4', name: 'GPT 5.4' },
|
|
1982
|
-
{ id: 'gpt-5.3-codex', name: 'GPT 5.3 Codex' }
|
|
1983
|
-
];
|
|
1981
|
+
return CODEX_MODELS;
|
|
1984
1982
|
}
|
|
1985
1983
|
|
|
1986
1984
|
function resolveManagedYunyiModelName(type, modelId, fallbackName) {
|
|
@@ -2038,15 +2036,29 @@ function canonicalizeManagedYunyiModelKey(modelKey, preferredType = '') {
|
|
|
2038
2036
|
return text;
|
|
2039
2037
|
}
|
|
2040
2038
|
|
|
2039
|
+
function getManagedYunyiProviderName(type) {
|
|
2040
|
+
return type === 'claude' ? YYMAXAPI_OPENCLAW_CLAUDE_PROVIDER : YYMAXAPI_OPENCLAW_GPT_PROVIDER;
|
|
2041
|
+
}
|
|
2042
|
+
|
|
2043
|
+
function getManagedYunyiDefaultPrimaryModelKey(type) {
|
|
2044
|
+
return type === 'claude' ? YYMAXAPI_OPENCLAW_CLAUDE_PRIMARY : YYMAXAPI_OPENCLAW_GPT_PRIMARY;
|
|
2045
|
+
}
|
|
2046
|
+
|
|
2041
2047
|
function getManagedYunyiKnownModelKeys(type) {
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2048
|
+
const providerName = getManagedYunyiProviderName(type);
|
|
2049
|
+
return getManagedYunyiModelCatalog(type).map(model => `${providerName}/${model.id}`);
|
|
2050
|
+
}
|
|
2051
|
+
|
|
2052
|
+
function getManagedYunyiModelAliasEntries() {
|
|
2053
|
+
return {
|
|
2054
|
+
...Object.fromEntries(getManagedYunyiKnownModelKeys('claude').map(modelKey => [modelKey, YYMAXAPI_OPENCLAW_CLAUDE_PROVIDER])),
|
|
2055
|
+
...Object.fromEntries(getManagedYunyiKnownModelKeys('codex').map(modelKey => [modelKey, YYMAXAPI_OPENCLAW_GPT_PROVIDER]))
|
|
2056
|
+
};
|
|
2045
2057
|
}
|
|
2046
2058
|
|
|
2047
2059
|
function normalizeManagedYunyiModelState(type, modelState = {}, options = {}) {
|
|
2048
2060
|
const knownKeys = getManagedYunyiKnownModelKeys(type);
|
|
2049
|
-
const fallbackPrimary = knownKeys[0];
|
|
2061
|
+
const fallbackPrimary = knownKeys[0] || getManagedYunyiDefaultPrimaryModelKey(type);
|
|
2050
2062
|
const currentPrimary = canonicalizeManagedYunyiModelKey(modelState.primary || '', type);
|
|
2051
2063
|
const canPreserve = !options.force && currentPrimary && knownKeys.includes(currentPrimary);
|
|
2052
2064
|
const primary = canPreserve ? currentPrimary : fallbackPrimary;
|
|
@@ -2136,12 +2148,7 @@ function applyManagedYunyiModelSelection(config, selectedModelKey) {
|
|
|
2136
2148
|
changed = true;
|
|
2137
2149
|
}
|
|
2138
2150
|
|
|
2139
|
-
const managedModelAliases =
|
|
2140
|
-
[YYMAXAPI_OPENCLAW_CLAUDE_PRIMARY]: YYMAXAPI_OPENCLAW_CLAUDE_PROVIDER,
|
|
2141
|
-
[YYMAXAPI_OPENCLAW_CLAUDE_FALLBACK]: YYMAXAPI_OPENCLAW_CLAUDE_PROVIDER,
|
|
2142
|
-
[YYMAXAPI_OPENCLAW_GPT_PRIMARY]: YYMAXAPI_OPENCLAW_GPT_PROVIDER,
|
|
2143
|
-
[YYMAXAPI_OPENCLAW_GPT_FALLBACK]: YYMAXAPI_OPENCLAW_GPT_PROVIDER
|
|
2144
|
-
};
|
|
2151
|
+
const managedModelAliases = getManagedYunyiModelAliasEntries();
|
|
2145
2152
|
for (const [modelKey, alias] of Object.entries(managedModelAliases)) {
|
|
2146
2153
|
const nextEntry = { alias };
|
|
2147
2154
|
if (JSON.stringify(config.agents.defaults.models[modelKey] || {}) !== JSON.stringify(nextEntry)) {
|
|
@@ -2528,12 +2535,7 @@ function applyManagedYunyiOpenClawLayout(config, options = {}) {
|
|
|
2528
2535
|
}
|
|
2529
2536
|
|
|
2530
2537
|
const defaultsModels = config.agents.defaults.models;
|
|
2531
|
-
const managedModelAliases =
|
|
2532
|
-
[YYMAXAPI_OPENCLAW_CLAUDE_PRIMARY]: YYMAXAPI_OPENCLAW_CLAUDE_PROVIDER,
|
|
2533
|
-
[YYMAXAPI_OPENCLAW_CLAUDE_FALLBACK]: YYMAXAPI_OPENCLAW_CLAUDE_PROVIDER,
|
|
2534
|
-
[YYMAXAPI_OPENCLAW_GPT_PRIMARY]: YYMAXAPI_OPENCLAW_GPT_PROVIDER,
|
|
2535
|
-
[YYMAXAPI_OPENCLAW_GPT_FALLBACK]: YYMAXAPI_OPENCLAW_GPT_PROVIDER
|
|
2536
|
-
};
|
|
2538
|
+
const managedModelAliases = getManagedYunyiModelAliasEntries();
|
|
2537
2539
|
for (const [modelKey, alias] of Object.entries(managedModelAliases)) {
|
|
2538
2540
|
const nextEntry = { alias };
|
|
2539
2541
|
if (JSON.stringify(defaultsModels[modelKey] || {}) !== JSON.stringify(nextEntry)) {
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
"models": {
|
|
26
26
|
"claude": [
|
|
27
27
|
{ "id": "claude-sonnet-4-6", "name": "Claude Sonnet 4.6" },
|
|
28
|
-
{ "id": "claude-opus-4-6", "name": "Claude Opus 4.6
|
|
28
|
+
{ "id": "claude-opus-4-6", "name": "Claude Opus 4.6" },
|
|
29
|
+
{ "id": "claude-opus-4-6-thinking", "name": "Claude Opus 4.6 Thinking" }
|
|
29
30
|
],
|
|
30
31
|
"codex": [
|
|
31
32
|
{ "id": "gpt-5.4", "name": "GPT 5.4" },
|
|
@@ -103,7 +104,7 @@ npx yymaxapi@latest
|
|
|
103
104
|
|
|
104
105
|
**注意事项:**
|
|
105
106
|
- `base_url` 不要加 `/v1`,平台会自动拼接路径
|
|
106
|
-
- Claude 可用模型:`claude-sonnet-4-6`、`claude-opus-4-6`
|
|
107
|
+
- Claude 可用模型:`claude-sonnet-4-6`、`claude-opus-4-6`、`claude-opus-4-6-thinking`
|
|
107
108
|
- GPT 可用模型:`gpt-5.4`
|
|
108
109
|
- 已验证环境:腾讯云 OpenCloudOS,OpenClaw `2026.2.3-1`
|
|
109
110
|
- 参考文档:https://cloud.tencent.com/developer/article/2624003
|