From edb5499caf0e1981e0ea2c546898a74f3d41b643 Mon Sep 17 00:00:00 2001 From: Maciej Lebiest Date: Mon, 9 Jun 2025 17:44:57 +0200 Subject: [PATCH] initial version --- openai-config.html | 31 +++++++++++++++++++++++++++++++ openai-config.js | 12 ++++++++++++ package.json | 22 ++++++++++++++++++++++ 3 files changed, 65 insertions(+) create mode 100644 openai-config.html create mode 100644 openai-config.js create mode 100644 package.json 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": {} +}