inspect-ai 0.3.62__py3-none-any.whl → 0.3.64__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/cache.py +8 -7
- inspect_ai/_cli/common.py +0 -12
- inspect_ai/_cli/eval.py +32 -4
- inspect_ai/_cli/info.py +1 -0
- inspect_ai/_cli/list.py +1 -1
- inspect_ai/_cli/log.py +2 -0
- inspect_ai/_cli/main.py +1 -1
- inspect_ai/_cli/sandbox.py +4 -1
- inspect_ai/_cli/score.py +181 -32
- inspect_ai/_cli/trace.py +10 -0
- inspect_ai/_cli/view.py +4 -2
- inspect_ai/_display/core/active.py +2 -3
- inspect_ai/_display/core/config.py +7 -1
- inspect_ai/_display/textual/widgets/samples.py +4 -3
- inspect_ai/_display/textual/widgets/sandbox.py +6 -0
- inspect_ai/_eval/eval.py +104 -101
- inspect_ai/_eval/evalset.py +75 -75
- inspect_ai/_eval/loader.py +122 -12
- inspect_ai/_eval/registry.py +1 -1
- inspect_ai/_eval/run.py +14 -0
- inspect_ai/_eval/score.py +125 -36
- inspect_ai/_eval/task/log.py +105 -4
- inspect_ai/_eval/task/results.py +92 -38
- inspect_ai/_eval/task/run.py +9 -2
- inspect_ai/_eval/task/sandbox.py +35 -2
- inspect_ai/_eval/task/task.py +49 -46
- inspect_ai/_util/constants.py +1 -1
- inspect_ai/_util/content.py +8 -0
- inspect_ai/_util/error.py +2 -0
- inspect_ai/_util/file.py +15 -1
- inspect_ai/_util/hash.py +1 -1
- inspect_ai/_util/logger.py +4 -2
- inspect_ai/_util/registry.py +7 -1
- inspect_ai/_view/view.py +1 -2
- inspect_ai/_view/www/.vscode/extensions.json +3 -0
- inspect_ai/_view/www/.vscode/settings.json +8 -0
- inspect_ai/_view/www/App.css +97 -29
- inspect_ai/_view/www/README.md +1 -1
- inspect_ai/_view/www/dist/assets/index.css +16663 -14674
- inspect_ai/_view/www/dist/assets/index.js +58808 -51348
- inspect_ai/_view/www/dist/index.html +1 -1
- inspect_ai/_view/www/index.html +2 -2
- inspect_ai/_view/www/log-schema.json +87 -73
- inspect_ai/_view/www/package.json +22 -4
- inspect_ai/_view/www/postcss.config.cjs +8 -9
- inspect_ai/_view/www/src/{App.mjs → App.tsx} +356 -365
- inspect_ai/_view/www/src/AppErrorBoundary.tsx +47 -0
- inspect_ai/_view/www/src/api/api-browser.ts +2 -2
- inspect_ai/_view/www/src/api/api-http.ts +3 -5
- inspect_ai/_view/www/src/api/api-vscode.ts +6 -6
- inspect_ai/_view/www/src/api/client-api.ts +4 -4
- inspect_ai/_view/www/src/api/index.ts +4 -4
- inspect_ai/_view/www/src/api/{Types.ts → types.ts} +25 -9
- inspect_ai/_view/www/src/appearance/colors.ts +9 -0
- inspect_ai/_view/www/src/appearance/fonts.ts +39 -0
- inspect_ai/_view/www/src/appearance/icons.ts +100 -0
- inspect_ai/_view/www/src/appearance/{Styles.mjs → styles.ts} +2 -32
- inspect_ai/_view/www/src/components/AnsiDisplay.tsx +198 -0
- inspect_ai/_view/www/src/components/AsciinemaPlayer.tsx +86 -0
- inspect_ai/_view/www/src/components/Card.css +60 -0
- inspect_ai/_view/www/src/components/Card.tsx +109 -0
- inspect_ai/_view/www/src/components/CopyButton.module.css +11 -0
- inspect_ai/_view/www/src/components/CopyButton.tsx +58 -0
- inspect_ai/_view/www/src/components/DownloadButton.css +4 -0
- inspect_ai/_view/www/src/components/DownloadButton.tsx +25 -0
- inspect_ai/_view/www/src/components/DownloadPanel.css +10 -0
- inspect_ai/_view/www/src/components/DownloadPanel.tsx +30 -0
- inspect_ai/_view/www/src/components/EmptyPanel.css +12 -0
- inspect_ai/_view/www/src/components/EmptyPanel.tsx +15 -0
- inspect_ai/_view/www/src/components/ErrorPanel.css +37 -0
- inspect_ai/_view/www/src/components/ErrorPanel.tsx +39 -0
- inspect_ai/_view/www/src/components/ExpandablePanel.css +40 -0
- inspect_ai/_view/www/src/components/ExpandablePanel.tsx +115 -0
- inspect_ai/_view/www/src/components/FindBand.css +49 -0
- inspect_ai/_view/www/src/components/FindBand.tsx +130 -0
- inspect_ai/_view/www/src/components/HumanBaselineView.css +41 -0
- inspect_ai/_view/www/src/components/HumanBaselineView.tsx +162 -0
- inspect_ai/_view/www/src/components/JsonPanel.css +20 -0
- inspect_ai/_view/www/src/components/JsonPanel.tsx +82 -0
- inspect_ai/_view/www/src/components/LabeledValue.css +20 -0
- inspect_ai/_view/www/src/components/LabeledValue.tsx +41 -0
- inspect_ai/_view/www/src/components/LargeModal.module.css +54 -0
- inspect_ai/_view/www/src/components/LargeModal.tsx +189 -0
- inspect_ai/_view/www/src/components/LightboxCarousel.css +95 -0
- inspect_ai/_view/www/src/components/LightboxCarousel.tsx +132 -0
- inspect_ai/_view/www/src/components/MarkdownDiv.css +3 -0
- inspect_ai/_view/www/src/components/MarkdownDiv.tsx +133 -0
- inspect_ai/_view/www/src/components/MessageBand.css +43 -0
- inspect_ai/_view/www/src/components/MessageBand.tsx +39 -0
- inspect_ai/_view/www/src/components/MorePopOver.css +0 -0
- inspect_ai/_view/www/src/components/MorePopOver.tsx +67 -0
- inspect_ai/_view/www/src/components/NavPills.module.css +18 -0
- inspect_ai/_view/www/src/components/NavPills.tsx +101 -0
- inspect_ai/_view/www/src/components/ProgressBar.module.css +37 -0
- inspect_ai/_view/www/src/components/ProgressBar.tsx +22 -0
- inspect_ai/_view/www/src/components/TabSet.module.css +40 -0
- inspect_ai/_view/www/src/components/TabSet.tsx +215 -0
- inspect_ai/_view/www/src/components/ToolButton.css +3 -0
- inspect_ai/_view/www/src/components/ToolButton.tsx +27 -0
- inspect_ai/_view/www/src/components/VirtualList.module.css +19 -0
- inspect_ai/_view/www/src/components/VirtualList.tsx +292 -0
- inspect_ai/_view/www/src/{index.js → index.tsx} +45 -19
- inspect_ai/_view/www/src/{log → logfile}/remoteLogFile.ts +3 -8
- inspect_ai/_view/www/src/{utils/remoteZipFile.mjs → logfile/remoteZipFile.ts} +86 -80
- inspect_ai/_view/www/src/metadata/MetaDataGrid.tsx +83 -0
- inspect_ai/_view/www/src/metadata/MetaDataView.module.css +35 -0
- inspect_ai/_view/www/src/metadata/MetaDataView.tsx +95 -0
- inspect_ai/_view/www/src/metadata/MetadataGrid.module.css +15 -0
- inspect_ai/_view/www/src/metadata/RenderedContent.module.css +12 -0
- inspect_ai/_view/www/src/{components/RenderedContent/RenderedContent.mjs → metadata/RenderedContent.tsx} +92 -73
- inspect_ai/_view/www/src/metadata/types.ts +18 -0
- inspect_ai/_view/www/src/plan/DatasetDetailView.module.css +3 -0
- inspect_ai/_view/www/src/plan/DatasetDetailView.tsx +37 -0
- inspect_ai/_view/www/src/plan/DetailStep.module.css +9 -0
- inspect_ai/_view/www/src/plan/DetailStep.tsx +31 -0
- inspect_ai/_view/www/src/plan/PlanCard.tsx +28 -0
- inspect_ai/_view/www/src/plan/PlanDetailView.module.css +48 -0
- inspect_ai/_view/www/src/plan/PlanDetailView.tsx +324 -0
- inspect_ai/_view/www/src/plan/ScorerDetailView.module.css +3 -0
- inspect_ai/_view/www/src/plan/ScorerDetailView.tsx +30 -0
- inspect_ai/_view/www/src/plan/SolverDetailView.module.css +15 -0
- inspect_ai/_view/www/src/plan/SolverDetailView.tsx +32 -0
- inspect_ai/_view/www/src/samples/InlineSampleDisplay.module.css +8 -0
- inspect_ai/_view/www/src/samples/InlineSampleDisplay.tsx +53 -0
- inspect_ai/_view/www/src/samples/SampleDialog.tsx +122 -0
- inspect_ai/_view/www/src/samples/SampleDisplay.module.css +29 -0
- inspect_ai/_view/www/src/samples/SampleDisplay.tsx +331 -0
- inspect_ai/_view/www/src/samples/SampleSummaryView.module.css +24 -0
- inspect_ai/_view/www/src/samples/SampleSummaryView.tsx +177 -0
- inspect_ai/_view/www/src/samples/SamplesTools.tsx +52 -0
- inspect_ai/_view/www/src/samples/chat/ChatMessage.module.css +29 -0
- inspect_ai/_view/www/src/samples/chat/ChatMessage.tsx +76 -0
- inspect_ai/_view/www/src/samples/chat/ChatMessageRenderer.tsx +60 -0
- inspect_ai/_view/www/src/samples/chat/ChatMessageRow.module.css +9 -0
- inspect_ai/_view/www/src/samples/chat/ChatMessageRow.tsx +57 -0
- inspect_ai/_view/www/src/samples/chat/ChatView.tsx +47 -0
- inspect_ai/_view/www/src/samples/chat/ChatViewVirtualList.module.css +4 -0
- inspect_ai/_view/www/src/samples/chat/ChatViewVirtualList.tsx +58 -0
- inspect_ai/_view/www/src/samples/chat/MessageContent.module.css +4 -0
- inspect_ai/_view/www/src/samples/chat/MessageContent.tsx +157 -0
- inspect_ai/_view/www/src/samples/chat/MessageContents.module.css +3 -0
- inspect_ai/_view/www/src/samples/chat/MessageContents.tsx +133 -0
- inspect_ai/_view/www/src/samples/chat/messages.ts +112 -0
- inspect_ai/_view/www/src/samples/chat/tools/ToolCallView.tsx +147 -0
- inspect_ai/_view/www/src/samples/chat/tools/ToolInput.module.css +14 -0
- inspect_ai/_view/www/src/samples/chat/tools/ToolInput.tsx +76 -0
- inspect_ai/_view/www/src/samples/chat/tools/ToolOutput.module.css +19 -0
- inspect_ai/_view/www/src/samples/chat/tools/ToolOutput.tsx +60 -0
- inspect_ai/_view/www/src/samples/chat/tools/ToolTitle.module.css +4 -0
- inspect_ai/_view/www/src/samples/chat/tools/ToolTitle.tsx +18 -0
- inspect_ai/_view/www/src/samples/chat/tools/tool.ts +92 -0
- inspect_ai/_view/www/src/samples/descriptor/samplesDescriptor.tsx +365 -0
- inspect_ai/_view/www/src/samples/descriptor/score/BooleanScoreDescriptor.module.css +22 -0
- inspect_ai/_view/www/src/samples/descriptor/score/BooleanScoreDescriptor.tsx +26 -0
- inspect_ai/_view/www/src/samples/descriptor/score/CategoricalScoreDescriptor.tsx +18 -0
- inspect_ai/_view/www/src/samples/descriptor/score/NumericScoreDescriptor.tsx +27 -0
- inspect_ai/_view/www/src/samples/descriptor/score/ObjectScoreDescriptor.module.css +18 -0
- inspect_ai/_view/www/src/samples/descriptor/score/ObjectScoreDescriptor.tsx +71 -0
- inspect_ai/_view/www/src/samples/descriptor/score/OtherScoreDescriptor.tsx +20 -0
- inspect_ai/_view/www/src/samples/descriptor/score/PassFailScoreDescriptor.module.css +28 -0
- inspect_ai/_view/www/src/samples/descriptor/score/PassFailScoreDescriptor.tsx +81 -0
- inspect_ai/_view/www/src/samples/descriptor/score/ScoreDescriptor.tsx +99 -0
- inspect_ai/_view/www/src/samples/descriptor/types.ts +55 -0
- inspect_ai/_view/www/src/samples/error/FlatSampleErrorView.module.css +19 -0
- inspect_ai/_view/www/src/samples/error/FlatSampleErrorView.tsx +22 -0
- inspect_ai/_view/www/src/samples/error/SampleErrorView.module.css +17 -0
- inspect_ai/_view/www/src/samples/error/SampleErrorView.tsx +31 -0
- inspect_ai/_view/www/src/samples/error/error.ts +15 -0
- inspect_ai/_view/www/src/samples/list/SampleFooter.module.css +9 -0
- inspect_ai/_view/www/src/samples/list/SampleFooter.tsx +14 -0
- inspect_ai/_view/www/src/samples/list/SampleHeader.module.css +13 -0
- inspect_ai/_view/www/src/samples/list/SampleHeader.tsx +36 -0
- inspect_ai/_view/www/src/samples/list/SampleList.module.css +11 -0
- inspect_ai/_view/www/src/samples/list/SampleList.tsx +247 -0
- inspect_ai/_view/www/src/samples/list/SampleRow.module.css +33 -0
- inspect_ai/_view/www/src/samples/list/SampleRow.tsx +98 -0
- inspect_ai/_view/www/src/samples/list/SampleSeparator.module.css +6 -0
- inspect_ai/_view/www/src/samples/list/SampleSeparator.tsx +24 -0
- inspect_ai/_view/www/src/samples/sample-tools/EpochFilter.module.css +9 -0
- inspect_ai/_view/www/src/samples/sample-tools/EpochFilter.tsx +51 -0
- inspect_ai/_view/www/src/samples/sample-tools/SelectScorer.module.css +16 -0
- inspect_ai/_view/www/src/samples/sample-tools/SelectScorer.tsx +175 -0
- inspect_ai/_view/www/src/samples/sample-tools/SortFilter.module.css +9 -0
- inspect_ai/_view/www/src/samples/sample-tools/SortFilter.tsx +186 -0
- inspect_ai/_view/www/src/samples/{tools/filters.mjs → sample-tools/filters.ts} +86 -81
- inspect_ai/_view/www/src/samples/sample-tools/sample-filter/SampleFilter.module.css +16 -0
- inspect_ai/_view/www/src/samples/sample-tools/sample-filter/SampleFilter.tsx +288 -0
- inspect_ai/_view/www/src/samples/sample-tools/sample-filter/completions.ts +346 -0
- inspect_ai/_view/www/src/samples/sample-tools/sample-filter/language.ts +19 -0
- inspect_ai/_view/www/src/samples/sample-tools/sample-filter/tokenize.ts +97 -0
- inspect_ai/_view/www/src/samples/{SampleLimit.mjs → sampleLimit.ts} +3 -6
- inspect_ai/_view/www/src/samples/scores/SampleScoreView.module.css +53 -0
- inspect_ai/_view/www/src/samples/scores/SampleScoreView.tsx +168 -0
- inspect_ai/_view/www/src/samples/scores/SampleScores.module.css +5 -0
- inspect_ai/_view/www/src/samples/scores/SampleScores.tsx +37 -0
- inspect_ai/_view/www/src/samples/transcript/ApprovalEventView.tsx +66 -0
- inspect_ai/_view/www/src/samples/transcript/ErrorEventView.tsx +51 -0
- inspect_ai/_view/www/src/samples/transcript/InfoEventView.module.css +3 -0
- inspect_ai/_view/www/src/samples/transcript/InfoEventView.tsx +54 -0
- inspect_ai/_view/www/src/samples/transcript/InputEventView.tsx +48 -0
- inspect_ai/_view/www/src/samples/transcript/LoggerEventView.module.css +6 -0
- inspect_ai/_view/www/src/samples/transcript/LoggerEventView.tsx +36 -0
- inspect_ai/_view/www/src/samples/transcript/ModelEventView.module.css +43 -0
- inspect_ai/_view/www/src/samples/transcript/ModelEventView.tsx +223 -0
- inspect_ai/_view/www/src/samples/transcript/SampleInitEventView.module.css +23 -0
- inspect_ai/_view/www/src/samples/transcript/SampleInitEventView.tsx +112 -0
- inspect_ai/_view/www/src/samples/transcript/SampleLimitEventView.tsx +75 -0
- inspect_ai/_view/www/src/samples/transcript/SampleTranscript.tsx +22 -0
- inspect_ai/_view/www/src/samples/transcript/ScoreEventView.module.css +15 -0
- inspect_ai/_view/www/src/samples/transcript/ScoreEventView.tsx +100 -0
- inspect_ai/_view/www/src/samples/transcript/StepEventView.tsx +171 -0
- inspect_ai/_view/www/src/samples/transcript/SubtaskEventView.module.css +19 -0
- inspect_ai/_view/www/src/samples/transcript/SubtaskEventView.tsx +133 -0
- inspect_ai/_view/www/src/samples/transcript/ToolEventView.module.css +10 -0
- inspect_ai/_view/www/src/samples/transcript/ToolEventView.tsx +92 -0
- inspect_ai/_view/www/src/samples/transcript/TranscriptView.module.css +49 -0
- inspect_ai/_view/www/src/samples/transcript/TranscriptView.tsx +449 -0
- inspect_ai/_view/www/src/samples/transcript/event/EventNav.module.css +5 -0
- inspect_ai/_view/www/src/samples/transcript/event/EventNav.tsx +43 -0
- inspect_ai/_view/www/src/samples/transcript/event/EventNavs.module.css +3 -0
- inspect_ai/_view/www/src/samples/transcript/event/EventNavs.tsx +39 -0
- inspect_ai/_view/www/src/samples/transcript/event/EventPanel.module.css +25 -0
- inspect_ai/_view/www/src/samples/transcript/event/EventPanel.tsx +191 -0
- inspect_ai/_view/www/src/samples/transcript/event/EventRow.module.css +13 -0
- inspect_ai/_view/www/src/samples/transcript/event/EventRow.tsx +32 -0
- inspect_ai/_view/www/src/samples/transcript/event/EventSection.module.css +8 -0
- inspect_ai/_view/www/src/samples/transcript/event/EventSection.tsx +29 -0
- inspect_ai/_view/www/src/samples/transcript/state/StateDiffView.tsx +67 -0
- inspect_ai/_view/www/src/samples/transcript/state/StateEventRenderers.tsx +285 -0
- inspect_ai/_view/www/src/samples/transcript/state/StateEventRenders.module.css +10 -0
- inspect_ai/_view/www/src/samples/transcript/state/StateEventView.module.css +9 -0
- inspect_ai/_view/www/src/samples/transcript/state/StateEventView.tsx +346 -0
- inspect_ai/_view/www/src/samples/transcript/types.ts +58 -0
- inspect_ai/_view/www/src/types/log.d.ts +108 -19
- inspect_ai/_view/www/src/types/prism.d.ts +11 -0
- inspect_ai/_view/www/src/types.ts +71 -0
- inspect_ai/_view/www/src/usage/ModelTokenTable.tsx +28 -0
- inspect_ai/_view/www/src/usage/ModelUsagePanel.module.css +24 -0
- inspect_ai/_view/www/src/usage/ModelUsagePanel.tsx +97 -0
- inspect_ai/_view/www/src/usage/TokenTable.module.css +17 -0
- inspect_ai/_view/www/src/usage/TokenTable.tsx +91 -0
- inspect_ai/_view/www/src/usage/UsageCard.module.css +15 -0
- inspect_ai/_view/www/src/usage/UsageCard.tsx +67 -0
- inspect_ai/_view/www/src/utils/attachments.ts +42 -0
- inspect_ai/_view/www/src/utils/{Base64.mjs → base64.ts} +1 -6
- inspect_ai/_view/www/src/{components/Browser.mjs → utils/browser.ts} +0 -1
- inspect_ai/_view/www/src/utils/debugging.ts +28 -0
- inspect_ai/_view/www/src/utils/dom.ts +30 -0
- inspect_ai/_view/www/src/utils/format.ts +194 -0
- inspect_ai/_view/www/src/utils/git.ts +7 -0
- inspect_ai/_view/www/src/utils/html.ts +6 -0
- inspect_ai/_view/www/src/utils/http.ts +14 -0
- inspect_ai/_view/www/src/utils/{Path.mjs → path.ts} +2 -9
- inspect_ai/_view/www/src/utils/{Print.mjs → print.ts} +34 -26
- inspect_ai/_view/www/src/utils/queue.ts +51 -0
- inspect_ai/_view/www/src/utils/sync.ts +114 -0
- inspect_ai/_view/www/src/utils/{Type.mjs → type.ts} +3 -6
- inspect_ai/_view/www/src/utils/vscode.ts +13 -0
- inspect_ai/_view/www/src/workspace/WorkSpace.tsx +324 -0
- inspect_ai/_view/www/src/workspace/WorkSpaceView.module.css +33 -0
- inspect_ai/_view/www/src/workspace/WorkSpaceView.tsx +158 -0
- inspect_ai/_view/www/src/workspace/error/TaskErrorPanel.module.css +3 -0
- inspect_ai/_view/www/src/workspace/error/TaskErrorPanel.tsx +28 -0
- inspect_ai/_view/www/src/workspace/navbar/Navbar.module.css +54 -0
- inspect_ai/_view/www/src/workspace/navbar/Navbar.tsx +68 -0
- inspect_ai/_view/www/src/workspace/navbar/PrimaryBar.module.css +52 -0
- inspect_ai/_view/www/src/workspace/navbar/PrimaryBar.tsx +114 -0
- inspect_ai/_view/www/src/workspace/navbar/ResultsPanel.module.css +90 -0
- inspect_ai/_view/www/src/workspace/navbar/ResultsPanel.tsx +180 -0
- inspect_ai/_view/www/src/workspace/navbar/SecondaryBar.module.css +28 -0
- inspect_ai/_view/www/src/workspace/navbar/SecondaryBar.tsx +226 -0
- inspect_ai/_view/www/src/workspace/navbar/StatusPanel.module.css +14 -0
- inspect_ai/_view/www/src/workspace/navbar/StatusPanel.tsx +61 -0
- inspect_ai/_view/www/src/workspace/sidebar/EvalStatus.module.css +15 -0
- inspect_ai/_view/www/src/workspace/sidebar/EvalStatus.tsx +71 -0
- inspect_ai/_view/www/src/workspace/sidebar/LogDirectoryTitleView.module.css +5 -0
- inspect_ai/_view/www/src/workspace/sidebar/LogDirectoryTitleView.tsx +56 -0
- inspect_ai/_view/www/src/workspace/sidebar/Sidebar.module.css +68 -0
- inspect_ai/_view/www/src/workspace/sidebar/Sidebar.tsx +85 -0
- inspect_ai/_view/www/src/workspace/sidebar/SidebarLogEntry.module.css +29 -0
- inspect_ai/_view/www/src/workspace/sidebar/SidebarLogEntry.tsx +95 -0
- inspect_ai/_view/www/src/workspace/sidebar/SidebarScoreView.module.css +23 -0
- inspect_ai/_view/www/src/workspace/sidebar/SidebarScoreView.tsx +43 -0
- inspect_ai/_view/www/src/workspace/sidebar/SidebarScoresView.module.css +35 -0
- inspect_ai/_view/www/src/workspace/sidebar/SidebarScoresView.tsx +63 -0
- inspect_ai/_view/www/src/workspace/tabs/InfoTab.module.css +0 -0
- inspect_ai/_view/www/src/workspace/tabs/InfoTab.tsx +70 -0
- inspect_ai/_view/www/src/workspace/tabs/JsonTab.module.css +5 -0
- inspect_ai/_view/www/src/workspace/tabs/JsonTab.tsx +46 -0
- inspect_ai/_view/www/src/workspace/tabs/SamplesTab.tsx +204 -0
- inspect_ai/_view/www/src/workspace/tabs/grouping.ts +195 -0
- inspect_ai/_view/www/src/workspace/tabs/types.ts +19 -0
- inspect_ai/_view/www/src/workspace/types.ts +10 -0
- inspect_ai/_view/www/src/workspace/utils.ts +34 -0
- inspect_ai/_view/www/tsconfig.json +23 -9
- inspect_ai/_view/www/vite.config.js +8 -17
- inspect_ai/_view/www/yarn.lock +627 -556
- inspect_ai/approval/_approval.py +2 -0
- inspect_ai/approval/_approver.py +4 -4
- inspect_ai/approval/_auto.py +1 -1
- inspect_ai/approval/_human/approver.py +3 -0
- inspect_ai/approval/_policy.py +5 -0
- inspect_ai/approval/_registry.py +2 -2
- inspect_ai/dataset/_dataset.py +64 -37
- inspect_ai/dataset/_sources/__init__.py +0 -0
- inspect_ai/dataset/_sources/csv.py +20 -12
- inspect_ai/dataset/_sources/file.py +4 -0
- inspect_ai/dataset/_sources/hf.py +39 -29
- inspect_ai/dataset/_sources/json.py +17 -9
- inspect_ai/log/__init__.py +2 -0
- inspect_ai/log/_convert.py +3 -3
- inspect_ai/log/_file.py +24 -9
- inspect_ai/log/_log.py +101 -13
- inspect_ai/log/_message.py +4 -2
- inspect_ai/log/_recorders/file.py +4 -0
- inspect_ai/log/_recorders/json.py +5 -7
- inspect_ai/log/_recorders/recorder.py +3 -0
- inspect_ai/log/_transcript.py +19 -8
- inspect_ai/model/__init__.py +2 -0
- inspect_ai/model/_cache.py +39 -21
- inspect_ai/model/_call_tools.py +4 -3
- inspect_ai/model/_chat_message.py +14 -4
- inspect_ai/model/_generate_config.py +1 -1
- inspect_ai/model/_model.py +31 -24
- inspect_ai/model/_model_output.py +14 -1
- inspect_ai/model/_openai.py +10 -18
- inspect_ai/model/_providers/anthropic.py +3 -3
- inspect_ai/model/_providers/google.py +9 -5
- inspect_ai/model/_providers/openai.py +5 -9
- inspect_ai/model/_providers/openai_o1.py +3 -5
- inspect_ai/model/_providers/openrouter.py +86 -0
- inspect_ai/model/_providers/providers.py +11 -0
- inspect_ai/scorer/__init__.py +6 -1
- inspect_ai/scorer/_answer.py +7 -7
- inspect_ai/scorer/_classification.py +38 -18
- inspect_ai/scorer/_common.py +2 -8
- inspect_ai/scorer/_match.py +4 -5
- inspect_ai/scorer/_metric.py +87 -28
- inspect_ai/scorer/_metrics/__init__.py +3 -3
- inspect_ai/scorer/_metrics/accuracy.py +8 -10
- inspect_ai/scorer/_metrics/mean.py +3 -17
- inspect_ai/scorer/_metrics/std.py +111 -30
- inspect_ai/scorer/_model.py +12 -12
- inspect_ai/scorer/_pattern.py +3 -3
- inspect_ai/scorer/_reducer/reducer.py +36 -21
- inspect_ai/scorer/_reducer/registry.py +2 -2
- inspect_ai/scorer/_reducer/types.py +7 -1
- inspect_ai/scorer/_score.py +11 -1
- inspect_ai/scorer/_scorer.py +110 -16
- inspect_ai/solver/__init__.py +1 -1
- inspect_ai/solver/_basic_agent.py +19 -22
- inspect_ai/solver/_bridge/__init__.py +0 -3
- inspect_ai/solver/_bridge/bridge.py +3 -3
- inspect_ai/solver/_chain.py +1 -2
- inspect_ai/solver/_critique.py +3 -3
- inspect_ai/solver/_fork.py +2 -2
- inspect_ai/solver/_human_agent/__init__.py +0 -0
- inspect_ai/solver/_human_agent/agent.py +5 -8
- inspect_ai/solver/_human_agent/commands/clock.py +14 -10
- inspect_ai/solver/_human_agent/commands/note.py +1 -1
- inspect_ai/solver/_human_agent/commands/score.py +0 -11
- inspect_ai/solver/_multiple_choice.py +38 -26
- inspect_ai/solver/_prompt.py +7 -7
- inspect_ai/solver/_solver.py +53 -52
- inspect_ai/solver/_task_state.py +80 -69
- inspect_ai/solver/_use_tools.py +9 -9
- inspect_ai/tool/__init__.py +4 -1
- inspect_ai/tool/_tool.py +43 -14
- inspect_ai/tool/_tool_call.py +6 -2
- inspect_ai/tool/_tool_choice.py +3 -1
- inspect_ai/tool/_tool_def.py +10 -8
- inspect_ai/tool/_tool_params.py +24 -0
- inspect_ai/tool/_tool_with.py +7 -7
- inspect_ai/tool/_tools/__init__.py +0 -0
- inspect_ai/tool/{beta → _tools}/_computer/_common.py +2 -2
- inspect_ai/tool/{beta → _tools}/_computer/_computer.py +13 -5
- inspect_ai/tool/_tools/_computer/_resources/tool/__init__.py +0 -0
- inspect_ai/tool/{beta → _tools}/_computer/_resources/tool/_x11_client.py +1 -1
- inspect_ai/tool/_tools/_computer/_resources/tool/requirements.txt +0 -0
- inspect_ai/tool/_tools/_execute.py +23 -11
- inspect_ai/tool/_tools/_web_browser/_resources/README.md +2 -2
- inspect_ai/tool/_tools/_web_browser/_web_browser.py +5 -3
- inspect_ai/tool/_tools/_web_search.py +7 -5
- inspect_ai/tool/beta.py +3 -0
- inspect_ai/util/_concurrency.py +3 -3
- inspect_ai/util/_panel.py +2 -0
- inspect_ai/util/_resource.py +12 -12
- inspect_ai/util/_sandbox/docker/compose.py +23 -20
- inspect_ai/util/_sandbox/docker/config.py +2 -1
- inspect_ai/util/_sandbox/docker/docker.py +42 -86
- inspect_ai/util/_sandbox/docker/service.py +100 -0
- inspect_ai/util/_sandbox/environment.py +99 -96
- inspect_ai/util/_sandbox/self_check.py +124 -16
- inspect_ai/util/_subprocess.py +5 -3
- inspect_ai/util/_subtask.py +15 -16
- {inspect_ai-0.3.62.dist-info → inspect_ai-0.3.64.dist-info}/LICENSE +1 -1
- {inspect_ai-0.3.62.dist-info → inspect_ai-0.3.64.dist-info}/METADATA +11 -6
- inspect_ai-0.3.64.dist-info/RECORD +625 -0
- inspect_ai/_view/www/src/Register.mjs +0 -3
- inspect_ai/_view/www/src/Types.mjs +0 -38
- inspect_ai/_view/www/src/appearance/Colors.mjs +0 -27
- inspect_ai/_view/www/src/appearance/Fonts.mjs +0 -66
- inspect_ai/_view/www/src/appearance/Icons.mjs +0 -240
- inspect_ai/_view/www/src/components/AnsiDisplay.mjs +0 -184
- inspect_ai/_view/www/src/components/AppErrorBoundary.mjs +0 -34
- inspect_ai/_view/www/src/components/AsciiCinemaPlayer.mjs +0 -74
- inspect_ai/_view/www/src/components/Card.mjs +0 -126
- inspect_ai/_view/www/src/components/ChatView.mjs +0 -441
- inspect_ai/_view/www/src/components/CopyButton.mjs +0 -48
- inspect_ai/_view/www/src/components/Dialog.mjs +0 -61
- inspect_ai/_view/www/src/components/DownloadButton.mjs +0 -15
- inspect_ai/_view/www/src/components/DownloadPanel.mjs +0 -29
- inspect_ai/_view/www/src/components/EmptyPanel.mjs +0 -23
- inspect_ai/_view/www/src/components/ErrorPanel.mjs +0 -66
- inspect_ai/_view/www/src/components/ExpandablePanel.mjs +0 -136
- inspect_ai/_view/www/src/components/FindBand.mjs +0 -157
- inspect_ai/_view/www/src/components/HumanBaselineView.mjs +0 -168
- inspect_ai/_view/www/src/components/JsonPanel.mjs +0 -61
- inspect_ai/_view/www/src/components/LabeledValue.mjs +0 -32
- inspect_ai/_view/www/src/components/LargeModal.mjs +0 -190
- inspect_ai/_view/www/src/components/LightboxCarousel.mjs +0 -217
- inspect_ai/_view/www/src/components/MarkdownDiv.mjs +0 -118
- inspect_ai/_view/www/src/components/MessageBand.mjs +0 -48
- inspect_ai/_view/www/src/components/MessageContent.mjs +0 -111
- inspect_ai/_view/www/src/components/MetaDataGrid.mjs +0 -92
- inspect_ai/_view/www/src/components/MetaDataView.mjs +0 -109
- inspect_ai/_view/www/src/components/MorePopOver.mjs +0 -50
- inspect_ai/_view/www/src/components/NavPills.mjs +0 -63
- inspect_ai/_view/www/src/components/ProgressBar.mjs +0 -51
- inspect_ai/_view/www/src/components/RenderedContent/ChatMessageRenderer.mjs +0 -54
- inspect_ai/_view/www/src/components/RenderedContent/Types.mjs +0 -19
- inspect_ai/_view/www/src/components/TabSet.mjs +0 -184
- inspect_ai/_view/www/src/components/ToolButton.mjs +0 -16
- inspect_ai/_view/www/src/components/Tools.mjs +0 -376
- inspect_ai/_view/www/src/components/VirtualList.mjs +0 -280
- inspect_ai/_view/www/src/components/ansi-output.js +0 -932
- inspect_ai/_view/www/src/json/JsonTab.mjs +0 -48
- inspect_ai/_view/www/src/log-reader/Log-Reader.mjs +0 -25
- inspect_ai/_view/www/src/log-reader/Native-Log-Reader.mjs +0 -13
- inspect_ai/_view/www/src/log-reader/Open-AI-Log-Reader.mjs +0 -263
- inspect_ai/_view/www/src/navbar/Navbar.mjs +0 -418
- inspect_ai/_view/www/src/navbar/SecondaryBar.mjs +0 -175
- inspect_ai/_view/www/src/plan/PlanCard.mjs +0 -418
- inspect_ai/_view/www/src/samples/SampleDialog.mjs +0 -123
- inspect_ai/_view/www/src/samples/SampleDisplay.mjs +0 -516
- inspect_ai/_view/www/src/samples/SampleError.mjs +0 -99
- inspect_ai/_view/www/src/samples/SampleList.mjs +0 -427
- inspect_ai/_view/www/src/samples/SampleScoreView.mjs +0 -172
- inspect_ai/_view/www/src/samples/SampleScores.mjs +0 -34
- inspect_ai/_view/www/src/samples/SampleTranscript.mjs +0 -20
- inspect_ai/_view/www/src/samples/SamplesDescriptor.mjs +0 -771
- inspect_ai/_view/www/src/samples/SamplesTab.mjs +0 -399
- inspect_ai/_view/www/src/samples/SamplesTools.mjs +0 -64
- inspect_ai/_view/www/src/samples/tools/EpochFilter.mjs +0 -38
- inspect_ai/_view/www/src/samples/tools/SampleFilter.mjs +0 -756
- inspect_ai/_view/www/src/samples/tools/SelectScorer.mjs +0 -141
- inspect_ai/_view/www/src/samples/tools/SortFilter.mjs +0 -151
- inspect_ai/_view/www/src/samples/transcript/ApprovalEventView.mjs +0 -71
- inspect_ai/_view/www/src/samples/transcript/ErrorEventView.mjs +0 -44
- inspect_ai/_view/www/src/samples/transcript/EventPanel.mjs +0 -271
- inspect_ai/_view/www/src/samples/transcript/EventRow.mjs +0 -46
- inspect_ai/_view/www/src/samples/transcript/EventSection.mjs +0 -33
- inspect_ai/_view/www/src/samples/transcript/InfoEventView.mjs +0 -59
- inspect_ai/_view/www/src/samples/transcript/InputEventView.mjs +0 -44
- inspect_ai/_view/www/src/samples/transcript/LoggerEventView.mjs +0 -32
- inspect_ai/_view/www/src/samples/transcript/ModelEventView.mjs +0 -216
- inspect_ai/_view/www/src/samples/transcript/SampleInitEventView.mjs +0 -107
- inspect_ai/_view/www/src/samples/transcript/SampleLimitEventView.mjs +0 -74
- inspect_ai/_view/www/src/samples/transcript/ScoreEventView.mjs +0 -100
- inspect_ai/_view/www/src/samples/transcript/StepEventView.mjs +0 -187
- inspect_ai/_view/www/src/samples/transcript/SubtaskEventView.mjs +0 -133
- inspect_ai/_view/www/src/samples/transcript/ToolEventView.mjs +0 -88
- inspect_ai/_view/www/src/samples/transcript/TranscriptView.mjs +0 -459
- inspect_ai/_view/www/src/samples/transcript/Types.mjs +0 -44
- inspect_ai/_view/www/src/samples/transcript/state/StateDiffView.mjs +0 -53
- inspect_ai/_view/www/src/samples/transcript/state/StateEventRenderers.mjs +0 -254
- inspect_ai/_view/www/src/samples/transcript/state/StateEventView.mjs +0 -313
- inspect_ai/_view/www/src/sidebar/Sidebar.mjs +0 -418
- inspect_ai/_view/www/src/usage/ModelTokenTable.mjs +0 -72
- inspect_ai/_view/www/src/usage/UsageCard.mjs +0 -159
- inspect_ai/_view/www/src/utils/Format.mjs +0 -260
- inspect_ai/_view/www/src/utils/Git.mjs +0 -12
- inspect_ai/_view/www/src/utils/Html.mjs +0 -21
- inspect_ai/_view/www/src/utils/attachments.mjs +0 -31
- inspect_ai/_view/www/src/utils/debugging.mjs +0 -23
- inspect_ai/_view/www/src/utils/http.mjs +0 -18
- inspect_ai/_view/www/src/utils/queue.mjs +0 -67
- inspect_ai/_view/www/src/utils/sync.mjs +0 -101
- inspect_ai/_view/www/src/workspace/TaskErrorPanel.mjs +0 -17
- inspect_ai/_view/www/src/workspace/WorkSpace.mjs +0 -516
- inspect_ai/tool/beta/__init__.py +0 -5
- inspect_ai-0.3.62.dist-info/RECORD +0 -481
- /inspect_ai/{tool/beta/_computer/_resources/tool → _eval}/__init__.py +0 -0
- /inspect_ai/{tool/beta/_computer/_resources/tool/requirements.txt → _util/__init__.py} +0 -0
- /inspect_ai/_view/www/src/{constants.mjs → constants.ts} +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/__init__.py +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/_computer_split.py +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/_resources/Dockerfile +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/_resources/README.md +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/_resources/entrypoint/entrypoint.sh +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/_resources/entrypoint/novnc_startup.sh +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/_resources/entrypoint/x11vnc_startup.sh +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/_resources/entrypoint/xfce_startup.sh +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/_resources/entrypoint/xvfb_startup.sh +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/_resources/image_home_dir/.config/Code/User/globalStorage/state.vscdb +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/_resources/image_home_dir/.config/Code/User/settings.json +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/_resources/image_home_dir/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/_resources/image_home_dir/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-screensaver.xml +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/_resources/image_home_dir/Desktop/Firefox Web Browser.desktop +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/_resources/image_home_dir/Desktop/Terminal.desktop +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/_resources/image_home_dir/Desktop/Visual Studio Code.desktop +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/_resources/tool/_logger.py +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/_resources/tool/_run.py +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/_resources/tool/_tool_result.py +0 -0
- /inspect_ai/tool/{beta → _tools}/_computer/_resources/tool/computer_tool.py +0 -0
- {inspect_ai-0.3.62.dist-info → inspect_ai-0.3.64.dist-info}/WHEEL +0 -0
- {inspect_ai-0.3.62.dist-info → inspect_ai-0.3.64.dist-info}/entry_points.txt +0 -0
- {inspect_ai-0.3.62.dist-info → inspect_ai-0.3.64.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,331 @@
|
|
1
|
+
import { TabPanel, TabSet } from "../components/TabSet";
|
2
|
+
import { MetaDataView } from "../metadata/MetaDataView";
|
3
|
+
|
4
|
+
import { escapeSelector } from "../utils/html";
|
5
|
+
import { isVscode } from "../utils/vscode";
|
6
|
+
|
7
|
+
import { ApplicationIcons } from "../appearance/icons";
|
8
|
+
import { ANSIDisplay } from "../components/AnsiDisplay";
|
9
|
+
import { ToolButton } from "../components/ToolButton";
|
10
|
+
import { SampleScoreView } from "./scores/SampleScoreView";
|
11
|
+
|
12
|
+
import clsx from "clsx";
|
13
|
+
import { Fragment, MouseEvent, RefObject } from "react";
|
14
|
+
import { Card, CardBody, CardHeader } from "../components/Card";
|
15
|
+
import { EmptyPanel } from "../components/EmptyPanel";
|
16
|
+
import { JSONPanel } from "../components/JsonPanel";
|
17
|
+
import {
|
18
|
+
kSampleErrorTabId,
|
19
|
+
kSampleJsonTabId,
|
20
|
+
kSampleMessagesTabId,
|
21
|
+
kSampleMetdataTabId,
|
22
|
+
kSampleScoringTabId,
|
23
|
+
kSampleTranscriptTabId,
|
24
|
+
} from "../constants";
|
25
|
+
import { EvalSample } from "../types/log";
|
26
|
+
import { ModelTokenTable } from "../usage/ModelTokenTable";
|
27
|
+
import { printHeadingHtml, printHtml } from "../utils/print";
|
28
|
+
import { ChatViewVirtualList } from "./chat/ChatViewVirtualList";
|
29
|
+
import { SamplesDescriptor } from "./descriptor/samplesDescriptor";
|
30
|
+
import styles from "./SampleDisplay.module.css";
|
31
|
+
import { SampleSummaryView } from "./SampleSummaryView";
|
32
|
+
import { SampleTranscript } from "./transcript/SampleTranscript";
|
33
|
+
|
34
|
+
interface SampleDisplayProps {
|
35
|
+
id: string;
|
36
|
+
sample?: EvalSample;
|
37
|
+
sampleDescriptor: SamplesDescriptor;
|
38
|
+
selectedTab?: string;
|
39
|
+
setSelectedTab: (tab: string) => void;
|
40
|
+
scrollRef: RefObject<HTMLDivElement | null>;
|
41
|
+
}
|
42
|
+
|
43
|
+
/**
|
44
|
+
* Component to display a sample with relevant context and visibility control.
|
45
|
+
*/
|
46
|
+
export const SampleDisplay: React.FC<SampleDisplayProps> = ({
|
47
|
+
id,
|
48
|
+
sample,
|
49
|
+
sampleDescriptor,
|
50
|
+
selectedTab,
|
51
|
+
setSelectedTab,
|
52
|
+
scrollRef,
|
53
|
+
}) => {
|
54
|
+
// Tab ids
|
55
|
+
const baseId = `sample-dialog`;
|
56
|
+
|
57
|
+
if (!sample) {
|
58
|
+
// Placeholder
|
59
|
+
return <EmptyPanel />;
|
60
|
+
}
|
61
|
+
|
62
|
+
// Tab selection
|
63
|
+
const onSelectedTab = (e: MouseEvent<HTMLElement>) => {
|
64
|
+
const el = e.currentTarget as HTMLElement;
|
65
|
+
const id = el.id;
|
66
|
+
setSelectedTab(id);
|
67
|
+
return false;
|
68
|
+
};
|
69
|
+
|
70
|
+
const scorerNames = Object.keys(sample.scores || {});
|
71
|
+
const sampleMetadatas = metadataViewsForSample(`${baseId}-${id}`, sample);
|
72
|
+
|
73
|
+
const tabsetId = `task-sample-details-tab-${id}`;
|
74
|
+
const targetId = `${tabsetId}-content`;
|
75
|
+
|
76
|
+
const tools = [];
|
77
|
+
if (!isVscode()) {
|
78
|
+
tools.push(
|
79
|
+
<ToolButton
|
80
|
+
key="sample-print-tool"
|
81
|
+
label="Print"
|
82
|
+
icon={ApplicationIcons.copy}
|
83
|
+
onClick={() => {
|
84
|
+
printSample(id, targetId);
|
85
|
+
}}
|
86
|
+
/>,
|
87
|
+
);
|
88
|
+
}
|
89
|
+
|
90
|
+
return (
|
91
|
+
<Fragment>
|
92
|
+
<SampleSummaryView
|
93
|
+
parent_id={id}
|
94
|
+
sample={sample}
|
95
|
+
sampleDescriptor={sampleDescriptor}
|
96
|
+
/>
|
97
|
+
<TabSet
|
98
|
+
id={tabsetId}
|
99
|
+
tabControlsClassName={clsx("text-size-base")}
|
100
|
+
tabPanelsClassName={clsx(styles.tabPanel)}
|
101
|
+
tools={tools}
|
102
|
+
>
|
103
|
+
{sample.events && sample.events.length > 0 ? (
|
104
|
+
<TabPanel
|
105
|
+
key={kSampleTranscriptTabId}
|
106
|
+
id={kSampleTranscriptTabId}
|
107
|
+
className="sample-tab"
|
108
|
+
title="Transcript"
|
109
|
+
onSelected={onSelectedTab}
|
110
|
+
selected={
|
111
|
+
selectedTab === kSampleTranscriptTabId ||
|
112
|
+
selectedTab === undefined
|
113
|
+
}
|
114
|
+
scrollable={false}
|
115
|
+
>
|
116
|
+
<SampleTranscript
|
117
|
+
key={`${baseId}-transcript-display-${id}`}
|
118
|
+
id={`${baseId}-transcript-display-${id}`}
|
119
|
+
evalEvents={sample.events}
|
120
|
+
scrollRef={scrollRef}
|
121
|
+
/>
|
122
|
+
</TabPanel>
|
123
|
+
) : null}
|
124
|
+
<TabPanel
|
125
|
+
key={kSampleMessagesTabId}
|
126
|
+
id={kSampleMessagesTabId}
|
127
|
+
className={clsx("sample-tab", styles.fullWidth)}
|
128
|
+
title="Messages"
|
129
|
+
onSelected={onSelectedTab}
|
130
|
+
selected={selectedTab === kSampleMessagesTabId}
|
131
|
+
scrollable={false}
|
132
|
+
>
|
133
|
+
<ChatViewVirtualList
|
134
|
+
key={`${baseId}-chat-${id}`}
|
135
|
+
id={`${baseId}-chat-${id}`}
|
136
|
+
messages={sample.messages}
|
137
|
+
indented={true}
|
138
|
+
scrollRef={scrollRef}
|
139
|
+
toolCallStyle="complete"
|
140
|
+
/>
|
141
|
+
</TabPanel>
|
142
|
+
{scorerNames.length === 1 ? (
|
143
|
+
<TabPanel
|
144
|
+
key={kSampleScoringTabId}
|
145
|
+
id={kSampleScoringTabId}
|
146
|
+
className="sample-tab"
|
147
|
+
title="Scoring"
|
148
|
+
onSelected={onSelectedTab}
|
149
|
+
selected={selectedTab === kSampleScoringTabId}
|
150
|
+
>
|
151
|
+
<SampleScoreView
|
152
|
+
sample={sample}
|
153
|
+
sampleDescriptor={sampleDescriptor}
|
154
|
+
scorer={scorerNames[0]}
|
155
|
+
/>
|
156
|
+
</TabPanel>
|
157
|
+
) : (
|
158
|
+
<>
|
159
|
+
{Object.keys(sample.scores || {}).map((scorer) => {
|
160
|
+
const tabId = `score-${scorer}`;
|
161
|
+
return (
|
162
|
+
<TabPanel
|
163
|
+
key={tabId}
|
164
|
+
id={tabId}
|
165
|
+
className="sample-tab"
|
166
|
+
title={scorer}
|
167
|
+
onSelected={onSelectedTab}
|
168
|
+
selected={selectedTab === tabId}
|
169
|
+
>
|
170
|
+
<SampleScoreView
|
171
|
+
sample={sample}
|
172
|
+
sampleDescriptor={sampleDescriptor}
|
173
|
+
scorer={scorer}
|
174
|
+
/>
|
175
|
+
</TabPanel>
|
176
|
+
);
|
177
|
+
})}
|
178
|
+
</>
|
179
|
+
)}
|
180
|
+
{sampleMetadatas.length > 0 ? (
|
181
|
+
<TabPanel
|
182
|
+
id={kSampleMetdataTabId}
|
183
|
+
className="sample-tab"
|
184
|
+
title="Metadata"
|
185
|
+
onSelected={onSelectedTab}
|
186
|
+
selected={selectedTab === kSampleMetdataTabId}
|
187
|
+
>
|
188
|
+
<div className={clsx(styles.metadataPanel)}>{sampleMetadatas}</div>
|
189
|
+
</TabPanel>
|
190
|
+
) : null}
|
191
|
+
{sample.error ? (
|
192
|
+
<TabPanel
|
193
|
+
id={kSampleErrorTabId}
|
194
|
+
className="sample-tab"
|
195
|
+
title="Error"
|
196
|
+
onSelected={onSelectedTab}
|
197
|
+
selected={selectedTab === kSampleErrorTabId}
|
198
|
+
>
|
199
|
+
<div className={clsx(styles.padded)}>
|
200
|
+
<ANSIDisplay
|
201
|
+
output={sample.error.traceback_ansi}
|
202
|
+
className={clsx("text-size-small", styles.ansi)}
|
203
|
+
/>
|
204
|
+
</div>
|
205
|
+
</TabPanel>
|
206
|
+
) : null}
|
207
|
+
{sample.messages.length < 100 ? (
|
208
|
+
<TabPanel
|
209
|
+
id={kSampleJsonTabId}
|
210
|
+
className={"sample-tab"}
|
211
|
+
title="JSON"
|
212
|
+
onSelected={onSelectedTab}
|
213
|
+
selected={selectedTab === kSampleJsonTabId}
|
214
|
+
>
|
215
|
+
<div className={clsx(styles.padded, styles.fullWidth)}>
|
216
|
+
<JSONPanel data={sample} simple={true} />
|
217
|
+
</div>
|
218
|
+
</TabPanel>
|
219
|
+
) : null}
|
220
|
+
</TabSet>
|
221
|
+
</Fragment>
|
222
|
+
);
|
223
|
+
};
|
224
|
+
|
225
|
+
const metadataViewsForSample = (id: string, sample: EvalSample) => {
|
226
|
+
const sampleMetadatas = [];
|
227
|
+
if (sample.model_usage && Object.keys(sample.model_usage).length > 0) {
|
228
|
+
sampleMetadatas.push(
|
229
|
+
<Card key={`sample-usage-${id}`}>
|
230
|
+
<CardHeader label="Usage" />
|
231
|
+
<CardBody>
|
232
|
+
<ModelTokenTable
|
233
|
+
model_usage={sample.model_usage}
|
234
|
+
className={clsx(styles.noTop)}
|
235
|
+
/>
|
236
|
+
</CardBody>
|
237
|
+
</Card>,
|
238
|
+
);
|
239
|
+
}
|
240
|
+
|
241
|
+
if (Object.keys(sample?.metadata).length > 0) {
|
242
|
+
sampleMetadatas.push(
|
243
|
+
<Card key={`sample-metadata-${id}`}>
|
244
|
+
<CardHeader label="Metadata" />
|
245
|
+
<CardBody>
|
246
|
+
<MetaDataView
|
247
|
+
id="task-sample-metadata-${id}"
|
248
|
+
entries={sample?.metadata as Record<string, unknown>}
|
249
|
+
className={clsx("tab-pane", styles.noTop)}
|
250
|
+
/>
|
251
|
+
</CardBody>
|
252
|
+
</Card>,
|
253
|
+
);
|
254
|
+
}
|
255
|
+
|
256
|
+
if (Object.keys(sample?.store).length > 0) {
|
257
|
+
sampleMetadatas.push(
|
258
|
+
<Card key={`sample-store-${id}`}>
|
259
|
+
<CardHeader label="Store" />
|
260
|
+
<CardBody>
|
261
|
+
<MetaDataView
|
262
|
+
id="task-sample-store-${id}"
|
263
|
+
entries={sample?.store as Record<string, unknown>}
|
264
|
+
className={clsx("tab-pane", styles.noTop)}
|
265
|
+
/>
|
266
|
+
</CardBody>
|
267
|
+
</Card>,
|
268
|
+
);
|
269
|
+
}
|
270
|
+
|
271
|
+
return sampleMetadatas;
|
272
|
+
};
|
273
|
+
const printSample = (id: string, targetId: string) => {
|
274
|
+
// The active tab
|
275
|
+
const targetTabEl = document.querySelector(
|
276
|
+
`#${escapeSelector(targetId)} .sample-tab.tab-pane.show.active`,
|
277
|
+
);
|
278
|
+
if (targetTabEl) {
|
279
|
+
// The target element
|
280
|
+
const targetEl = targetTabEl.firstElementChild;
|
281
|
+
if (targetEl) {
|
282
|
+
// Get the sample heading to include
|
283
|
+
const headingId = `sample-heading-${id}`;
|
284
|
+
const headingEl = document.getElementById(headingId);
|
285
|
+
|
286
|
+
// Print the document
|
287
|
+
const headingHtml = printHeadingHtml();
|
288
|
+
const css = `
|
289
|
+
html { font-size: 9pt }
|
290
|
+
/* Allow content to break anywhere without any forced page breaks */
|
291
|
+
* {
|
292
|
+
break-inside: auto; /* Let elements break anywhere */
|
293
|
+
page-break-inside: auto; /* Legacy support */
|
294
|
+
break-before: auto;
|
295
|
+
page-break-before: auto;
|
296
|
+
break-after: auto;
|
297
|
+
page-break-after: auto;
|
298
|
+
}
|
299
|
+
/* Specifically disable all page breaks for divs */
|
300
|
+
div {
|
301
|
+
break-inside: auto;
|
302
|
+
page-break-inside: auto;
|
303
|
+
}
|
304
|
+
body > .transcript-step {
|
305
|
+
break-inside: avoid;
|
306
|
+
}
|
307
|
+
body{
|
308
|
+
-webkit-print-color-adjust:exact !important;
|
309
|
+
print-color-adjust:exact !important;
|
310
|
+
}
|
311
|
+
/* Allow preformatted text and code blocks to break across pages */
|
312
|
+
pre, code {
|
313
|
+
white-space: pre-wrap; /* Wrap long lines instead of keeping them on one line */
|
314
|
+
overflow-wrap: break-word; /* Ensure long words are broken to fit within the page */
|
315
|
+
break-inside: auto; /* Allow page breaks inside the element */
|
316
|
+
page-break-inside: auto; /* Older equivalent */
|
317
|
+
}
|
318
|
+
|
319
|
+
/* Additional control for long lines within code/preformatted blocks */
|
320
|
+
pre {
|
321
|
+
word-wrap: break-word; /* Break long words if needed */
|
322
|
+
}
|
323
|
+
|
324
|
+
`;
|
325
|
+
printHtml(
|
326
|
+
[headingHtml, headingEl?.outerHTML, targetEl.innerHTML].join("\n"),
|
327
|
+
css,
|
328
|
+
);
|
329
|
+
}
|
330
|
+
}
|
331
|
+
};
|
@@ -0,0 +1,24 @@
|
|
1
|
+
.target {
|
2
|
+
padding-left: 0;
|
3
|
+
}
|
4
|
+
|
5
|
+
.answer {
|
6
|
+
padding-left: 0;
|
7
|
+
}
|
8
|
+
|
9
|
+
.grid {
|
10
|
+
display: grid;
|
11
|
+
grid-column-gap: 0.5em;
|
12
|
+
border-bottom: solid var(--bs-border-color) 1px;
|
13
|
+
margin-bottom: 1em;
|
14
|
+
padding: 0em 1em 1em 1em;
|
15
|
+
}
|
16
|
+
|
17
|
+
.centerLabel {
|
18
|
+
display: flex;
|
19
|
+
justify-content: center;
|
20
|
+
}
|
21
|
+
|
22
|
+
.wrap {
|
23
|
+
word-wrap: anywhere;
|
24
|
+
}
|
@@ -0,0 +1,177 @@
|
|
1
|
+
import clsx from "clsx";
|
2
|
+
import { MarkdownDiv } from "../components/MarkdownDiv";
|
3
|
+
import { EvalSample } from "../types/log";
|
4
|
+
import { arrayToString, inputString } from "../utils/format";
|
5
|
+
import { SamplesDescriptor } from "./descriptor/samplesDescriptor";
|
6
|
+
import { FlatSampleError } from "./error/FlatSampleErrorView";
|
7
|
+
|
8
|
+
import { ReactNode } from "react";
|
9
|
+
import styles from "./SampleSummaryView.module.css";
|
10
|
+
|
11
|
+
interface SampleSummaryViewProps {
|
12
|
+
parent_id: string;
|
13
|
+
sample: EvalSample;
|
14
|
+
sampleDescriptor: SamplesDescriptor;
|
15
|
+
}
|
16
|
+
|
17
|
+
interface SummaryColumn {
|
18
|
+
label: string;
|
19
|
+
value: string | ReactNode;
|
20
|
+
size: string;
|
21
|
+
center?: boolean;
|
22
|
+
clamp?: boolean;
|
23
|
+
}
|
24
|
+
|
25
|
+
/**
|
26
|
+
* Component to display a sample with relevant context and visibility control.
|
27
|
+
*/
|
28
|
+
export const SampleSummaryView: React.FC<SampleSummaryViewProps> = ({
|
29
|
+
parent_id,
|
30
|
+
sample,
|
31
|
+
sampleDescriptor,
|
32
|
+
}) => {
|
33
|
+
const input =
|
34
|
+
sampleDescriptor?.messageShape.normalized.input > 0
|
35
|
+
? Math.max(0.15, sampleDescriptor.messageShape.normalized.input)
|
36
|
+
: 0;
|
37
|
+
const target =
|
38
|
+
sampleDescriptor?.messageShape.normalized.target > 0
|
39
|
+
? Math.max(0.15, sampleDescriptor.messageShape.normalized.target)
|
40
|
+
: 0;
|
41
|
+
const answer =
|
42
|
+
sampleDescriptor?.messageShape.normalized.answer > 0
|
43
|
+
? Math.max(0.15, sampleDescriptor.messageShape.normalized.answer)
|
44
|
+
: 0;
|
45
|
+
const limitSize =
|
46
|
+
sampleDescriptor?.messageShape.normalized.limit > 0
|
47
|
+
? Math.max(0.15, sampleDescriptor.messageShape.normalized.limit)
|
48
|
+
: 0;
|
49
|
+
const idSize = Math.max(
|
50
|
+
2,
|
51
|
+
Math.min(10, sampleDescriptor?.messageShape.raw.id),
|
52
|
+
);
|
53
|
+
|
54
|
+
const scoreInput = inputString(sample.input);
|
55
|
+
if (sample.choices && sample.choices.length > 0) {
|
56
|
+
scoreInput.push("");
|
57
|
+
scoreInput.push(
|
58
|
+
...sample.choices.map((choice, index) => {
|
59
|
+
return `${String.fromCharCode(65 + index)}) ${choice}`;
|
60
|
+
}),
|
61
|
+
);
|
62
|
+
}
|
63
|
+
|
64
|
+
// The columns for the sample
|
65
|
+
const columns: SummaryColumn[] = [];
|
66
|
+
columns.push({
|
67
|
+
label: "Id",
|
68
|
+
value: sample.id,
|
69
|
+
size: `${idSize}em`,
|
70
|
+
});
|
71
|
+
|
72
|
+
columns.push({
|
73
|
+
label: "Input",
|
74
|
+
value: scoreInput,
|
75
|
+
size: `${input}fr`,
|
76
|
+
clamp: true,
|
77
|
+
});
|
78
|
+
|
79
|
+
if (sample.target) {
|
80
|
+
columns.push({
|
81
|
+
label: "Target",
|
82
|
+
value: (
|
83
|
+
<MarkdownDiv
|
84
|
+
markdown={arrayToString(arrayToString(sample?.target || "none"))}
|
85
|
+
className={clsx("no-last-para-padding", styles.target)}
|
86
|
+
/>
|
87
|
+
),
|
88
|
+
size: `${target}fr`,
|
89
|
+
clamp: true,
|
90
|
+
});
|
91
|
+
}
|
92
|
+
|
93
|
+
const fullAnswer =
|
94
|
+
sample && sampleDescriptor
|
95
|
+
? sampleDescriptor.selectedScorerDescriptor(sample).answer()
|
96
|
+
: undefined;
|
97
|
+
if (fullAnswer) {
|
98
|
+
columns.push({
|
99
|
+
label: "Answer",
|
100
|
+
value: sample ? (
|
101
|
+
<MarkdownDiv
|
102
|
+
markdown={fullAnswer}
|
103
|
+
className={clsx("no-last-para-padding", styles.answer)}
|
104
|
+
/>
|
105
|
+
) : (
|
106
|
+
""
|
107
|
+
),
|
108
|
+
size: `${answer}fr`,
|
109
|
+
clamp: true,
|
110
|
+
});
|
111
|
+
}
|
112
|
+
|
113
|
+
if (sample?.limit && limitSize > 0) {
|
114
|
+
columns.push({
|
115
|
+
label: "Limit",
|
116
|
+
value: sample.limit.type,
|
117
|
+
size: `${limitSize}fr`,
|
118
|
+
center: true,
|
119
|
+
});
|
120
|
+
}
|
121
|
+
|
122
|
+
columns.push({
|
123
|
+
label: "Score",
|
124
|
+
value: sample.error ? (
|
125
|
+
<FlatSampleError message={sample.error.message} />
|
126
|
+
) : (
|
127
|
+
// TODO: Cleanup once the PR lands which makes sample / sample summary share common interface
|
128
|
+
sampleDescriptor?.selectedScore(sample)?.render() || ""
|
129
|
+
),
|
130
|
+
size: "minmax(2em, auto)",
|
131
|
+
center: true,
|
132
|
+
});
|
133
|
+
|
134
|
+
return (
|
135
|
+
<div
|
136
|
+
id={`sample-heading-${parent_id}`}
|
137
|
+
className={clsx(styles.grid, "text-size-base")}
|
138
|
+
style={{
|
139
|
+
gridTemplateColumns: `${columns
|
140
|
+
.map((col) => {
|
141
|
+
return col.size;
|
142
|
+
})
|
143
|
+
.join(" ")}`,
|
144
|
+
}}
|
145
|
+
>
|
146
|
+
{columns.map((col, idx) => {
|
147
|
+
return (
|
148
|
+
<div
|
149
|
+
key={`sample-summ-lbl-${idx}`}
|
150
|
+
className={clsx(
|
151
|
+
"text-style-label",
|
152
|
+
"text-style-secondary",
|
153
|
+
"text-size-base",
|
154
|
+
col.center ? styles.centerLabel : undefined,
|
155
|
+
)}
|
156
|
+
>
|
157
|
+
{col.label}
|
158
|
+
</div>
|
159
|
+
);
|
160
|
+
})}
|
161
|
+
{columns.map((col, idx) => {
|
162
|
+
return (
|
163
|
+
<div
|
164
|
+
key={`sample-summ-val-${idx}`}
|
165
|
+
className={clsx(
|
166
|
+
styles.wrap,
|
167
|
+
col.clamp ? "three-line-clamp" : undefined,
|
168
|
+
col.center ? styles.centerLabel : undefined,
|
169
|
+
)}
|
170
|
+
>
|
171
|
+
{col.value}
|
172
|
+
</div>
|
173
|
+
);
|
174
|
+
})}
|
175
|
+
</div>
|
176
|
+
);
|
177
|
+
};
|
@@ -0,0 +1,52 @@
|
|
1
|
+
import { Fragment } from "react/jsx-runtime";
|
2
|
+
import { ScoreFilter, ScoreLabel } from "../types";
|
3
|
+
import { SamplesDescriptor } from "./descriptor/samplesDescriptor";
|
4
|
+
import { EpochFilter } from "./sample-tools/EpochFilter";
|
5
|
+
import { SampleFilter } from "./sample-tools/sample-filter/SampleFilter";
|
6
|
+
import { SelectScorer } from "./sample-tools/SelectScorer";
|
7
|
+
import { SortFilter } from "./sample-tools/SortFilter";
|
8
|
+
|
9
|
+
interface SampleToolsProps {
|
10
|
+
epoch: string;
|
11
|
+
setEpoch: (epoch: string) => void;
|
12
|
+
epochs: number;
|
13
|
+
scoreFilter: ScoreFilter;
|
14
|
+
setScoreFilter: (filter: ScoreFilter) => void;
|
15
|
+
sort: string;
|
16
|
+
setSort: (sort: string) => void;
|
17
|
+
score?: ScoreLabel;
|
18
|
+
setScore: (score: ScoreLabel) => void;
|
19
|
+
scores: ScoreLabel[];
|
20
|
+
sampleDescriptor: SamplesDescriptor;
|
21
|
+
}
|
22
|
+
|
23
|
+
export const SampleTools: React.FC<SampleToolsProps> = ({
|
24
|
+
epoch,
|
25
|
+
setEpoch,
|
26
|
+
epochs,
|
27
|
+
scoreFilter,
|
28
|
+
setScoreFilter,
|
29
|
+
sort,
|
30
|
+
setSort,
|
31
|
+
score,
|
32
|
+
setScore,
|
33
|
+
scores,
|
34
|
+
sampleDescriptor,
|
35
|
+
}) => {
|
36
|
+
return (
|
37
|
+
<Fragment>
|
38
|
+
<SampleFilter
|
39
|
+
evalDescriptor={sampleDescriptor.evalDescriptor}
|
40
|
+
scoreFilter={scoreFilter}
|
41
|
+
setScoreFilter={setScoreFilter}
|
42
|
+
/>
|
43
|
+
{scores.length > 1 ? (
|
44
|
+
<SelectScorer scores={scores} score={score} setScore={setScore} />
|
45
|
+
) : undefined}
|
46
|
+
{epochs > 1 ? (
|
47
|
+
<EpochFilter epoch={epoch} setEpoch={setEpoch} epochs={epochs} />
|
48
|
+
) : undefined}
|
49
|
+
<SortFilter sort={sort} setSort={setSort} epochs={epochs} />
|
50
|
+
</Fragment>
|
51
|
+
);
|
52
|
+
};
|
@@ -0,0 +1,29 @@
|
|
1
|
+
.message {
|
2
|
+
font-weight: 300;
|
3
|
+
padding-bottom: 0.5em;
|
4
|
+
margin-left: 0;
|
5
|
+
margin-right: 0;
|
6
|
+
white-space: normal;
|
7
|
+
}
|
8
|
+
|
9
|
+
.systemRole {
|
10
|
+
opacity: 0.7;
|
11
|
+
}
|
12
|
+
|
13
|
+
.messageGrid {
|
14
|
+
display: grid;
|
15
|
+
grid-template-columns: max-content auto;
|
16
|
+
column-gap: 0.3em;
|
17
|
+
font-weight: 500;
|
18
|
+
margin-bottom: 0.5em;
|
19
|
+
}
|
20
|
+
|
21
|
+
.messageContents {
|
22
|
+
margin-left: 0;
|
23
|
+
padding-bottom: 0;
|
24
|
+
}
|
25
|
+
|
26
|
+
.messageContents.indented {
|
27
|
+
margin-left: 1.1rem;
|
28
|
+
padding-bottom: 0.8rem;
|
29
|
+
}
|
@@ -0,0 +1,76 @@
|
|
1
|
+
import clsx from "clsx";
|
2
|
+
import { Fragment } from "react";
|
3
|
+
import ExpandablePanel from "../../components/ExpandablePanel";
|
4
|
+
import { MarkdownDiv } from "../../components/MarkdownDiv";
|
5
|
+
import {
|
6
|
+
ChatMessageAssistant,
|
7
|
+
ChatMessageSystem,
|
8
|
+
ChatMessageTool,
|
9
|
+
ChatMessageUser,
|
10
|
+
} from "../../types/log";
|
11
|
+
import styles from "./ChatMessage.module.css";
|
12
|
+
import { MessageContents } from "./MessageContents";
|
13
|
+
import { iconForMsg } from "./messages";
|
14
|
+
|
15
|
+
interface ChatMessageProps {
|
16
|
+
id: string;
|
17
|
+
message: ChatMessageAssistant | ChatMessageSystem | ChatMessageUser;
|
18
|
+
toolMessages: ChatMessageTool[];
|
19
|
+
indented?: boolean;
|
20
|
+
toolCallStyle: "compact" | "complete";
|
21
|
+
}
|
22
|
+
|
23
|
+
export const ChatMessage: React.FC<ChatMessageProps> = ({
|
24
|
+
id,
|
25
|
+
message,
|
26
|
+
toolMessages,
|
27
|
+
indented,
|
28
|
+
toolCallStyle,
|
29
|
+
}) => {
|
30
|
+
const collapse = message.role === "system";
|
31
|
+
return (
|
32
|
+
<div
|
33
|
+
className={clsx(
|
34
|
+
message.role,
|
35
|
+
"text-size-base",
|
36
|
+
styles.message,
|
37
|
+
message.role === "system" ? styles.systemRole : undefined,
|
38
|
+
)}
|
39
|
+
>
|
40
|
+
<div className={clsx(styles.messageGrid, "text-style-label")}>
|
41
|
+
<i className={iconForMsg(message)} />
|
42
|
+
{message.role}
|
43
|
+
</div>
|
44
|
+
{message.role === "assistant" && message.reasoning ? (
|
45
|
+
<Fragment key={`${id}-response-label`}>
|
46
|
+
<div className={clsx("text-style-label", "text-style-secondary")}>
|
47
|
+
Reasoning
|
48
|
+
</div>
|
49
|
+
<ExpandablePanel collapse={true}>
|
50
|
+
<MarkdownDiv markdown={message.reasoning} />
|
51
|
+
</ExpandablePanel>
|
52
|
+
</Fragment>
|
53
|
+
) : undefined}
|
54
|
+
<div
|
55
|
+
className={clsx(
|
56
|
+
styles.messageContents,
|
57
|
+
indented ? styles.indented : undefined,
|
58
|
+
)}
|
59
|
+
>
|
60
|
+
{message.role === "assistant" && message.reasoning ? (
|
61
|
+
<div className={clsx("text-style-label", "text-style-secondary")}>
|
62
|
+
Response
|
63
|
+
</div>
|
64
|
+
) : undefined}
|
65
|
+
<ExpandablePanel collapse={collapse}>
|
66
|
+
<MessageContents
|
67
|
+
key={`${id}-contents`}
|
68
|
+
message={message}
|
69
|
+
toolMessages={toolMessages}
|
70
|
+
toolCallStyle={toolCallStyle}
|
71
|
+
/>
|
72
|
+
</ExpandablePanel>
|
73
|
+
</div>
|
74
|
+
</div>
|
75
|
+
);
|
76
|
+
};
|