Show task v2 output instead of extracted information (#2034)

This commit is contained in:
Shuchang Zheng
2025-03-27 06:58:20 -07:00
committed by GitHub
parent 578a56d649
commit 98c8897069

View File

@@ -146,6 +146,8 @@ function WorkflowRun() {
aggregatedExtractedInformation,
).some((value) => value !== null);
const hasTaskv2Output = Boolean(isTaskv2Run && workflowRun.task_v2?.output);
const hasFileUrls =
isFetched &&
workflowRun &&
@@ -155,11 +157,12 @@ function WorkflowRun() {
? (workflowRun.downloaded_file_urls as string[])
: [];
const showBoth = hasSomeExtractedInformation && hasFileUrls;
const showBoth =
(hasSomeExtractedInformation || hasTaskv2Output) && hasFileUrls;
const showOutputSection =
workflowRunIsFinalized &&
(hasSomeExtractedInformation || hasFileUrls) &&
(hasSomeExtractedInformation || hasFileUrls || hasTaskv2Output) &&
workflowRun.status === Status.Completed;
return (
@@ -269,12 +272,18 @@ function WorkflowRun() {
"grid-cols-2": showBoth,
})}
>
{hasSomeExtractedInformation && (
{(hasSomeExtractedInformation || hasTaskv2Output) && (
<div className="space-y-4">
<Label>Extracted Information</Label>
<Label>
{hasTaskv2Output ? "Output" : "Extracted Information"}
</Label>
<CodeEditor
language="json"
value={JSON.stringify(aggregatedExtractedInformation, null, 2)}
value={
hasTaskv2Output
? JSON.stringify(workflowRun.task_v2?.output, null, 2)
: JSON.stringify(aggregatedExtractedInformation, null, 2)
}
readOnly
maxHeight="250px"
/>