@n8n/ai-utilities 0.31.0 → 0.32.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.
@@ -9,15 +9,17 @@ export { N8nBinaryLoader } from './utils/n8n-binary-loader';
9
9
  export { N8nJsonLoader } from './utils/n8n-json-loader';
10
10
  export { N8nPdfLoader } from './utils/loaders/n8n-pdf-loader';
11
11
  export { N8nLlmTracing } from './utils/n8n-llm-tracing';
12
+ export { redactHeaderValues } from './utils/redact-headers';
12
13
  export { TextEditorDocument, NoMatchFoundError, MultipleMatchesError, InvalidLineNumberError, InvalidViewRangeError, InvalidPathError, FileExistsError, FileNotFoundError, BatchReplacementError, formatTextWithLineNumbers, findDivergenceContext, parseStrReplacements, } from './utils/workflow-text-editor';
13
14
  export type { ViewCommand, CreateCommand, StrReplaceCommand, InsertCommand, BatchStrReplaceCommand, TextEditorCommand, TextEditorCommandWithBatch, TextEditorToolCall, TextEditorResult, StrReplacement, BatchReplaceResult, TextEditorDocumentOptions, } from './utils/workflow-text-editor';
14
15
  export { estimateTokensFromStringList, estimateTokensByCharCount, estimateTextSplitsByTokens, } from './utils/tokenizer/token-estimator';
15
16
  export { encodingForModel, getEncoding } from './utils/tokenizer/tiktoken';
16
17
  export { makeN8nLlmFailedAttemptHandler } from './utils/failed-attempt-handler/n8nLlmFailedAttemptHandler';
17
- export { getProxyAgent, getNodeProxyAgent, proxyFetch, type AgentTimeoutOptions, } from './utils/http-proxy-agent';
18
+ export { getProxyAgent, getNodeProxyAgent, proxyFetch, type AgentTimeoutOptions, type ProxyFetchOptions, } from './utils/http-proxy-agent';
18
19
  export { braveSearch, searxngSearch, type BraveSearchOptions } from './web-search';
19
20
  export type { WebSearchOptions, WebSearchResponse, WebSearchResult } from './web-search';
20
21
  export { fetchFollowingRedirects, type FollowRedirectsOptions, } from './utils/follow-redirects';
22
+ export { createRefreshingAuthFetch, type RefreshingAuthFetchOptions, } from './utils/refreshing-auth-fetch';
21
23
  export { getConnectionHintNoticeField, metadataFilterField, getBatchingOptionFields, getTemplateNoticeField, } from './utils/shared-fields';
22
24
  export { createToolFromNode, createZodSchemaFromArgs, extractFromAIParameters, } from './utils/fromai-tool-factory';
23
25
  export { createVectorStoreNode } from './utils/vector-store/createVectorStoreNode/createVectorStoreNode';
