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