Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ai flow prompt fix + explanation in ui #2374

Merged
merged 1 commit into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion frontend/src/lib/components/copilot/FlowCopilotDrawer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,24 @@
<ToggleButton value="sequence" label="Sequence" />
<ToggleButton value="trigger" label="Trigger" />
</ToggleButtonGroup>
{#if flowCopilotMode === 'trigger'}
<Alert title="Trigger flow builder">
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. <br /><br />
The flow is automatically set to run every 15 minutes when deployed.
</Alert>{:else}
<Alert title="Sequence flow builder">
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.
</Alert>
{/if}
{#each $modulesStore as copilotModule, i}
<div>
{#if i === 1 && $modulesStore[i - 1].type === 'trigger'}
Expand Down Expand Up @@ -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={() => {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/components/copilot/flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading