dsh-livebench-panel 0.1.13 → 0.1.14

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.
Files changed (2) hide show
  1. package/lib/client.js +35 -36
  2. package/package.json +43 -43
package/lib/client.js CHANGED
@@ -92,7 +92,7 @@ window.__ModuleLoader__.load({
92
92
  function LiveBenchView() {
93
93
  const [config, setConfig] = useState(null);
94
94
  const [configError, setConfigError] = useState(null);
95
- const [sel, setSel] = useState({ models: [], reasoning: "default", cats: [], tasks: [], release: "2024-11-25", begin: "", end: "", maxTokens: "32000" });
95
+ const [sel, setSel] = useState({ models: [], efforts: {}, cats: [], tasks: [], release: "2024-11-25", begin: "", end: "", maxTokens: "32000" });
96
96
  const [modelDdOpen, setModelDdOpen] = useState(false);
97
97
  const modelDdRef = useRef(null);
98
98
  const [busy, setBusy] = useState(false);
@@ -199,24 +199,14 @@ window.__ModuleLoader__.load({
199
199
  const next = list.includes(value) ? list.filter((v) => v !== value) : [...list, value];
200
200
  return { ...prev, [key]: next };
201
201
  });
202
- // 已选模型(provider::model 值列表)的解析与 effort 并集
202
+ // 已选模型(provider::model 值列表)的解析与 per-model effort
203
203
  const selectedModelEntries = useMemo(() => sel.models.map((value) => {
204
204
  const [pid, ...rest] = value.split("::");
205
205
  const mid = rest.join("::");
206
206
  const provider = config?.providers.find((p) => p.id === pid) ?? null;
207
207
  const model = provider?.models.find((m) => m.id === mid) ?? null;
208
- return { providerId: pid, modelId: mid, efforts: model?.efforts ?? [] };
208
+ return { providerId: pid, modelId: mid, modelValue: value, efforts: model?.efforts ?? [] };
209
209
  }).filter((entry) => entry.modelId !== ""), [sel.models, config]);
210
- const effortOptions = useMemo(() => {
211
- const seen = new Set();
212
- const union = [];
213
- for (const entry of selectedModelEntries) {
214
- for (const e of entry.efforts) {
215
- if (!seen.has(e)) { seen.add(e); union.push({ value: e, label: e === "off" ? "off(关闭思考)" : e }); }
216
- }
217
- }
218
- return union;
219
- }, [selectedModelEntries]);
220
210
 
221
211
  const onStart = async () => {
222
212
  setStartError(null);
@@ -239,7 +229,8 @@ window.__ModuleLoader__.load({
239
229
  }
240
230
  setBusy(true);
241
231
  try {
242
- // 每个 selected 模型并发启动一个评测(服务端有并发上限保护)
232
+ // 每个 selected 模型并发启动一个评测(服务端有并发上限保护),
233
+ // 推理强度按各模型在次级下拉中的选择逐个下发
243
234
  const failures = [];
244
235
  const launches = selectedModelEntries.map(async (entry) => {
245
236
  const payload = await api("/start", {
@@ -248,7 +239,7 @@ window.__ModuleLoader__.load({
248
239
  body: JSON.stringify({
249
240
  provider: entry.providerId,
250
241
  model: entry.modelId,
251
- reasoningEffort: sel.reasoning,
242
+ reasoningEffort: sel.efforts[entry.modelValue] ?? "default",
252
243
  benchNames,
253
244
  release: sel.release,
254
245
  begin: sel.begin,
@@ -408,10 +399,8 @@ window.__ModuleLoader__.load({
408
399
  : `已选 ${sel.models.length} 个模型`),
409
400
  modelDdOpen && h("div", {
410
401
  style: {
411
- position: "absolute", zIndex: 30, top: "calc(100% + 4px)", left: 0, right: 0,
412
- maxHeight: "320px", overflowY: "auto", border: "1px solid var(--dsw-alias-border-l2)",
402
+ marginTop: "6px", maxHeight: "340px", overflowY: "auto", border: "1px solid var(--dsw-alias-border-l2)",
413
403
  borderRadius: "8px", background: "var(--dsw-alias-bg-layer-1)", padding: "6px",
414
- boxShadow: "var(--dsw-shadow-lv1, 0 4px 16px rgba(0,0,0,.25))",
415
404
  },
416
405
  },
417
406
  (config?.providers ?? []).map((p) => h("div", { key: p.id, style: { marginBottom: "4px" } },
@@ -420,26 +409,36 @@ window.__ModuleLoader__.load({
420
409
  p.models.map((m) => {
421
410
  const value = p.id + "::" + m.id;
422
411
  const checked = sel.models.includes(value);
423
- return h("label", {
424
- key: value,
425
- style: { display: "flex", alignItems: "center", gap: "6px", padding: "3px 4px", cursor: "pointer", borderRadius: "6px" },
426
- },
427
- h("input", { type: "checkbox", checked, onChange: () => {
428
- setSel((prev) => {
429
- const set = new Set(prev.models);
430
- if (set.has(value)) set.delete(value); else set.add(value);
431
- return { ...prev, models: [...set] };
432
- });
433
- } }),
434
- h("span", { style: { fontSize: "12.5px" } }, m.name));
412
+ return h("div", { key: value, style: { borderBottom: "1px solid var(--dsw-alias-border-l2)", padding: "3px 4px" } },
413
+ h("div", {
414
+ style: { display: "flex", alignItems: "center", gap: "8px", cursor: "pointer" },
415
+ onClick: () => {
416
+ setSel((prev) => {
417
+ const set = new Set(prev.models);
418
+ const nextEfforts = { ...prev.efforts };
419
+ if (set.has(value)) { set.delete(value); delete nextEfforts[value]; }
420
+ else set.add(value);
421
+ return { ...prev, models: [...set], efforts: nextEfforts };
422
+ });
423
+ },
424
+ },
425
+ h("input", { type: "checkbox", checked, readOnly: true, style: { cursor: "pointer" } }),
426
+ h("span", { style: { fontSize: "12.5px", flex: 1 } }, m.name)),
427
+ checked && m.efforts.length > 0 && h("div", { style: { display: "flex", alignItems: "center", gap: "6px", padding: "4px 0 2px 26px" } },
428
+ h("span", { style: { fontSize: "11px", color: "var(--dsw-alias-label-tertiary)", whiteSpace: "nowrap" } }, "推理强度"),
429
+ h("select", {
430
+ className: c("select"), style: { height: "28px", fontSize: "12px", flex: 1 },
431
+ value: sel.efforts[value] ?? "default",
432
+ onClick: (event) => event.stopPropagation(),
433
+ onChange: (event) => {
434
+ const v = event.target.value;
435
+ setSel((prev) => ({ ...prev, efforts: { ...prev.efforts, [value]: v } }));
436
+ },
437
+ },
438
+ h("option", { value: "default" }, "(模型默认)"),
439
+ m.efforts.map((e) => h("option", { key: e, value: e }, e === "off" ? "off(关闭思考)" : e)))));
435
440
  }))),
436
441
  ),
437
- h("div", { className: c("field") },
438
- h("label", { className: c("label") }, "推理强度"),
439
- h("select", { className: c("select"), value: sel.reasoning, onChange: setField("reasoning"), disabled: effortOptions.length === 0 },
440
- h("option", { value: "default" }, effortOptions.length === 0 ? "(按模型默认)" : "(模型默认)"),
441
- effortOptions.map((e) => h("option", { key: e.value, value: e.value }, e.label))),
442
- ),
443
442
  h("div", { className: c("field") },
444
443
  h("label", { className: c("label") }, "题集 release"),
445
444
  h("select", { className: c("select"), value: sel.release, onChange: setField("release") },
package/package.json CHANGED
@@ -1,43 +1,43 @@
1
- {
2
- "name": "dsh-livebench-panel",
3
- "version": "0.1.13",
4
- "description": "DSH web plugin: a LiveBench tab in the Trajectory view (right of 对话/轨迹). Run LiveBench evaluations against every model configured in the DeepSeek Harness — pick provider/model, category, task, release and question range from dropdowns, watch progress, and read scores in place.",
5
- "license": "MIT",
6
- "type": "module",
7
- "main": "lib/index.js",
8
- "exports": {
9
- ".": "./lib/index.js",
10
- "./client": "./lib/client.js",
11
- "./cordis.patch.yml": "./cordis.patch.yml",
12
- "./package.json": "./package.json"
13
- },
14
- "engines": {
15
- "node": ">=20"
16
- },
17
- "files": [
18
- "lib",
19
- "cordis.patch.yml",
20
- "README.md"
21
- ],
22
- "keywords": [
23
- "dsh-plugin",
24
- "deepseek-harness",
25
- "livebench",
26
- "benchmark",
27
- "evaluation"
28
- ],
29
- "dsh": {
30
- "bundle": {
31
- "patch": "./cordis.patch.yml"
32
- },
33
- "client": {
34
- "platform": "web",
35
- "inject": [
36
- "@deepseek-ai/dsh-client-runtime",
37
- "@deepseek-ai/dsh-client-locale",
38
- "@deepseek-ai/dsh-client-ui-slots",
39
- "@deepseek-ai/dsh-client-ui-conversation"
40
- ]
41
- }
42
- }
43
- }
1
+ {
2
+ "name": "dsh-livebench-panel",
3
+ "version": "0.1.14",
4
+ "description": "DSH web plugin: a LiveBench tab in the Trajectory view (right of 对话/轨迹). Run LiveBench evaluations against every model configured in the DeepSeek Harness — pick provider/model, category, task, release and question range from dropdowns, watch progress, and read scores in place.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "main": "lib/index.js",
8
+ "exports": {
9
+ ".": "./lib/index.js",
10
+ "./client": "./lib/client.js",
11
+ "./cordis.patch.yml": "./cordis.patch.yml",
12
+ "./package.json": "./package.json"
13
+ },
14
+ "engines": {
15
+ "node": ">=20"
16
+ },
17
+ "files": [
18
+ "lib",
19
+ "cordis.patch.yml",
20
+ "README.md"
21
+ ],
22
+ "keywords": [
23
+ "dsh-plugin",
24
+ "deepseek-harness",
25
+ "livebench",
26
+ "benchmark",
27
+ "evaluation"
28
+ ],
29
+ "dsh": {
30
+ "bundle": {
31
+ "patch": "./cordis.patch.yml"
32
+ },
33
+ "client": {
34
+ "platform": "web",
35
+ "inject": [
36
+ "@deepseek-ai/dsh-client-runtime",
37
+ "@deepseek-ai/dsh-client-locale",
38
+ "@deepseek-ai/dsh-client-ui-slots",
39
+ "@deepseek-ai/dsh-client-ui-conversation"
40
+ ]
41
+ }
42
+ }
43
+ }