From 78742e2d3ea7dfda1be79153816a3f37f2146c5b Mon Sep 17 00:00:00 2001 From: HugoCasa Date: Mon, 2 Oct 2023 19:40:06 +0200 Subject: [PATCH] fix: ai flow prompt fix + explanation in ui (#2374) --- .../copilot/FlowCopilotDrawer.svelte | 20 ++++++++++++++++++- frontend/src/lib/components/copilot/flow.ts | 2 +- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/frontend/src/lib/components/copilot/FlowCopilotDrawer.svelte b/frontend/src/lib/components/copilot/FlowCopilotDrawer.svelte index fdb75419ec..8c56b05c95 100644 --- a/frontend/src/lib/components/copilot/FlowCopilotDrawer.svelte +++ b/frontend/src/lib/components/copilot/FlowCopilotDrawer.svelte @@ -40,6 +40,24 @@ + {#if flowCopilotMode === 'trigger'} + + Build a flow with two scripts, one that regularly checks for changes in an external system + and a second that is executed for each change using a for-loop. For both steps, you can + either choose a script from the hub or generate one from scratch using Windmill AI. The + inputs of the for-loop action are automatically filled in with the ouputs of the trigger + step. At the end of the process, flow inputs are inferred and you just need to fill them + in.

+ The flow is automatically set to run every 15 minutes when deployed. +
{:else} + + Build a flow with a sequence of scripts that are executed one after the other. For each + step, you can either choose a script from the hub or generate one from scratch using + Windmill AI. Each step inputs are automatically filled in with the previous step's + outputs. At the end of the process, flow inputs are inferred and you just need to fill + them in. + + {/if} {#each $modulesStore as copilotModule, i}
{#if i === 1 && $modulesStore[i - 1].type === 'trigger'} @@ -141,7 +159,7 @@ name="description" type="text" placeholder={copilotModule.type === 'trigger' - ? 'describe what should trigger your flow' + ? 'describe what should trigger your flow e.g. "new slack message"' : 'describe what this step should do'} bind:value={copilotModule.description} on:input={() => { diff --git a/frontend/src/lib/components/copilot/flow.ts b/frontend/src/lib/components/copilot/flow.ts index cae90ede00..cf39a534e2 100644 --- a/frontend/src/lib/components/copilot/flow.ts +++ b/frontend/src/lib/components/copilot/flow.ts @@ -79,7 +79,7 @@ const triggerPrompts: { python3: string } = { bun: `I'm building a workflow which is a sequence of script steps. Write the first script in {codeLang} which should check for {description} and return an array. -You can use "const {state_name}: {state_type} = getState(...)" and "setState(...)" from "windmill-client@1" to maintain state across runs. +You can use "const {state_name}: {state_type} = await getState(...)" and "await setState(...)" from "windmill-client@1" to maintain state across runs. {additionalInformation}`, python3: `I'm building a workflow which is a sequence of script steps. Write the first script in {codeLang} which should check for {description} and return an array.