n8n-nodes-vercel-ai-sdk-universal-temp 0.1.68 → 0.1.70
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/nodes/UniversalAI/UniversalAI.node.js +71 -403
- package/dist/nodes/UniversalAI/UniversalAI.node.js.map +1 -1
- package/dist/nodes/UniversalEmbedding/UniversalEmbedding.node.js +16 -68
- package/dist/nodes/UniversalEmbedding/UniversalEmbedding.node.js.map +1 -1
- package/dist/nodes/UniversalImageGen/UniversalImageGen.node.js +16 -66
- package/dist/nodes/UniversalImageGen/UniversalImageGen.node.js.map +1 -1
- package/dist/nodes/UniversalSpeechGen/UniversalSpeechGen.node.js +8 -32
- package/dist/nodes/UniversalSpeechGen/UniversalSpeechGen.node.js.map +1 -1
- package/dist/nodes/UniversalTranscription/UniversalTranscription.node.js +3 -8
- package/dist/nodes/UniversalTranscription/UniversalTranscription.node.js.map +1 -1
- package/dist/nodes/shared/constants.d.ts +45 -0
- package/dist/nodes/shared/constants.js +49 -0
- package/dist/nodes/shared/constants.js.map +1 -0
- package/dist/nodes/shared/helpers.d.ts +55 -1
- package/dist/nodes/shared/helpers.js +573 -2
- package/dist/nodes/shared/helpers.js.map +1 -1
- package/dist/nodes/shared/model-lists.d.ts +65 -0
- package/dist/nodes/shared/model-lists.js +280 -0
- package/dist/nodes/shared/model-lists.js.map +1 -0
- package/dist/nodes/shared/types.d.ts +68 -0
- package/dist/nodes/shared/types.js +3 -0
- package/dist/nodes/shared/types.js.map +1 -0
- package/dist/package.json +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export declare const HUMAN_UNITS: {
|
|
2
|
+
readonly KB_TO_MB: 1024;
|
|
3
|
+
readonly MS_TO_SEC: 1000;
|
|
4
|
+
readonly MS_TO_MIN: number;
|
|
5
|
+
readonly MS_TO_HOUR: number;
|
|
6
|
+
readonly SEC_TO_MIN: 60;
|
|
7
|
+
readonly SEC_TO_HOUR: number;
|
|
8
|
+
};
|
|
9
|
+
export declare const CACHE_TTL: {
|
|
10
|
+
readonly DEFAULT: number;
|
|
11
|
+
readonly GOOGLE_CLIENT: number;
|
|
12
|
+
readonly GOOGLE_CONTEXT: number;
|
|
13
|
+
};
|
|
14
|
+
export declare const CACHE_SIZE: {
|
|
15
|
+
readonly MODEL: 50;
|
|
16
|
+
readonly PROVIDER: 20;
|
|
17
|
+
readonly SCHEMA: 30;
|
|
18
|
+
readonly GOOGLE_CLIENT: 10;
|
|
19
|
+
readonly GOOGLE_CONTEXT: 50;
|
|
20
|
+
};
|
|
21
|
+
export declare const PROCESSING: {
|
|
22
|
+
readonly MAX_CONCURRENT_ATTACHMENTS: 3;
|
|
23
|
+
readonly MAX_BASE64_SIZE: number;
|
|
24
|
+
};
|
|
25
|
+
export declare const GOOGLE_CACHE: {
|
|
26
|
+
readonly DEFAULT_TTL_SECONDS: number;
|
|
27
|
+
readonly MIN_REFRESH_BUFFER_SECONDS: number;
|
|
28
|
+
};
|
|
29
|
+
export declare const FILE_SIZE: {
|
|
30
|
+
readonly MAX_BASE64: number;
|
|
31
|
+
};
|
|
32
|
+
export declare const AI_DEFAULTS: {
|
|
33
|
+
readonly IMAGE_COUNT: 1;
|
|
34
|
+
readonly MAX_RETRIES: 3;
|
|
35
|
+
readonly MAX_PARALLEL_CALLS: 5;
|
|
36
|
+
readonly DEFAULT_DIMENSIONS: 1536;
|
|
37
|
+
readonly OUTPUT_DIMENSIONALITY: 768;
|
|
38
|
+
};
|
|
39
|
+
export declare const AI_VALIDATION: {
|
|
40
|
+
readonly MIN_DIMENSIONS: 1;
|
|
41
|
+
readonly MAX_DIMENSIONS: 3072;
|
|
42
|
+
readonly MIN_OUTPUT_DIMENSIONALITY: 1;
|
|
43
|
+
readonly MAX_OUTPUT_DIMENSIONALITY: 3072;
|
|
44
|
+
readonly MAX_IMAGE_COUNT: 10;
|
|
45
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AI_VALIDATION = exports.AI_DEFAULTS = exports.FILE_SIZE = exports.GOOGLE_CACHE = exports.PROCESSING = exports.CACHE_SIZE = exports.CACHE_TTL = exports.HUMAN_UNITS = void 0;
|
|
4
|
+
exports.HUMAN_UNITS = {
|
|
5
|
+
KB_TO_MB: 1024,
|
|
6
|
+
MS_TO_SEC: 1000,
|
|
7
|
+
MS_TO_MIN: 60 * 1000,
|
|
8
|
+
MS_TO_HOUR: 60 * 60 * 1000,
|
|
9
|
+
SEC_TO_MIN: 60,
|
|
10
|
+
SEC_TO_HOUR: 60 * 60,
|
|
11
|
+
};
|
|
12
|
+
exports.CACHE_TTL = {
|
|
13
|
+
DEFAULT: 5 * exports.HUMAN_UNITS.MS_TO_MIN,
|
|
14
|
+
GOOGLE_CLIENT: 1 * exports.HUMAN_UNITS.MS_TO_HOUR,
|
|
15
|
+
GOOGLE_CONTEXT: 55 * exports.HUMAN_UNITS.MS_TO_MIN,
|
|
16
|
+
};
|
|
17
|
+
exports.CACHE_SIZE = {
|
|
18
|
+
MODEL: 50,
|
|
19
|
+
PROVIDER: 20,
|
|
20
|
+
SCHEMA: 30,
|
|
21
|
+
GOOGLE_CLIENT: 10,
|
|
22
|
+
GOOGLE_CONTEXT: 50,
|
|
23
|
+
};
|
|
24
|
+
exports.PROCESSING = {
|
|
25
|
+
MAX_CONCURRENT_ATTACHMENTS: 3,
|
|
26
|
+
MAX_BASE64_SIZE: 50 * exports.HUMAN_UNITS.KB_TO_MB,
|
|
27
|
+
};
|
|
28
|
+
exports.GOOGLE_CACHE = {
|
|
29
|
+
DEFAULT_TTL_SECONDS: 1 * exports.HUMAN_UNITS.SEC_TO_HOUR,
|
|
30
|
+
MIN_REFRESH_BUFFER_SECONDS: 5 * exports.HUMAN_UNITS.SEC_TO_MIN,
|
|
31
|
+
};
|
|
32
|
+
exports.FILE_SIZE = {
|
|
33
|
+
MAX_BASE64: 50 * exports.HUMAN_UNITS.KB_TO_MB,
|
|
34
|
+
};
|
|
35
|
+
exports.AI_DEFAULTS = {
|
|
36
|
+
IMAGE_COUNT: 1,
|
|
37
|
+
MAX_RETRIES: 3,
|
|
38
|
+
MAX_PARALLEL_CALLS: 5,
|
|
39
|
+
DEFAULT_DIMENSIONS: 1536,
|
|
40
|
+
OUTPUT_DIMENSIONALITY: 768,
|
|
41
|
+
};
|
|
42
|
+
exports.AI_VALIDATION = {
|
|
43
|
+
MIN_DIMENSIONS: 1,
|
|
44
|
+
MAX_DIMENSIONS: 3072,
|
|
45
|
+
MIN_OUTPUT_DIMENSIONALITY: 1,
|
|
46
|
+
MAX_OUTPUT_DIMENSIONALITY: 3072,
|
|
47
|
+
MAX_IMAGE_COUNT: 10,
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../nodes/shared/constants.ts"],"names":[],"mappings":";;;AACa,QAAA,WAAW,GAAG;IAC1B,QAAQ,EAAE,IAAI;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,EAAE,GAAG,IAAI;IACpB,UAAU,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI;IACvB,UAAU,EAAE,EAAE;IACd,WAAW,EAAE,EAAE,GAAG,EAAE;CACd,CAAC;AAEE,QAAA,SAAS,GAAG;IACxB,OAAO,EAAE,CAAC,GAAG,mBAAW,CAAC,SAAS;IAClC,aAAa,EAAE,CAAC,GAAG,mBAAW,CAAC,UAAU;IACzC,cAAc,EAAE,EAAE,GAAG,mBAAW,CAAC,SAAS;CACjC,CAAC;AAEE,QAAA,UAAU,GAAG;IACzB,KAAK,EAAE,EAAE;IACT,QAAQ,EAAE,EAAE;IACZ,MAAM,EAAE,EAAE;IACV,aAAa,EAAE,EAAE;IACjB,cAAc,EAAE,EAAE;CACT,CAAC;AAEE,QAAA,UAAU,GAAG;IACzB,0BAA0B,EAAE,CAAC;IAC7B,eAAe,EAAE,EAAE,GAAG,mBAAW,CAAC,QAAQ;CACjC,CAAC;AAEE,QAAA,YAAY,GAAG;IAC3B,mBAAmB,EAAE,CAAC,GAAG,mBAAW,CAAC,WAAW;IAChD,0BAA0B,EAAE,CAAC,GAAG,mBAAW,CAAC,UAAU;CAC7C,CAAC;AAEE,QAAA,SAAS,GAAG;IACxB,UAAU,EAAE,EAAE,GAAG,mBAAW,CAAC,QAAQ;CAC5B,CAAC;AAGE,QAAA,WAAW,GAAG;IAC1B,WAAW,EAAE,CAAC;IACd,WAAW,EAAE,CAAC;IACd,kBAAkB,EAAE,CAAC;IACrB,kBAAkB,EAAE,IAAI;IACxB,qBAAqB,EAAE,GAAG;CACjB,CAAC;AAEE,QAAA,aAAa,GAAG;IAC5B,cAAc,EAAE,CAAC;IACjB,cAAc,EAAE,IAAI;IACpB,yBAAyB,EAAE,CAAC;IAC5B,yBAAyB,EAAE,IAAI;IAC/B,eAAe,EAAE,EAAE;CACV,CAAC"}
|
|
@@ -1,6 +1,60 @@
|
|
|
1
1
|
import { IExecuteFunctions } from 'n8n-workflow';
|
|
2
|
+
import { ProviderInstance, GoogleProviderOptions, ProcessingInput, SupportedProvider, CacheableContent } from './types';
|
|
3
|
+
export declare class LRUCache<T> {
|
|
4
|
+
private cache;
|
|
5
|
+
private head;
|
|
6
|
+
private tail;
|
|
7
|
+
private readonly maxSize;
|
|
8
|
+
private readonly ttl;
|
|
9
|
+
private totalHits;
|
|
10
|
+
private totalMisses;
|
|
11
|
+
private totalEvictions;
|
|
12
|
+
constructor(maxSize: number, ttl?: number);
|
|
13
|
+
get(key: string): T | undefined;
|
|
14
|
+
set(key: string, value: T, customTTL?: number): void;
|
|
15
|
+
delete(key: string): boolean;
|
|
16
|
+
clear(): void;
|
|
17
|
+
getStats(): {
|
|
18
|
+
size: number;
|
|
19
|
+
maxSize: number;
|
|
20
|
+
hitRate: number;
|
|
21
|
+
totalHits: number;
|
|
22
|
+
totalMisses: number;
|
|
23
|
+
totalEvictions: number;
|
|
24
|
+
ttl: number;
|
|
25
|
+
};
|
|
26
|
+
private addToFront;
|
|
27
|
+
private moveToFront;
|
|
28
|
+
private remove;
|
|
29
|
+
}
|
|
2
30
|
export declare function getProviderCredentials(exec: IExecuteFunctions, provider: string, credentialName: string): Promise<{
|
|
3
31
|
apiKey: string;
|
|
4
32
|
baseUrl?: string;
|
|
5
33
|
}>;
|
|
6
|
-
export declare const modelCache:
|
|
34
|
+
export declare const modelCache: LRUCache<any[]>;
|
|
35
|
+
export declare const providerCache: LRUCache<ProviderInstance>;
|
|
36
|
+
export declare const schemaCache: LRUCache<Record<string, any>>;
|
|
37
|
+
export declare const googleCacheClients: LRUCache<any>;
|
|
38
|
+
export declare const googleCachedContexts: LRUCache<{
|
|
39
|
+
name: string;
|
|
40
|
+
}>;
|
|
41
|
+
export declare function restoreCacheableContent(params: Record<string, any>, input: ProcessingInput): void;
|
|
42
|
+
export declare function getGoogleCacheManager(apiKey: string): Promise<any>;
|
|
43
|
+
export declare function getProvider(exec: IExecuteFunctions, provider: SupportedProvider, apiKey: string, baseURL?: string, customHeaders?: Record<string, string>): Promise<ProviderInstance>;
|
|
44
|
+
export declare function createGoogleCache(exec: IExecuteFunctions, index: number, apiKey: string, cacheableContent: CacheableContent[], modelId: string, thinkingBudgetValue: number, includeThoughts: boolean, tools?: Record<string, any>, ttlSeconds?: number): Promise<string | null>;
|
|
45
|
+
export declare function buildGoogleProviderOptions(exec: IExecuteFunctions, index: number, cachedContentName?: string, thinkingBudgetOverride?: number, includeThoughtsOverride?: boolean): GoogleProviderOptions | undefined;
|
|
46
|
+
export declare function buildGoogleTools(exec: IExecuteFunctions, index: number): Promise<Record<string, any> | undefined>;
|
|
47
|
+
export declare function createSpeechProvider(provider: 'google' | 'openai', apiKey: string, baseURL?: string): Promise<any>;
|
|
48
|
+
export declare function getCredentials(exec: IExecuteFunctions, provider: 'google' | 'openai' | 'deepseek' | 'groq' | 'openrouter'): Promise<{
|
|
49
|
+
apiKey: string;
|
|
50
|
+
baseUrl?: string;
|
|
51
|
+
}>;
|
|
52
|
+
export declare function buildEmbeddingProviderOptions(provider: 'google' | 'openai', options: import('../shared/types').EmbeddingOptions): any;
|
|
53
|
+
export declare function buildImageProviderOptions(provider: 'google' | 'openai', options: import('../shared/types').ImageGenOptions): any;
|
|
54
|
+
export declare function validateEmbeddingOptions(options: import('../shared/types').EmbeddingOptions): void;
|
|
55
|
+
export declare function validateImageOptions(options: import('../shared/types').ImageGenOptions): void;
|
|
56
|
+
export declare function handleNodeError(exec: IExecuteFunctions, error: unknown, itemIndex?: number): never;
|
|
57
|
+
export declare function createTranscriptionProvider(apiKey: string, baseURL?: string): Promise<any>;
|
|
58
|
+
export declare function createImageProvider(provider: 'google' | 'openai', apiKey: string, baseURL?: string): Promise<any>;
|
|
59
|
+
export declare function createEmbeddingProvider(provider: 'google' | 'openai', apiKey: string, baseURL?: string): Promise<any>;
|
|
60
|
+
export declare function setupGoogleProviderOptions(exec: IExecuteFunctions, index: number, input: ProcessingInput, model: string, apiKey: string): Promise<GoogleProviderOptions | undefined>;
|