Hi everyone, Im pleased to introduce my open-source OpenAI plugin. Build Flows, generate explainers, and create specifications within Node-RED!
This is an early release, I have lots planned, and will publish a roadmap, github and issues soon, for now you can load the plugin via npm.
https://www.npmjs.com/package/@thingcode/node-red-plugin-openai
To deploy this project run in your Node-RED folder.
npm i @thingcode/node-red-plugin-openai
Append to your package.json
"node-red": {
"plugins": {
"openai": "plugin.js"
}
}
Once the plugin is loaded, you'll have a new tab in the Sidebar called OpenAi.
Click the gear icon to add your OpenAi API Token (Note, currently this is stored unencrypted in .config.runtime.json)
You'll now see two new panels, one called Build and one called Explainers.
Using Build you can describe a flow, function, configured switch node etc. e.g.
a function node, to make a string lowercase connected to an inject and debug node
a switch node, with outputs for payload Foo, Bar, Baz
5 mqtt nodes with topics, mqtt/foo1, mqtt/foo2 etc
Click build, the plugin will then generate the Nodes needed and will after a short wait make them available for you to place in a flow, on the same way as Import Flows.
Using Explainers you can generate text explainers and specifications within the editor. Choose a single Flow, All Flows or a Selected Node, click the explainer, a side panel will open and the text will be streamed to a tab. You can stop, reload, close and open the explainer tab as needed.
Notes.
Beta release, backup your flows before using.
Your flow file is sent to the OpenAi API's.
Your OpenAi API Token is currently stored unencrypted in .config.runtime.json
Sometimes the response from OpenAi will be broken, currently implementing function calling to reduce this. Usually a retry or small change to your prompt will improve the response.
Project will be open-source on GitHub soon.
Get creative, excited to talk more!
Max