diff --git a/openai-config.html b/openai-config.html new file mode 100644 index 0000000..e190873 --- /dev/null +++ b/openai-config.html @@ -0,0 +1,31 @@ + + + diff --git a/openai-config.js b/openai-config.js new file mode 100644 index 0000000..5f2577f --- /dev/null +++ b/openai-config.js @@ -0,0 +1,12 @@ +module.exports = function(RED) { + function OpenAIConfigNode(config) { + RED.nodes.createNode(this, config); + this.apiUrl = config.apiUrl; + this.apiToken = config.apiToken; + } + RED.nodes.registerType("openai-config", OpenAIConfigNode, { + credentials: { + apiToken: { type: "password" } + } + }); +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..574cf8c --- /dev/null +++ b/package.json @@ -0,0 +1,22 @@ +{ + "name": "node-red-contrib-openai-config", + "version": "1.0.0", + "description": "A configuration node for OpenAI-like API URL and token", + "main": "openai-config.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [ + "node-red", + "openai", + "config" + ], + "author": "Your Name", + "license": "MIT", + "node-red": { + "nodes": { + "openai-config": "openai-config.js" + } + }, + "dependencies": {} +}