accept ai_fallback for new workflows (#3358)
This commit is contained in:
@@ -48,6 +48,7 @@ import {
|
|||||||
MAX_SCREENSHOT_SCROLLS_DEFAULT,
|
MAX_SCREENSHOT_SCROLLS_DEFAULT,
|
||||||
MAX_STEPS_DEFAULT,
|
MAX_STEPS_DEFAULT,
|
||||||
} from "@/routes/workflows/editor/nodes/Taskv2Node/types";
|
} from "@/routes/workflows/editor/nodes/Taskv2Node/types";
|
||||||
|
import { OrgWalled } from "@/components/Orgwalled";
|
||||||
|
|
||||||
function createTemplateTaskFromTaskGenerationParameters(
|
function createTemplateTaskFromTaskGenerationParameters(
|
||||||
values: TaskGenerationApiResponse,
|
values: TaskGenerationApiResponse,
|
||||||
@@ -470,7 +471,7 @@ function PromptBox() {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<OrgWalled className="p-0">
|
||||||
<div className="flex gap-16">
|
<div className="flex gap-16">
|
||||||
<div className="w-48 shrink-0">
|
<div className="w-48 shrink-0">
|
||||||
<div className="text-sm">Generate Script</div>
|
<div className="text-sm">Generate Script</div>
|
||||||
@@ -486,6 +487,7 @@ function PromptBox() {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
</OrgWalled>
|
||||||
<div className="flex gap-16">
|
<div className="flex gap-16">
|
||||||
<div className="w-48 shrink-0">
|
<div className="w-48 shrink-0">
|
||||||
<div className="text-sm">Publish Workflow</div>
|
<div className="text-sm">Publish Workflow</div>
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import { useWorkflowHasChangesStore } from "@/store/WorkflowHasChangesStore";
|
|||||||
import { cn } from "@/util/utils";
|
import { cn } from "@/util/utils";
|
||||||
import { WorkflowApiResponse } from "../types/workflowTypes";
|
import { WorkflowApiResponse } from "../types/workflowTypes";
|
||||||
import { CacheKeyValuesResponse } from "@/routes/workflows/types/scriptTypes";
|
import { CacheKeyValuesResponse } from "@/routes/workflows/types/scriptTypes";
|
||||||
|
import { OrgWalled } from "@/components/Orgwalled";
|
||||||
|
|
||||||
interface Dom {
|
interface Dom {
|
||||||
input: React.MutableRefObject<HTMLInputElement | null>;
|
input: React.MutableRefObject<HTMLInputElement | null>;
|
||||||
@@ -125,6 +126,7 @@ function WorkflowHeader({
|
|||||||
<div className="flex h-full items-center justify-end gap-4">
|
<div className="flex h-full items-center justify-end gap-4">
|
||||||
{user && workflow.generate_script && (
|
{user && workflow.generate_script && (
|
||||||
// (cacheKeyValues?.total_count ?? 0) > 0 && (
|
// (cacheKeyValues?.total_count ?? 0) > 0 && (
|
||||||
|
<OrgWalled className="p-0">
|
||||||
<div
|
<div
|
||||||
tabIndex={1}
|
tabIndex={1}
|
||||||
className="flex max-w-[15rem] items-center justify-center gap-1 rounded-md border border-input pr-1 focus-within:ring-1 focus-within:ring-ring"
|
className="flex max-w-[15rem] items-center justify-center gap-1 rounded-md border border-input pr-1 focus-within:ring-1 focus-within:ring-ring"
|
||||||
@@ -181,6 +183,7 @@ function WorkflowHeader({
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
</OrgWalled>
|
||||||
)}
|
)}
|
||||||
{isGlobalWorkflow ? (
|
{isGlobalWorkflow ? (
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import {
|
|||||||
DropdownMenuTrigger,
|
DropdownMenuTrigger,
|
||||||
} from "@/components/ui/dropdown-menu";
|
} from "@/components/ui/dropdown-menu";
|
||||||
import { DotsHorizontalIcon } from "@radix-ui/react-icons";
|
import { DotsHorizontalIcon } from "@radix-ui/react-icons";
|
||||||
|
import { OrgWalled } from "@/components/Orgwalled";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
isDeletable?: boolean;
|
isDeletable?: boolean;
|
||||||
@@ -44,7 +45,9 @@ function NodeActionMenu({
|
|||||||
Delete Block
|
Delete Block
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
)}
|
)}
|
||||||
{isScriptable && onShowScript && (
|
{isScriptable && (
|
||||||
|
<OrgWalled className="p-0">
|
||||||
|
{onShowScript && (
|
||||||
<DropdownMenuItem
|
<DropdownMenuItem
|
||||||
onSelect={() => {
|
onSelect={() => {
|
||||||
onShowScript();
|
onShowScript();
|
||||||
@@ -53,6 +56,8 @@ function NodeActionMenu({
|
|||||||
{showScriptText ?? "Show Code"}
|
{showScriptText ?? "Show Code"}
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
)}
|
)}
|
||||||
|
</OrgWalled>
|
||||||
|
)}
|
||||||
</DropdownMenuContent>
|
</DropdownMenuContent>
|
||||||
</DropdownMenu>
|
</DropdownMenu>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import { ModelSelector } from "@/components/ModelSelector";
|
|||||||
import { WorkflowModel } from "@/routes/workflows/types/workflowTypes";
|
import { WorkflowModel } from "@/routes/workflows/types/workflowTypes";
|
||||||
import { MAX_SCREENSHOT_SCROLLS_DEFAULT } from "../Taskv2Node/types";
|
import { MAX_SCREENSHOT_SCROLLS_DEFAULT } from "../Taskv2Node/types";
|
||||||
import { KeyValueInput } from "@/components/KeyValueInput";
|
import { KeyValueInput } from "@/components/KeyValueInput";
|
||||||
|
import { OrgWalled } from "@/components/Orgwalled";
|
||||||
import { placeholders } from "@/routes/workflows/editor/helpContent";
|
import { placeholders } from "@/routes/workflows/editor/helpContent";
|
||||||
import { useToggleScriptForNodeCallback } from "@/routes/workflows/hooks/useToggleScriptForNodeCallback";
|
import { useToggleScriptForNodeCallback } from "@/routes/workflows/hooks/useToggleScriptForNodeCallback";
|
||||||
import { useWorkflowSettingsStore } from "@/store/WorkflowSettingsStore";
|
import { useWorkflowSettingsStore } from "@/store/WorkflowSettingsStore";
|
||||||
@@ -162,6 +163,7 @@ function StartNode({ id, data }: NodeProps<StartNode>) {
|
|||||||
<div className="relative">
|
<div className="relative">
|
||||||
<div className="absolute right-[-0.5rem] top-[-0.25rem]">
|
<div className="absolute right-[-0.5rem] top-[-0.25rem]">
|
||||||
<div>
|
<div>
|
||||||
|
<OrgWalled className="p-0">
|
||||||
<Button variant="link" size="icon" onClick={showAllScripts}>
|
<Button variant="link" size="icon" onClick={showAllScripts}>
|
||||||
<TooltipProvider>
|
<TooltipProvider>
|
||||||
<Tooltip>
|
<Tooltip>
|
||||||
@@ -172,6 +174,7 @@ function StartNode({ id, data }: NodeProps<StartNode>) {
|
|||||||
</Tooltip>
|
</Tooltip>
|
||||||
</TooltipProvider>
|
</TooltipProvider>
|
||||||
</Button>
|
</Button>
|
||||||
|
</OrgWalled>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<header className="mb-6 mt-2">Start</header>
|
<header className="mb-6 mt-2">Start</header>
|
||||||
@@ -224,7 +227,7 @@ function StartNode({ id, data }: NodeProps<StartNode>) {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
<OrgWalled className="p-0 hover:p-0">
|
||||||
<div className="flex flex-col gap-4">
|
<div className="flex flex-col gap-4">
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
@@ -275,6 +278,7 @@ function StartNode({ id, data }: NodeProps<StartNode>) {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
</OrgWalled>
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<Label>Save & Reuse Session</Label>
|
<Label>Save & Reuse Session</Label>
|
||||||
|
|||||||
@@ -1701,6 +1701,7 @@ class WorkflowService:
|
|||||||
status=request.status,
|
status=request.status,
|
||||||
generate_script=request.generate_script,
|
generate_script=request.generate_script,
|
||||||
cache_key=request.cache_key,
|
cache_key=request.cache_key,
|
||||||
|
ai_fallback=request.ai_fallback,
|
||||||
)
|
)
|
||||||
# Keeping track of the new workflow id to delete it if an error occurs during the creation process
|
# Keeping track of the new workflow id to delete it if an error occurs during the creation process
|
||||||
new_workflow_id = workflow.workflow_id
|
new_workflow_id = workflow.workflow_id
|
||||||
|
|||||||
Reference in New Issue
Block a user