n8n-nodes-vercel-ai-sdk-universal-temp 0.1.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.
Files changed (42) hide show
  1. package/LICENSE.md +19 -0
  2. package/README.md +74 -0
  3. package/dist/credentials/DeepSeekApi.credentials.d.ts +9 -0
  4. package/dist/credentials/DeepSeekApi.credentials.js +37 -0
  5. package/dist/credentials/DeepSeekApi.credentials.js.map +1 -0
  6. package/dist/credentials/GoogleGenerativeAIApi.credentials.d.ts +9 -0
  7. package/dist/credentials/GoogleGenerativeAIApi.credentials.js +37 -0
  8. package/dist/credentials/GoogleGenerativeAIApi.credentials.js.map +1 -0
  9. package/dist/credentials/GroqApi.credentials.d.ts +9 -0
  10. package/dist/credentials/GroqApi.credentials.js +37 -0
  11. package/dist/credentials/GroqApi.credentials.js.map +1 -0
  12. package/dist/credentials/OpenRouterApi.credentials.d.ts +9 -0
  13. package/dist/credentials/OpenRouterApi.credentials.js +37 -0
  14. package/dist/credentials/OpenRouterApi.credentials.js.map +1 -0
  15. package/dist/nodes/DeepSeek/DeepSeek.node.d.ts +10 -0
  16. package/dist/nodes/DeepSeek/DeepSeek.node.js +574 -0
  17. package/dist/nodes/DeepSeek/DeepSeek.node.js.map +1 -0
  18. package/dist/nodes/DeepSeek/icons/deepseek.svg +1 -0
  19. package/dist/nodes/GoogleGenerativeAI/GoogleGenerativeAI.node.d.ts +10 -0
  20. package/dist/nodes/GoogleGenerativeAI/GoogleGenerativeAI.node.js +845 -0
  21. package/dist/nodes/GoogleGenerativeAI/GoogleGenerativeAI.node.js.map +1 -0
  22. package/dist/nodes/GoogleGenerativeAI/icons/GoogleGenerativeAI.svg +1 -0
  23. package/dist/nodes/Groq/Groq.node.d.ts +10 -0
  24. package/dist/nodes/Groq/Groq.node.js +552 -0
  25. package/dist/nodes/Groq/Groq.node.js.map +1 -0
  26. package/dist/nodes/Groq/icons/groq.svg +1 -0
  27. package/dist/nodes/UniversalAI/UniversalAI.node.d.ts +10 -0
  28. package/dist/nodes/UniversalAI/UniversalAI.node.js +1273 -0
  29. package/dist/nodes/UniversalAI/UniversalAI.node.js.map +1 -0
  30. package/dist/nodes/UniversalAI/icons/UniversalAI.svg +4 -0
  31. package/dist/nodes/UniversalEmbedding/UniversalEmbedding.node.d.ts +10 -0
  32. package/dist/nodes/UniversalEmbedding/UniversalEmbedding.node.js +332 -0
  33. package/dist/nodes/UniversalEmbedding/UniversalEmbedding.node.js.map +1 -0
  34. package/dist/nodes/UniversalEmbedding/icons/UniversalEmbedding.svg +11 -0
  35. package/dist/nodes/UniversalImageGen/UniversalImageGen.node.d.ts +10 -0
  36. package/dist/nodes/UniversalImageGen/UniversalImageGen.node.js +359 -0
  37. package/dist/nodes/UniversalImageGen/UniversalImageGen.node.js.map +1 -0
  38. package/dist/nodes/UniversalImageGen/icons/UniversalImageGen.svg +5 -0
  39. package/dist/package.json +66 -0
  40. package/dist/tsconfig.tsbuildinfo +1 -0
  41. package/index.js +0 -0
  42. package/package.json +64 -0
