n8n-nodes-openrouter-selector 0.3.0 → 0.4.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.
@@ -0,0 +1,17 @@
1
+ /**
2
+ * OpenRouter Chat Tool Class
3
+ *
4
+ * DynamicStructuredTool wrapper for AI Agent integration.
5
+ */
6
+ import { DynamicStructuredTool } from '@langchain/core/tools';
7
+ export interface OpenRouterChatToolConfig {
8
+ apiKey: string;
9
+ model: string;
10
+ toolName: string;
11
+ toolDescription: string;
12
+ systemPrompt?: string;
13
+ temperature?: number;
14
+ maxTokens?: number;
15
+ }
16
+ export declare function createOpenRouterChatTool(config: OpenRouterChatToolConfig): DynamicStructuredTool;
17
+ //# sourceMappingURL=OpenRouterChatTool.class.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpenRouterChatTool.class.d.ts","sourceRoot":"","sources":["../../../nodes/OpenRouterChatTool/OpenRouterChatTool.class.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAG9D,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAkBD,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,wBAAwB,GAAG,qBAAqB,CAwDhG"}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ /**
3
+ * OpenRouter Chat Tool Class
4
+ *
5
+ * DynamicStructuredTool wrapper for AI Agent integration.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.createOpenRouterChatTool = createOpenRouterChatTool;
9
+ const tools_1 = require("@langchain/core/tools");
10
+ const zod_1 = require("zod");
11
+ function createOpenRouterChatTool(config) {
12
+ return new tools_1.DynamicStructuredTool({
13
+ name: config.toolName,
14
+ description: config.toolDescription,
15
+ schema: zod_1.z.object({
16
+ prompt: zod_1.z.string().describe('The question or prompt to send to the LLM'),
17
+ context: zod_1.z.string().optional().describe('Optional context for the query'),
18
+ }),
19
+ func: async ({ prompt, context }) => {
20
+ const messages = [];
21
+ if (config.systemPrompt) {
22
+ messages.push({ role: 'system', content: config.systemPrompt });
23
+ }
24
+ if (context) {
25
+ messages.push({ role: 'user', content: `Context: ${context}` });
26
+ }
27
+ messages.push({ role: 'user', content: prompt });
28
+ let response;
29
+ try {
30
+ response = await fetch('https://openrouter.ai/api/v1/chat/completions', {
31
+ method: 'POST',
32
+ headers: {
33
+ 'Authorization': `Bearer ${config.apiKey}`,
34
+ 'Content-Type': 'application/json',
35
+ 'HTTP-Referer': 'https://n8n.io',
36
+ 'X-Title': 'n8n OpenRouter Chat Tool',
37
+ },
38
+ body: JSON.stringify({
39
+ model: config.model,
40
+ messages,
41
+ temperature: config.temperature ?? 0.7,
42
+ max_tokens: config.maxTokens ?? 1000,
43
+ }),
44
+ });
45
+ }
46
+ catch (networkError) {
47
+ throw new Error(`Network error calling OpenRouter: ${networkError.message}`);
48
+ }
49
+ if (!response.ok) {
50
+ const error = await response.json().catch(() => ({}));
51
+ throw new Error(`OpenRouter API Error: ${response.status} - ${error.error?.message || response.statusText}`);
52
+ }
53
+ const data = await response.json();
54
+ if (data.error) {
55
+ throw new Error(`OpenRouter Error: ${data.error.message}`);
56
+ }
57
+ return data.choices[0]?.message?.content ?? '';
58
+ },
59
+ });
60
+ }
61
+ //# sourceMappingURL=OpenRouterChatTool.class.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpenRouterChatTool.class.js","sourceRoot":"","sources":["../../../nodes/OpenRouterChatTool/OpenRouterChatTool.class.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AA+BH,4DAwDC;AArF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AS,CAAC;wBACnB,KAAK,EAAE,MAAM,CAAC,KAAK;wBACnB,QAAQ;wBACR,WAAW,EAAE,MAAM,CAAC,WAAW,IAAI,GAAG;wBACtC,UAAU,EAAE,MAAM,CAAC,SAAS,IAAI,IAAI;qBACrC,CAAC;iBACH,CAAC,CAAC;YACL,CAAC;YAAC,OAAO,YAAY,EAAE,CAAC;gBACtB,MAAM,IAAI,KAAK,CAAC,qCAAsC,YAAsB,CAAC,OAAO,EAAE,CAAC,CAAC;YAC1F,CAAC;YAED,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;gBACjB,MAAM,KAAK,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAqC,CAAC;gBAC1F,MAAM,IAAI,KAAK,CAAC,yBAAyB,QAAQ,CAAC,MAAM,MAAM,KAAK,CAAC,KAAK,EAAE,OAAO,IAAI,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;YAC/G,CAAC;YAED,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAA4B,CAAC;YAE7D,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,qBAAqB,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YAC7D,CAAC;YAED,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,IAAI,EAAE,CAAC;QACjD,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * OpenRouter Chat Tool Node
3
+ *
4
+ * AI Tool node for n8n AI Agent integration.
5
+ */
6
+ import type { INodeType, INodeTypeDescription, ISupplyDataFunctions, SupplyData, ILoadOptionsFunctions, INodePropertyOptions } from 'n8n-workflow';
7
+ export declare class OpenRouterChatTool implements INodeType {
8
+ description: INodeTypeDescription;
9
+ methods: {
10
+ loadOptions: {
11
+ getModels(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
12
+ };
13
+ };
14
+ supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData>;
15
+ }
16
+ //# sourceMappingURL=OpenRouterChatTool.node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpenRouterChatTool.node.d.ts","sourceRoot":"","sources":["../../../nodes/OpenRouterChatTool/OpenRouterChatTool.node.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,SAAS,EACT,oBAAoB,EACpB,oBAAoB,EACpB,UAAU,EACV,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,cAAc,CAAC;AAKtB,qBAAa,kBAAmB,YAAW,SAAS;IAClD,WAAW,EAAE,oBAAoB,CAmF/B;IAEF,OAAO;;4BAEmB,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;;MAqC/E;IAEI,UAAU,CAAC,IAAI,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;CAwBrF"}
@@ -0,0 +1,145 @@
1
+ "use strict";
2
+ /**
3
+ * OpenRouter Chat Tool Node
4
+ *
5
+ * AI Tool node for n8n AI Agent integration.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.OpenRouterChatTool = void 0;
9
+ const n8n_workflow_1 = require("n8n-workflow");
10
+ const OpenRouterChatTool_class_1 = require("./OpenRouterChatTool.class");
11
+ class OpenRouterChatTool {
12
+ description = {
13
+ displayName: 'OpenRouter Chat Tool',
14
+ name: 'openRouterChatTool',
15
+ icon: 'file:openrouter-tool.svg',
16
+ group: ['transform'],
17
+ version: 1,
18
+ description: 'Chat tool for AI Agents using OpenRouter models',
19
+ defaults: { name: 'OpenRouter Chat Tool' },
20
+ codex: {
21
+ categories: ['AI'],
22
+ subcategories: { AI: ['Tools'] },
23
+ resources: {
24
+ primaryDocumentation: [{ url: 'https://github.com/ecolights/n8n-nodes-openrouter-selector' }],
25
+ },
26
+ },
27
+ inputs: [],
28
+ outputs: [n8n_workflow_1.NodeConnectionTypes.AiTool],
29
+ outputNames: ['Tool'],
30
+ credentials: [
31
+ { name: 'openRouterApi', required: true },
32
+ ],
33
+ properties: [
34
+ {
35
+ displayName: 'Tool Name',
36
+ name: 'toolName',
37
+ type: 'string',
38
+ default: 'openrouter_chat',
39
+ description: 'Name of the tool (used by agent to call it)',
40
+ },
41
+ {
42
+ displayName: 'Tool Description',
43
+ name: 'toolDescription',
44
+ type: 'string',
45
+ typeOptions: { rows: 3 },
46
+ default: 'Use this tool to ask questions to a powerful AI model. Provide a clear prompt and optionally context.',
47
+ description: 'Description shown to the agent - helps it decide when to use this tool',
48
+ },
49
+ {
50
+ displayName: 'Model',
51
+ name: 'model',
52
+ type: 'options',
53
+ default: 'anthropic/claude-3.5-sonnet',
54
+ typeOptions: { loadOptionsMethod: 'getModels' },
55
+ description: 'The OpenRouter model to use for chat completions',
56
+ },
57
+ {
58
+ displayName: 'System Prompt',
59
+ name: 'systemPrompt',
60
+ type: 'string',
61
+ typeOptions: { rows: 4 },
62
+ default: '',
63
+ description: 'Optional system prompt to set the behavior of the model',
64
+ },
65
+ {
66
+ displayName: 'Options',
67
+ name: 'options',
68
+ type: 'collection',
69
+ placeholder: 'Add Option',
70
+ default: {},
71
+ options: [
72
+ {
73
+ displayName: 'Temperature',
74
+ name: 'temperature',
75
+ type: 'number',
76
+ typeOptions: { minValue: 0, maxValue: 2, numberPrecision: 1 },
77
+ default: 0.7,
78
+ description: 'Controls randomness. Lower = more focused, higher = more creative.',
79
+ },
80
+ {
81
+ displayName: 'Max Tokens',
82
+ name: 'maxTokens',
83
+ type: 'number',
84
+ typeOptions: { minValue: 1, maxValue: 128000 },
85
+ default: 1000,
86
+ description: 'Maximum number of tokens in the response',
87
+ },
88
+ ],
89
+ },
90
+ ],
91
+ };
92
+ methods = {
93
+ loadOptions: {
94
+ async getModels() {
95
+ const credentials = await this.getCredentials('openRouterApi');
96
+ try {
97
+ const response = await this.helpers.httpRequest({
98
+ method: 'GET',
99
+ url: 'https://openrouter.ai/api/v1/models',
100
+ headers: { Authorization: `Bearer ${credentials.apiKey}` },
101
+ });
102
+ const models = response.data;
103
+ return models
104
+ .filter((m) => m.id && !m.id.includes(':free'))
105
+ .map((m) => ({
106
+ name: m.name || m.id,
107
+ value: m.id,
108
+ description: m.context_length ? `Context: ${m.context_length.toLocaleString()}` : undefined,
109
+ }))
110
+ .sort((a, b) => a.name.localeCompare(b.name));
111
+ }
112
+ catch {
113
+ return [
114
+ { name: 'Claude 3.5 Sonnet', value: 'anthropic/claude-3.5-sonnet' },
115
+ { name: 'Claude 3 Opus', value: 'anthropic/claude-3-opus' },
116
+ { name: 'GPT-4o', value: 'openai/gpt-4o' },
117
+ { name: 'GPT-4 Turbo', value: 'openai/gpt-4-turbo' },
118
+ { name: 'Llama 3.1 70B', value: 'meta-llama/llama-3.1-70b-instruct' },
119
+ { name: 'Gemini Pro 1.5', value: 'google/gemini-pro-1.5' },
120
+ ];
121
+ }
122
+ },
123
+ },
124
+ };
125
+ async supplyData(itemIndex) {
126
+ const credentials = await this.getCredentials('openRouterApi');
127
+ const toolName = this.getNodeParameter('toolName', itemIndex);
128
+ const toolDescription = this.getNodeParameter('toolDescription', itemIndex);
129
+ const model = this.getNodeParameter('model', itemIndex);
130
+ const systemPrompt = this.getNodeParameter('systemPrompt', itemIndex);
131
+ const options = this.getNodeParameter('options', itemIndex, {});
132
+ const tool = (0, OpenRouterChatTool_class_1.createOpenRouterChatTool)({
133
+ apiKey: credentials.apiKey,
134
+ model,
135
+ toolName,
136
+ toolDescription,
137
+ systemPrompt: systemPrompt || undefined,
138
+ temperature: options.temperature,
139
+ maxTokens: options.maxTokens,
140
+ });
141
+ return { response: tool };
142
+ }
143
+ }
144
+ exports.OpenRouterChatTool = OpenRouterChatTool;
145
+ //# sourceMappingURL=OpenRouterChatTool.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpenRouterChatTool.node.js","sourceRoot":"","sources":["../../../nodes/OpenRouterChatTool/OpenRouterChatTool.node.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAUH,+CAAmD;AAEnD,yEAAsE;AAEtE,MAAa,kBAAkB;IAC7B,WAAW,GAAyB;QAClC,WAAW,EAAE,sBAAsB;QACnC,IAAI,EAAE,oBAAoB;QAC1B,IAAI,EAAE,0BAA0B;QAChC,KAAK,EAAE,CAAC,WAAW,CAAC;QACpB,OAAO,EAAE,CAAC;QACV,WAAW,EAAE,iDAAiD;QAC9D,QAAQ,EAAE,EAAE,IAAI,EAAE,sBAAsB,EAAE;QAE1C,KAAK,EAAE;YACL,UAAU,EAAE,CAAC,IAAI,CAAC;YAClB,aAAa,EAAE,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE;YAChC,SAAS,EAAE;gBACT,oBAAoB,EAAE,CAAC,EAAE,GAAG,EAAE,4DAA4D,EAAE,CAAC;aAC9F;SACF;QAED,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,CAAC,kCAAmB,CAAC,MAAM,CAAC;QACrC,WAAW,EAAE,CAAC,MAAM,CAAC;QAErB,WAAW,EAAE;YACX,EAAE,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,IAAI,EAAE;SAC1C;QAED,UAAU,EAAE;YACV;gBACE,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,iBAAiB;gBAC1B,WAAW,EAAE,6CAA6C;aAC3D;YACD;gBACE,WAAW,EAAE,kBAAkB;gBAC/B,IAAI,EAAE,iBAAiB;gBACvB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;gBACxB,OAAO,EAAE,uGAAuG;gBAChH,WAAW,EAAE,wEAAwE;aACtF;YACD;gBACE,WAAW,EAAE,OAAO;gBACpB,IAAI,EAAE,OAAO;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UAAU,CAA6B,SAAiB;QAC5D,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;QAE/D,MAAM,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAC,UAAU,EAAE,SAAS,CAAW,CAAC;QACxE,MAAM,eAAe,GAAG,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,SAAS,CAAW,CAAC;QACtF,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,SAAS,CAAW,CAAC;QAClE,MAAM,YAAY,GAAG,IAAI,CAAC,gBAAgB,CAAC,cAAc,EAAE,SAAS,CAAW,CAAC;QAChF,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE,CAG7D,CAAC;QAEF,MAAM,IAAI,GAAG,IAAA,mDAAwB,EAAC;YACpC,MAAM,EAAE,WAAW,CAAC,MAAgB;YACpC,KAAK;YACL,QAAQ;YACR,eAAe;YACf,YAAY,EAAE,YAAY,IAAI,SAAS;YACvC,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,SAAS,EAAE,OAAO,CAAC,SAAS;SAC7B,CAAC,CAAC;QAEH,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC5B,CAAC;CACF;AAvJD,gDAuJC"}
@@ -0,0 +1,17 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 60">
2
+ <rect width="60" height="60" rx="12" fill="#8b5cf6"/>
3
+ <!-- Chat bubble -->
4
+ <path d="M10 14h22c1.5 0 2.5 1 2.5 2.5v10c0 1.5-1 2.5-2.5 2.5H18l-4 3.5v-3.5h-4c-1.5 0-2.5-1-2.5-2.5v-10c0-1.5 1-2.5 2.5-2.5z" fill="white"/>
5
+ <!-- Dots in bubble -->
6
+ <circle cx="16" cy="22" r="1.5" fill="#8b5cf6"/>
7
+ <circle cx="21" cy="22" r="1.5" fill="#6366f1"/>
8
+ <circle cx="26" cy="22" r="1.5" fill="#ec4899"/>
9
+ <!-- Wrench tool -->
10
+ <g transform="translate(32, 28) rotate(-45)">
11
+ <rect x="0" y="4" width="20" height="6" rx="1" fill="white"/>
12
+ <path d="M-2 4l4-3v3h-4z" fill="white"/>
13
+ <path d="M-2 10l4 3v-3h-4z" fill="white"/>
14
+ <circle cx="16" cy="7" r="5" fill="white" stroke="#8b5cf6" stroke-width="2"/>
15
+ <circle cx="16" cy="7" r="2" fill="#8b5cf6"/>
16
+ </g>
17
+ </svg>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-openrouter-selector",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "n8n community node for intelligent OpenRouter model selection based on task, budget, and benchmarks",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",
@@ -9,7 +9,8 @@
9
9
  "model-selection",
10
10
  "ai",
11
11
  "benchmark",
12
- "embeddings"
12
+ "embeddings",
13
+ "ai-tools"
13
14
  ],
14
15
  "license": "MIT",
15
16
  "homepage": "https://github.com/ecolights/n8n-nodes-openrouter-selector",
@@ -42,11 +43,13 @@
42
43
  "dist/nodes/OpenRouterModelSelector/OpenRouterModelSelector.node.js",
43
44
  "dist/nodes/OpenRouterChatCompletion/OpenRouterChatCompletion.node.js",
44
45
  "dist/nodes/OpenRouterSmartChat/OpenRouterSmartChat.node.js",
45
- "dist/nodes/OpenRouterSmartEmbedding/OpenRouterSmartEmbedding.node.js"
46
+ "dist/nodes/OpenRouterSmartEmbedding/OpenRouterSmartEmbedding.node.js",
47
+ "dist/nodes/OpenRouterChatTool/OpenRouterChatTool.node.js"
46
48
  ]
47
49
  },
48
50
  "dependencies": {
49
- "@langchain/core": "^0.3.0"
51
+ "@langchain/core": "^0.3.0",
52
+ "zod": "^3.23.0"
50
53
  },
51
54
  "devDependencies": {
52
55
  "@types/node": "^20.10.0",