We’re rolling out a fresh feature for the Code piece that you’re sure to love – AI-powered code generation.
Craft Code with AI Assistance
Forget the hassle of writing scripts from scratch. Just tell the AI what you want to do in plain language, and watch as it writes the code for your flow’s Code piece.
Simple Steps to Get Started:
Open your Code piece configuration.
Click Generate
Describe the task you need code for.
Let the AI generate the script for you.
Review, tweak if needed, and implement!
This feature is available for cloud users out of the box, while self-hosters need to define the AP_OPENAI_API_KEY environment variable to get it working.
With this new addition, turning your automation ideas into reality just got a whole lot smoother. Dive in and give it a whirl!
Hello, this is great addition to a wonderful application. Quick question… Which version for self hosted is this implemented? I have the latest which is 16.0 but I do not have the button. Is there something more that is needed to be done for self hosted? I also do not have the ability to add my OpenAi info…
@MoShizzle great feature! The only issue that I’ve found so far is it’s using the require syntax rather than the import when using external modules.
It’s open source for sure but we’re still haven’t decided on which plans it will be included on the cloud, we’ll focus on making sure the feature is useful then see how we’ll price it (especially that there is the OpenAI cost).
Do you think you’re willing to add your OpenAI API key to run the feature?
I think users should add there own key to us it so the cost will not be on AP… Or give a limit of 100 or so uses per month…
Also it would be nice to offer the prompt given so if a user doesn’t have a key they can try it out themselves with any other chat interface.
So far I am having a nice time playing around with the ai code and it seems to work nicely
Thank you for all the input. We’ll discuss it and see where we take it.
@David_M While I don’t know the prompt right now, we’re open source and the prompt is in the code Feel free to find and publish it on the community if no one else does it.
You are absolutely right! One of the aspects I truly appreciate about open source is the ability to observe and, hopefully, make improvements that benefit all users. Keep up the amazing work.
How do I add my OpenAI API key? I’m running on localhost. Not sure where “environment variables” are but I’ve already connected my API to the ChatGPT feature.
@Cole_Don_Media You need to modify your .env file in the root dir… just add [quote=“MoShizzle, post:1, topic:2534”]
AP_OPENAI_API_KEY
[/quote]
Then = (equal sign) the your openai api key.
Example - AP_OPENAI_API_KEY= ENTER-YOUR-OPENAI-API
Restart activepieces from command line… then you will see “Generate button” unlocked.
Hope this helps
Side note - I just thought about… have not tried, but will later when I’m back home, but will Gemini api work here as well? I know openai is a bit better in how it formats, etc…. Just curious if anyone has tried yet…