n8n-nodes-rooyai-model 1.0.22 → 1.0.25

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.
@@ -1,8 +1,39 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
2
35
  Object.defineProperty(exports, "__esModule", { value: true });
3
36
  exports.RooyaiChatModel = void 0;
4
- const openai_1 = require("@langchain/openai");
5
- const ROOYAI_TOKEN = '12345678';
6
37
  class RooyaiChatModel {
7
38
  constructor() {
8
39
  this.description = {
@@ -72,7 +103,10 @@ class RooyaiChatModel {
72
103
  const credentials = await this.getCredentials('rooyaiApi');
73
104
  const modelName = this.getNodeParameter('model', itemIndex);
74
105
  const options = this.getNodeParameter('options', itemIndex, {});
75
- const model = new openai_1.ChatOpenAI({
106
+ // استخدم ChatOpenAI اللي موجودة في n8n نفسه
107
+ // @ts-ignore - n8n توفر ده عند runtime
108
+ const { ChatOpenAI } = await Promise.resolve().then(() => __importStar(require('langchain/chat_models/openai')));
109
+ const model = new ChatOpenAI({
76
110
  openAIApiKey: credentials.apiKey,
77
111
  modelName: modelName,
78
112
  temperature: options.temperature ?? 0.7,
@@ -80,7 +114,7 @@ class RooyaiChatModel {
80
114
  configuration: {
81
115
  baseURL: 'http://35.226.94.120:3000/v1',
82
116
  defaultHeaders: {
83
- 'x-rooyai-token': ROOYAI_TOKEN,
117
+ 'x-rooyai-token': '12345678',
84
118
  'x-rooyai-provider': credentials.providerType,
85
119
  },
86
120
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-rooyai-model",
3
- "version": "1.0.22",
3
+ "version": "1.0.25",
4
4
  "description": "Rooyai AI Model Integration for n8n",
5
5
  "keywords": [
6
6
  "n8n-community-node-package"
@@ -25,12 +25,6 @@
25
25
  ],
26
26
  "devDependencies": {
27
27
  "n8n-workflow": "^1.120.4",
28
- "typescript": "^5.0.0",
29
- "@langchain/core": "*",
30
- "@langchain/openai": "*"
31
- },
32
- "peerDependencies": {
33
- "@langchain/core": "*",
34
- "@langchain/openai": "*"
28
+ "typescript": "^5.0.0"
35
29
  }
36
30
  }