Windmill provides ways to have AI help you in your coding experience.
If you're interested leveraging OpenAI from your scripts, flows and apps, check OpenAI Integration.
Generate Windmill-specific code from simple text.
On the workspace settings, go to the "OpenAI Credentials" tab and add an OpenAI resource.
Code generation on Windmill from OpenAI only works on GPT-4 so far.
Then from a code editor (Script, Flow, Apps), click on
AI Gen and write with a prompt what the script should do. The script will use Windmill's main requirements and features (exposing a main function, importing libraries, using resource types, declaring required parameters with types, leveraging database schema).
When in the code editor, select the code section you want to edit and the "AI Gen" button will turn into "AI Edit", letting you enter instructions for the AI Assistant.
You will then be offered to accept or decline the suggested code.
Upon error when executing code, you will be offered to "AI Fix" it. The assistant will automatically read the code, explain what went wrong, and suggest a way to fix it.
Code Auto-Completion with Codium
Here is how to install the extension on Chrome (details here):
- Install the extension.
- Sign in to Codeium using an e-mail or Google.
- If it works, you should see the Codeium extension turn green.
- To have it work on Windmill, add it to your Codeium allowlist:
- Click on Codeium extension icon.
Open Options Page.
- In the Allowlist, write
https:\/\/app\.windmill\.dev\/.*(or your domain, if self-hosting).
Now you're good to have Codeium suggest code in Windmill's code editor (scripts, flows, apps).
The code will auto-suggest, and if you like it, press on
tab to accept.
You can help it by giving proper functions names:
Or by writing comments:
Please note that the code suggested by Codeidum is not specific to Windmill and therefore does not necessarily meet its requirements (exposing a main function and declaring dependencies in the same file).