add cua support in navigation block (#2359)
This commit is contained in:
@@ -35,6 +35,13 @@ import { ParametersMultiSelect } from "../TaskNode/ParametersMultiSelect";
|
|||||||
import { AppNode } from "..";
|
import { AppNode } from "..";
|
||||||
import { getAvailableOutputParameterKeys } from "../../workflowEditorUtils";
|
import { getAvailableOutputParameterKeys } from "../../workflowEditorUtils";
|
||||||
import { useIsFirstBlockInWorkflow } from "../../hooks/useIsFirstNodeInWorkflow";
|
import { useIsFirstBlockInWorkflow } from "../../hooks/useIsFirstNodeInWorkflow";
|
||||||
|
import {
|
||||||
|
Select,
|
||||||
|
SelectTrigger,
|
||||||
|
SelectContent,
|
||||||
|
SelectValue,
|
||||||
|
SelectItem,
|
||||||
|
} from "@/components/ui/select";
|
||||||
|
|
||||||
function NavigationNode({ id, data }: NodeProps<NavigationNode>) {
|
function NavigationNode({ id, data }: NodeProps<NavigationNode>) {
|
||||||
const { updateNodeData } = useReactFlow();
|
const { updateNodeData } = useReactFlow();
|
||||||
@@ -56,6 +63,7 @@ function NavigationNode({ id, data }: NodeProps<NavigationNode>) {
|
|||||||
totpIdentifier: data.totpIdentifier,
|
totpIdentifier: data.totpIdentifier,
|
||||||
completeCriterion: data.completeCriterion,
|
completeCriterion: data.completeCriterion,
|
||||||
terminateCriterion: data.terminateCriterion,
|
terminateCriterion: data.terminateCriterion,
|
||||||
|
engine: data.engine,
|
||||||
includeActionHistoryInVerification: data.includeActionHistoryInVerification,
|
includeActionHistoryInVerification: data.includeActionHistoryInVerification,
|
||||||
});
|
});
|
||||||
const deleteNodeCallback = useDeleteNodeCallback();
|
const deleteNodeCallback = useDeleteNodeCallback();
|
||||||
@@ -196,6 +204,30 @@ function NavigationNode({ id, data }: NodeProps<NavigationNode>) {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<Separator />
|
<Separator />
|
||||||
|
<div className="flex items-center justify-between">
|
||||||
|
<div className="flex gap-2">
|
||||||
|
<Label className="text-xs font-normal text-slate-300">
|
||||||
|
Engine
|
||||||
|
</Label>
|
||||||
|
</div>
|
||||||
|
<Select
|
||||||
|
value={inputs.engine ?? "skyvern-1.0"}
|
||||||
|
onValueChange={(value) => {
|
||||||
|
handleChange("engine", value);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<SelectTrigger className="nopan w-52 text-xs">
|
||||||
|
<SelectValue />
|
||||||
|
</SelectTrigger>
|
||||||
|
<SelectContent>
|
||||||
|
<SelectItem value="skyvern-1.0">Skyvern 1.0</SelectItem>
|
||||||
|
<SelectItem value="openai-cua">OpenAI CUA</SelectItem>
|
||||||
|
<SelectItem value="anthropic-cua">
|
||||||
|
Anthropic CUA
|
||||||
|
</SelectItem>
|
||||||
|
</SelectContent>
|
||||||
|
</Select>
|
||||||
|
</div>
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<div className="flex gap-2">
|
<div className="flex gap-2">
|
||||||
<Label className="text-xs font-normal text-slate-300">
|
<Label className="text-xs font-normal text-slate-300">
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ export type NavigationNodeData = NodeBaseData & {
|
|||||||
errorCodeMapping: string;
|
errorCodeMapping: string;
|
||||||
completeCriterion: string;
|
completeCriterion: string;
|
||||||
terminateCriterion: string;
|
terminateCriterion: string;
|
||||||
|
engine: string | null;
|
||||||
maxRetries: number | null;
|
maxRetries: number | null;
|
||||||
maxStepsOverride: number | null;
|
maxStepsOverride: number | null;
|
||||||
allowDownloads: boolean;
|
allowDownloads: boolean;
|
||||||
@@ -27,6 +28,7 @@ export const navigationNodeDefaultData: NavigationNodeData = {
|
|||||||
completeCriterion: "",
|
completeCriterion: "",
|
||||||
terminateCriterion: "",
|
terminateCriterion: "",
|
||||||
errorCodeMapping: "null",
|
errorCodeMapping: "null",
|
||||||
|
engine: "skyvern-1.0",
|
||||||
maxRetries: null,
|
maxRetries: null,
|
||||||
maxStepsOverride: null,
|
maxStepsOverride: null,
|
||||||
allowDownloads: false,
|
allowDownloads: false,
|
||||||
|
|||||||
@@ -306,6 +306,7 @@ function convertToNode(
|
|||||||
maxStepsOverride: block.max_steps_per_run ?? null,
|
maxStepsOverride: block.max_steps_per_run ?? null,
|
||||||
completeCriterion: block.complete_criterion ?? "",
|
completeCriterion: block.complete_criterion ?? "",
|
||||||
terminateCriterion: block.terminate_criterion ?? "",
|
terminateCriterion: block.terminate_criterion ?? "",
|
||||||
|
engine: block.engine ?? "skyvern-1.0",
|
||||||
includeActionHistoryInVerification:
|
includeActionHistoryInVerification:
|
||||||
block.include_action_history_in_verification ?? false,
|
block.include_action_history_in_verification ?? false,
|
||||||
},
|
},
|
||||||
@@ -1052,6 +1053,7 @@ function getWorkflowBlock(node: WorkflowBlockNode): BlockYAML {
|
|||||||
cache_actions: node.data.cacheActions,
|
cache_actions: node.data.cacheActions,
|
||||||
complete_criterion: node.data.completeCriterion,
|
complete_criterion: node.data.completeCriterion,
|
||||||
terminate_criterion: node.data.terminateCriterion,
|
terminate_criterion: node.data.terminateCriterion,
|
||||||
|
engine: node.data.engine,
|
||||||
include_action_history_in_verification:
|
include_action_history_in_verification:
|
||||||
node.data.includeActionHistoryInVerification,
|
node.data.includeActionHistoryInVerification,
|
||||||
};
|
};
|
||||||
@@ -1763,6 +1765,7 @@ function convertBlocksToBlockYAML(
|
|||||||
block_type: "navigation",
|
block_type: "navigation",
|
||||||
url: block.url,
|
url: block.url,
|
||||||
title: block.title,
|
title: block.title,
|
||||||
|
engine: block.engine,
|
||||||
navigation_goal: block.navigation_goal,
|
navigation_goal: block.navigation_goal,
|
||||||
error_code_mapping: block.error_code_mapping,
|
error_code_mapping: block.error_code_mapping,
|
||||||
max_retries: block.max_retries,
|
max_retries: block.max_retries,
|
||||||
|
|||||||
@@ -364,6 +364,7 @@ export type NavigationBlock = WorkflowBlockBase & {
|
|||||||
cache_actions: boolean;
|
cache_actions: boolean;
|
||||||
complete_criterion: string | null;
|
complete_criterion: string | null;
|
||||||
terminate_criterion: string | null;
|
terminate_criterion: string | null;
|
||||||
|
engine: string | null;
|
||||||
include_action_history_in_verification: boolean;
|
include_action_history_in_verification: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -185,6 +185,7 @@ export type NavigationBlockYAML = BlockYAMLBase & {
|
|||||||
cache_actions: boolean;
|
cache_actions: boolean;
|
||||||
complete_criterion: string | null;
|
complete_criterion: string | null;
|
||||||
terminate_criterion: string | null;
|
terminate_criterion: string | null;
|
||||||
|
engine: string | null;
|
||||||
include_action_history_in_verification: boolean;
|
include_action_history_in_verification: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user