inspect-ai 0.3.93__py3-none-any.whl → 0.3.95__py3-none-any.whl
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.
- inspect_ai/_display/textual/widgets/samples.py +3 -3
- inspect_ai/_display/textual/widgets/transcript.py +3 -29
- inspect_ai/_eval/loader.py +1 -1
- inspect_ai/_eval/task/run.py +21 -12
- inspect_ai/_util/answer.py +26 -0
- inspect_ai/_util/constants.py +0 -1
- inspect_ai/_util/exception.py +4 -0
- inspect_ai/_util/hash.py +39 -0
- inspect_ai/_util/local_server.py +51 -21
- inspect_ai/_util/path.py +22 -0
- inspect_ai/_util/trace.py +1 -1
- inspect_ai/_util/working.py +4 -0
- inspect_ai/_view/www/dist/assets/index.css +23 -22
- inspect_ai/_view/www/dist/assets/index.js +517 -204
- inspect_ai/_view/www/log-schema.json +375 -0
- inspect_ai/_view/www/package.json +1 -1
- inspect_ai/_view/www/src/@types/log.d.ts +90 -12
- inspect_ai/_view/www/src/app/log-view/navbar/SecondaryBar.tsx +2 -2
- inspect_ai/_view/www/src/app/log-view/tabs/SamplesTab.tsx +1 -4
- inspect_ai/_view/www/src/app/samples/SamplesTools.tsx +3 -13
- inspect_ai/_view/www/src/app/samples/sample-tools/SelectScorer.tsx +45 -48
- inspect_ai/_view/www/src/app/samples/sample-tools/filters.ts +16 -15
- inspect_ai/_view/www/src/app/samples/sample-tools/sample-filter/SampleFilter.tsx +47 -75
- inspect_ai/_view/www/src/app/samples/sample-tools/sample-filter/completions.ts +9 -9
- inspect_ai/_view/www/src/app/samples/transcript/SandboxEventView.module.css +2 -1
- inspect_ai/_view/www/src/app/samples/transcript/SpanEventView.tsx +174 -0
- inspect_ai/_view/www/src/app/samples/transcript/ToolEventView.tsx +8 -8
- inspect_ai/_view/www/src/app/samples/transcript/TranscriptView.tsx +12 -2
- inspect_ai/_view/www/src/app/samples/transcript/TranscriptVirtualListComponent.module.css +1 -1
- inspect_ai/_view/www/src/app/samples/transcript/event/EventPanel.tsx +0 -3
- inspect_ai/_view/www/src/app/samples/transcript/transform/fixups.ts +87 -25
- inspect_ai/_view/www/src/app/samples/transcript/transform/treeify.ts +229 -17
- inspect_ai/_view/www/src/app/samples/transcript/transform/utils.ts +11 -0
- inspect_ai/_view/www/src/app/samples/transcript/types.ts +5 -1
- inspect_ai/_view/www/src/app/types.ts +12 -2
- inspect_ai/_view/www/src/components/ExpandablePanel.module.css +1 -1
- inspect_ai/_view/www/src/components/ExpandablePanel.tsx +5 -5
- inspect_ai/_view/www/src/state/hooks.ts +19 -3
- inspect_ai/_view/www/src/state/logSlice.ts +23 -5
- inspect_ai/_view/www/yarn.lock +9 -9
- inspect_ai/agent/_as_solver.py +3 -1
- inspect_ai/agent/_as_tool.py +6 -4
- inspect_ai/agent/_bridge/patch.py +1 -3
- inspect_ai/agent/_handoff.py +5 -1
- inspect_ai/agent/_react.py +4 -3
- inspect_ai/agent/_run.py +6 -1
- inspect_ai/agent/_types.py +9 -0
- inspect_ai/analysis/__init__.py +0 -0
- inspect_ai/analysis/beta/__init__.py +57 -0
- inspect_ai/analysis/beta/_dataframe/__init__.py +0 -0
- inspect_ai/analysis/beta/_dataframe/columns.py +145 -0
- inspect_ai/analysis/beta/_dataframe/evals/__init__.py +0 -0
- inspect_ai/analysis/beta/_dataframe/evals/columns.py +132 -0
- inspect_ai/analysis/beta/_dataframe/evals/extract.py +23 -0
- inspect_ai/analysis/beta/_dataframe/evals/table.py +140 -0
- inspect_ai/analysis/beta/_dataframe/events/__init__.py +0 -0
- inspect_ai/analysis/beta/_dataframe/events/columns.py +37 -0
- inspect_ai/analysis/beta/_dataframe/events/table.py +14 -0
- inspect_ai/analysis/beta/_dataframe/extract.py +54 -0
- inspect_ai/analysis/beta/_dataframe/messages/__init__.py +0 -0
- inspect_ai/analysis/beta/_dataframe/messages/columns.py +60 -0
- inspect_ai/analysis/beta/_dataframe/messages/extract.py +21 -0
- inspect_ai/analysis/beta/_dataframe/messages/table.py +87 -0
- inspect_ai/analysis/beta/_dataframe/record.py +377 -0
- inspect_ai/analysis/beta/_dataframe/samples/__init__.py +0 -0
- inspect_ai/analysis/beta/_dataframe/samples/columns.py +73 -0
- inspect_ai/analysis/beta/_dataframe/samples/extract.py +82 -0
- inspect_ai/analysis/beta/_dataframe/samples/table.py +329 -0
- inspect_ai/analysis/beta/_dataframe/util.py +157 -0
- inspect_ai/analysis/beta/_dataframe/validate.py +171 -0
- inspect_ai/dataset/_dataset.py +6 -3
- inspect_ai/log/__init__.py +10 -0
- inspect_ai/log/_convert.py +4 -9
- inspect_ai/log/_file.py +1 -1
- inspect_ai/log/_log.py +21 -1
- inspect_ai/log/_samples.py +14 -17
- inspect_ai/log/_transcript.py +77 -35
- inspect_ai/log/_tree.py +118 -0
- inspect_ai/model/_call_tools.py +44 -35
- inspect_ai/model/_model.py +51 -44
- inspect_ai/model/_openai_responses.py +17 -18
- inspect_ai/model/_providers/anthropic.py +30 -5
- inspect_ai/model/_providers/hf.py +27 -1
- inspect_ai/model/_providers/providers.py +1 -1
- inspect_ai/model/_providers/sglang.py +8 -2
- inspect_ai/model/_providers/vllm.py +6 -2
- inspect_ai/scorer/_choice.py +1 -2
- inspect_ai/solver/_chain.py +1 -1
- inspect_ai/solver/_fork.py +1 -1
- inspect_ai/solver/_multiple_choice.py +9 -23
- inspect_ai/solver/_plan.py +2 -2
- inspect_ai/solver/_task_state.py +7 -3
- inspect_ai/solver/_transcript.py +6 -7
- inspect_ai/tool/_mcp/_context.py +3 -5
- inspect_ai/tool/_mcp/_mcp.py +6 -5
- inspect_ai/tool/_mcp/server.py +1 -1
- inspect_ai/tool/_tools/_execute.py +4 -1
- inspect_ai/tool/_tools/_think.py +1 -1
- inspect_ai/tool/_tools/_web_search/__init__.py +3 -0
- inspect_ai/tool/_tools/{_web_search.py → _web_search/_google.py} +56 -103
- inspect_ai/tool/_tools/_web_search/_tavily.py +77 -0
- inspect_ai/tool/_tools/_web_search/_web_search.py +85 -0
- inspect_ai/util/__init__.py +4 -0
- inspect_ai/util/_anyio.py +11 -0
- inspect_ai/util/_collect.py +50 -0
- inspect_ai/util/_sandbox/events.py +3 -2
- inspect_ai/util/_span.py +58 -0
- inspect_ai/util/_subtask.py +27 -42
- {inspect_ai-0.3.93.dist-info → inspect_ai-0.3.95.dist-info}/METADATA +8 -1
- {inspect_ai-0.3.93.dist-info → inspect_ai-0.3.95.dist-info}/RECORD +114 -82
- {inspect_ai-0.3.93.dist-info → inspect_ai-0.3.95.dist-info}/WHEEL +1 -1
- inspect_ai/_display/core/group.py +0 -79
- {inspect_ai-0.3.93.dist-info → inspect_ai-0.3.95.dist-info}/entry_points.txt +0 -0
- {inspect_ai-0.3.93.dist-info → inspect_ai-0.3.95.dist-info}/licenses/LICENSE +0 -0
- {inspect_ai-0.3.93.dist-info → inspect_ai-0.3.95.dist-info}/top_level.txt +0 -0
@@ -23080,7 +23080,8 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
|
|
23080
23080
|
pendingSampleSummaries: void 0,
|
23081
23081
|
loadedLog: void 0,
|
23082
23082
|
// Filter state
|
23083
|
-
filter:
|
23083
|
+
filter: "",
|
23084
|
+
filterError: void 0,
|
23084
23085
|
epoch: "all",
|
23085
23086
|
sort: kDefaultSort,
|
23086
23087
|
score: void 0,
|
@@ -23115,6 +23116,14 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
|
|
23115
23116
|
setFilter: (filter) => set2((state) => {
|
23116
23117
|
state.log.filter = filter;
|
23117
23118
|
}),
|
23119
|
+
setFilterError: (error2) => set2((state) => {
|
23120
|
+
state.log.filterError = error2;
|
23121
|
+
}),
|
23122
|
+
clearFilterError: () => {
|
23123
|
+
set2((state) => {
|
23124
|
+
state.log.filterError = void 0;
|
23125
|
+
});
|
23126
|
+
},
|
23118
23127
|
setEpoch: (epoch) => set2((state) => {
|
23119
23128
|
state.log.epoch = epoch;
|
23120
23129
|
}),
|
@@ -23128,7 +23137,8 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
|
|
23128
23137
|
state.log.scores = scores2;
|
23129
23138
|
}),
|
23130
23139
|
resetFiltering: () => set2((state) => {
|
23131
|
-
state.log.filter =
|
23140
|
+
state.log.filter = "";
|
23141
|
+
state.log.filterError = void 0;
|
23132
23142
|
state.log.epoch = "all";
|
23133
23143
|
state.log.sort = kDefaultSort;
|
23134
23144
|
state.log.score = void 0;
|
@@ -24422,12 +24432,12 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
|
|
24422
24432
|
}, [callback]);
|
24423
24433
|
return elementRef;
|
24424
24434
|
};
|
24425
|
-
const expandableBordered = "
|
24426
|
-
const expandableCollapsed = "
|
24427
|
-
const moreToggle = "
|
24428
|
-
const bordered = "
|
24429
|
-
const moreToggleContainer = "
|
24430
|
-
const moreToggleButton = "
|
24435
|
+
const expandableBordered = "_expandableBordered_59eal_1";
|
24436
|
+
const expandableCollapsed = "_expandableCollapsed_59eal_13";
|
24437
|
+
const moreToggle = "_moreToggle_59eal_17";
|
24438
|
+
const bordered = "_bordered_59eal_24";
|
24439
|
+
const moreToggleContainer = "_moreToggleContainer_59eal_28";
|
24440
|
+
const moreToggleButton = "_moreToggleButton_59eal_39";
|
24431
24441
|
const styles$1j = {
|
24432
24442
|
expandableBordered,
|
24433
24443
|
expandableCollapsed,
|
@@ -24440,15 +24450,16 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
|
|
24440
24450
|
({ id, collapse, border, lines = 15, children: children2, className: className2 }) => {
|
24441
24451
|
const [collapsed, setCollapsed] = useCollapsedState(id, collapse);
|
24442
24452
|
const [showToggle, setShowToggle] = reactExports.useState(false);
|
24443
|
-
const
|
24453
|
+
const baseFontSizeRef = reactExports.useRef(0);
|
24444
24454
|
const checkOverflow = reactExports.useCallback(
|
24445
24455
|
(entry2) => {
|
24446
24456
|
const element = entry2.target;
|
24447
|
-
if (
|
24457
|
+
if (baseFontSizeRef.current === 0) {
|
24448
24458
|
const computedStyle = window.getComputedStyle(element);
|
24449
|
-
|
24459
|
+
const rootFontSize = parseFloat(computedStyle.fontSize);
|
24460
|
+
baseFontSizeRef.current = rootFontSize;
|
24450
24461
|
}
|
24451
|
-
const maxCollapsedHeight =
|
24462
|
+
const maxCollapsedHeight = baseFontSizeRef.current * lines;
|
24452
24463
|
const contentHeight = element.scrollHeight;
|
24453
24464
|
setShowToggle(contentHeight > maxCollapsedHeight);
|
24454
24465
|
},
|
@@ -41943,7 +41954,7 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
|
|
41943
41954
|
has_retries: sample2.retries !== void 0 && sample2.retries > 0
|
41944
41955
|
};
|
41945
41956
|
};
|
41946
|
-
const
|
41957
|
+
const sampleFilterItems = (evalDescriptor) => {
|
41947
41958
|
const items = [];
|
41948
41959
|
const bannedShortNames = bannedShortScoreNames(evalDescriptor.scores);
|
41949
41960
|
const valueToString = (value2) => typeof value2 === "string" ? `"${value2}"` : String(value2);
|
@@ -42090,7 +42101,8 @@ categories: ${categories.join(" ")}`;
|
|
42090
42101
|
}
|
42091
42102
|
};
|
42092
42103
|
const filterSamples = (evalDescriptor, samples, filterValue) => {
|
42093
|
-
|
42104
|
+
let error2 = void 0;
|
42105
|
+
let errorCount = 0;
|
42094
42106
|
const result2 = samples.filter((sample2) => {
|
42095
42107
|
if (filterValue) {
|
42096
42108
|
const { matches, error: sampleError } = filterExpression(
|
@@ -42099,12 +42111,15 @@ categories: ${categories.join(" ")}`;
|
|
42099
42111
|
filterValue
|
42100
42112
|
);
|
42101
42113
|
error2 || (error2 = sampleError);
|
42114
|
+
if (sampleError) {
|
42115
|
+
errorCount++;
|
42116
|
+
}
|
42102
42117
|
return matches;
|
42103
42118
|
} else {
|
42104
42119
|
return true;
|
42105
42120
|
}
|
42106
42121
|
});
|
42107
|
-
return { result: result2, error: error2 };
|
42122
|
+
return { result: result2, error: error2, allErrors: errorCount === samples.length };
|
42108
42123
|
};
|
42109
42124
|
const flex$1 = "_flex_1kye9_1";
|
42110
42125
|
const label$7 = "_label_1kye9_5";
|
@@ -42381,12 +42396,22 @@ categories: ${categories.join(" ")}`;
|
|
42381
42396
|
const evalDescriptor = useEvalDescriptor();
|
42382
42397
|
const sampleSummaries = useSampleSummaries();
|
42383
42398
|
const filter = useStore((state) => state.log.filter);
|
42399
|
+
const setFilterError = useStore((state) => state.logActions.setFilterError);
|
42400
|
+
const clearFilterError = useStore(
|
42401
|
+
(state) => state.logActions.clearFilterError
|
42402
|
+
);
|
42384
42403
|
const epoch = useStore((state) => state.log.epoch);
|
42385
42404
|
const sort = useStore((state) => state.log.sort);
|
42386
42405
|
const samplesDescriptor = useSampleDescriptor();
|
42387
42406
|
const score2 = useScore();
|
42388
42407
|
return reactExports.useMemo(() => {
|
42389
|
-
const
|
42408
|
+
const { result: result2, error: error2, allErrors } = evalDescriptor && filter ? filterSamples(evalDescriptor, sampleSummaries, filter) : { result: sampleSummaries, error: void 0, allErrors: false };
|
42409
|
+
if (error2 && allErrors) {
|
42410
|
+
setFilterError(error2);
|
42411
|
+
} else {
|
42412
|
+
clearFilterError();
|
42413
|
+
}
|
42414
|
+
const prefiltered = error2 === void 0 || !allErrors ? result2 : sampleSummaries;
|
42390
42415
|
const filtered = epoch && epoch !== "all" ? prefiltered.filter((sample2) => epoch === String(sample2.epoch)) : prefiltered;
|
42391
42416
|
const sorted = samplesDescriptor ? sortSamples(sort, filtered, samplesDescriptor, score2) : filtered;
|
42392
42417
|
return [...sorted];
|
@@ -42394,6 +42419,8 @@ categories: ${categories.join(" ")}`;
|
|
42394
42419
|
evalDescriptor,
|
42395
42420
|
sampleSummaries,
|
42396
42421
|
filter,
|
42422
|
+
setFilterError,
|
42423
|
+
clearFilterError,
|
42397
42424
|
epoch,
|
42398
42425
|
sort,
|
42399
42426
|
samplesDescriptor,
|
@@ -44311,7 +44338,7 @@ categories: ${categories.join(" ")}`;
|
|
44311
44338
|
if (!evalDescriptor) {
|
44312
44339
|
return null;
|
44313
44340
|
}
|
44314
|
-
const items =
|
44341
|
+
const items = sampleFilterItems(evalDescriptor);
|
44315
44342
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { position: "relative" }, children: Array.from(items).map((item2, index2, array) => /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
|
44316
44343
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { title: item2.tooltip, children: item2.canonicalName }),
|
44317
44344
|
index2 < array.length - 1 ? ", " : ""
|
@@ -51205,8 +51232,7 @@ self.onmessage = function (e) {
|
|
51205
51232
|
text: text2,
|
51206
51233
|
icon: icon2,
|
51207
51234
|
collapse,
|
51208
|
-
children: children2
|
51209
|
-
running: running2
|
51235
|
+
children: children2
|
51210
51236
|
}) => {
|
51211
51237
|
const [isCollapsed, setCollapsed] = useProperty(id, "collapsed", {
|
51212
51238
|
defaultValue: !!collapse
|
@@ -51302,35 +51328,32 @@ self.onmessage = function (e) {
|
|
51302
51328
|
]
|
51303
51329
|
}
|
51304
51330
|
) : "";
|
51305
|
-
const card2 = /* @__PURE__ */ jsxRuntimeExports.
|
51306
|
-
|
51307
|
-
|
51308
|
-
|
51309
|
-
|
51310
|
-
|
51311
|
-
|
51312
|
-
|
51313
|
-
|
51314
|
-
|
51315
|
-
|
51316
|
-
|
51317
|
-
|
51318
|
-
|
51319
|
-
|
51320
|
-
|
51321
|
-
|
51322
|
-
|
51323
|
-
|
51324
|
-
|
51325
|
-
|
51326
|
-
|
51327
|
-
|
51328
|
-
|
51329
|
-
|
51330
|
-
|
51331
|
-
] }),
|
51332
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(ProgressBar, { animating: !!running2 })
|
51333
|
-
] });
|
51331
|
+
const card2 = /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { id, className: clsx(className2, styles$s.card), children: [
|
51332
|
+
titleEl,
|
51333
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
51334
|
+
"div",
|
51335
|
+
{
|
51336
|
+
className: clsx(
|
51337
|
+
"tab-content",
|
51338
|
+
styles$s.cardContent,
|
51339
|
+
hasCollapse && isCollapsed ? styles$s.hidden : void 0
|
51340
|
+
),
|
51341
|
+
children: filteredArrChildren == null ? void 0 : filteredArrChildren.map((child, index2) => {
|
51342
|
+
const id2 = pillId(index2);
|
51343
|
+
const isSelected = id2 === selectedNav;
|
51344
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
51345
|
+
"div",
|
51346
|
+
{
|
51347
|
+
id: id2,
|
51348
|
+
className: clsx("tab-pane", "show", isSelected ? "active" : ""),
|
51349
|
+
children: child
|
51350
|
+
},
|
51351
|
+
`children-${id2}-${index2}`
|
51352
|
+
);
|
51353
|
+
})
|
51354
|
+
}
|
51355
|
+
)
|
51356
|
+
] }) });
|
51334
51357
|
return card2;
|
51335
51358
|
};
|
51336
51359
|
function hasDataDefault(node2) {
|
@@ -51839,11 +51862,11 @@ self.onmessage = function (e) {
|
|
51839
51862
|
const icon2 = resolve_icon(event.type);
|
51840
51863
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(EventPanel, { id, title: title2, icon: icon2, className: className2, children: event.message });
|
51841
51864
|
};
|
51842
|
-
const twoColumn = "
|
51843
|
-
const exec = "
|
51844
|
-
const result = "
|
51845
|
-
const fileLabel = "
|
51846
|
-
const wrapPre = "
|
51865
|
+
const twoColumn = "_twoColumn_1irga_9";
|
51866
|
+
const exec = "_exec_1irga_15";
|
51867
|
+
const result = "_result_1irga_19";
|
51868
|
+
const fileLabel = "_fileLabel_1irga_23";
|
51869
|
+
const wrapPre = "_wrapPre_1irga_28";
|
51847
51870
|
const styles$l = {
|
51848
51871
|
twoColumn,
|
51849
51872
|
exec,
|
@@ -59404,6 +59427,13 @@ ${events}
|
|
59404
59427
|
function initializeObject(current2) {
|
59405
59428
|
return current2 ?? {};
|
59406
59429
|
}
|
59430
|
+
const ET_STEP = "step";
|
59431
|
+
const ACTION_BEGIN = "begin";
|
59432
|
+
const ET_SPAN_BEGIN = "span_begin";
|
59433
|
+
const ET_SPAN_END = "span_end";
|
59434
|
+
const hasSpans = (events) => {
|
59435
|
+
return events.some((event) => event.event === ET_SPAN_BEGIN);
|
59436
|
+
};
|
59407
59437
|
const kSandboxSignalName = "53787D8A-D3FC-426D-B383-9F880B70E4AA";
|
59408
59438
|
const fixupEventStream = (events, filterPending = true) => {
|
59409
59439
|
const collapsed = processPendingEvents(events, filterPending);
|
@@ -59426,44 +59456,65 @@ ${events}
|
|
59426
59456
|
}, []);
|
59427
59457
|
};
|
59428
59458
|
const collapseSampleInit = (events) => {
|
59459
|
+
const hasSpans2 = events.some((e) => {
|
59460
|
+
return e.event === "span_begin" || e.event === "span_end";
|
59461
|
+
});
|
59462
|
+
if (hasSpans2) {
|
59463
|
+
return events;
|
59464
|
+
}
|
59429
59465
|
const hasInitStep = events.findIndex((e) => {
|
59430
59466
|
return e.event === "step" && e.name === "init";
|
59431
59467
|
}) !== -1;
|
59468
|
+
if (hasInitStep) {
|
59469
|
+
return events;
|
59470
|
+
}
|
59432
59471
|
const initEventIndex = events.findIndex((e) => {
|
59433
59472
|
return e.event === "sample_init";
|
59434
59473
|
});
|
59435
59474
|
const initEvent = events[initEventIndex];
|
59436
|
-
|
59437
|
-
|
59438
|
-
fixedUp.splice(initEventIndex, 0, {
|
59439
|
-
timestamp: initEvent.timestamp,
|
59440
|
-
event: "step",
|
59441
|
-
action: "begin",
|
59442
|
-
type: null,
|
59443
|
-
name: "sample_init",
|
59444
|
-
pending: false,
|
59445
|
-
working_start: 0
|
59446
|
-
});
|
59447
|
-
fixedUp.splice(initEventIndex + 2, 0, {
|
59448
|
-
timestamp: initEvent.timestamp,
|
59449
|
-
event: "step",
|
59450
|
-
action: "end",
|
59451
|
-
type: null,
|
59452
|
-
name: "sample_init",
|
59453
|
-
pending: false,
|
59454
|
-
working_start: 0
|
59455
|
-
});
|
59475
|
+
if (!initEvent) {
|
59476
|
+
return events;
|
59456
59477
|
}
|
59478
|
+
const fixedUp = [...events];
|
59479
|
+
fixedUp.splice(initEventIndex, 0, {
|
59480
|
+
timestamp: initEvent.timestamp,
|
59481
|
+
event: "step",
|
59482
|
+
action: "begin",
|
59483
|
+
type: null,
|
59484
|
+
name: "sample_init",
|
59485
|
+
pending: false,
|
59486
|
+
working_start: 0,
|
59487
|
+
span_id: initEvent.span_id
|
59488
|
+
});
|
59489
|
+
fixedUp.splice(initEventIndex + 2, 0, {
|
59490
|
+
timestamp: initEvent.timestamp,
|
59491
|
+
event: "step",
|
59492
|
+
action: "end",
|
59493
|
+
type: null,
|
59494
|
+
name: "sample_init",
|
59495
|
+
pending: false,
|
59496
|
+
working_start: 0,
|
59497
|
+
span_id: initEvent.span_id
|
59498
|
+
});
|
59457
59499
|
return fixedUp;
|
59458
59500
|
};
|
59459
59501
|
const groupSandboxEvents = (events) => {
|
59460
59502
|
const result2 = [];
|
59461
59503
|
const pendingSandboxEvents = [];
|
59504
|
+
const useSpans = hasSpans(events);
|
59462
59505
|
const pushPendingSandboxEvents = () => {
|
59463
59506
|
const timestamp = pendingSandboxEvents[pendingSandboxEvents.length - 1].timestamp;
|
59464
|
-
|
59507
|
+
if (useSpans) {
|
59508
|
+
result2.push(createSpanBegin(kSandboxSignalName, timestamp, null));
|
59509
|
+
} else {
|
59510
|
+
result2.push(createStepEvent(kSandboxSignalName, timestamp, "begin"));
|
59511
|
+
}
|
59465
59512
|
result2.push(...pendingSandboxEvents);
|
59466
|
-
|
59513
|
+
if (useSpans) {
|
59514
|
+
result2.push(createSpanEnd(kSandboxSignalName, timestamp));
|
59515
|
+
} else {
|
59516
|
+
result2.push(createStepEvent(kSandboxSignalName, timestamp, "end"));
|
59517
|
+
}
|
59467
59518
|
pendingSandboxEvents.length = 0;
|
59468
59519
|
};
|
59469
59520
|
for (const event of events) {
|
@@ -59488,8 +59539,32 @@ ${events}
|
|
59488
59539
|
type: null,
|
59489
59540
|
name: name2,
|
59490
59541
|
pending: false,
|
59491
|
-
working_start: 0
|
59542
|
+
working_start: 0,
|
59543
|
+
span_id: null
|
59492
59544
|
});
|
59545
|
+
const createSpanBegin = (name2, timestamp, parent_id) => {
|
59546
|
+
return {
|
59547
|
+
name: name2,
|
59548
|
+
id: `${name2}-begin`,
|
59549
|
+
span_id: name2,
|
59550
|
+
parent_id,
|
59551
|
+
timestamp,
|
59552
|
+
event: "span_begin",
|
59553
|
+
type: null,
|
59554
|
+
pending: false,
|
59555
|
+
working_start: 0
|
59556
|
+
};
|
59557
|
+
};
|
59558
|
+
const createSpanEnd = (name2, timestamp) => {
|
59559
|
+
return {
|
59560
|
+
id: `${name2}-end`,
|
59561
|
+
timestamp,
|
59562
|
+
event: "span_end",
|
59563
|
+
pending: false,
|
59564
|
+
working_start: 0,
|
59565
|
+
span_id: name2
|
59566
|
+
};
|
59567
|
+
};
|
59493
59568
|
const StepEventView = ({
|
59494
59569
|
id,
|
59495
59570
|
event,
|
@@ -59498,7 +59573,7 @@ ${events}
|
|
59498
59573
|
}) => {
|
59499
59574
|
const descriptor = stepDescriptor(event);
|
59500
59575
|
const title2 = descriptor.name || `${event.type ? event.type + ": " : "Step: "}${event.name}`;
|
59501
|
-
const text2 = summarize(children2);
|
59576
|
+
const text2 = summarize$1(children2);
|
59502
59577
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
59503
59578
|
EventPanel,
|
59504
59579
|
{
|
@@ -59519,7 +59594,7 @@ ${events}
|
|
59519
59594
|
}
|
59520
59595
|
);
|
59521
59596
|
};
|
59522
|
-
const summarize = (children2) => {
|
59597
|
+
const summarize$1 = (children2) => {
|
59523
59598
|
if (children2.length === 0) {
|
59524
59599
|
return "(no events)";
|
59525
59600
|
}
|
@@ -59736,7 +59811,7 @@ ${events}
|
|
59736
59811
|
const ToolEventView = ({
|
59737
59812
|
id,
|
59738
59813
|
event,
|
59739
|
-
|
59814
|
+
children: children2,
|
59740
59815
|
className: className2
|
59741
59816
|
}) => {
|
59742
59817
|
var _a2, _b2;
|
@@ -59794,20 +59869,157 @@ ${events}
|
|
59794
59869
|
) : "",
|
59795
59870
|
event.pending ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$f.progress), children: /* @__PURE__ */ jsxRuntimeExports.jsx(PulsingDots, { subtle: false, size: "medium" }) }) : void 0
|
59796
59871
|
] }),
|
59797
|
-
|
59798
|
-
|
59872
|
+
children2.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
59873
|
+
TranscriptComponent,
|
59799
59874
|
{
|
59800
|
-
id: `${id}-subtask`,
|
59801
59875
|
"data-name": "Transcript",
|
59802
|
-
|
59803
|
-
|
59804
|
-
|
59876
|
+
id: `${id}-subtask`,
|
59877
|
+
eventNodes: children2,
|
59878
|
+
"data-default": event.failed || event.agent ? true : null
|
59805
59879
|
}
|
59806
59880
|
) : ""
|
59807
59881
|
]
|
59808
59882
|
}
|
59809
59883
|
);
|
59810
59884
|
};
|
59885
|
+
const SpanEventView = ({
|
59886
|
+
id,
|
59887
|
+
event,
|
59888
|
+
children: children2,
|
59889
|
+
className: className2
|
59890
|
+
}) => {
|
59891
|
+
const descriptor = spanDescriptor(event);
|
59892
|
+
const title2 = descriptor.name || `${event.type ? event.type + ": " : "Step: "}${event.name}`;
|
59893
|
+
const text2 = summarize(children2);
|
59894
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
59895
|
+
EventPanel,
|
59896
|
+
{
|
59897
|
+
id: `span-${event.name}-${id}`,
|
59898
|
+
className: clsx("transcript-span", className2),
|
59899
|
+
title: title2,
|
59900
|
+
subTitle: formatDateTime(new Date(event.timestamp)),
|
59901
|
+
text: text2,
|
59902
|
+
collapse: descriptor.collapse,
|
59903
|
+
icon: descriptor.icon,
|
59904
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
59905
|
+
TranscriptComponent,
|
59906
|
+
{
|
59907
|
+
id: `span|${event.name}|${id}`,
|
59908
|
+
eventNodes: children2
|
59909
|
+
}
|
59910
|
+
)
|
59911
|
+
}
|
59912
|
+
);
|
59913
|
+
};
|
59914
|
+
const summarize = (children2) => {
|
59915
|
+
if (children2.length === 0) {
|
59916
|
+
return "(no events)";
|
59917
|
+
}
|
59918
|
+
const formatEvent = (event, count) => {
|
59919
|
+
if (count === 1) {
|
59920
|
+
return `${count} ${event} event`;
|
59921
|
+
} else {
|
59922
|
+
return `${count} ${event} events`;
|
59923
|
+
}
|
59924
|
+
};
|
59925
|
+
const typeCount = {};
|
59926
|
+
children2.forEach((child) => {
|
59927
|
+
const currentCount = typeCount[child.event.event] || 0;
|
59928
|
+
typeCount[child.event.event] = currentCount + 1;
|
59929
|
+
});
|
59930
|
+
const numberOfTypes = Object.keys(typeCount).length;
|
59931
|
+
if (numberOfTypes < 3) {
|
59932
|
+
return Object.keys(typeCount).map((key2) => {
|
59933
|
+
return formatEvent(key2, typeCount[key2]);
|
59934
|
+
}).join(", ");
|
59935
|
+
}
|
59936
|
+
if (children2.length === 1) {
|
59937
|
+
return "1 event";
|
59938
|
+
} else {
|
59939
|
+
return `${children2.length} events`;
|
59940
|
+
}
|
59941
|
+
};
|
59942
|
+
const spanDescriptor = (event) => {
|
59943
|
+
const rootStepDescriptor = {
|
59944
|
+
endSpace: true
|
59945
|
+
};
|
59946
|
+
if (event.type === "solver") {
|
59947
|
+
switch (event.name) {
|
59948
|
+
case "chain_of_thought":
|
59949
|
+
return {
|
59950
|
+
...rootStepDescriptor,
|
59951
|
+
collapse: false
|
59952
|
+
};
|
59953
|
+
case "generate":
|
59954
|
+
return {
|
59955
|
+
...rootStepDescriptor,
|
59956
|
+
collapse: false
|
59957
|
+
};
|
59958
|
+
case "self_critique":
|
59959
|
+
return {
|
59960
|
+
...rootStepDescriptor,
|
59961
|
+
collapse: false
|
59962
|
+
};
|
59963
|
+
case "system_message":
|
59964
|
+
return {
|
59965
|
+
...rootStepDescriptor,
|
59966
|
+
collapse: true
|
59967
|
+
};
|
59968
|
+
case "use_tools":
|
59969
|
+
return {
|
59970
|
+
...rootStepDescriptor,
|
59971
|
+
collapse: false
|
59972
|
+
};
|
59973
|
+
case "multiple_choice":
|
59974
|
+
return {
|
59975
|
+
...rootStepDescriptor,
|
59976
|
+
collapse: false
|
59977
|
+
};
|
59978
|
+
default:
|
59979
|
+
return {
|
59980
|
+
...rootStepDescriptor,
|
59981
|
+
collapse: false
|
59982
|
+
};
|
59983
|
+
}
|
59984
|
+
} else if (event.type === "scorer") {
|
59985
|
+
return {
|
59986
|
+
...rootStepDescriptor,
|
59987
|
+
collapse: false
|
59988
|
+
};
|
59989
|
+
} else if (event.event === "span_begin") {
|
59990
|
+
if (event.span_id === kSandboxSignalName) {
|
59991
|
+
return {
|
59992
|
+
...rootStepDescriptor,
|
59993
|
+
name: "Sandbox Events",
|
59994
|
+
collapse: true
|
59995
|
+
};
|
59996
|
+
} else if (event.name === "init") {
|
59997
|
+
return {
|
59998
|
+
...rootStepDescriptor,
|
59999
|
+
name: "Init",
|
60000
|
+
collapse: true
|
60001
|
+
};
|
60002
|
+
} else {
|
60003
|
+
return {
|
60004
|
+
...rootStepDescriptor,
|
60005
|
+
collapse: false
|
60006
|
+
};
|
60007
|
+
}
|
60008
|
+
} else {
|
60009
|
+
switch (event.name) {
|
60010
|
+
case "sample_init":
|
60011
|
+
return {
|
60012
|
+
...rootStepDescriptor,
|
60013
|
+
name: "Sample Init",
|
60014
|
+
collapse: true
|
60015
|
+
};
|
60016
|
+
default:
|
60017
|
+
return {
|
60018
|
+
endSpace: false
|
60019
|
+
};
|
60020
|
+
}
|
60021
|
+
}
|
60022
|
+
};
|
59811
60023
|
const transcriptComponent = "_transcriptComponent_171gc_19";
|
59812
60024
|
const eventNode = "_eventNode_171gc_25";
|
59813
60025
|
const darkenBg = "_darkenBg_171gc_29";
|
@@ -59824,10 +60036,10 @@ ${events}
|
|
59824
60036
|
noBottom,
|
59825
60037
|
attached: attached$1
|
59826
60038
|
};
|
59827
|
-
const darkenedBg = "
|
59828
|
-
const normalBg = "
|
59829
|
-
const node = "
|
59830
|
-
const attached = "
|
60039
|
+
const darkenedBg = "_darkenedBg_u9na2_1";
|
60040
|
+
const normalBg = "_normalBg_u9na2_5";
|
60041
|
+
const node = "_node_u9na2_9";
|
60042
|
+
const attached = "_attached_u9na2_14";
|
59831
60043
|
const styles$d = {
|
59832
60044
|
darkenedBg,
|
59833
60045
|
normalBg,
|
@@ -59873,9 +60085,11 @@ ${events}
|
|
59873
60085
|
}
|
59874
60086
|
}
|
59875
60087
|
function treeifyEvents(events, depth) {
|
60088
|
+
const useSpans = hasSpans(events);
|
60089
|
+
const treeFn = useSpans ? treeifyFnSpan : treeifyFnStep;
|
59876
60090
|
const rootNodes = [];
|
59877
60091
|
const stack2 = [];
|
59878
|
-
const
|
60092
|
+
const addNode = (event) => {
|
59879
60093
|
const node2 = new EventNode(event, stack2.length + depth);
|
59880
60094
|
if (stack2.length > 0) {
|
59881
60095
|
const parentNode = stack2[stack2.length - 1];
|
@@ -59885,20 +60099,139 @@ ${events}
|
|
59885
60099
|
}
|
59886
60100
|
return node2;
|
59887
60101
|
};
|
60102
|
+
const pushStack = (node2) => {
|
60103
|
+
stack2.push(node2);
|
60104
|
+
};
|
60105
|
+
const popStack = () => {
|
60106
|
+
if (stack2.length > 0) {
|
60107
|
+
stack2.pop();
|
60108
|
+
}
|
60109
|
+
};
|
59888
60110
|
events.forEach((event) => {
|
59889
|
-
|
59890
|
-
|
59891
|
-
|
59892
|
-
|
59893
|
-
|
59894
|
-
|
60111
|
+
treeFn(event, addNode, pushStack, popStack);
|
60112
|
+
});
|
60113
|
+
if (useSpans) {
|
60114
|
+
return transformTree(rootNodes);
|
60115
|
+
} else {
|
60116
|
+
return rootNodes;
|
60117
|
+
}
|
60118
|
+
}
|
60119
|
+
const treeifyFnStep = (event, addNode, pushStack, popStack) => {
|
60120
|
+
switch (event.event) {
|
60121
|
+
case ET_STEP:
|
60122
|
+
if (event.action === ACTION_BEGIN) {
|
60123
|
+
const node2 = addNode(event);
|
60124
|
+
pushStack(node2);
|
60125
|
+
} else {
|
60126
|
+
popStack();
|
60127
|
+
}
|
60128
|
+
break;
|
60129
|
+
case ET_SPAN_BEGIN: {
|
60130
|
+
break;
|
60131
|
+
}
|
60132
|
+
case ET_SPAN_END: {
|
60133
|
+
break;
|
60134
|
+
}
|
60135
|
+
default:
|
60136
|
+
addNode(event);
|
60137
|
+
break;
|
60138
|
+
}
|
60139
|
+
};
|
60140
|
+
const treeifyFnSpan = (event, addNode, pushStack, popStack) => {
|
60141
|
+
switch (event.event) {
|
60142
|
+
case ET_STEP:
|
60143
|
+
break;
|
60144
|
+
case ET_SPAN_BEGIN: {
|
60145
|
+
const node2 = addNode(event);
|
60146
|
+
pushStack(node2);
|
60147
|
+
break;
|
60148
|
+
}
|
60149
|
+
case ET_SPAN_END: {
|
60150
|
+
popStack();
|
60151
|
+
break;
|
60152
|
+
}
|
60153
|
+
default:
|
60154
|
+
addNode(event);
|
60155
|
+
break;
|
60156
|
+
}
|
60157
|
+
};
|
60158
|
+
const treeNodeTransformers = [
|
60159
|
+
{
|
60160
|
+
name: "unwrap_tools",
|
60161
|
+
matches: (node2) => node2.event.event === "span_begin" && node2.event.type === "tool",
|
60162
|
+
process: (node2) => elevateChildNode(node2, "tool") || node2
|
60163
|
+
},
|
60164
|
+
{
|
60165
|
+
name: "unwrap_subtasks",
|
60166
|
+
matches: (node2) => node2.event.event === "span_begin" && node2.event.type === "subtask",
|
60167
|
+
process: (node2) => elevateChildNode(node2, "subtask") || node2
|
60168
|
+
},
|
60169
|
+
{
|
60170
|
+
name: "unwrap_agent_solver",
|
60171
|
+
matches: (node2) => node2.event.event === "span_begin" && node2.event["type"] === "solver" && node2.children.length === 2 && node2.children[0].event.event === "span_begin" && node2.children[0].event.type === "agent" && node2.children[1].event.event === "state",
|
60172
|
+
process: (node2) => skipFirstChildNode(node2)
|
60173
|
+
},
|
60174
|
+
{
|
60175
|
+
name: "unwrap_agent_solver w/store",
|
60176
|
+
matches: (node2) => node2.event.event === "span_begin" && node2.event["type"] === "solver" && node2.children.length === 3 && node2.children[0].event.event === "span_begin" && node2.children[0].event.type === "agent" && node2.children[1].event.event === "state" && node2.children[2].event.event === "store",
|
60177
|
+
process: (node2) => skipFirstChildNode(node2)
|
60178
|
+
},
|
60179
|
+
{
|
60180
|
+
name: "unwrap_handoff",
|
60181
|
+
matches: (node2) => node2.event.event === "span_begin" && node2.event["type"] === "handoff" && node2.children.length === 2 && node2.children[0].event.event === "tool" && node2.children[1].event.event === "store" && node2.children[0].children.length === 2 && node2.children[0].children[0].event.event === "span_begin" && node2.children[0].children[0].event.type === "agent",
|
60182
|
+
process: (node2) => skipThisNode(node2)
|
60183
|
+
}
|
60184
|
+
];
|
60185
|
+
const transformTree = (roots) => {
|
60186
|
+
const visitNode = (node2) => {
|
60187
|
+
let processedNode = node2;
|
60188
|
+
processedNode.children = processedNode.children.map(visitNode);
|
60189
|
+
for (const transformer of treeNodeTransformers) {
|
60190
|
+
if (transformer.matches(processedNode)) {
|
60191
|
+
processedNode = transformer.process(processedNode);
|
60192
|
+
break;
|
59895
60193
|
}
|
59896
|
-
} else {
|
59897
|
-
pushNode(event);
|
59898
60194
|
}
|
60195
|
+
return processedNode;
|
60196
|
+
};
|
60197
|
+
return roots.map(visitNode);
|
60198
|
+
};
|
60199
|
+
const elevateChildNode = (node2, childEventType) => {
|
60200
|
+
const targetIndex = node2.children.findIndex(
|
60201
|
+
(child) => child.event.event === childEventType
|
60202
|
+
);
|
60203
|
+
if (targetIndex === -1) {
|
60204
|
+
console.log(
|
60205
|
+
`No ${childEventType} event found in a span, this is very unexpected.`
|
60206
|
+
);
|
60207
|
+
return null;
|
60208
|
+
}
|
60209
|
+
const targetNode = { ...node2.children[targetIndex] };
|
60210
|
+
const remainingChildren = node2.children.filter((_, i2) => i2 !== targetIndex);
|
60211
|
+
targetNode.depth = node2.depth;
|
60212
|
+
targetNode.children = reduceDepth(remainingChildren);
|
60213
|
+
return targetNode;
|
60214
|
+
};
|
60215
|
+
const skipFirstChildNode = (node2) => {
|
60216
|
+
const agentSpan = node2.children.splice(0, 1)[0];
|
60217
|
+
node2.children.unshift(...reduceDepth(agentSpan.children));
|
60218
|
+
return node2;
|
60219
|
+
};
|
60220
|
+
const skipThisNode = (node2) => {
|
60221
|
+
const newNode = { ...node2.children[0] };
|
60222
|
+
newNode.depth = node2.depth;
|
60223
|
+
newNode.children = reduceDepth(newNode.children[0].children, 2);
|
60224
|
+
return newNode;
|
60225
|
+
};
|
60226
|
+
const reduceDepth = (nodes, depth = 1) => {
|
60227
|
+
return nodes.map((node2) => {
|
60228
|
+
if (node2.children.length > 0) {
|
60229
|
+
node2.children = reduceDepth(node2.children, 1);
|
60230
|
+
}
|
60231
|
+
node2.depth = node2.depth - depth;
|
60232
|
+
return node2;
|
59899
60233
|
});
|
59900
|
-
|
59901
|
-
}
|
60234
|
+
};
|
59902
60235
|
const TranscriptView = ({
|
59903
60236
|
id,
|
59904
60237
|
events,
|
@@ -60016,6 +60349,16 @@ ${events}
|
|
60016
60349
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(ScoreEventView, { id, event: node2.event, className: className2 });
|
60017
60350
|
case "state":
|
60018
60351
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(StateEventView, { id, event: node2.event, className: className2 });
|
60352
|
+
case "span_begin":
|
60353
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
60354
|
+
SpanEventView,
|
60355
|
+
{
|
60356
|
+
id,
|
60357
|
+
event: node2.event,
|
60358
|
+
children: node2.children,
|
60359
|
+
className: className2
|
60360
|
+
}
|
60361
|
+
);
|
60019
60362
|
case "step":
|
60020
60363
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
60021
60364
|
StepEventView,
|
@@ -60053,7 +60396,7 @@ ${events}
|
|
60053
60396
|
id,
|
60054
60397
|
event: node2.event,
|
60055
60398
|
className: className2,
|
60056
|
-
|
60399
|
+
children: node2.children
|
60057
60400
|
}
|
60058
60401
|
);
|
60059
60402
|
case "input":
|
@@ -80985,14 +81328,6 @@ Supported expressions:
|
|
80985
81328
|
overflow: "hidden"
|
80986
81329
|
}
|
80987
81330
|
});
|
80988
|
-
const getFilteringResult = (evalDescriptor, sampleSummaries, filterValue) => {
|
80989
|
-
const { result: result2, error: error2 } = filterSamples(
|
80990
|
-
evalDescriptor,
|
80991
|
-
sampleSummaries,
|
80992
|
-
filterValue
|
80993
|
-
);
|
80994
|
-
return { numSamples: result2.length, error: error2 };
|
80995
|
-
};
|
80996
81331
|
const ensureOneLine = (tr2) => {
|
80997
81332
|
const newDoc = tr2.newDoc.toString();
|
80998
81333
|
if (!newDoc.includes("\n")) return tr2;
|
@@ -81021,11 +81356,7 @@ Supported expressions:
|
|
81021
81356
|
}
|
81022
81357
|
];
|
81023
81358
|
};
|
81024
|
-
const SampleFilter = ({
|
81025
|
-
samples,
|
81026
|
-
scoreFilter,
|
81027
|
-
setScoreFilter
|
81028
|
-
}) => {
|
81359
|
+
const SampleFilter = () => {
|
81029
81360
|
const editorRef = reactExports.useRef(null);
|
81030
81361
|
const editorViewRef = reactExports.useRef(null);
|
81031
81362
|
const linterCompartment = reactExports.useRef(new Compartment());
|
@@ -81033,41 +81364,50 @@ Supported expressions:
|
|
81033
81364
|
const updateListenerCompartment = reactExports.useRef(new Compartment());
|
81034
81365
|
const evalDescriptor = useEvalDescriptor();
|
81035
81366
|
const filterItems = reactExports.useMemo(
|
81036
|
-
() => evalDescriptor ?
|
81367
|
+
() => evalDescriptor ? sampleFilterItems(evalDescriptor) : [],
|
81037
81368
|
[evalDescriptor]
|
81038
81369
|
);
|
81039
|
-
const
|
81040
|
-
const
|
81370
|
+
const filter = useStore((state) => state.log.filter);
|
81371
|
+
const filterError = useStore((state) => state.log.filterError);
|
81372
|
+
const setFilter = useStore((state) => state.logActions.setFilter);
|
81373
|
+
const handleFocus = reactExports.useCallback((event, view) => {
|
81041
81374
|
if (event.isTrusted && view.state.doc.toString() === "") {
|
81042
81375
|
setTimeout(() => startCompletion(view), 0);
|
81043
81376
|
}
|
81044
|
-
};
|
81045
|
-
const makeAutocompletion = (
|
81046
|
-
|
81047
|
-
|
81048
|
-
|
81049
|
-
|
81050
|
-
|
81051
|
-
|
81052
|
-
|
81053
|
-
|
81054
|
-
|
81055
|
-
|
81056
|
-
|
81057
|
-
|
81058
|
-
|
81059
|
-
|
81377
|
+
}, []);
|
81378
|
+
const makeAutocompletion = reactExports.useCallback(
|
81379
|
+
() => autocompletion({
|
81380
|
+
override: [(context) => getCompletions(context, filterItems)],
|
81381
|
+
activateOnCompletion: (c2) => c2.label.endsWith(" ")
|
81382
|
+
}),
|
81383
|
+
[]
|
81384
|
+
);
|
81385
|
+
const makeLinter = reactExports.useCallback(
|
81386
|
+
() => linter((view) => getLints(view, filterError)),
|
81387
|
+
[filterError]
|
81388
|
+
);
|
81389
|
+
const debounceSetFilter = reactExports.useCallback(
|
81390
|
+
debounce$1((value2) => {
|
81391
|
+
setFilter(value2);
|
81392
|
+
}, 200),
|
81393
|
+
[setFilter]
|
81394
|
+
);
|
81395
|
+
const makeUpdateListener = reactExports.useCallback(
|
81396
|
+
() => EditorView.updateListener.of((update) => {
|
81397
|
+
if (update.docChanged && evalDescriptor) {
|
81398
|
+
const newValue = update.state.doc.toString();
|
81399
|
+
debounceSetFilter(newValue);
|
81060
81400
|
}
|
81061
|
-
|
81062
|
-
|
81063
|
-
|
81401
|
+
}),
|
81402
|
+
[setFilter]
|
81403
|
+
);
|
81064
81404
|
reactExports.useEffect(() => {
|
81065
81405
|
var _a2;
|
81066
81406
|
(_a2 = editorViewRef.current) == null ? void 0 : _a2.destroy();
|
81067
81407
|
editorViewRef.current = new EditorView({
|
81068
81408
|
parent: editorRef.current ?? void 0,
|
81069
81409
|
state: EditorState.create({
|
81070
|
-
doc:
|
81410
|
+
doc: filter || "",
|
81071
81411
|
extensions: [
|
81072
81412
|
minimalSetup,
|
81073
81413
|
bracketMatching(),
|
@@ -81090,20 +81430,15 @@ Supported expressions:
|
|
81090
81430
|
reactExports.useEffect(() => {
|
81091
81431
|
if (!editorViewRef.current) return;
|
81092
81432
|
const currentValue = editorViewRef.current.state.doc.toString();
|
81093
|
-
if (
|
81094
|
-
if (evalDescriptor) {
|
81095
|
-
setFilteringResultInstant(
|
81096
|
-
getFilteringResult(evalDescriptor, samples, scoreFilter.value || "")
|
81097
|
-
);
|
81098
|
-
}
|
81433
|
+
if (filter === currentValue) return;
|
81099
81434
|
editorViewRef.current.dispatch({
|
81100
81435
|
changes: {
|
81101
81436
|
from: 0,
|
81102
81437
|
to: currentValue.length,
|
81103
|
-
insert:
|
81438
|
+
insert: filter || ""
|
81104
81439
|
}
|
81105
81440
|
});
|
81106
|
-
}, [
|
81441
|
+
}, [filter]);
|
81107
81442
|
reactExports.useEffect(() => {
|
81108
81443
|
var _a2;
|
81109
81444
|
(_a2 = editorViewRef.current) == null ? void 0 : _a2.dispatch({
|
@@ -81121,7 +81456,7 @@ Supported expressions:
|
|
81121
81456
|
(_a2 = editorViewRef.current) == null ? void 0 : _a2.dispatch({
|
81122
81457
|
effects: linterCompartment.current.reconfigure(makeLinter())
|
81123
81458
|
});
|
81124
|
-
}, [
|
81459
|
+
}, [filterError]);
|
81125
81460
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { display: "flex" }, children: [
|
81126
81461
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
81127
81462
|
"span",
|
@@ -81140,10 +81475,7 @@ Supported expressions:
|
|
81140
81475
|
"div",
|
81141
81476
|
{
|
81142
81477
|
ref: editorRef,
|
81143
|
-
className: clsx(
|
81144
|
-
(filteringResultInstant == null ? void 0 : filteringResultInstant.error) && "filter-pending",
|
81145
|
-
styles$9.input
|
81146
|
-
)
|
81478
|
+
className: clsx(filterError && "filter-pending", styles$9.input)
|
81147
81479
|
}
|
81148
81480
|
),
|
81149
81481
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
@@ -81171,20 +81503,16 @@ Supported expressions:
|
|
81171
81503
|
score: score2,
|
81172
81504
|
setScore
|
81173
81505
|
}) => {
|
81174
|
-
const scorers =
|
81175
|
-
|
81176
|
-
|
81177
|
-
|
81178
|
-
|
81179
|
-
|
81180
|
-
|
81181
|
-
|
81182
|
-
|
81183
|
-
|
81184
|
-
setScore(scores2[index2]);
|
81185
|
-
},
|
81186
|
-
[setScore, scores2]
|
81187
|
-
);
|
81506
|
+
const scorers = reactExports.useMemo(() => {
|
81507
|
+
return scores2.reduce((accum, scorer2) => {
|
81508
|
+
if (!accum.find((sc) => {
|
81509
|
+
return scorer2.scorer === sc.scorer;
|
81510
|
+
})) {
|
81511
|
+
accum.push(scorer2);
|
81512
|
+
}
|
81513
|
+
return accum;
|
81514
|
+
}, []);
|
81515
|
+
}, [scores2]);
|
81188
81516
|
if (scorers.length === 1) {
|
81189
81517
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$8.flex, children: [
|
81190
81518
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
@@ -81204,8 +81532,8 @@ Supported expressions:
|
|
81204
81532
|
ScoreSelector,
|
81205
81533
|
{
|
81206
81534
|
scores: scores2,
|
81207
|
-
|
81208
|
-
|
81535
|
+
selectedScore: score2,
|
81536
|
+
setSelectedScore: setScore
|
81209
81537
|
}
|
81210
81538
|
)
|
81211
81539
|
] });
|
@@ -81232,8 +81560,8 @@ Supported expressions:
|
|
81232
81560
|
ScorerSelector,
|
81233
81561
|
{
|
81234
81562
|
scorers,
|
81235
|
-
|
81236
|
-
|
81563
|
+
selectedScore: score2,
|
81564
|
+
setSelectedScore: setScore
|
81237
81565
|
}
|
81238
81566
|
),
|
81239
81567
|
scorerScores.length > 1 ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
@@ -81241,8 +81569,8 @@ Supported expressions:
|
|
81241
81569
|
{
|
81242
81570
|
className: clsx(styles$8.secondSel),
|
81243
81571
|
scores: scorerScores,
|
81244
|
-
|
81245
|
-
|
81572
|
+
selectedScore: score2,
|
81573
|
+
setSelectedScore: setScore
|
81246
81574
|
}
|
81247
81575
|
) : void 0
|
81248
81576
|
] });
|
@@ -81250,17 +81578,20 @@ Supported expressions:
|
|
81250
81578
|
};
|
81251
81579
|
const ScoreSelector = ({
|
81252
81580
|
scores: scores2,
|
81253
|
-
|
81254
|
-
|
81581
|
+
selectedScore,
|
81582
|
+
setSelectedScore,
|
81255
81583
|
className: className2
|
81256
81584
|
}) => {
|
81257
81585
|
const handleChange = reactExports.useCallback(
|
81258
81586
|
(e) => {
|
81259
81587
|
const sel = e.target;
|
81260
|
-
|
81588
|
+
setSelectedScore(scores2[sel.selectedIndex]);
|
81261
81589
|
},
|
81262
|
-
[
|
81590
|
+
[setSelectedScore, scores2]
|
81263
81591
|
);
|
81592
|
+
const index2 = scores2.findIndex((sc) => {
|
81593
|
+
return selectedScore && sc.name === selectedScore.name && sc.scorer === selectedScore.scorer;
|
81594
|
+
});
|
81264
81595
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
81265
81596
|
"select",
|
81266
81597
|
{
|
@@ -81271,7 +81602,7 @@ Supported expressions:
|
|
81271
81602
|
className2
|
81272
81603
|
),
|
81273
81604
|
"aria-label": ".select-scorer-label",
|
81274
|
-
value: scores2[
|
81605
|
+
value: scores2[index2].name,
|
81275
81606
|
onChange: handleChange,
|
81276
81607
|
children: scores2.map((score2) => {
|
81277
81608
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: score2.name, children: score2.name }, score2.name);
|
@@ -81281,22 +81612,25 @@ Supported expressions:
|
|
81281
81612
|
};
|
81282
81613
|
const ScorerSelector = ({
|
81283
81614
|
scorers,
|
81284
|
-
|
81285
|
-
|
81615
|
+
selectedScore,
|
81616
|
+
setSelectedScore
|
81286
81617
|
}) => {
|
81287
81618
|
const handleChange = reactExports.useCallback(
|
81288
81619
|
(e) => {
|
81289
81620
|
const sel = e.target;
|
81290
|
-
|
81621
|
+
setSelectedScore(scorers[sel.selectedIndex]);
|
81291
81622
|
},
|
81292
|
-
[
|
81623
|
+
[setSelectedScore, scorers]
|
81293
81624
|
);
|
81625
|
+
const index2 = scorers.findIndex((sc) => {
|
81626
|
+
return selectedScore && sc.scorer === selectedScore.scorer;
|
81627
|
+
});
|
81294
81628
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
81295
81629
|
"select",
|
81296
81630
|
{
|
81297
81631
|
className: clsx("form-select", "form-select-sm", "text-size-smaller"),
|
81298
81632
|
"aria-label": ".epoch-filter-label",
|
81299
|
-
value: scorers[
|
81633
|
+
value: scorers[index2].scorer,
|
81300
81634
|
onChange: handleChange,
|
81301
81635
|
children: scorers.map((scorer2) => {
|
81302
81636
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: scorer2.scorer, children: scorer2.scorer }, scorer2.scorer);
|
@@ -81304,16 +81638,8 @@ Supported expressions:
|
|
81304
81638
|
}
|
81305
81639
|
);
|
81306
81640
|
};
|
81307
|
-
const
|
81308
|
-
return score2 && sc.name === score2.name && sc.scorer === score2.scorer;
|
81309
|
-
});
|
81310
|
-
const scorerIndex = (scores2, score2) => scores2.findIndex((sc) => {
|
81311
|
-
return score2 && sc.scorer === score2.scorer;
|
81312
|
-
});
|
81313
|
-
const SampleTools = ({ samples }) => {
|
81641
|
+
const SampleTools = () => {
|
81314
81642
|
const selectedLogSummary = useStore((state) => state.log.selectedLogSummary);
|
81315
|
-
const filter = useStore((state) => state.log.filter);
|
81316
|
-
const setFilter = useStore((state) => state.logActions.setFilter);
|
81317
81643
|
const scores2 = useScores();
|
81318
81644
|
const score2 = useScore();
|
81319
81645
|
const setScore = useStore((state) => state.logActions.setScore);
|
@@ -81323,14 +81649,7 @@ Supported expressions:
|
|
81323
81649
|
const setSort = useStore((state) => state.logActions.setSort);
|
81324
81650
|
const epochs = (selectedLogSummary == null ? void 0 : selectedLogSummary.eval.config.epochs) || 1;
|
81325
81651
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
81326
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
81327
|
-
SampleFilter,
|
81328
|
-
{
|
81329
|
-
samples,
|
81330
|
-
scoreFilter: filter,
|
81331
|
-
setScoreFilter: setFilter
|
81332
|
-
}
|
81333
|
-
),
|
81652
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SampleFilter, {}),
|
81334
81653
|
(scores2 == null ? void 0 : scores2.length) > 1 ? /* @__PURE__ */ jsxRuntimeExports.jsx(SelectScorer, { scores: scores2, score: score2, setScore }) : void 0,
|
81335
81654
|
epochs > 1 ? /* @__PURE__ */ jsxRuntimeExports.jsx(EpochFilter, { epoch, setEpoch, epochs }) : void 0,
|
81336
81655
|
/* @__PURE__ */ jsxRuntimeExports.jsx(SortFilter, { sort, setSort, epochs })
|
@@ -82026,13 +82345,7 @@ Supported expressions:
|
|
82026
82345
|
running: evalStatus === "started"
|
82027
82346
|
},
|
82028
82347
|
tools: () => !samplesDescriptor ? void 0 : totalSampleCount === 1 ? [/* @__PURE__ */ jsxRuntimeExports.jsx(ScoreFilterTools, {})] : [
|
82029
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
82030
|
-
SampleTools,
|
82031
|
-
{
|
82032
|
-
samples: sampleSummaries || []
|
82033
|
-
},
|
82034
|
-
"sample-tools"
|
82035
|
-
),
|
82348
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SampleTools, {}, "sample-tools"),
|
82036
82349
|
evalStatus === "started" && !streamSamples && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
82037
82350
|
ToolButton,
|
82038
82351
|
{
|