package/dist/cjs/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fromLcMessage = exports.getParametersJsonSchema = exports.processDocument = exports.processDocuments = exports.MemoryVectorStoreManager = exports.createVectorStoreNode = exports.extractFromAIParameters = exports.createZodSchemaFromArgs = exports.createToolFromNode = exports.getTemplateNoticeField = exports.getBatchingOptionFields = exports.metadataFilterField = exports.getConnectionHintNoticeField = exports.fetchFollowingRedirects = exports.searxngSearch = exports.braveSearch = exports.proxyFetch = exports.getNodeProxyAgent = exports.getProxyAgent = exports.makeN8nLlmFailedAttemptHandler = exports.getEncoding = exports.encodingForModel = exports.estimateTextSplitsByTokens = exports.estimateTokensByCharCount = exports.estimateTokensFromStringList = exports.parseStrReplacements = exports.findDivergenceContext = exports.formatTextWithLineNumbers = exports.BatchReplacementError = exports.FileNotFoundError = exports.FileExistsError = exports.InvalidPathError = exports.InvalidViewRangeError = exports.InvalidLineNumberError = exports.MultipleMatchesError = exports.NoMatchFoundError = exports.TextEditorDocument = exports.N8nLlmTracing = exports.N8nPdfLoader = exports.N8nJsonLoader = exports.N8nBinaryLoader = exports.hasLongSequentialRepeat = exports.getMetadataFiltersValues = exports.validateEmbedDocumentsInput = exports.validateEmbedQueryInput = exports.parseSSEStream = exports.redactSecrets = exports.logAiEvent = exports.logWrapper = exports.AI_NODE_SDK_VERSION = void 0;
4
- exports.supplyModel = exports.supplyMemory = exports.WindowedChatMemory = exports.BaseChatMemory = exports.BaseChatHistory = exports.BaseChatModel = exports.LangchainChatModelAdapter = exports.isToolsInstance = exports.isChatInstance = exports.isBaseChatMessageHistory = exports.isBaseChatMemory = exports.fromLcContent = exports.toLcContent = exports.toLcMessage = void 0;
3
+ exports.processDocument = exports.processDocuments = exports.MemoryVectorStoreManager = exports.createVectorStoreNode = exports.extractFromAIParameters = exports.createZodSchemaFromArgs = exports.createToolFromNode = exports.getTemplateNoticeField = exports.getBatchingOptionFields = exports.metadataFilterField = exports.getConnectionHintNoticeField = exports.createRefreshingAuthFetch = exports.fetchFollowingRedirects = exports.searxngSearch = exports.braveSearch = exports.proxyFetch = exports.getNodeProxyAgent = exports.getProxyAgent = exports.makeN8nLlmFailedAttemptHandler = exports.getEncoding = exports.encodingForModel = exports.estimateTextSplitsByTokens = exports.estimateTokensByCharCount = exports.estimateTokensFromStringList = exports.parseStrReplacements = exports.findDivergenceContext = exports.formatTextWithLineNumbers = exports.BatchReplacementError = exports.FileNotFoundError = exports.FileExistsError = exports.InvalidPathError = exports.InvalidViewRangeError = exports.InvalidLineNumberError = exports.MultipleMatchesError = exports.NoMatchFoundError = exports.TextEditorDocument = exports.redactHeaderValues = exports.N8nLlmTracing = exports.N8nPdfLoader = exports.N8nJsonLoader = exports.N8nBinaryLoader = exports.hasLongSequentialRepeat = exports.getMetadataFiltersValues = exports.validateEmbedDocumentsInput = exports.validateEmbedQueryInput = exports.parseSSEStream = exports.redactSecrets = exports.logAiEvent = exports.logWrapper = exports.AI_NODE_SDK_VERSION = void 0;
4
+ exports.supplyModel = exports.supplyMemory = exports.WindowedChatMemory = exports.BaseChatMemory = exports.BaseChatHistory = exports.BaseChatModel = exports.LangchainChatModelAdapter = exports.isToolsInstance = exports.isChatInstance = exports.isBaseChatMessageHistory = exports.isBaseChatMemory = exports.fromLcContent = exports.toLcContent = exports.toLcMessage = exports.fromLcMessage = exports.getParametersJsonSchema = void 0;
5
5
  var ai_node_sdk_version_1 = require("./ai-node-sdk-version");
6
6
  Object.defineProperty(exports, "AI_NODE_SDK_VERSION", { enumerable: true, get: function () { return ai_node_sdk_version_1.AI_NODE_SDK_VERSION; } });
7
7
  var log_wrapper_1 = require("./utils/log-wrapper");
@@ -26,6 +26,8 @@ var n8n_pdf_loader_1 = require("./utils/loaders/n8n-pdf-loader");
26
26
  Object.defineProperty(exports, "N8nPdfLoader", { enumerable: true, get: function () { return n8n_pdf_loader_1.N8nPdfLoader; } });
27
27
  var n8n_llm_tracing_1 = require("./utils/n8n-llm-tracing");
28
28
  Object.defineProperty(exports, "N8nLlmTracing", { enumerable: true, get: function () { return n8n_llm_tracing_1.N8nLlmTracing; } });
29
+ var redact_headers_1 = require("./utils/redact-headers");
30
+ Object.defineProperty(exports, "redactHeaderValues", { enumerable: true, get: function () { return redact_headers_1.redactHeaderValues; } });
29
31
  var workflow_text_editor_1 = require("./utils/workflow-text-editor");
30
32
  Object.defineProperty(exports, "TextEditorDocument", { enumerable: true, get: function () { return workflow_text_editor_1.TextEditorDocument; } });
31
33
  Object.defineProperty(exports, "NoMatchFoundError", { enumerable: true, get: function () { return workflow_text_editor_1.NoMatchFoundError; } });
@@ -57,6 +59,8 @@ Object.defineProperty(exports, "braveSearch", { enumerable: true, get: function
57
59
  Object.defineProperty(exports, "searxngSearch", { enumerable: true, get: function () { return web_search_1.searxngSearch; } });
58
60
  var follow_redirects_1 = require("./utils/follow-redirects");
59
61
  Object.defineProperty(exports, "fetchFollowingRedirects", { enumerable: true, get: function () { return follow_redirects_1.fetchFollowingRedirects; } });
62
+ var refreshing_auth_fetch_1 = require("./utils/refreshing-auth-fetch");
63
+ Object.defineProperty(exports, "createRefreshingAuthFetch", { enumerable: true, get: function () { return refreshing_auth_fetch_1.createRefreshingAuthFetch; } });
60
64
  var shared_fields_1 = require("./utils/shared-fields");
61
65
  Object.defineProperty(exports, "getConnectionHintNoticeField", { enumerable: true, get: function () { return shared_fields_1.getConnectionHintNoticeField; } });
62
66
  Object.defineProperty(exports, "metadataFilterField", { enumerable: true, get: function () { return shared_fields_1.metadataFilterField; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"m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