@cloud411716/fancy-webnovel 4.30.24 → 4.30.26
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
|
@@ -2130,13 +2130,7 @@ async function handleTeamCommand(ctx, session, tokens) {
|
|
|
2130
2130
|
return notify(session, 'error', '❌ 读取模型列表失败:' + (err && err.message ? err.message : String(err)));
|
|
2131
2131
|
}
|
|
2132
2132
|
const ids = models.map((item) => String(item && item.id || ''));
|
|
2133
|
-
|
|
2134
|
-
return notify(session, 'error', [
|
|
2135
|
-
`❌ ${provider} 没有模型 "${model}"。可用:`,
|
|
2136
|
-
...ids.slice(0, 30).map((id) => '- ' + id),
|
|
2137
|
-
ids.length > 30 ? `… 共 ${ids.length} 个` : '',
|
|
2138
|
-
].filter(Boolean).join('\n'));
|
|
2139
|
-
}
|
|
2133
|
+
const catalogMiss = ids.length && !ids.includes(model);
|
|
2140
2134
|
const field = key === 'a' ? 'generatorA' : key === 'b' ? 'generatorB' : 'judge';
|
|
2141
2135
|
const clash = ['generatorA', 'generatorB', 'judge']
|
|
2142
2136
|
.filter((name) => name !== field)
|
|
@@ -2146,7 +2140,8 @@ async function handleTeamCommand(ctx, session, tokens) {
|
|
|
2146
2140
|
}
|
|
2147
2141
|
config[field] = { provider, model };
|
|
2148
2142
|
writeTeamConfig(root, config);
|
|
2149
|
-
return notify(session, 'success', `✅ ${field} 已设为 ${provider}/${model}。`
|
|
2143
|
+
return notify(session, 'success', `✅ ${field} 已设为 ${provider}/${model}。`
|
|
2144
|
+
+ (catalogMiss ? '\n⚠️ 该模型不在当前 provider 目录里,生成时以实际 API 为准。' : ''));
|
|
2150
2145
|
}
|
|
2151
2146
|
if (key === 'rounds') {
|
|
2152
2147
|
const n = Number.parseInt(value[0], 10);
|
|
@@ -10,7 +10,7 @@ import fs from 'node:fs';
|
|
|
10
10
|
import path from 'node:path';
|
|
11
11
|
|
|
12
12
|
const TEAM_FILE = 'team.json';
|
|
13
|
-
const TEAM_CALL_TIMEOUT_MS =
|
|
13
|
+
const TEAM_CALL_TIMEOUT_MS = 40 * 60 * 1000;
|
|
14
14
|
const DEFAULT_TEAM = Object.freeze({
|
|
15
15
|
version: 1,
|
|
16
16
|
enabled: false,
|
|
@@ -120,9 +120,11 @@ export async function validateTeamModels(ctx, config) {
|
|
|
120
120
|
return `${label} 的 provider "${route.provider}" 不可用:${err && err.message ? err.message : String(err)}`;
|
|
121
121
|
}
|
|
122
122
|
const ids = (Array.isArray(models) ? models : []).map((item) => String(item && item.id || ''));
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
123
|
+
// Provider catalogs can lag behind accepted model aliases (for example a
|
|
124
|
+
// deprecated `-free` id that the API redirects to its stable id). Do not
|
|
125
|
+
// block generation here; an actually invalid route fails at the call with
|
|
126
|
+
// the provider's own error, which the team meta now records.
|
|
127
|
+
if (ids.length && !ids.includes(route.model)) continue;
|
|
126
128
|
}
|
|
127
129
|
return '';
|
|
128
130
|
}
|