inspect-ai 0.3.80__py3-none-any.whl → 0.3.82__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/_cli/eval.py +35 -2
- inspect_ai/_cli/util.py +44 -1
- inspect_ai/_display/core/config.py +1 -1
- inspect_ai/_display/core/display.py +13 -4
- inspect_ai/_display/core/results.py +1 -1
- inspect_ai/_display/textual/widgets/task_detail.py +5 -4
- inspect_ai/_eval/eval.py +38 -1
- inspect_ai/_eval/evalset.py +5 -0
- inspect_ai/_eval/run.py +5 -2
- inspect_ai/_eval/task/log.py +53 -6
- inspect_ai/_eval/task/run.py +51 -10
- inspect_ai/_util/constants.py +2 -0
- inspect_ai/_util/file.py +17 -1
- inspect_ai/_util/json.py +36 -1
- inspect_ai/_view/server.py +113 -1
- inspect_ai/_view/www/App.css +1 -1
- inspect_ai/_view/www/dist/assets/index.css +518 -296
- inspect_ai/_view/www/dist/assets/index.js +38803 -36307
- inspect_ai/_view/www/eslint.config.mjs +1 -1
- inspect_ai/_view/www/log-schema.json +13 -0
- inspect_ai/_view/www/node_modules/flatted/python/flatted.py +149 -0
- inspect_ai/_view/www/package.json +8 -2
- inspect_ai/_view/www/src/App.tsx +151 -855
- inspect_ai/_view/www/src/api/api-browser.ts +176 -5
- inspect_ai/_view/www/src/api/api-vscode.ts +75 -1
- inspect_ai/_view/www/src/api/client-api.ts +66 -10
- inspect_ai/_view/www/src/api/jsonrpc.ts +2 -0
- inspect_ai/_view/www/src/api/types.ts +107 -2
- inspect_ai/_view/www/src/appearance/icons.ts +1 -0
- inspect_ai/_view/www/src/components/AsciinemaPlayer.tsx +3 -3
- inspect_ai/_view/www/src/components/DownloadPanel.tsx +2 -2
- inspect_ai/_view/www/src/components/ExpandablePanel.tsx +56 -61
- inspect_ai/_view/www/src/components/FindBand.tsx +17 -9
- inspect_ai/_view/www/src/components/HumanBaselineView.tsx +1 -1
- inspect_ai/_view/www/src/components/JsonPanel.tsx +14 -24
- inspect_ai/_view/www/src/components/LargeModal.tsx +2 -35
- inspect_ai/_view/www/src/components/LightboxCarousel.tsx +27 -11
- inspect_ai/_view/www/src/components/LiveVirtualList.module.css +11 -0
- inspect_ai/_view/www/src/components/LiveVirtualList.tsx +177 -0
- inspect_ai/_view/www/src/components/MarkdownDiv.tsx +3 -3
- inspect_ai/_view/www/src/components/MessageBand.tsx +14 -9
- inspect_ai/_view/www/src/components/MorePopOver.tsx +3 -3
- inspect_ai/_view/www/src/components/NavPills.tsx +20 -8
- inspect_ai/_view/www/src/components/NoContentsPanel.module.css +12 -0
- inspect_ai/_view/www/src/components/NoContentsPanel.tsx +20 -0
- inspect_ai/_view/www/src/components/ProgressBar.module.css +5 -4
- inspect_ai/_view/www/src/components/ProgressBar.tsx +3 -2
- inspect_ai/_view/www/src/components/PulsingDots.module.css +81 -0
- inspect_ai/_view/www/src/components/PulsingDots.tsx +45 -0
- inspect_ai/_view/www/src/components/TabSet.tsx +4 -37
- inspect_ai/_view/www/src/components/ToolButton.tsx +3 -4
- inspect_ai/_view/www/src/index.tsx +26 -94
- inspect_ai/_view/www/src/logfile/remoteLogFile.ts +9 -1
- inspect_ai/_view/www/src/logfile/remoteZipFile.ts +30 -4
- inspect_ai/_view/www/src/metadata/RenderedContent.tsx +4 -6
- inspect_ai/_view/www/src/plan/ScorerDetailView.tsx +1 -1
- inspect_ai/_view/www/src/samples/InlineSampleDisplay.module.css +9 -1
- inspect_ai/_view/www/src/samples/InlineSampleDisplay.tsx +67 -28
- inspect_ai/_view/www/src/samples/SampleDialog.tsx +51 -22
- inspect_ai/_view/www/src/samples/SampleDisplay.module.css +4 -0
- inspect_ai/_view/www/src/samples/SampleDisplay.tsx +144 -90
- inspect_ai/_view/www/src/samples/SampleSummaryView.module.css +4 -0
- inspect_ai/_view/www/src/samples/SampleSummaryView.tsx +82 -35
- inspect_ai/_view/www/src/samples/SamplesTools.tsx +23 -30
- inspect_ai/_view/www/src/samples/chat/ChatMessage.tsx +2 -1
- inspect_ai/_view/www/src/samples/chat/ChatMessageRenderer.tsx +1 -1
- inspect_ai/_view/www/src/samples/chat/ChatViewVirtualList.tsx +45 -53
- inspect_ai/_view/www/src/samples/chat/MessageContent.tsx +4 -1
- inspect_ai/_view/www/src/samples/chat/MessageContents.tsx +3 -0
- inspect_ai/_view/www/src/samples/chat/messages.ts +34 -0
- inspect_ai/_view/www/src/samples/chat/tools/ToolCallView.module.css +3 -0
- inspect_ai/_view/www/src/samples/chat/tools/ToolCallView.tsx +10 -1
- inspect_ai/_view/www/src/samples/chat/tools/ToolInput.tsx +22 -46
- inspect_ai/_view/www/src/samples/descriptor/samplesDescriptor.tsx +25 -17
- inspect_ai/_view/www/src/samples/descriptor/score/ObjectScoreDescriptor.tsx +2 -1
- inspect_ai/_view/www/src/samples/descriptor/types.ts +6 -5
- inspect_ai/_view/www/src/samples/list/SampleFooter.module.css +21 -3
- inspect_ai/_view/www/src/samples/list/SampleFooter.tsx +20 -1
- inspect_ai/_view/www/src/samples/list/SampleList.tsx +105 -85
- inspect_ai/_view/www/src/samples/list/SampleRow.module.css +6 -0
- inspect_ai/_view/www/src/samples/list/SampleRow.tsx +27 -14
- inspect_ai/_view/www/src/samples/sample-tools/SelectScorer.tsx +29 -18
- inspect_ai/_view/www/src/samples/sample-tools/SortFilter.tsx +28 -28
- inspect_ai/_view/www/src/samples/sample-tools/sample-filter/SampleFilter.tsx +19 -9
- inspect_ai/_view/www/src/samples/sampleDataAdapter.ts +33 -0
- inspect_ai/_view/www/src/samples/sampleLimit.ts +2 -2
- inspect_ai/_view/www/src/samples/scores/SampleScoreView.tsx +7 -9
- inspect_ai/_view/www/src/samples/scores/SampleScores.tsx +7 -11
- inspect_ai/_view/www/src/samples/transcript/ErrorEventView.tsx +0 -13
- inspect_ai/_view/www/src/samples/transcript/InfoEventView.tsx +0 -13
- inspect_ai/_view/www/src/samples/transcript/InputEventView.tsx +0 -13
- inspect_ai/_view/www/src/samples/transcript/ModelEventView.module.css +4 -0
- inspect_ai/_view/www/src/samples/transcript/ModelEventView.tsx +10 -24
- inspect_ai/_view/www/src/samples/transcript/SampleInitEventView.tsx +0 -13
- inspect_ai/_view/www/src/samples/transcript/SampleLimitEventView.tsx +4 -22
- inspect_ai/_view/www/src/samples/transcript/SandboxEventView.tsx +15 -24
- inspect_ai/_view/www/src/samples/transcript/ScoreEventView.tsx +0 -13
- inspect_ai/_view/www/src/samples/transcript/StepEventView.tsx +6 -28
- inspect_ai/_view/www/src/samples/transcript/SubtaskEventView.tsx +24 -34
- inspect_ai/_view/www/src/samples/transcript/ToolEventView.module.css +4 -0
- inspect_ai/_view/www/src/samples/transcript/ToolEventView.tsx +8 -13
- inspect_ai/_view/www/src/samples/transcript/TranscriptView.tsx +197 -338
- inspect_ai/_view/www/src/samples/transcript/TranscriptVirtualListComponent.module.css +16 -0
- inspect_ai/_view/www/src/samples/transcript/TranscriptVirtualListComponent.tsx +44 -0
- inspect_ai/_view/www/src/samples/transcript/event/EventNav.tsx +7 -4
- inspect_ai/_view/www/src/samples/transcript/event/EventPanel.tsx +52 -58
- inspect_ai/_view/www/src/samples/transcript/event/EventProgressPanel.module.css +23 -0
- inspect_ai/_view/www/src/samples/transcript/event/EventProgressPanel.tsx +27 -0
- inspect_ai/_view/www/src/samples/transcript/state/StateEventRenderers.tsx +30 -1
- inspect_ai/_view/www/src/samples/transcript/state/StateEventView.tsx +102 -72
- inspect_ai/_view/www/src/scoring/utils.ts +87 -0
- inspect_ai/_view/www/src/state/appSlice.ts +244 -0
- inspect_ai/_view/www/src/state/hooks.ts +397 -0
- inspect_ai/_view/www/src/state/logPolling.ts +196 -0
- inspect_ai/_view/www/src/state/logSlice.ts +214 -0
- inspect_ai/_view/www/src/state/logsPolling.ts +118 -0
- inspect_ai/_view/www/src/state/logsSlice.ts +181 -0
- inspect_ai/_view/www/src/state/samplePolling.ts +311 -0
- inspect_ai/_view/www/src/state/sampleSlice.ts +127 -0
- inspect_ai/_view/www/src/state/sampleUtils.ts +21 -0
- inspect_ai/_view/www/src/state/scrolling.ts +206 -0
- inspect_ai/_view/www/src/state/store.ts +168 -0
- inspect_ai/_view/www/src/state/store_filter.ts +84 -0
- inspect_ai/_view/www/src/state/utils.ts +23 -0
- inspect_ai/_view/www/src/storage/index.ts +26 -0
- inspect_ai/_view/www/src/types/log.d.ts +2 -0
- inspect_ai/_view/www/src/types.ts +94 -32
- inspect_ai/_view/www/src/utils/attachments.ts +58 -23
- inspect_ai/_view/www/src/utils/logger.ts +52 -0
- inspect_ai/_view/www/src/utils/polling.ts +100 -0
- inspect_ai/_view/www/src/utils/react.ts +30 -0
- inspect_ai/_view/www/src/utils/vscode.ts +1 -1
- inspect_ai/_view/www/src/workspace/WorkSpace.tsx +181 -216
- inspect_ai/_view/www/src/workspace/WorkSpaceView.tsx +11 -53
- inspect_ai/_view/www/src/workspace/navbar/Navbar.tsx +8 -18
- inspect_ai/_view/www/src/workspace/navbar/PrimaryBar.module.css +1 -0
- inspect_ai/_view/www/src/workspace/navbar/PrimaryBar.tsx +40 -22
- inspect_ai/_view/www/src/workspace/navbar/ResultsPanel.module.css +0 -1
- inspect_ai/_view/www/src/workspace/navbar/ResultsPanel.tsx +98 -39
- inspect_ai/_view/www/src/workspace/navbar/RunningStatusPanel.module.css +32 -0
- inspect_ai/_view/www/src/workspace/navbar/RunningStatusPanel.tsx +32 -0
- inspect_ai/_view/www/src/workspace/navbar/SecondaryBar.tsx +11 -13
- inspect_ai/_view/www/src/workspace/navbar/StatusPanel.tsx +6 -2
- inspect_ai/_view/www/src/workspace/sidebar/LogDirectoryTitleView.tsx +4 -4
- inspect_ai/_view/www/src/workspace/sidebar/Sidebar.tsx +28 -13
- inspect_ai/_view/www/src/workspace/tabs/InfoTab.tsx +5 -10
- inspect_ai/_view/www/src/workspace/tabs/JsonTab.tsx +4 -4
- inspect_ai/_view/www/src/workspace/tabs/RunningNoSamples.module.css +22 -0
- inspect_ai/_view/www/src/workspace/tabs/RunningNoSamples.tsx +19 -0
- inspect_ai/_view/www/src/workspace/tabs/SamplesTab.tsx +110 -115
- inspect_ai/_view/www/src/workspace/tabs/grouping.ts +37 -5
- inspect_ai/_view/www/src/workspace/tabs/types.ts +4 -0
- inspect_ai/_view/www/src/workspace/types.ts +4 -3
- inspect_ai/_view/www/src/workspace/utils.ts +4 -4
- inspect_ai/_view/www/vite.config.js +6 -0
- inspect_ai/_view/www/yarn.lock +370 -354
- inspect_ai/log/_condense.py +26 -0
- inspect_ai/log/_log.py +6 -3
- inspect_ai/log/_recorders/buffer/__init__.py +14 -0
- inspect_ai/log/_recorders/buffer/buffer.py +30 -0
- inspect_ai/log/_recorders/buffer/database.py +685 -0
- inspect_ai/log/_recorders/buffer/filestore.py +259 -0
- inspect_ai/log/_recorders/buffer/types.py +84 -0
- inspect_ai/log/_recorders/eval.py +2 -11
- inspect_ai/log/_recorders/types.py +30 -0
- inspect_ai/log/_transcript.py +27 -1
- inspect_ai/model/_call_tools.py +1 -0
- inspect_ai/model/_generate_config.py +2 -2
- inspect_ai/model/_model.py +1 -0
- inspect_ai/tool/_tool_support_helpers.py +4 -4
- inspect_ai/tool/_tools/_web_browser/_web_browser.py +3 -1
- inspect_ai/util/_subtask.py +1 -0
- {inspect_ai-0.3.80.dist-info → inspect_ai-0.3.82.dist-info}/METADATA +2 -2
- {inspect_ai-0.3.80.dist-info → inspect_ai-0.3.82.dist-info}/RECORD +178 -138
- inspect_ai/_view/www/src/samples/transcript/SampleTranscript.tsx +0 -22
- {inspect_ai-0.3.80.dist-info → inspect_ai-0.3.82.dist-info}/WHEEL +0 -0
- {inspect_ai-0.3.80.dist-info → inspect_ai-0.3.82.dist-info}/entry_points.txt +0 -0
- {inspect_ai-0.3.80.dist-info → inspect_ai-0.3.82.dist-info}/licenses/LICENSE +0 -0
- {inspect_ai-0.3.80.dist-info → inspect_ai-0.3.82.dist-info}/top_level.txt +0 -0
@@ -1,12 +1,16 @@
|
|
1
1
|
import { SampleSummary } from "../../api/types";
|
2
2
|
import { SamplesDescriptor } from "../../samples/descriptor/samplesDescriptor";
|
3
|
+
import { ScoreLabel } from "../../types";
|
4
|
+
import { Epochs } from "../../types/log";
|
3
5
|
import { ListItem, SampleListItem, SeparatorListItem } from "./types";
|
4
6
|
|
5
7
|
export const getSampleProcessor = (
|
6
8
|
samples: SampleSummary[],
|
9
|
+
epochs: Epochs,
|
7
10
|
groupBy: "sample" | "epoch" | "none",
|
8
11
|
groupByOrder: "asc" | "desc",
|
9
12
|
sampleDescriptor: SamplesDescriptor,
|
13
|
+
score?: ScoreLabel,
|
10
14
|
): ((
|
11
15
|
sample: SampleSummary,
|
12
16
|
index: number,
|
@@ -14,11 +18,17 @@ export const getSampleProcessor = (
|
|
14
18
|
) => ListItem[]) => {
|
15
19
|
// Perform grouping if there are epochs
|
16
20
|
if (groupBy == "epoch") {
|
17
|
-
return groupByEpoch(samples, sampleDescriptor, groupByOrder);
|
21
|
+
return groupByEpoch(samples, epochs, sampleDescriptor, groupByOrder, score);
|
18
22
|
} else if (groupBy === "sample") {
|
19
|
-
return groupBySample(
|
23
|
+
return groupBySample(
|
24
|
+
samples,
|
25
|
+
epochs,
|
26
|
+
sampleDescriptor,
|
27
|
+
groupByOrder,
|
28
|
+
score,
|
29
|
+
);
|
20
30
|
} else {
|
21
|
-
return noGrouping(samples, groupByOrder);
|
31
|
+
return noGrouping(samples, groupByOrder, sampleDescriptor, score);
|
22
32
|
}
|
23
33
|
};
|
24
34
|
|
@@ -28,6 +38,8 @@ export const getSampleProcessor = (
|
|
28
38
|
const noGrouping = (
|
29
39
|
samples: SampleSummary[],
|
30
40
|
order: "asc" | "desc",
|
41
|
+
sampleDescriptor: SamplesDescriptor,
|
42
|
+
score?: ScoreLabel,
|
31
43
|
): ((sample: SampleSummary, index: number) => ListItem[]) => {
|
32
44
|
const counter = getCounter(samples.length, 1, order);
|
33
45
|
return (sample: SampleSummary, index: number) => {
|
@@ -40,6 +52,12 @@ const noGrouping = (
|
|
40
52
|
index: index,
|
41
53
|
data: sample,
|
42
54
|
type: "sample",
|
55
|
+
answer:
|
56
|
+
sampleDescriptor.selectedScorerDescriptor(sample)?.answer() || "",
|
57
|
+
scoreRendered: sampleDescriptor.evalDescriptor
|
58
|
+
.score(sample, score)
|
59
|
+
?.render(),
|
60
|
+
completed: sample.completed !== undefined ? sample.completed : true,
|
43
61
|
},
|
44
62
|
];
|
45
63
|
};
|
@@ -50,8 +68,10 @@ const noGrouping = (
|
|
50
68
|
*/
|
51
69
|
const groupBySample = (
|
52
70
|
samples: SampleSummary[],
|
71
|
+
epochs: Epochs,
|
53
72
|
sampleDescriptor: SamplesDescriptor,
|
54
73
|
order: "asc" | "desc",
|
74
|
+
score?: ScoreLabel,
|
55
75
|
): ((
|
56
76
|
sample: SampleSummary,
|
57
77
|
index: number,
|
@@ -73,7 +93,7 @@ const groupBySample = (
|
|
73
93
|
}
|
74
94
|
}
|
75
95
|
});
|
76
|
-
const groupCount = samples.length /
|
96
|
+
const groupCount = samples.length / (epochs || 1);
|
77
97
|
const itemCount = samples.length / groupCount;
|
78
98
|
const counter = getCounter(itemCount, groupCount, order);
|
79
99
|
return (
|
@@ -103,6 +123,11 @@ const groupBySample = (
|
|
103
123
|
index: index,
|
104
124
|
data: sample,
|
105
125
|
type: "sample",
|
126
|
+
answer: sampleDescriptor.selectedScorerDescriptor(sample)?.answer() || "",
|
127
|
+
scoreRendered: sampleDescriptor.evalDescriptor
|
128
|
+
.score(sample, score)
|
129
|
+
?.render(),
|
130
|
+
completed: sample.completed !== undefined ? sample.completed : true,
|
106
131
|
} as SampleListItem);
|
107
132
|
|
108
133
|
return results;
|
@@ -114,14 +139,16 @@ const groupBySample = (
|
|
114
139
|
*/
|
115
140
|
const groupByEpoch = (
|
116
141
|
samples: SampleSummary[],
|
142
|
+
epochs: Epochs,
|
117
143
|
sampleDescriptor: SamplesDescriptor,
|
118
144
|
order: "asc" | "desc",
|
145
|
+
score?: ScoreLabel,
|
119
146
|
): ((
|
120
147
|
sample: SampleSummary,
|
121
148
|
index: number,
|
122
149
|
previousSample?: SampleSummary,
|
123
150
|
) => ListItem[]) => {
|
124
|
-
const groupCount =
|
151
|
+
const groupCount = epochs || 1;
|
125
152
|
const itemCount = samples.length / groupCount;
|
126
153
|
const counter = getCounter(itemCount, groupCount, order);
|
127
154
|
|
@@ -153,6 +180,11 @@ const groupByEpoch = (
|
|
153
180
|
index: index,
|
154
181
|
data: sample,
|
155
182
|
type: "sample",
|
183
|
+
answer: sampleDescriptor.selectedScorerDescriptor(sample)?.answer() || "",
|
184
|
+
scoreRendered: sampleDescriptor.evalDescriptor
|
185
|
+
.score(sample, score)
|
186
|
+
?.render(),
|
187
|
+
completed: sample.completed !== undefined ? sample.completed : true,
|
156
188
|
} as SampleListItem);
|
157
189
|
|
158
190
|
return results;
|
@@ -1,11 +1,15 @@
|
|
1
|
+
import { ReactNode } from "react";
|
1
2
|
import { SampleSummary } from "../../api/types";
|
2
3
|
|
3
4
|
export interface SampleListItem {
|
4
5
|
label: string;
|
5
6
|
index: number;
|
6
7
|
number: number;
|
8
|
+
answer: string;
|
9
|
+
scoreRendered: ReactNode;
|
7
10
|
data: SampleSummary;
|
8
11
|
type: "sample";
|
12
|
+
completed: boolean;
|
9
13
|
}
|
10
14
|
|
11
15
|
export interface SeparatorListItem {
|
@@ -1,10 +1,11 @@
|
|
1
|
-
import { ReactNode, RefObject } from "react";
|
1
|
+
import { ComponentType, ReactNode, RefObject } from "react";
|
2
2
|
|
3
|
-
export interface TabDescriptor {
|
3
|
+
export interface TabDescriptor<P> {
|
4
4
|
id: string;
|
5
5
|
scrollable: boolean;
|
6
6
|
scrollRef?: RefObject<HTMLDivElement | null>;
|
7
7
|
label: string;
|
8
|
-
|
8
|
+
component: ComponentType<P>;
|
9
|
+
componentProps: P;
|
9
10
|
tools?: () => ReactNode[] | undefined;
|
10
11
|
}
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import {
|
1
|
+
import { ResultsMetric } from "./navbar/ResultsPanel";
|
2
2
|
|
3
|
-
export const metricDisplayName = (metric:
|
3
|
+
export const metricDisplayName = (metric: ResultsMetric): string => {
|
4
4
|
let modifier = undefined;
|
5
5
|
for (const metricModifier of metricModifiers) {
|
6
6
|
modifier = metricModifier(metric);
|
@@ -13,10 +13,10 @@ export const metricDisplayName = (metric: EvalMetric): string => {
|
|
13
13
|
return metricName;
|
14
14
|
};
|
15
15
|
|
16
|
-
type MetricModifier = (metric:
|
16
|
+
type MetricModifier = (metric: ResultsMetric) => string | undefined;
|
17
17
|
|
18
18
|
const clusterMetricModifier: MetricModifier = (
|
19
|
-
metric:
|
19
|
+
metric: ResultsMetric,
|
20
20
|
): string | undefined => {
|
21
21
|
if (metric.name !== "stderr") {
|
22
22
|
return undefined;
|
@@ -24,4 +24,10 @@ export default defineConfig({
|
|
24
24
|
resolve: {
|
25
25
|
dedupe: ["react", "react-dom"],
|
26
26
|
},
|
27
|
+
define: {
|
28
|
+
__DEV_WATCH__: JSON.stringify(process.env.DEV_LOGGING === "true"),
|
29
|
+
__LOGGING_FILTER__: JSON.stringify(
|
30
|
+
process.env.DEV_LOGGING_NAMESPACES || "*",
|
31
|
+
),
|
32
|
+
},
|
27
33
|
});
|