@inductiv/node-red-openai-api 0.7.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -62
- package/examples/assistants.json +156 -189
- package/examples/chat.json +5 -3
- package/examples/embeddings.json +9 -2
- package/examples/fine-tuning.json +3 -1
- package/examples/messages.json +4 -2
- package/examples/models.json +3 -1
- package/examples/threads.json +3 -1
- package/lib.js +411 -656
- package/locales/de-DE/node.json +20 -2
- package/locales/en-US/node.json +18 -1
- package/locales/ja/node.json +18 -3
- package/locales/zh-CN/node.json +20 -2
- package/node.html +1141 -171
- package/node.js +9 -4
- package/package.json +22 -15
package/node.js
CHANGED
|
@@ -11,7 +11,15 @@ module.exports = function (RED) {
|
|
|
11
11
|
node.config = config;
|
|
12
12
|
|
|
13
13
|
node.on("input", function (msg) {
|
|
14
|
-
let
|
|
14
|
+
let clientApiKey = node.service.credentials.secureApiKeyValue || "";
|
|
15
|
+
let clientApiBase = node.service.apiBase;
|
|
16
|
+
let clientOrganization = node.service.organizationId;
|
|
17
|
+
|
|
18
|
+
let client = new lib.OpenaiApi(
|
|
19
|
+
clientApiKey,
|
|
20
|
+
clientApiBase,
|
|
21
|
+
clientOrganization,
|
|
22
|
+
);
|
|
15
23
|
let payload;
|
|
16
24
|
|
|
17
25
|
const propertyType = node.config.propertyType || "msg";
|
|
@@ -26,9 +34,6 @@ module.exports = function (RED) {
|
|
|
26
34
|
|
|
27
35
|
const serviceName = node.config.method; // Set the service name to call.
|
|
28
36
|
let serviceParametersObject = {
|
|
29
|
-
organization: node.service.organizationId,
|
|
30
|
-
apiBase: node.service.apiBase,
|
|
31
|
-
apiKey: node.service.credentials.secureApiKeyValue || "",
|
|
32
37
|
_node: node,
|
|
33
38
|
msg: msg,
|
|
34
39
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inductiv/node-red-openai-api",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Enhance your Node-RED flows with advanced AI capabilities. This package offers seamless integration with OpenAI's latest Assistants v2 API, including support for batch requests and vector store features, ensuring robust AIoT solutions with improved usability and stability.",
|
|
5
5
|
"main": "node.js",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=12.0.0"
|
|
@@ -13,21 +13,28 @@
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"keywords": [
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
16
|
+
"Node-RED",
|
|
17
|
+
"AIoT",
|
|
18
|
+
"OpenAI",
|
|
19
|
+
"AI",
|
|
20
|
+
"OpenAI API",
|
|
21
|
+
"Assistants v2",
|
|
22
|
+
"batch requests",
|
|
23
|
+
"vector store",
|
|
24
|
+
"IoT",
|
|
25
|
+
"node-red-contrib",
|
|
26
|
+
"Automation",
|
|
27
|
+
"smart devices",
|
|
28
|
+
"node-red-node",
|
|
29
|
+
"artificial intelligence",
|
|
30
|
+
"API integration",
|
|
31
|
+
"LLM",
|
|
32
|
+
"SLM",
|
|
33
|
+
"AI Agent",
|
|
34
|
+
"Low-code"
|
|
28
35
|
],
|
|
29
36
|
"dependencies": {
|
|
30
|
-
"openai": "^4.
|
|
37
|
+
"openai": "^4.38.5"
|
|
31
38
|
},
|
|
32
39
|
"devDependencies": {
|
|
33
40
|
"eslint": "^8.54.0",
|