package/LICENSE.md ADDED
@@ -0,0 +1,19 @@
1
+ Copyright 2022 n8n
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
4
+ this software and associated documentation files (the "Software"), to deal in
5
+ the Software without restriction, including without limitation the rights to
6
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
7
+ of the Software, and to permit persons to whom the Software is furnished to do
8
+ so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,74 @@
1
+ # n8n-nodes-vercel-ai-sdk-universal
2
+
3
+ Community nodes for [n8n](https://n8n.io/) that expose a single set of **Universal** building blocks powered by the [Vercel AI SDK](https://ai-sdk.dev/). Use one node to talk to multiple model providers, plus dedicated nodes for embeddings and image generation.
4
+
5
+ ## Installation
6
+
7
+ Follow the [n8n community node installation guide](https://docs.n8n.io/integrations/community-nodes/installation/).
8
+
9
+ ## Nodes
10
+
11
+ - **Universal AI** (`nodes/UniversalAI/`)
12
+ - **Universal Embedding** (`nodes/UniversalEmbedding/`)
13
+ - **Universal Image Generation** (`nodes/UniversalImageGen/`)
14
+
15
+ ## Universal AI Node
16
+
17
+ Supports text and structured generation across providers:
18
+
19
+ - **Providers**: Google Generative AI (Gemini), DeepSeek, Groq, OpenRouter.
20
+ - **Operations**: `Generate Text`, `Generate Object` (JSON schema-based outputs).
21
+ - **Streaming**: Optional chunked streaming using `Enable Streaming`.
22
+ - **Prompt Inputs**: Single prompt or conversational message threads with file parts (including YouTube URLs, PDFs, images, etc.).
23
+ - **Stop Sequences**: Provider-aware handling for Google and OpenRouter.
24
+ - **Google Enhancements**:
25
+ - **cachedContent** for explicit cache reuse.
26
+ - **responseModalities** (TEXT, IMAGE).
27
+ - **thinkingConfig** with `thinkingBudget` and `includeThoughts`.
28
+ - **Tools**: Google Search, URL Context, Code Execution (toggle individually).
29
+ - **Safety Settings** and Search Grounding controls.
30
+ - **Outputs**: Rich metadata (usage, reasoning, tool calls) with optional request echo.
31
+
32
+ ## Universal Embedding Node
33
+
34
+ Generate text embeddings with a consistent interface:
35
+
36
+ - **Providers**: Google Generative AI, OpenAI.
37
+ - **Operations**: `Embed Single`, `Embed Many`.
38
+ - **Google Options**: `outputDimensionality`, `taskType` (semantic similarity, retrieval, QA, etc.).
39
+ - **Outputs**: Embedding vectors, dimensions, token usage, original text(s).
40
+
41
+ ## Universal Image Generation Node
42
+
43
+ Create images via multiple providers while sharing one configuration surface:
44
+
45
+ - **Providers**: Google Imagen, OpenAI DALL-E.
46
+ - **Controls**:
47
+ - **Common**: Prompt, number of images.
48
+ - **Google**: Aspect ratio, negative prompt, safety filter level.
49
+ - **OpenAI**: Image size, quality, style.
50
+ - **Outputs**: Base64 image data, MIME type, downloadable binary, warnings.
51
+
52
+ ## Credentials
53
+
54
+ - **Google Generative AI**: API key from [Google AI Studio](https://makersuite.google.com/app/apikey).
55
+ - **DeepSeek**: API key from [DeepSeek](https://platform.deepseek.com/).
56
+ - **Groq**: API key from [Groq Console](https://console.groq.com/).
57
+ - **OpenRouter**: API key from [OpenRouter](https://openrouter.ai/).
58
+ - **OpenAI** (for embeddings/images through OpenRouter-ready models): API key from [OpenAI](https://platform.openai.com/).
59
+
60
+ Provide keys directly in node parameters or configure reusable n8n credentials.
61
+
62
+ ## Compatibility
63
+
64
+ - **n8n**: 1.0.0 or later.
65
+ - **Node.js**: Matches n8n engine requirements.
66
+
67
+ ## Resources
68
+
69
+ - [Vercel AI SDK Documentation](https://ai-sdk.dev/)
70
+ - [Google Gemini Documentation](https://ai.google.dev/)
71
+ - [DeepSeek Documentation](https://platform.deepseek.com/)
72
+ - [Groq Documentation](https://console.groq.com/docs)
73
+ - [OpenRouter Documentation](https://openrouter.ai/docs)
74
+
@@ -0,0 +1,9 @@
1
+ import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
2
+ export declare class DeepSeekApi implements ICredentialType {
3
+ name: string;
4
+ displayName: string;
5
+ documentationUrl: string;
6
+ properties: INodeProperties[];
7
+ authenticate: IAuthenticateGeneric;
8
+ test: ICredentialTestRequest;
9
+ }
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeepSeekApi = void 0;
4
+ class DeepSeekApi {
5
+ constructor() {
6
+ this.name = 'deepSeekApi';
7
+ this.displayName = 'DeepSeek API';
8
+ this.documentationUrl = 'https://platform.deepseek.com/docs';
9
+ this.properties = [
10
+ {
11
+ displayName: 'API Key',
12
+ name: 'apiKey',
13
+ type: 'string',
14
+ typeOptions: { password: true },
15
+ default: '',
16
+ required: true,
17
+ },
18
+ ];
19
+ this.authenticate = {
20
+ type: 'generic',
21
+ properties: {
22
+ headers: {
23
+ Authorization: '=Bearer {{$credentials.apiKey}}',
24
+ },
25
+ },
26
+ };
27
+ this.test = {
28
+ request: {
29
+ baseURL: 'https://api.deepseek.com',
30
+ url: '/v1/user/balance',
31
+ method: 'GET',
32
+ },
33
+ };
34
+ }
35
+ }
36
+ exports.DeepSeekApi = DeepSeekApi;
37
+ //# sourceMappingURL=DeepSeekApi.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeepSeekApi.credentials.js","sourceRoot":"","sources":["../../credentials/DeepSeekApi.credentials.ts"],"names":[],"mappings":";;;AAOA,MAAa,WAAW;IAAxB;QACI,SAAI,GAAG,aAAa,CAAC;QACrB,gBAAW,GAAG,cAAc,CAAC;QAC7B,qBAAgB,GAAG,oCAAoC,CAAC;QACxD,eAAU,GAAsB;YAC5B;gBACI,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;aACjB;SACJ,CAAC;QAEF,iBAAY,GAAyB;YACjC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACR,OAAO,EAAE;oBACL,aAAa,EAAE,iCAAiC;iBACnD;aACJ;SACJ,CAAC;QAEF,SAAI,GAA2B;YAC3B,OAAO,EAAE;gBACL,OAAO,EAAE,0BAA0B;gBACnC,GAAG,EAAE,kBAAkB;gBACvB,MAAM,EAAE,KAAK;aAChB;SACJ,CAAC;IACN,CAAC;CAAA;AA/BD,kCA+BC"}
@@ -0,0 +1,9 @@
1
+ import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
2
+ export declare class GoogleGenerativeAIApi implements ICredentialType {
3
+ name: string;
4
+ displayName: string;
5
+ documentationUrl: string;
6
+ properties: INodeProperties[];
7
+ authenticate: IAuthenticateGeneric;
8
+ test: ICredentialTestRequest;
9
+ }
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GoogleGenerativeAIApi = void 0;
4
+ class GoogleGenerativeAIApi {
5
+ constructor() {
6
+ this.name = 'googleGenerativeAIApi';
7
+ this.displayName = 'Google Generative AI API';
8
+ this.documentationUrl = 'https://ai.google.dev/docs';
9
+ this.properties = [
10
+ {
11
+ displayName: 'API Key',
12
+ name: 'apiKey',
13
+ type: 'string',
14
+ typeOptions: { password: true },
15
+ default: '',
16
+ required: true,
17
+ },
18
+ ];
19
+ this.authenticate = {
20
+ type: 'generic',
21
+ properties: {
22
+ headers: {
23
+ 'x-goog-api-key': '={{$credentials.apiKey}}',
24
+ },
25
+ },
26
+ };
27
+ this.test = {
28
+ request: {
29
+ baseURL: 'https://generativelanguage.googleapis.com',
30
+ url: '/v1/models',
31
+ method: 'GET',
32
+ },
33
+ };
34
+ }
35
+ }
36
+ exports.GoogleGenerativeAIApi = GoogleGenerativeAIApi;
37
+ //# sourceMappingURL=GoogleGenerativeAIApi.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GoogleGenerativeAIApi.credentials.js","sourceRoot":"","sources":["../../credentials/GoogleGenerativeAIApi.credentials.ts"],"names":[],"mappings":";;;AAQA,MAAa,qBAAqB;IAAlC;QACC,SAAI,GAAG,uBAAuB,CAAC;QAC/B,gBAAW,GAAG,0BAA0B,CAAC;QACzC,qBAAgB,GAAG,4BAA4B,CAAC;QAChD,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;aACd;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,gBAAgB,EAAE,0BAA0B;iBAC5C;aACD;SACD,CAAC;QAEF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,2CAA2C;gBACpD,GAAG,EAAE,YAAY;gBACjB,MAAM,EAAE,KAAK;aACb;SACD,CAAC;IACH,CAAC;CAAA;AA/BD,sDA+BC"}
@@ -0,0 +1,9 @@
1
+ import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
2
+ export declare class GroqApi implements ICredentialType {
3
+ name: string;
4
+ displayName: string;
5
+ documentationUrl: string;
6
+ properties: INodeProperties[];
7
+ authenticate: IAuthenticateGeneric;
8
+ test: ICredentialTestRequest;
9
+ }
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GroqApi = void 0;
4
+ class GroqApi {
5
+ constructor() {
6
+ this.name = 'groqApi';
7
+ this.displayName = 'Groq API';
8
+ this.documentationUrl = 'https://console.groq.com/docs/models';
9
+ this.properties = [
10
+ {
11
+ displayName: 'API Key',
12
+ name: 'apiKey',
13
+ type: 'string',
14
+ typeOptions: { password: true },
15
+ default: '',
16
+ required: true,
17
+ },
18
+ ];
19
+ this.authenticate = {
20
+ type: 'generic',
21
+ properties: {
22
+ headers: {
23
+ Authorization: '=Bearer {{$credentials.apiKey}}',
24
+ },
25
+ },
26
+ };
27
+ this.test = {
28
+ request: {
29
+ baseURL: 'https://api.groq.com',
30
+ url: '/openai/v1/models',
31
+ method: 'GET',
32
+ },
33
+ };
34
+ }
35
+ }
36
+ exports.GroqApi = GroqApi;
37
+ //# sourceMappingURL=GroqApi.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GroqApi.credentials.js","sourceRoot":"","sources":["../../credentials/GroqApi.credentials.ts"],"names":[],"mappings":";;;AAOA,MAAa,OAAO;IAApB;QACI,SAAI,GAAG,SAAS,CAAC;QACjB,gBAAW,GAAG,UAAU,CAAC;QACzB,qBAAgB,GAAG,sCAAsC,CAAC;QAC1D,eAAU,GAAsB;YAC5B;gBACI,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;aACjB;SACJ,CAAC;QAEF,iBAAY,GAAyB;YACjC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACR,OAAO,EAAE;oBACL,aAAa,EAAE,iCAAiC;iBACnD;aACJ;SACJ,CAAC;QAEF,SAAI,GAA2B;YAC3B,OAAO,EAAE;gBACL,OAAO,EAAE,sBAAsB;gBAC/B,GAAG,EAAE,mBAAmB;gBACxB,MAAM,EAAE,KAAK;aAChB;SACJ,CAAC;IACN,CAAC;CAAA;AA/BD,0BA+BC"}
@@ -0,0 +1,9 @@
1
+ import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
2
+ export declare class OpenRouterApi implements ICredentialType {
3
+ name: string;
4
+ displayName: string;
5
+ documentationUrl: string;
6
+ properties: INodeProperties[];
7
+ authenticate: IAuthenticateGeneric;
8
+ test: ICredentialTestRequest;
9
+ }
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OpenRouterApi = void 0;
4
+ class OpenRouterApi {
5
+ constructor() {
6
+ this.name = 'openRouterApi';
7
+ this.displayName = 'OpenRouter API';
8
+ this.documentationUrl = 'https://openrouter.ai/docs';
9
+ this.properties = [
10
+ {
11
+ displayName: 'API Key',
12
+ name: 'apiKey',
13
+ type: 'string',
14
+ typeOptions: { password: true },
15
+ default: '',
16
+ required: true,
17
+ },
18
+ ];
19
+ this.authenticate = {
20
+ type: 'generic',
21
+ properties: {
22
+ headers: {
23
+ Authorization: '=Bearer {{$credentials.apiKey}}',
24
+ },
25
+ },
26
+ };
27
+ this.test = {
28
+ request: {
29
+ baseURL: 'https://openrouter.ai/api/v1',
30
+ url: '/models',
31
+ method: 'GET',
32
+ },
33
+ };
34
+ }
35
+ }
36
+ exports.OpenRouterApi = OpenRouterApi;
37
+ //# sourceMappingURL=OpenRouterApi.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpenRouterApi.credentials.js","sourceRoot":"","sources":["../../credentials/OpenRouterApi.credentials.ts"],"names":[],"mappings":";;;AAOA,MAAa,aAAa;IAA1B;QACC,SAAI,GAAG,eAAe,CAAC;QACvB,gBAAW,GAAG,gBAAgB,CAAC;QAC/B,qBAAgB,GAAG,4BAA4B,CAAC;QAChD,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;aACd;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,aAAa,EAAE,iCAAiC;iBAChD;aACD;SACD,CAAC;QAEF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,8BAA8B;gBACvC,GAAG,EAAE,SAAS;gBACd,MAAM,EAAE,KAAK;aACb;SACD,CAAC;IACH,CAAC;CAAA;AA/BD,sCA+BC"}
@@ -0,0 +1,10 @@
1
+ import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription, ILoadOptionsFunctions, INodePropertyOptions } from 'n8n-workflow';
2
+ export declare class DeepSeek implements INodeType {
3
+ description: INodeTypeDescription;
4
+ methods: {
5
+ loadOptions: {
6
+ getModels(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
7
+ };
8
+ };
9
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
10
+ }