inspect-ai 0.3.95__py3-none-any.whl → 0.3.97__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/_eval/eval.py +10 -2
- inspect_ai/_eval/task/util.py +32 -3
- inspect_ai/_util/local_server.py +16 -0
- inspect_ai/_util/registry.py +7 -0
- inspect_ai/_util/timer.py +13 -0
- inspect_ai/_view/www/dist/assets/index.css +275 -195
- inspect_ai/_view/www/dist/assets/index.js +8568 -7376
- inspect_ai/_view/www/src/app/App.css +1 -0
- inspect_ai/_view/www/src/app/App.tsx +27 -10
- inspect_ai/_view/www/src/app/appearance/icons.ts +5 -0
- inspect_ai/_view/www/src/app/content/RecordTree.module.css +22 -0
- inspect_ai/_view/www/src/app/content/RecordTree.tsx +370 -0
- inspect_ai/_view/www/src/app/content/RenderedContent.module.css +5 -0
- inspect_ai/_view/www/src/app/content/RenderedContent.tsx +32 -19
- inspect_ai/_view/www/src/app/content/record_processors/store.ts +101 -0
- inspect_ai/_view/www/src/app/content/record_processors/types.ts +3 -0
- inspect_ai/_view/www/src/app/content/types.ts +5 -0
- inspect_ai/_view/www/src/app/log-view/LogView.tsx +1 -0
- inspect_ai/_view/www/src/app/log-view/LogViewContainer.tsx +35 -28
- inspect_ai/_view/www/src/app/log-view/LogViewLayout.tsx +1 -8
- inspect_ai/_view/www/src/app/log-view/navbar/PrimaryBar.tsx +2 -4
- inspect_ai/_view/www/src/app/log-view/navbar/ResultsPanel.tsx +13 -3
- inspect_ai/_view/www/src/app/log-view/navbar/ScoreGrid.module.css +15 -0
- inspect_ai/_view/www/src/app/log-view/navbar/ScoreGrid.tsx +14 -10
- inspect_ai/_view/www/src/app/log-view/tabs/InfoTab.tsx +9 -3
- inspect_ai/_view/www/src/app/log-view/tabs/JsonTab.tsx +1 -3
- inspect_ai/_view/www/src/app/log-view/tabs/SamplesTab.tsx +8 -2
- inspect_ai/_view/www/src/app/log-view/types.ts +1 -0
- inspect_ai/_view/www/src/app/plan/ModelCard.module.css +7 -0
- inspect_ai/_view/www/src/app/plan/ModelCard.tsx +5 -2
- inspect_ai/_view/www/src/app/plan/PlanCard.tsx +13 -8
- inspect_ai/_view/www/src/app/routing/navigationHooks.ts +63 -8
- inspect_ai/_view/www/src/app/routing/url.ts +45 -0
- inspect_ai/_view/www/src/app/samples/InlineSampleDisplay.module.css +2 -1
- inspect_ai/_view/www/src/app/samples/InlineSampleDisplay.tsx +15 -8
- inspect_ai/_view/www/src/app/samples/SampleDialog.module.css +3 -0
- inspect_ai/_view/www/src/app/samples/SampleDialog.tsx +16 -5
- inspect_ai/_view/www/src/app/samples/SampleDisplay.module.css +9 -1
- inspect_ai/_view/www/src/app/samples/SampleDisplay.tsx +68 -31
- inspect_ai/_view/www/src/app/samples/chat/ChatMessage.module.css +12 -7
- inspect_ai/_view/www/src/app/samples/chat/ChatMessage.tsx +17 -5
- inspect_ai/_view/www/src/app/samples/chat/ChatMessageRow.module.css +9 -0
- inspect_ai/_view/www/src/app/samples/chat/ChatMessageRow.tsx +48 -18
- inspect_ai/_view/www/src/app/samples/chat/ChatView.tsx +0 -1
- inspect_ai/_view/www/src/app/samples/chat/ChatViewVirtualList.module.css +4 -0
- inspect_ai/_view/www/src/app/samples/chat/ChatViewVirtualList.tsx +41 -1
- inspect_ai/_view/www/src/app/samples/chat/messages.ts +7 -0
- inspect_ai/_view/www/src/app/samples/chat/tools/ToolCallView.module.css +0 -3
- inspect_ai/_view/www/src/app/samples/chat/tools/ToolCallView.tsx +1 -1
- inspect_ai/_view/www/src/app/samples/chat/tools/ToolInput.module.css +1 -1
- inspect_ai/_view/www/src/app/samples/chat/tools/ToolOutput.module.css +1 -1
- inspect_ai/_view/www/src/app/samples/descriptor/score/NumericScoreDescriptor.tsx +5 -1
- inspect_ai/_view/www/src/app/samples/descriptor/score/PassFailScoreDescriptor.tsx +11 -6
- inspect_ai/_view/www/src/app/samples/list/SampleList.tsx +7 -0
- inspect_ai/_view/www/src/app/samples/list/SampleRow.tsx +5 -18
- inspect_ai/_view/www/src/app/samples/sample-tools/SortFilter.tsx +1 -1
- inspect_ai/_view/www/src/app/samples/scores/SampleScoresGrid.tsx +18 -5
- inspect_ai/_view/www/src/app/samples/scores/SampleScoresView.module.css +0 -6
- inspect_ai/_view/www/src/app/samples/scores/SampleScoresView.tsx +4 -1
- inspect_ai/_view/www/src/app/samples/transcript/ApprovalEventView.tsx +4 -2
- inspect_ai/_view/www/src/app/samples/transcript/ErrorEventView.tsx +6 -4
- inspect_ai/_view/www/src/app/samples/transcript/InfoEventView.module.css +1 -1
- inspect_ai/_view/www/src/app/samples/transcript/InfoEventView.tsx +13 -6
- inspect_ai/_view/www/src/app/samples/transcript/InputEventView.tsx +6 -4
- inspect_ai/_view/www/src/app/samples/transcript/LoggerEventView.tsx +4 -2
- inspect_ai/_view/www/src/app/samples/transcript/ModelEventView.tsx +11 -8
- inspect_ai/_view/www/src/app/samples/transcript/SampleInitEventView.tsx +14 -8
- inspect_ai/_view/www/src/app/samples/transcript/SampleLimitEventView.tsx +13 -8
- inspect_ai/_view/www/src/app/samples/transcript/SandboxEventView.tsx +25 -16
- inspect_ai/_view/www/src/app/samples/transcript/ScoreEventView.tsx +7 -5
- inspect_ai/_view/www/src/app/samples/transcript/SpanEventView.tsx +11 -28
- inspect_ai/_view/www/src/app/samples/transcript/StepEventView.tsx +12 -20
- inspect_ai/_view/www/src/app/samples/transcript/SubtaskEventView.tsx +12 -31
- inspect_ai/_view/www/src/app/samples/transcript/ToolEventView.tsx +25 -29
- inspect_ai/_view/www/src/app/samples/transcript/TranscriptVirtualList.tsx +297 -0
- inspect_ai/_view/www/src/app/samples/transcript/TranscriptVirtualListComponent.module.css +0 -8
- inspect_ai/_view/www/src/app/samples/transcript/TranscriptVirtualListComponent.tsx +43 -25
- inspect_ai/_view/www/src/app/samples/transcript/event/EventPanel.module.css +43 -0
- inspect_ai/_view/www/src/app/samples/transcript/event/EventPanel.tsx +109 -43
- inspect_ai/_view/www/src/app/samples/transcript/state/StateEventView.tsx +19 -8
- inspect_ai/_view/www/src/app/samples/transcript/transform/treeify.ts +128 -60
- inspect_ai/_view/www/src/app/samples/transcript/transform/utils.ts +14 -4
- inspect_ai/_view/www/src/app/samples/transcript/types.ts +6 -4
- inspect_ai/_view/www/src/app/types.ts +12 -1
- inspect_ai/_view/www/src/components/Card.css +6 -3
- inspect_ai/_view/www/src/components/Card.tsx +15 -2
- inspect_ai/_view/www/src/components/CopyButton.tsx +4 -6
- inspect_ai/_view/www/src/components/ExpandablePanel.module.css +20 -14
- inspect_ai/_view/www/src/components/ExpandablePanel.tsx +17 -22
- inspect_ai/_view/www/src/components/LargeModal.tsx +5 -1
- inspect_ai/_view/www/src/components/LiveVirtualList.tsx +25 -1
- inspect_ai/_view/www/src/components/MarkdownDiv.css +4 -0
- inspect_ai/_view/www/src/components/MarkdownDiv.tsx +2 -2
- inspect_ai/_view/www/src/components/TabSet.module.css +6 -1
- inspect_ai/_view/www/src/components/TabSet.tsx +8 -2
- inspect_ai/_view/www/src/state/hooks.ts +83 -13
- inspect_ai/_view/www/src/state/logPolling.ts +2 -2
- inspect_ai/_view/www/src/state/logSlice.ts +1 -2
- inspect_ai/_view/www/src/state/logsSlice.ts +9 -9
- inspect_ai/_view/www/src/state/samplePolling.ts +1 -1
- inspect_ai/_view/www/src/state/sampleSlice.ts +134 -7
- inspect_ai/_view/www/src/state/scoring.ts +1 -1
- inspect_ai/_view/www/src/state/scrolling.ts +39 -6
- inspect_ai/_view/www/src/state/store.ts +5 -0
- inspect_ai/_view/www/src/state/store_filter.ts +47 -44
- inspect_ai/_view/www/src/utils/debugging.ts +95 -0
- inspect_ai/_view/www/src/utils/format.ts +2 -2
- inspect_ai/_view/www/src/utils/json.ts +29 -0
- inspect_ai/agent/__init__.py +2 -1
- inspect_ai/agent/_agent.py +12 -0
- inspect_ai/agent/_react.py +184 -48
- inspect_ai/agent/_types.py +15 -2
- inspect_ai/analysis/beta/__init__.py +11 -3
- inspect_ai/analysis/beta/_dataframe/columns.py +11 -16
- inspect_ai/analysis/beta/_dataframe/evals/table.py +101 -39
- inspect_ai/analysis/beta/_dataframe/events/columns.py +50 -0
- inspect_ai/analysis/beta/_dataframe/events/extract.py +26 -0
- inspect_ai/analysis/beta/_dataframe/events/table.py +77 -3
- inspect_ai/analysis/beta/_dataframe/extract.py +44 -25
- inspect_ai/analysis/beta/_dataframe/messages/columns.py +1 -1
- inspect_ai/analysis/beta/_dataframe/messages/table.py +30 -29
- inspect_ai/analysis/beta/_dataframe/progress.py +56 -0
- inspect_ai/analysis/beta/_dataframe/record.py +13 -9
- inspect_ai/analysis/beta/_dataframe/samples/columns.py +8 -4
- inspect_ai/analysis/beta/_dataframe/samples/extract.py +5 -33
- inspect_ai/analysis/beta/_dataframe/samples/table.py +211 -60
- inspect_ai/analysis/beta/_dataframe/util.py +33 -28
- inspect_ai/log/_file.py +9 -2
- inspect_ai/model/_call_tools.py +1 -1
- inspect_ai/model/_providers/anthropic.py +18 -5
- inspect_ai/model/_providers/azureai.py +7 -2
- inspect_ai/model/_providers/util/llama31.py +3 -3
- inspect_ai/solver/_task_state.py +1 -1
- inspect_ai/tool/_mcp/_sandbox.py +17 -14
- {inspect_ai-0.3.95.dist-info → inspect_ai-0.3.97.dist-info}/METADATA +2 -2
- {inspect_ai-0.3.95.dist-info → inspect_ai-0.3.97.dist-info}/RECORD +140 -133
- {inspect_ai-0.3.95.dist-info → inspect_ai-0.3.97.dist-info}/WHEEL +1 -1
- inspect_ai/_view/www/src/app/samples/transcript/TranscriptView.module.css +0 -48
- inspect_ai/_view/www/src/app/samples/transcript/TranscriptView.tsx +0 -276
- {inspect_ai-0.3.95.dist-info → inspect_ai-0.3.97.dist-info}/entry_points.txt +0 -0
- {inspect_ai-0.3.95.dist-info → inspect_ai-0.3.97.dist-info}/licenses/LICENSE +0 -0
- {inspect_ai-0.3.95.dist-info → inspect_ai-0.3.97.dist-info}/top_level.txt +0 -0
@@ -24,10 +24,10 @@ import { usePrismHighlight } from "../../../state/hooks";
|
|
24
24
|
import styles from "./ModelEventView.module.css";
|
25
25
|
import { EventTimingPanel } from "./event/EventTimingPanel";
|
26
26
|
import { formatTiming, formatTitle } from "./event/utils";
|
27
|
+
import { EventNode } from "./types";
|
27
28
|
|
28
29
|
interface ModelEventViewProps {
|
29
|
-
|
30
|
-
event: ModelEvent;
|
30
|
+
eventNode: EventNode<ModelEvent>;
|
31
31
|
className?: string | string[];
|
32
32
|
}
|
33
33
|
|
@@ -35,10 +35,10 @@ interface ModelEventViewProps {
|
|
35
35
|
* Renders the StateEventView component.
|
36
36
|
*/
|
37
37
|
export const ModelEventView: FC<ModelEventViewProps> = ({
|
38
|
-
|
39
|
-
event,
|
38
|
+
eventNode,
|
40
39
|
className,
|
41
40
|
}) => {
|
41
|
+
const event = eventNode.event;
|
42
42
|
const totalUsage = event.output.usage?.total_tokens;
|
43
43
|
const callTime = event.output.time;
|
44
44
|
|
@@ -69,7 +69,8 @@ export const ModelEventView: FC<ModelEventViewProps> = ({
|
|
69
69
|
|
70
70
|
return (
|
71
71
|
<EventPanel
|
72
|
-
id={id}
|
72
|
+
id={eventNode.id}
|
73
|
+
depth={eventNode.depth}
|
73
74
|
className={className}
|
74
75
|
title={formatTitle(panelTitle, totalUsage, callTime)}
|
75
76
|
subTitle={formatTiming(event.timestamp, event.working_start)}
|
@@ -77,7 +78,7 @@ export const ModelEventView: FC<ModelEventViewProps> = ({
|
|
77
78
|
>
|
78
79
|
<div data-name="Summary" className={styles.container}>
|
79
80
|
<ChatView
|
80
|
-
id={`${id}-model-output`}
|
81
|
+
id={`${eventNode.id}-model-output`}
|
81
82
|
messages={[...userMessages, ...(outputMessages || [])]}
|
82
83
|
numbered={false}
|
83
84
|
toolCallStyle="omit"
|
@@ -117,7 +118,7 @@ export const ModelEventView: FC<ModelEventViewProps> = ({
|
|
117
118
|
|
118
119
|
<EventSection title="Messages">
|
119
120
|
<ChatView
|
120
|
-
id={`${id}-model-input-full`}
|
121
|
+
id={`${eventNode.id}-model-input-full`}
|
121
122
|
messages={[...event.input, ...(outputMessages || [])]}
|
122
123
|
/>
|
123
124
|
</EventSection>
|
@@ -212,7 +213,9 @@ const ToolsConfig: FC<ToolConfigProps> = ({ tools, toolChoice }) => {
|
|
212
213
|
|
213
214
|
return (
|
214
215
|
<>
|
215
|
-
<div className={styles.toolConfig}>
|
216
|
+
<div className={clsx(styles.toolConfig, "text-size-small")}>
|
217
|
+
{toolEls}
|
218
|
+
</div>
|
216
219
|
<div className={styles.toolChoice}>
|
217
220
|
<div className={clsx("text-style-label", "text-style-secondary")}>
|
218
221
|
Tool Choice
|
@@ -8,12 +8,13 @@ import { ChatView } from "../chat/ChatView";
|
|
8
8
|
import { EventPanel } from "./event/EventPanel";
|
9
9
|
import { EventSection } from "./event/EventSection";
|
10
10
|
|
11
|
+
import clsx from "clsx";
|
11
12
|
import { FC } from "react";
|
12
13
|
import styles from "./SampleInitEventView.module.css";
|
14
|
+
import { EventNode } from "./types";
|
13
15
|
|
14
16
|
interface SampleInitEventViewProps {
|
15
|
-
|
16
|
-
event: SampleInitEvent;
|
17
|
+
eventNode: EventNode<SampleInitEvent>;
|
17
18
|
className?: string | string[];
|
18
19
|
}
|
19
20
|
|
@@ -21,17 +22,17 @@ interface SampleInitEventViewProps {
|
|
21
22
|
* Renders the SampleInitEventView component.
|
22
23
|
*/
|
23
24
|
export const SampleInitEventView: FC<SampleInitEventViewProps> = ({
|
24
|
-
|
25
|
-
event,
|
25
|
+
eventNode,
|
26
26
|
className,
|
27
27
|
}) => {
|
28
|
+
const event = eventNode.event;
|
28
29
|
const stateObj = event.state as Record<string, unknown>;
|
29
30
|
|
30
31
|
const sections = [];
|
31
32
|
|
32
33
|
if (event.sample.files && Object.keys(event.sample.files).length > 0) {
|
33
34
|
sections.push(
|
34
|
-
<EventSection title="Files" key={`
|
35
|
+
<EventSection title="Files" key={`event-${eventNode.id}`}>
|
35
36
|
{Object.keys(event.sample.files).map((file) => {
|
36
37
|
return (
|
37
38
|
<pre key={`sample-init-file-${file}`} className={styles.noMargin}>
|
@@ -45,7 +46,7 @@ export const SampleInitEventView: FC<SampleInitEventViewProps> = ({
|
|
45
46
|
|
46
47
|
if (event.sample.setup) {
|
47
48
|
sections.push(
|
48
|
-
<EventSection title="Setup" key={
|
49
|
+
<EventSection title="Setup" key={`${eventNode.id}-section-setup`}>
|
49
50
|
<pre className={styles.code}>
|
50
51
|
<code className="sourceCode">{event.sample.setup}</code>
|
51
52
|
</pre>
|
@@ -55,7 +56,8 @@ export const SampleInitEventView: FC<SampleInitEventViewProps> = ({
|
|
55
56
|
|
56
57
|
return (
|
57
58
|
<EventPanel
|
58
|
-
id={id}
|
59
|
+
id={eventNode.id}
|
60
|
+
depth={eventNode.depth}
|
59
61
|
className={className}
|
60
62
|
title="Sample"
|
61
63
|
icon={ApplicationIcons.sample}
|
@@ -81,7 +83,11 @@ export const SampleInitEventView: FC<SampleInitEventViewProps> = ({
|
|
81
83
|
{event.sample.target ? (
|
82
84
|
<EventSection title="Target">
|
83
85
|
{toArray(event.sample.target).map((target) => {
|
84
|
-
return
|
86
|
+
return (
|
87
|
+
<div key={target} className={clsx("text-size-base")}>
|
88
|
+
{target}
|
89
|
+
</div>
|
90
|
+
);
|
85
91
|
})}
|
86
92
|
</EventSection>
|
87
93
|
) : undefined}
|
@@ -2,10 +2,10 @@ import { FC } from "react";
|
|
2
2
|
import { SampleLimitEvent, Type10 } from "../../../@types/log";
|
3
3
|
import { ApplicationIcons } from "../../appearance/icons";
|
4
4
|
import { EventPanel } from "./event/EventPanel";
|
5
|
+
import { EventNode } from "./types";
|
5
6
|
|
6
7
|
interface SampleLimitEventViewProps {
|
7
|
-
|
8
|
-
event: SampleLimitEvent;
|
8
|
+
eventNode: EventNode<SampleLimitEvent>;
|
9
9
|
className?: string | string[];
|
10
10
|
}
|
11
11
|
|
@@ -13,8 +13,7 @@ interface SampleLimitEventViewProps {
|
|
13
13
|
* Renders the InfoEventView component.
|
14
14
|
*/
|
15
15
|
export const SampleLimitEventView: FC<SampleLimitEventViewProps> = ({
|
16
|
-
|
17
|
-
event,
|
16
|
+
eventNode,
|
18
17
|
className,
|
19
18
|
}) => {
|
20
19
|
const resolve_title = (type: Type10) => {
|
@@ -51,12 +50,18 @@ export const SampleLimitEventView: FC<SampleLimitEventViewProps> = ({
|
|
51
50
|
}
|
52
51
|
};
|
53
52
|
|
54
|
-
const title = resolve_title(event.type);
|
55
|
-
const icon = resolve_icon(event.type);
|
53
|
+
const title = resolve_title(eventNode.event.type);
|
54
|
+
const icon = resolve_icon(eventNode.event.type);
|
56
55
|
|
57
56
|
return (
|
58
|
-
<EventPanel
|
59
|
-
{
|
57
|
+
<EventPanel
|
58
|
+
id={eventNode.id}
|
59
|
+
depth={eventNode.depth}
|
60
|
+
title={title}
|
61
|
+
icon={icon}
|
62
|
+
className={className}
|
63
|
+
>
|
64
|
+
{eventNode.event.message}
|
60
65
|
</EventPanel>
|
61
66
|
);
|
62
67
|
};
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import { SandboxEvent } from "../../../@types/log";
|
2
2
|
import ExpandablePanel from "../../../components/ExpandablePanel";
|
3
|
-
import { MarkdownDiv } from "../../../components/MarkdownDiv";
|
4
3
|
import { ApplicationIcons } from "../../appearance/icons";
|
5
4
|
import { MetaDataGrid } from "../../content/MetaDataGrid";
|
6
5
|
import { EventPanel } from "./event/EventPanel";
|
@@ -8,12 +7,13 @@ import { EventSection } from "./event/EventSection";
|
|
8
7
|
|
9
8
|
import clsx from "clsx";
|
10
9
|
import { FC } from "react";
|
10
|
+
import { RenderedContent } from "../../content/RenderedContent";
|
11
11
|
import styles from "./SandboxEventView.module.css";
|
12
12
|
import { formatTiming } from "./event/utils";
|
13
|
+
import { EventNode } from "./types";
|
13
14
|
|
14
15
|
interface SandboxEventViewProps {
|
15
|
-
|
16
|
-
event: SandboxEvent;
|
16
|
+
eventNode: EventNode<SandboxEvent>;
|
17
17
|
className?: string | string[];
|
18
18
|
}
|
19
19
|
|
@@ -21,13 +21,15 @@ interface SandboxEventViewProps {
|
|
21
21
|
* Renders the SandboxEventView component.
|
22
22
|
*/
|
23
23
|
export const SandboxEventView: FC<SandboxEventViewProps> = ({
|
24
|
-
|
25
|
-
event,
|
24
|
+
eventNode,
|
26
25
|
className,
|
27
26
|
}) => {
|
27
|
+
const event = eventNode.event;
|
28
|
+
const id = eventNode.id;
|
28
29
|
return (
|
29
30
|
<EventPanel
|
30
31
|
id={id}
|
32
|
+
depth={eventNode.depth}
|
31
33
|
className={className}
|
32
34
|
title={`Sandbox: ${event.action}`}
|
33
35
|
icon={ApplicationIcons.sandbox}
|
@@ -57,7 +59,7 @@ const ExecView: FC<ExecViewProps> = ({ id, event }) => {
|
|
57
59
|
const options = event.options;
|
58
60
|
const input = event.input;
|
59
61
|
const result = event.result;
|
60
|
-
const output = event.output;
|
62
|
+
const output = event.output ? event.output.trim() : undefined;
|
61
63
|
|
62
64
|
return (
|
63
65
|
<div className={clsx(styles.exec)}>
|
@@ -78,16 +80,23 @@ const ExecView: FC<ExecViewProps> = ({ id, event }) => {
|
|
78
80
|
) : undefined}
|
79
81
|
</div>
|
80
82
|
</EventSection>
|
81
|
-
|
82
|
-
{
|
83
|
-
|
84
|
-
<
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
83
|
+
{output || (result !== null && result !== 0) ? (
|
84
|
+
<EventSection title={`Result`}>
|
85
|
+
{output ? (
|
86
|
+
<ExpandablePanel id={`${id}-output`} collapse={false}>
|
87
|
+
<RenderedContent
|
88
|
+
id={`${id}-output-content`}
|
89
|
+
entry={{ name: "sandbox_output", value: output }}
|
90
|
+
/>
|
91
|
+
</ExpandablePanel>
|
92
|
+
) : undefined}
|
93
|
+
{result !== 0 ? (
|
94
|
+
<div className={clsx(styles.result, "text-size-base")}>
|
95
|
+
(exited with code {result})
|
96
|
+
</div>
|
97
|
+
) : undefined}
|
98
|
+
</EventSection>
|
99
|
+
) : undefined}
|
91
100
|
</div>
|
92
101
|
);
|
93
102
|
};
|
@@ -8,10 +8,10 @@ import { EventPanel } from "./event/EventPanel";
|
|
8
8
|
|
9
9
|
import clsx from "clsx";
|
10
10
|
import styles from "./ScoreEventView.module.css";
|
11
|
+
import { EventNode } from "./types";
|
11
12
|
|
12
13
|
interface ScoreEventViewProps {
|
13
|
-
|
14
|
-
event: ScoreEvent;
|
14
|
+
eventNode: EventNode<ScoreEvent>;
|
15
15
|
className?: string | string[];
|
16
16
|
}
|
17
17
|
|
@@ -19,10 +19,10 @@ interface ScoreEventViewProps {
|
|
19
19
|
* Renders the ScoreEventView component.
|
20
20
|
*/
|
21
21
|
export const ScoreEventView: FC<ScoreEventViewProps> = ({
|
22
|
-
|
23
|
-
event,
|
22
|
+
eventNode,
|
24
23
|
className,
|
25
24
|
}) => {
|
25
|
+
const event = eventNode.event;
|
26
26
|
const resolvedTarget = event.target
|
27
27
|
? Array.isArray(event.target)
|
28
28
|
? event.target.join("\n")
|
@@ -31,11 +31,13 @@ export const ScoreEventView: FC<ScoreEventViewProps> = ({
|
|
31
31
|
|
32
32
|
return (
|
33
33
|
<EventPanel
|
34
|
-
id={id}
|
34
|
+
id={eventNode.id}
|
35
|
+
depth={eventNode.depth}
|
35
36
|
title={(event.intermediate ? "Intermediate " : "") + "Score"}
|
36
37
|
className={clsx(className, "text-size-small")}
|
37
38
|
subTitle={formatDateTime(new Date(event.timestamp))}
|
38
39
|
icon={ApplicationIcons.scorer}
|
40
|
+
collapsibleContent={true}
|
39
41
|
>
|
40
42
|
<div data-name="Explanation" className={clsx(styles.explanation)}>
|
41
43
|
{event.target ? (
|
@@ -3,14 +3,12 @@ import { FC } from "react";
|
|
3
3
|
import { SpanBeginEvent } from "../../../@types/log";
|
4
4
|
import { formatDateTime } from "../../../utils/format";
|
5
5
|
import { EventPanel } from "./event/EventPanel";
|
6
|
-
import { TranscriptComponent } from "./TranscriptView";
|
7
6
|
import { kSandboxSignalName } from "./transform/fixups";
|
8
|
-
import { EventNode } from "./types";
|
7
|
+
import { EventNode, EventType } from "./types";
|
9
8
|
|
10
9
|
interface SpanEventViewProps {
|
11
|
-
|
12
|
-
|
13
|
-
children: EventNode[];
|
10
|
+
eventNode: EventNode<SpanBeginEvent>;
|
11
|
+
children: EventNode<EventType>[];
|
14
12
|
className?: string | string[];
|
15
13
|
}
|
16
14
|
|
@@ -18,11 +16,12 @@ interface SpanEventViewProps {
|
|
18
16
|
* Renders the SpanEventView component.
|
19
17
|
*/
|
20
18
|
export const SpanEventView: FC<SpanEventViewProps> = ({
|
21
|
-
|
22
|
-
event,
|
19
|
+
eventNode,
|
23
20
|
children,
|
24
21
|
className,
|
25
22
|
}) => {
|
23
|
+
const event = eventNode.event;
|
24
|
+
const id = eventNode.id;
|
26
25
|
const descriptor = spanDescriptor(event);
|
27
26
|
const title =
|
28
27
|
descriptor.name ||
|
@@ -31,19 +30,15 @@ export const SpanEventView: FC<SpanEventViewProps> = ({
|
|
31
30
|
|
32
31
|
return (
|
33
32
|
<EventPanel
|
34
|
-
id={
|
33
|
+
id={id}
|
34
|
+
depth={eventNode.depth}
|
35
|
+
childIds={children.map((child) => child.id)}
|
35
36
|
className={clsx("transcript-span", className)}
|
36
37
|
title={title}
|
37
38
|
subTitle={formatDateTime(new Date(event.timestamp))}
|
38
39
|
text={text}
|
39
|
-
collapse={descriptor.collapse}
|
40
40
|
icon={descriptor.icon}
|
41
|
-
|
42
|
-
<TranscriptComponent
|
43
|
-
id={`span|${event.name}|${id}`}
|
44
|
-
eventNodes={children}
|
45
|
-
/>
|
46
|
-
</EventPanel>
|
41
|
+
/>
|
47
42
|
);
|
48
43
|
};
|
49
44
|
|
@@ -90,7 +85,7 @@ const summarize = (children: EventNode[]) => {
|
|
90
85
|
*/
|
91
86
|
const spanDescriptor = (
|
92
87
|
event: SpanBeginEvent,
|
93
|
-
): { icon?: string; name?: string; endSpace?: boolean
|
88
|
+
): { icon?: string; name?: string; endSpace?: boolean } => {
|
94
89
|
const rootStepDescriptor = {
|
95
90
|
endSpace: true,
|
96
91
|
};
|
@@ -100,61 +95,50 @@ const spanDescriptor = (
|
|
100
95
|
case "chain_of_thought":
|
101
96
|
return {
|
102
97
|
...rootStepDescriptor,
|
103
|
-
collapse: false,
|
104
98
|
};
|
105
99
|
case "generate":
|
106
100
|
return {
|
107
101
|
...rootStepDescriptor,
|
108
|
-
collapse: false,
|
109
102
|
};
|
110
103
|
case "self_critique":
|
111
104
|
return {
|
112
105
|
...rootStepDescriptor,
|
113
|
-
collapse: false,
|
114
106
|
};
|
115
107
|
case "system_message":
|
116
108
|
return {
|
117
109
|
...rootStepDescriptor,
|
118
|
-
collapse: true,
|
119
110
|
};
|
120
111
|
case "use_tools":
|
121
112
|
return {
|
122
113
|
...rootStepDescriptor,
|
123
|
-
collapse: false,
|
124
114
|
};
|
125
115
|
case "multiple_choice":
|
126
116
|
return {
|
127
117
|
...rootStepDescriptor,
|
128
|
-
collapse: false,
|
129
118
|
};
|
130
119
|
default:
|
131
120
|
return {
|
132
121
|
...rootStepDescriptor,
|
133
|
-
collapse: false,
|
134
122
|
};
|
135
123
|
}
|
136
124
|
} else if (event.type === "scorer") {
|
137
125
|
return {
|
138
126
|
...rootStepDescriptor,
|
139
|
-
collapse: false,
|
140
127
|
};
|
141
128
|
} else if (event.event === "span_begin") {
|
142
129
|
if (event.span_id === kSandboxSignalName) {
|
143
130
|
return {
|
144
131
|
...rootStepDescriptor,
|
145
132
|
name: "Sandbox Events",
|
146
|
-
collapse: true,
|
147
133
|
};
|
148
134
|
} else if (event.name === "init") {
|
149
135
|
return {
|
150
136
|
...rootStepDescriptor,
|
151
137
|
name: "Init",
|
152
|
-
collapse: true,
|
153
138
|
};
|
154
139
|
} else {
|
155
140
|
return {
|
156
141
|
...rootStepDescriptor,
|
157
|
-
collapse: false,
|
158
142
|
};
|
159
143
|
}
|
160
144
|
} else {
|
@@ -163,7 +147,6 @@ const spanDescriptor = (
|
|
163
147
|
return {
|
164
148
|
...rootStepDescriptor,
|
165
149
|
name: "Sample Init",
|
166
|
-
collapse: true,
|
167
150
|
};
|
168
151
|
default:
|
169
152
|
return {
|
@@ -3,14 +3,12 @@ import { FC } from "react";
|
|
3
3
|
import { StepEvent } from "../../../@types/log";
|
4
4
|
import { formatDateTime } from "../../../utils/format";
|
5
5
|
import { EventPanel } from "./event/EventPanel";
|
6
|
-
import { TranscriptComponent } from "./TranscriptView";
|
7
6
|
import { kSandboxSignalName } from "./transform/fixups";
|
8
|
-
import { EventNode } from "./types";
|
7
|
+
import { EventNode, EventType } from "./types";
|
9
8
|
|
10
9
|
interface StepEventViewProps {
|
11
|
-
|
12
|
-
|
13
|
-
children: EventNode[];
|
10
|
+
eventNode: EventNode<StepEvent>;
|
11
|
+
children: EventNode<EventType>[];
|
14
12
|
className?: string | string[];
|
15
13
|
}
|
16
14
|
|
@@ -18,11 +16,13 @@ interface StepEventViewProps {
|
|
18
16
|
* Renders the StepEventView component.
|
19
17
|
*/
|
20
18
|
export const StepEventView: FC<StepEventViewProps> = ({
|
21
|
-
|
22
|
-
event,
|
19
|
+
eventNode,
|
23
20
|
children,
|
24
21
|
className,
|
25
22
|
}) => {
|
23
|
+
const event = eventNode.event;
|
24
|
+
const id = eventNode.id;
|
25
|
+
|
26
26
|
const descriptor = stepDescriptor(event);
|
27
27
|
const title =
|
28
28
|
descriptor.name ||
|
@@ -31,19 +31,15 @@ export const StepEventView: FC<StepEventViewProps> = ({
|
|
31
31
|
|
32
32
|
return (
|
33
33
|
<EventPanel
|
34
|
-
id={
|
34
|
+
id={id}
|
35
|
+
depth={eventNode.depth}
|
36
|
+
childIds={children.map((child) => child.id)}
|
35
37
|
className={clsx("transcript-step", className)}
|
36
38
|
title={title}
|
37
39
|
subTitle={formatDateTime(new Date(event.timestamp))}
|
38
40
|
icon={descriptor.icon}
|
39
|
-
collapse={descriptor.collapse}
|
40
41
|
text={text}
|
41
|
-
|
42
|
-
<TranscriptComponent
|
43
|
-
id={`step|${event.name}|${id}`}
|
44
|
-
eventNodes={children}
|
45
|
-
/>
|
46
|
-
</EventPanel>
|
42
|
+
/>
|
47
43
|
);
|
48
44
|
};
|
49
45
|
|
@@ -93,7 +89,7 @@ const summarize = (children: EventNode[]) => {
|
|
93
89
|
*/
|
94
90
|
const stepDescriptor = (
|
95
91
|
event: StepEvent,
|
96
|
-
): { icon?: string; name?: string; endSpace?: boolean
|
92
|
+
): { icon?: string; name?: string; endSpace?: boolean } => {
|
97
93
|
const rootStepDescriptor = {
|
98
94
|
endSpace: true,
|
99
95
|
};
|
@@ -115,7 +111,6 @@ const stepDescriptor = (
|
|
115
111
|
case "system_message":
|
116
112
|
return {
|
117
113
|
...rootStepDescriptor,
|
118
|
-
collapse: true,
|
119
114
|
};
|
120
115
|
case "use_tools":
|
121
116
|
return {
|
@@ -139,13 +134,11 @@ const stepDescriptor = (
|
|
139
134
|
return {
|
140
135
|
...rootStepDescriptor,
|
141
136
|
name: "Sandbox Events",
|
142
|
-
collapse: true,
|
143
137
|
};
|
144
138
|
} else if (event.name === "init") {
|
145
139
|
return {
|
146
140
|
...rootStepDescriptor,
|
147
141
|
name: "Init",
|
148
|
-
collapse: true,
|
149
142
|
};
|
150
143
|
} else {
|
151
144
|
return {
|
@@ -158,7 +151,6 @@ const stepDescriptor = (
|
|
158
151
|
return {
|
159
152
|
...rootStepDescriptor,
|
160
153
|
name: "Sample Init",
|
161
|
-
collapse: true,
|
162
154
|
};
|
163
155
|
default:
|
164
156
|
return {
|
@@ -6,12 +6,11 @@ import { MetaDataView } from "../../content/MetaDataView";
|
|
6
6
|
import { EventPanel } from "./event/EventPanel";
|
7
7
|
import { formatTiming, formatTitle } from "./event/utils";
|
8
8
|
import styles from "./SubtaskEventView.module.css";
|
9
|
-
import {
|
9
|
+
import { EventNode, EventType } from "./types";
|
10
10
|
|
11
11
|
interface SubtaskEventViewProps {
|
12
|
-
|
13
|
-
|
14
|
-
depth: number;
|
12
|
+
eventNode: EventNode<SubtaskEvent>;
|
13
|
+
children: EventNode<EventType>[];
|
15
14
|
className?: string | string[];
|
16
15
|
}
|
17
16
|
|
@@ -19,11 +18,12 @@ interface SubtaskEventViewProps {
|
|
19
18
|
* Renders the StateEventView component.
|
20
19
|
*/
|
21
20
|
export const SubtaskEventView: FC<SubtaskEventViewProps> = ({
|
22
|
-
|
23
|
-
|
24
|
-
depth,
|
21
|
+
eventNode,
|
22
|
+
children,
|
25
23
|
className,
|
26
24
|
}) => {
|
25
|
+
const event = eventNode.event;
|
26
|
+
const id = eventNode.id;
|
27
27
|
const body: ReactNode[] = [];
|
28
28
|
if (event.type === "fork") {
|
29
29
|
body.push(
|
@@ -32,17 +32,6 @@ export const SubtaskEventView: FC<SubtaskEventViewProps> = ({
|
|
32
32
|
<div className={clsx(styles.summaryRendered)}>
|
33
33
|
<Rendered values={event.input} />
|
34
34
|
</div>
|
35
|
-
<div className={clsx("text-style-label")}>Transcript</div>
|
36
|
-
{event.events.length > 0 ? (
|
37
|
-
<TranscriptView
|
38
|
-
id={`${id}-subtask`}
|
39
|
-
data-name="Transcript"
|
40
|
-
events={event.events}
|
41
|
-
depth={depth + 1}
|
42
|
-
/>
|
43
|
-
) : (
|
44
|
-
<None />
|
45
|
-
)}
|
46
35
|
</div>,
|
47
36
|
);
|
48
37
|
} else {
|
@@ -53,16 +42,6 @@ export const SubtaskEventView: FC<SubtaskEventViewProps> = ({
|
|
53
42
|
result={event.result}
|
54
43
|
/>,
|
55
44
|
);
|
56
|
-
if (event.events.length > 0) {
|
57
|
-
body.push(
|
58
|
-
<TranscriptView
|
59
|
-
id={`${id}-subtask`}
|
60
|
-
data-name="Transcript"
|
61
|
-
events={event.events}
|
62
|
-
depth={depth + 1}
|
63
|
-
/>,
|
64
|
-
);
|
65
|
-
}
|
66
45
|
}
|
67
46
|
|
68
47
|
// Is this a traditional subtask or a fork?
|
@@ -70,6 +49,7 @@ export const SubtaskEventView: FC<SubtaskEventViewProps> = ({
|
|
70
49
|
return (
|
71
50
|
<EventPanel
|
72
51
|
id={id}
|
52
|
+
depth={eventNode.depth}
|
73
53
|
className={className}
|
74
54
|
title={formatTitle(
|
75
55
|
`${type}: ${event.name}`,
|
@@ -77,7 +57,8 @@ export const SubtaskEventView: FC<SubtaskEventViewProps> = ({
|
|
77
57
|
event.working_time,
|
78
58
|
)}
|
79
59
|
subTitle={formatTiming(event.timestamp, event.working_start)}
|
80
|
-
|
60
|
+
childIds={children.map((child) => child.id)}
|
61
|
+
collapseControl="bottom"
|
81
62
|
>
|
82
63
|
{body}
|
83
64
|
</EventPanel>
|
@@ -95,9 +76,9 @@ const SubtaskSummary: FC<SubtaskSummaryProps> = ({ input, result }) => {
|
|
95
76
|
const output = typeof result === "object" ? result : { result };
|
96
77
|
return (
|
97
78
|
<div className={clsx(styles.subtaskSummary)}>
|
98
|
-
<div className={clsx("text-style-label")}>Input</div>
|
79
|
+
<div className={clsx("text-style-label", "text-size-small")}>Input</div>
|
99
80
|
<div className={clsx("text-size-large", styles.subtaskLabel)}></div>
|
100
|
-
<div className={clsx("text-style-label")}>Output</div>
|
81
|
+
<div className={clsx("text-style-label", "text-size-small")}>Output</div>
|
101
82
|
{input ? <Rendered values={input} /> : undefined}
|
102
83
|
<div className={clsx("text-size-title-secondary", styles.subtaskLabel)}>
|
103
84
|
<i className={ApplicationIcons.arrows.right} />
|