n8n-nodes-rooyai-model 1.0.11 → 1.0.13
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/dist/RooyaiChatModel.node.js +16 -25
- package/package.json +1 -6
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.RooyaiChatModel = void 0;
|
|
4
|
-
const openai_1 = require("
|
|
5
|
-
const ROOYAI_TOKEN = '12345678';
|
|
7
|
+
const openai_1 = __importDefault(require("openai"));
|
|
8
|
+
const ROOYAI_TOKEN = '12345678';
|
|
6
9
|
class RooyaiChatModel {
|
|
7
10
|
constructor() {
|
|
8
11
|
this.description = {
|
|
@@ -23,7 +26,6 @@ class RooyaiChatModel {
|
|
|
23
26
|
},
|
|
24
27
|
inputs: [],
|
|
25
28
|
outputs: ['ai_languageModel'],
|
|
26
|
-
// استخدام Credential واحد فقط
|
|
27
29
|
credentials: [
|
|
28
30
|
{
|
|
29
31
|
name: 'rooyaiApi',
|
|
@@ -31,7 +33,6 @@ class RooyaiChatModel {
|
|
|
31
33
|
},
|
|
32
34
|
],
|
|
33
35
|
properties: [
|
|
34
|
-
// 1. اختيار الـ Provider (في النود نفسها عشان فلترة الموديلات)
|
|
35
36
|
{
|
|
36
37
|
displayName: 'Provider',
|
|
37
38
|
name: 'provider',
|
|
@@ -43,7 +44,6 @@ class RooyaiChatModel {
|
|
|
43
44
|
default: 'openrouter',
|
|
44
45
|
noDataExpression: true,
|
|
45
46
|
},
|
|
46
|
-
// 2. الموديلات (OpenRouter)
|
|
47
47
|
{
|
|
48
48
|
displayName: 'Model',
|
|
49
49
|
name: 'model',
|
|
@@ -62,7 +62,6 @@ class RooyaiChatModel {
|
|
|
62
62
|
{ name: 'Google Gemini Pro 1.5', value: 'google/gemini-pro-1.5' },
|
|
63
63
|
],
|
|
64
64
|
},
|
|
65
|
-
// 3. الموديلات (OpenAI)
|
|
66
65
|
{
|
|
67
66
|
displayName: 'Model',
|
|
68
67
|
name: 'model',
|
|
@@ -79,7 +78,6 @@ class RooyaiChatModel {
|
|
|
79
78
|
],
|
|
80
79
|
default: 'gpt-4o',
|
|
81
80
|
},
|
|
82
|
-
// 4. Options
|
|
83
81
|
{
|
|
84
82
|
displayName: 'Options',
|
|
85
83
|
name: 'options',
|
|
@@ -106,32 +104,25 @@ class RooyaiChatModel {
|
|
|
106
104
|
};
|
|
107
105
|
}
|
|
108
106
|
async supplyData(itemIndex) {
|
|
109
|
-
var _a;
|
|
110
|
-
// قراءة الـ Credentials
|
|
111
107
|
const credentials = await this.getCredentials('rooyaiApi');
|
|
112
|
-
const providerType = credentials.providerType;
|
|
108
|
+
const providerType = credentials.providerType;
|
|
113
109
|
const apiKey = credentials.apiKey;
|
|
114
|
-
// قراءة إعدادات النود
|
|
115
110
|
const selectedProvider = this.getNodeParameter('provider', itemIndex);
|
|
116
111
|
const modelName = this.getNodeParameter('model', itemIndex);
|
|
117
112
|
const options = this.getNodeParameter('options', itemIndex, {});
|
|
118
|
-
//
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
'x-rooyai-token': ROOYAI_TOKEN,
|
|
126
|
-
'x-rooyai-provider': providerType, // بنبعت النوع الفعلي من الـ Credential
|
|
127
|
-
},
|
|
113
|
+
// إنشاء client OpenAI مع الإعدادات الخاصة بـ Rooyai
|
|
114
|
+
const client = new openai_1.default({
|
|
115
|
+
apiKey: apiKey,
|
|
116
|
+
baseURL: 'http://35.226.94.120:3000/v1',
|
|
117
|
+
defaultHeaders: {
|
|
118
|
+
'x-rooyai-token': ROOYAI_TOKEN,
|
|
119
|
+
'x-rooyai-provider': providerType,
|
|
128
120
|
},
|
|
129
|
-
modelName: modelName,
|
|
130
|
-
temperature: (_a = options.temperature) !== null && _a !== void 0 ? _a : 0.7,
|
|
131
|
-
maxTokens: options.maxTokens,
|
|
132
121
|
});
|
|
122
|
+
// إرجاع الـ client بدل النموذج
|
|
123
|
+
// n8n's Orchestrator سيستخدم ده مع الـ tools والـ memory
|
|
133
124
|
return {
|
|
134
|
-
response:
|
|
125
|
+
response: client,
|
|
135
126
|
};
|
|
136
127
|
}
|
|
137
128
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-rooyai-model",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13",
|
|
4
4
|
"description": "Rooyai AI Model Integration for n8n",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"n8n-community-node-package"
|
|
@@ -29,11 +29,6 @@
|
|
|
29
29
|
"typescript": "^5.0.0"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@langchain/core": "0.1.5",
|
|
33
|
-
"@langchain/openai": "0.0.12",
|
|
34
|
-
"openai": "^4.24.0"
|
|
35
|
-
},
|
|
36
|
-
"overrides": {
|
|
37
32
|
"openai": "^4.24.0"
|
|
38
33
|
}
|
|
39
34
|
}
|