denpendent run frontend (#3462)
This commit is contained in:
@@ -64,6 +64,7 @@ function Debugger() {
|
||||
useScriptCache: workflow.generate_script,
|
||||
scriptCacheKey: workflow.cache_key,
|
||||
aiFallback: workflow.ai_fallback ?? true,
|
||||
runSequentially: workflow.run_sequentially ?? false,
|
||||
};
|
||||
|
||||
const elements = getElements(
|
||||
|
||||
@@ -65,6 +65,7 @@ function WorkflowEditor() {
|
||||
useScriptCache: workflow.generate_script,
|
||||
scriptCacheKey: workflow.cache_key,
|
||||
aiFallback: workflow.ai_fallback ?? true,
|
||||
runSequentially: workflow.run_sequentially ?? false,
|
||||
};
|
||||
|
||||
const elements = getElements(
|
||||
|
||||
@@ -75,6 +75,7 @@ function StartNode({ id, data }: NodeProps<StartNode>) {
|
||||
useScriptCache: data.withWorkflowSettings ? data.useScriptCache : false,
|
||||
scriptCacheKey: data.withWorkflowSettings ? data.scriptCacheKey : null,
|
||||
aiFallback: data.withWorkflowSettings ? data.aiFallback : true,
|
||||
runSequentially: data.withWorkflowSettings ? data.runSequentially : false,
|
||||
});
|
||||
|
||||
const [facing, setFacing] = useState<"front" | "back">("front");
|
||||
@@ -254,6 +255,19 @@ function StartNode({ id, data }: NodeProps<StartNode>) {
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<div className="flex items-center gap-2">
|
||||
<Label>Run Sequentially</Label>
|
||||
<HelpTooltip content="Run the workflow in a sequential order" />
|
||||
<Switch
|
||||
className="ml-auto"
|
||||
checked={inputs.runSequentially}
|
||||
onCheckedChange={(value) => {
|
||||
handleChange("runSequentially", value);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<div className="flex items-center gap-2">
|
||||
<Label>Save & Reuse Session</Label>
|
||||
|
||||
@@ -15,6 +15,7 @@ export type WorkflowStartNodeData = {
|
||||
useScriptCache: boolean;
|
||||
scriptCacheKey: string | null;
|
||||
aiFallback: boolean;
|
||||
runSequentially: boolean;
|
||||
label: "__start_block__";
|
||||
showCode: boolean;
|
||||
};
|
||||
|
||||
@@ -708,6 +708,7 @@ function getElements(
|
||||
aiFallback: settings.aiFallback ?? true,
|
||||
label: "__start_block__",
|
||||
showCode: false,
|
||||
runSequentially: settings.runSequentially,
|
||||
}),
|
||||
);
|
||||
|
||||
@@ -1418,6 +1419,7 @@ function getWorkflowSettings(nodes: Array<AppNode>): WorkflowSettings {
|
||||
useScriptCache: false,
|
||||
scriptCacheKey: null,
|
||||
aiFallback: true,
|
||||
runSequentially: false,
|
||||
};
|
||||
const startNodes = nodes.filter(isStartNode);
|
||||
const startNodeWithWorkflowSettings = startNodes.find(
|
||||
@@ -1438,6 +1440,7 @@ function getWorkflowSettings(nodes: Array<AppNode>): WorkflowSettings {
|
||||
useScriptCache: data.useScriptCache,
|
||||
scriptCacheKey: data.scriptCacheKey,
|
||||
aiFallback: data.aiFallback,
|
||||
runSequentially: data.runSequentially,
|
||||
};
|
||||
}
|
||||
return defaultSettings;
|
||||
|
||||
@@ -530,6 +530,7 @@ export type WorkflowApiResponse = {
|
||||
generate_script: boolean;
|
||||
cache_key: string | null;
|
||||
ai_fallback: boolean | null;
|
||||
run_sequentially: boolean | null;
|
||||
};
|
||||
|
||||
export type WorkflowSettings = {
|
||||
@@ -542,6 +543,7 @@ export type WorkflowSettings = {
|
||||
useScriptCache: boolean;
|
||||
scriptCacheKey: string | null;
|
||||
aiFallback: boolean | null;
|
||||
runSequentially: boolean;
|
||||
};
|
||||
|
||||
export type WorkflowModel = JsonObjectExtendable<{ model_name: string }>;
|
||||
|
||||
@@ -17,6 +17,7 @@ export type WorkflowCreateYAMLRequest = {
|
||||
generate_script?: boolean;
|
||||
cache_key?: string | null;
|
||||
ai_fallback?: boolean;
|
||||
run_sequentially?: boolean;
|
||||
};
|
||||
|
||||
export type WorkflowDefinitionYAML = {
|
||||
|
||||
@@ -122,6 +122,7 @@ const useWorkflowSave = () => {
|
||||
blocks: saveData.blocks,
|
||||
},
|
||||
is_saved_task: saveData.workflow.is_saved_task,
|
||||
run_sequentially: saveData.settings.runSequentially,
|
||||
};
|
||||
|
||||
const yaml = convertToYAML(requestBody);
|
||||
|
||||
Reference in New Issue
Block a user