@kyuda/n8n-nodes-databricks 1.2.1 → 1.3.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.
Potentially problematic release.
This version of @kyuda/n8n-nodes-databricks might be problematic. Click here for more details.
- package/dist/nodes/Databricks/resources/jobs/handler.js +6 -0
- package/dist/nodes/Databricks/resources/jobs/handler.js.map +1 -1
- package/dist/nodes/Databricks/resources/jobs/parameters.js +18 -0
- package/dist/nodes/Databricks/resources/jobs/parameters.js.map +1 -1
- package/dist/package.json +6 -30
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -30
- package/dist/nodes/agents/DatabricksAiAgent/CallbackHandler.d.ts +0 -66
- package/dist/nodes/agents/DatabricksAiAgent/CallbackHandler.js +0 -531
- package/dist/nodes/agents/DatabricksAiAgent/CallbackHandler.js.map +0 -1
- package/dist/nodes/agents/DatabricksAiAgent/DatabricksAiAgent.node.d.ts +0 -5
- package/dist/nodes/agents/DatabricksAiAgent/DatabricksAiAgent.node.js +0 -133
- package/dist/nodes/agents/DatabricksAiAgent/DatabricksAiAgent.node.js.map +0 -1
- package/dist/nodes/agents/DatabricksAiAgent/DatabricksAiAgentDark.icon.svg +0 -9
- package/dist/nodes/agents/DatabricksAiAgent/DatabricksAiAgentLight.icon.svg +0 -9
- package/dist/nodes/agents/DatabricksAiAgent/description.d.ts +0 -4
- package/dist/nodes/agents/DatabricksAiAgent/description.js +0 -28
- package/dist/nodes/agents/DatabricksAiAgent/description.js.map +0 -1
- package/dist/nodes/agents/DatabricksAiAgent/execute.d.ts +0 -2
- package/dist/nodes/agents/DatabricksAiAgent/execute.js +0 -418
- package/dist/nodes/agents/DatabricksAiAgent/execute.js.map +0 -1
- package/dist/nodes/agents/DatabricksAiAgent/src/constants.d.ts +0 -82
- package/dist/nodes/agents/DatabricksAiAgent/src/constants.js +0 -105
- package/dist/nodes/agents/DatabricksAiAgent/src/constants.js.map +0 -1
- package/dist/nodes/agents/DatabricksAiAgent/src/types/types.d.ts +0 -6
- package/dist/nodes/agents/DatabricksAiAgent/src/types/types.js +0 -3
- package/dist/nodes/agents/DatabricksAiAgent/src/types/types.js.map +0 -1
- package/dist/nodes/agents/DatabricksAiAgent/src/utils/N8nOutputParser.d.ts +0 -5
- package/dist/nodes/agents/DatabricksAiAgent/src/utils/N8nOutputParser.js +0 -13
- package/dist/nodes/agents/DatabricksAiAgent/src/utils/N8nOutputParser.js.map +0 -1
- package/dist/nodes/agents/DatabricksAiAgent/src/utils/N8nTool.d.ts +0 -10
- package/dist/nodes/agents/DatabricksAiAgent/src/utils/N8nTool.js +0 -88
- package/dist/nodes/agents/DatabricksAiAgent/src/utils/N8nTool.js.map +0 -1
- package/dist/nodes/agents/DatabricksAiAgent/src/utils/common.d.ts +0 -28
- package/dist/nodes/agents/DatabricksAiAgent/src/utils/common.js +0 -207
- package/dist/nodes/agents/DatabricksAiAgent/src/utils/common.js.map +0 -1
- package/dist/nodes/agents/DatabricksAiAgent/src/utils/descriptions.d.ts +0 -17
- package/dist/nodes/agents/DatabricksAiAgent/src/utils/descriptions.js +0 -135
- package/dist/nodes/agents/DatabricksAiAgent/src/utils/descriptions.js.map +0 -1
- package/dist/nodes/agents/DatabricksAiAgent/src/utils/helpers.d.ts +0 -24
- package/dist/nodes/agents/DatabricksAiAgent/src/utils/helpers.js +0 -221
- package/dist/nodes/agents/DatabricksAiAgent/src/utils/helpers.js.map +0 -1
- package/dist/nodes/agents/DatabricksAiAgent/src/utils/options.d.ts +0 -2
- package/dist/nodes/agents/DatabricksAiAgent/src/utils/options.js +0 -38
- package/dist/nodes/agents/DatabricksAiAgent/src/utils/options.js.map +0 -1
- package/dist/nodes/agents/DatabricksAiAgent/src/utils/output_parsers/N8nStructuredOutputParser.d.ts +0 -12
- package/dist/nodes/agents/DatabricksAiAgent/src/utils/output_parsers/N8nStructuredOutputParser.js +0 -106
- package/dist/nodes/agents/DatabricksAiAgent/src/utils/output_parsers/N8nStructuredOutputParser.js.map +0 -1
- package/dist/nodes/agents/DatabricksAiAgent/src/utils/prompt.d.ts +0 -1
- package/dist/nodes/agents/DatabricksAiAgent/src/utils/prompt.js +0 -5
- package/dist/nodes/agents/DatabricksAiAgent/src/utils/prompt.js.map +0 -1
- package/dist/nodes/agents/DatabricksAiAgent/src/utils/retry.d.ts +0 -16
- package/dist/nodes/agents/DatabricksAiAgent/src/utils/retry.js +0 -132
- package/dist/nodes/agents/DatabricksAiAgent/src/utils/retry.js.map +0 -1
- package/dist/nodes/agents/DatabricksAiAgent/src/utils/security.d.ts +0 -18
- package/dist/nodes/agents/DatabricksAiAgent/src/utils/security.js +0 -150
- package/dist/nodes/agents/DatabricksAiAgent/src/utils/security.js.map +0 -1
- package/dist/nodes/agents/DatabricksAiAgent/src/utils/sharedFields.d.ts +0 -7
- package/dist/nodes/agents/DatabricksAiAgent/src/utils/sharedFields.js +0 -150
- package/dist/nodes/agents/DatabricksAiAgent/src/utils/sharedFields.js.map +0 -1
- package/dist/nodes/agents/DatabricksAiAgent/utils.d.ts +0 -2
- package/dist/nodes/agents/DatabricksAiAgent/utils.js +0 -52
- package/dist/nodes/agents/DatabricksAiAgent/utils.js.map +0 -1
- package/dist/nodes/embeddings/EmbeddingsDatabricks/EmbeddingsDatabricks.node.d.ts +0 -5
- package/dist/nodes/embeddings/EmbeddingsDatabricks/EmbeddingsDatabricks.node.js +0 -155
- package/dist/nodes/embeddings/EmbeddingsDatabricks/EmbeddingsDatabricks.node.js.map +0 -1
- package/dist/nodes/embeddings/EmbeddingsDatabricks/databricks.dark.svg +0 -19
- package/dist/nodes/embeddings/EmbeddingsDatabricks/databricks.svg +0 -19
- package/dist/nodes/llms/LmChatDatabricks/LmChatDatabricks.node.d.ts +0 -10
- package/dist/nodes/llms/LmChatDatabricks/LmChatDatabricks.node.js +0 -265
- package/dist/nodes/llms/LmChatDatabricks/LmChatDatabricks.node.js.map +0 -1
- package/dist/nodes/llms/LmChatDatabricks/databricks.dark.svg +0 -19
- package/dist/nodes/llms/LmChatDatabricks/databricks.svg +0 -19
- package/dist/nodes/llms/N8nLlmTracing.d.ts +0 -44
- package/dist/nodes/llms/N8nLlmTracing.js +0 -140
- package/dist/nodes/llms/N8nLlmTracing.js.map +0 -1
- package/dist/nodes/llms/n8nDefaultFailedAttemptHandler.d.ts +0 -1
- package/dist/nodes/llms/n8nDefaultFailedAttemptHandler.js +0 -31
- package/dist/nodes/llms/n8nDefaultFailedAttemptHandler.js.map +0 -1
- package/dist/nodes/llms/n8nDefaultFailedAttemptHandler.test.d.ts +0 -1
- package/dist/nodes/llms/n8nDefaultFailedAttemptHandler.test.js +0 -53
- package/dist/nodes/llms/n8nDefaultFailedAttemptHandler.test.js.map +0 -1
- package/dist/nodes/llms/n8nLlmFailedAttemptHandler.d.ts +0 -3
- package/dist/nodes/llms/n8nLlmFailedAttemptHandler.js +0 -28
- package/dist/nodes/llms/n8nLlmFailedAttemptHandler.js.map +0 -1
- package/dist/nodes/llms/n8nLlmFailedAttemptHandler.test.d.ts +0 -1
- package/dist/nodes/llms/n8nLlmFailedAttemptHandler.test.js +0 -50
- package/dist/nodes/llms/n8nLlmFailedAttemptHandler.test.js.map +0 -1
- package/dist/nodes/vector_store/VectorStoreDatabricks/VectorStoreDatabricks.node.d.ts +0 -15
- package/dist/nodes/vector_store/VectorStoreDatabricks/VectorStoreDatabricks.node.js +0 -98
- package/dist/nodes/vector_store/VectorStoreDatabricks/VectorStoreDatabricks.node.js.map +0 -1
- package/dist/nodes/vector_store/VectorStoreDatabricks/databricks.dark.svg +0 -19
- package/dist/nodes/vector_store/VectorStoreDatabricks/databricks.svg +0 -19
- package/dist/nodes/vector_store/shared/MemoryManager/MemoryCalculator.d.ts +0 -7
- package/dist/nodes/vector_store/shared/MemoryManager/MemoryCalculator.js +0 -50
- package/dist/nodes/vector_store/shared/MemoryManager/MemoryCalculator.js.map +0 -1
- package/dist/nodes/vector_store/shared/MemoryManager/MemoryVectorStoreManager.d.ts +0 -32
- package/dist/nodes/vector_store/shared/MemoryManager/MemoryVectorStoreManager.js +0 -175
- package/dist/nodes/vector_store/shared/MemoryManager/MemoryVectorStoreManager.js.map +0 -1
- package/dist/nodes/vector_store/shared/MemoryManager/StoreCleanupService.d.ts +0 -16
- package/dist/nodes/vector_store/shared/MemoryManager/StoreCleanupService.js +0 -95
- package/dist/nodes/vector_store/shared/MemoryManager/StoreCleanupService.js.map +0 -1
- package/dist/nodes/vector_store/shared/MemoryManager/config.d.ts +0 -4
- package/dist/nodes/vector_store/shared/MemoryManager/config.js +0 -38
- package/dist/nodes/vector_store/shared/MemoryManager/config.js.map +0 -1
- package/dist/nodes/vector_store/shared/MemoryManager/test/MemoryCalculator.test.d.ts +0 -1
- package/dist/nodes/vector_store/shared/MemoryManager/test/MemoryCalculator.test.js +0 -158
- package/dist/nodes/vector_store/shared/MemoryManager/test/MemoryCalculator.test.js.map +0 -1
- package/dist/nodes/vector_store/shared/MemoryManager/test/MemoryVectorStoreManager.test.d.ts +0 -1
- package/dist/nodes/vector_store/shared/MemoryManager/test/MemoryVectorStoreManager.test.js +0 -204
- package/dist/nodes/vector_store/shared/MemoryManager/test/MemoryVectorStoreManager.test.js.map +0 -1
- package/dist/nodes/vector_store/shared/MemoryManager/test/StoreCleanupService.test.d.ts +0 -1
- package/dist/nodes/vector_store/shared/MemoryManager/test/StoreCleanupService.test.js +0 -138
- package/dist/nodes/vector_store/shared/MemoryManager/test/StoreCleanupService.test.js.map +0 -1
- package/dist/nodes/vector_store/shared/MemoryManager/test/config.test.d.ts +0 -1
- package/dist/nodes/vector_store/shared/MemoryManager/test/config.test.js +0 -57
- package/dist/nodes/vector_store/shared/MemoryManager/test/config.test.js.map +0 -1
- package/dist/nodes/vector_store/shared/MemoryManager/types.d.ts +0 -39
- package/dist/nodes/vector_store/shared/MemoryManager/types.js +0 -3
- package/dist/nodes/vector_store/shared/MemoryManager/types.js.map +0 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/__tests__/utils.test.d.ts +0 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/__tests__/utils.test.js +0 -156
- package/dist/nodes/vector_store/shared/createVectorStoreNode/__tests__/utils.test.js.map +0 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/constants.d.ts +0 -4
- package/dist/nodes/vector_store/shared/createVectorStoreNode/constants.js +0 -45
- package/dist/nodes/vector_store/shared/createVectorStoreNode/constants.js.map +0 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.d.ts +0 -15
- package/dist/nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.js +0 -227
- package/dist/nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.js.map +0 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.test.d.ts +0 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.test.js +0 -131
- package/dist/nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.test.js.map +0 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/methods/listSearch.d.ts +0 -7
- package/dist/nodes/vector_store/shared/createVectorStoreNode/methods/listSearch.js +0 -32
- package/dist/nodes/vector_store/shared/createVectorStoreNode/methods/listSearch.js.map +0 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/insertOperation.test.d.ts +0 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/insertOperation.test.js +0 -190
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/insertOperation.test.js.map +0 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/loadOperation.test.d.ts +0 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/loadOperation.test.js +0 -101
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/loadOperation.test.js.map +0 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/operationHandlers.test.d.ts +0 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/operationHandlers.test.js +0 -93
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/operationHandlers.test.js.map +0 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/retrieveAsToolOperation.test.d.ts +0 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/retrieveAsToolOperation.test.js +0 -109
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/retrieveAsToolOperation.test.js.map +0 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/retrieveOperation.test.d.ts +0 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/retrieveOperation.test.js +0 -60
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/retrieveOperation.test.js.map +0 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/updateOperation.test.d.ts +0 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/updateOperation.test.js +0 -108
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/updateOperation.test.js.map +0 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/index.d.ts +0 -5
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/index.js +0 -22
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/index.js.map +0 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/insertOperation.d.ts +0 -5
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/insertOperation.js +0 -36
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/insertOperation.js.map +0 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/loadOperation.d.ts +0 -5
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/loadOperation.js +0 -34
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/loadOperation.js.map +0 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveAsToolOperation.d.ts +0 -5
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveAsToolOperation.js +0 -43
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveAsToolOperation.js.map +0 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveOperation.d.ts +0 -5
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveOperation.js +0 -17
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveOperation.js.map +0 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/updateOperation.d.ts +0 -5
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/updateOperation.js +0 -40
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/updateOperation.js.map +0 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/test-helpers.d.ts +0 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/test-helpers.js +0 -2
- package/dist/nodes/vector_store/shared/createVectorStoreNode/test-helpers.js.map +0 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/types.d.ts +0 -31
- package/dist/nodes/vector_store/shared/createVectorStoreNode/types.js +0 -3
- package/dist/nodes/vector_store/shared/createVectorStoreNode/types.js.map +0 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/utils.d.ts +0 -6
- package/dist/nodes/vector_store/shared/createVectorStoreNode/utils.js +0 -22
- package/dist/nodes/vector_store/shared/createVectorStoreNode/utils.js.map +0 -1
- package/dist/nodes/vector_store/shared/descriptions.d.ts +0 -4
- package/dist/nodes/vector_store/shared/descriptions.js +0 -70
- package/dist/nodes/vector_store/shared/descriptions.js.map +0 -1
- package/dist/nodes/vector_store/shared/processDocuments.d.ts +0 -25
- package/dist/nodes/vector_store/shared/processDocuments.js +0 -42
- package/dist/nodes/vector_store/shared/processDocuments.js.map +0 -1
- package/dist/utils/DatabricksVectorStoreLangChain.d.ts +0 -26
- package/dist/utils/DatabricksVectorStoreLangChain.js +0 -116
- package/dist/utils/DatabricksVectorStoreLangChain.js.map +0 -1
- package/dist/utils/N8nBinaryLoader.d.ts +0 -18
- package/dist/utils/N8nBinaryLoader.js +0 -159
- package/dist/utils/N8nBinaryLoader.js.map +0 -1
- package/dist/utils/N8nJsonLoader.d.ts +0 -11
- package/dist/utils/N8nJsonLoader.js +0 -67
- package/dist/utils/N8nJsonLoader.js.map +0 -1
- package/dist/utils/N8nTool.d.ts +0 -10
- package/dist/utils/N8nTool.js +0 -88
- package/dist/utils/N8nTool.js.map +0 -1
- package/dist/utils/descriptions.d.ts +0 -13
- package/dist/utils/descriptions.js +0 -112
- package/dist/utils/descriptions.js.map +0 -1
- package/dist/utils/helpers.d.ts +0 -23
- package/dist/utils/helpers.js +0 -172
- package/dist/utils/helpers.js.map +0 -1
- package/dist/utils/logWrapper.d.ts +0 -27
- package/dist/utils/logWrapper.js +0 -297
- package/dist/utils/logWrapper.js.map +0 -1
- package/dist/utils/output_parsers/N8nItemListOutputParser.d.ts +0 -13
- package/dist/utils/output_parsers/N8nItemListOutputParser.js +0 -43
- package/dist/utils/output_parsers/N8nItemListOutputParser.js.map +0 -1
- package/dist/utils/output_parsers/N8nOutputFixingParser.d.ts +0 -18
- package/dist/utils/output_parsers/N8nOutputFixingParser.js +0 -68
- package/dist/utils/output_parsers/N8nOutputFixingParser.js.map +0 -1
- package/dist/utils/output_parsers/N8nOutputParser.d.ts +0 -7
- package/dist/utils/output_parsers/N8nOutputParser.js +0 -19
- package/dist/utils/output_parsers/N8nOutputParser.js.map +0 -1
- package/dist/utils/output_parsers/N8nStructuredOutputParser.d.ts +0 -12
- package/dist/utils/output_parsers/N8nStructuredOutputParser.js +0 -84
- package/dist/utils/output_parsers/N8nStructuredOutputParser.js.map +0 -1
- package/dist/utils/output_parsers/prompt.d.ts +0 -3
- package/dist/utils/output_parsers/prompt.js +0 -22
- package/dist/utils/output_parsers/prompt.js.map +0 -1
- package/dist/utils/schemaParsing.d.ts +0 -6
- package/dist/utils/schemaParsing.js +0 -23
- package/dist/utils/schemaParsing.js.map +0 -1
- package/dist/utils/sharedFields.d.ts +0 -6
- package/dist/utils/sharedFields.js +0 -122
- package/dist/utils/sharedFields.js.map +0 -1
- package/dist/utils/tracing.d.ts +0 -7
- package/dist/utils/tracing.js +0 -20
- package/dist/utils/tracing.js.map +0 -1
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.N8nJsonLoader = void 0;
|
|
4
|
-
const json_1 = require("@langchain/classic/document_loaders/fs/json");
|
|
5
|
-
const text_1 = require("@langchain/classic/document_loaders/fs/text");
|
|
6
|
-
const n8n_workflow_1 = require("n8n-workflow");
|
|
7
|
-
const helpers_1 = require("./helpers");
|
|
8
|
-
class N8nJsonLoader {
|
|
9
|
-
constructor(context, optionsPrefix = '', textSplitter) {
|
|
10
|
-
this.context = context;
|
|
11
|
-
this.optionsPrefix = optionsPrefix;
|
|
12
|
-
this.textSplitter = textSplitter;
|
|
13
|
-
}
|
|
14
|
-
async processAll(items) {
|
|
15
|
-
const docs = [];
|
|
16
|
-
if (!items)
|
|
17
|
-
return [];
|
|
18
|
-
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
|
|
19
|
-
const processedDocuments = await this.processItem(items[itemIndex], itemIndex);
|
|
20
|
-
docs.push(...processedDocuments);
|
|
21
|
-
}
|
|
22
|
-
return docs;
|
|
23
|
-
}
|
|
24
|
-
async processItem(item, itemIndex) {
|
|
25
|
-
var _a;
|
|
26
|
-
const mode = this.context.getNodeParameter('jsonMode', itemIndex, 'allInputData');
|
|
27
|
-
const pointers = this.context.getNodeParameter(`${this.optionsPrefix}pointers`, itemIndex, '');
|
|
28
|
-
const pointersArray = pointers.split(',').map((pointer) => pointer.trim());
|
|
29
|
-
const metadata = (_a = (0, helpers_1.getMetadataFiltersValues)(this.context, itemIndex)) !== null && _a !== void 0 ? _a : [];
|
|
30
|
-
if (!item)
|
|
31
|
-
return [];
|
|
32
|
-
let documentLoader = null;
|
|
33
|
-
if (mode === 'allInputData') {
|
|
34
|
-
const itemString = JSON.stringify(item.json);
|
|
35
|
-
const itemBlob = new Blob([itemString], { type: 'application/json' });
|
|
36
|
-
documentLoader = new json_1.JSONLoader(itemBlob, pointersArray);
|
|
37
|
-
}
|
|
38
|
-
if (mode === 'expressionData') {
|
|
39
|
-
const dataString = this.context.getNodeParameter('jsonData', itemIndex);
|
|
40
|
-
if (typeof dataString === 'object') {
|
|
41
|
-
const itemBlob = new Blob([JSON.stringify(dataString)], { type: 'application/json' });
|
|
42
|
-
documentLoader = new json_1.JSONLoader(itemBlob, pointersArray);
|
|
43
|
-
}
|
|
44
|
-
if (typeof dataString === 'string') {
|
|
45
|
-
const itemBlob = new Blob([dataString], { type: 'text/plain' });
|
|
46
|
-
documentLoader = new text_1.TextLoader(itemBlob);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
if (documentLoader === null) {
|
|
50
|
-
throw new n8n_workflow_1.NodeOperationError(this.context.getNode(), 'Document loader is not initialized');
|
|
51
|
-
}
|
|
52
|
-
const docs = this.textSplitter
|
|
53
|
-
? await this.textSplitter.splitDocuments(await documentLoader.load())
|
|
54
|
-
: await documentLoader.load();
|
|
55
|
-
if (metadata) {
|
|
56
|
-
docs.forEach((doc) => {
|
|
57
|
-
doc.metadata = {
|
|
58
|
-
...doc.metadata,
|
|
59
|
-
...metadata,
|
|
60
|
-
};
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
return docs;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
exports.N8nJsonLoader = N8nJsonLoader;
|
|
67
|
-
//# sourceMappingURL=N8nJsonLoader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"N8nJsonLoader.js","sourceRoot":"","sources":["../../utils/N8nJsonLoader.ts"],"names":[],"mappings":";;;AAEA,sEAAyE;AACzE,sEAAyE;AACzE,+CAKsB;AAEtB,uCAAqD;AA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CAAC,MAAM,cAAc,CAAC,IAAI,EAAE,CAAC;YACrE,CAAC,CAAC,MAAM,cAAc,CAAC,IAAI,EAAE,CAAC;QAE/B,IAAI,QAAQ,EAAE,CAAC;YACd,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;gBACpB,GAAG,CAAC,QAAQ,GAAG;oBACd,GAAG,GAAG,CAAC,QAAQ;oBACf,GAAG,QAAQ;iBACX,CAAC;YACH,CAAC,CAAC,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;CACD;AA5ED,sCA4EC"}
|
package/dist/utils/N8nTool.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { DynamicStructuredToolInput } from '@langchain/core/tools';
|
|
2
|
-
import { DynamicStructuredTool, DynamicTool } from '@langchain/core/tools';
|
|
3
|
-
import type { ISupplyDataFunctions } from 'n8n-workflow';
|
|
4
|
-
import { ZodObject } from 'zod';
|
|
5
|
-
export declare const prepareFallbackToolDescription: (toolDescription: string, schema: ZodObject<any>) => string;
|
|
6
|
-
export declare class N8nTool extends DynamicStructuredTool {
|
|
7
|
-
private context;
|
|
8
|
-
constructor(context: ISupplyDataFunctions, fields: DynamicStructuredToolInput);
|
|
9
|
-
asDynamicTool(): DynamicTool;
|
|
10
|
-
}
|
package/dist/utils/N8nTool.js
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.N8nTool = exports.prepareFallbackToolDescription = void 0;
|
|
4
|
-
const tools_1 = require("@langchain/core/tools");
|
|
5
|
-
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
|
-
const zod_1 = require("zod");
|
|
7
|
-
const getSimplifiedType = (schema) => {
|
|
8
|
-
if (schema instanceof zod_1.ZodObject) {
|
|
9
|
-
return 'object';
|
|
10
|
-
}
|
|
11
|
-
else if (schema instanceof zod_1.ZodNumber) {
|
|
12
|
-
return 'number';
|
|
13
|
-
}
|
|
14
|
-
else if (schema instanceof zod_1.ZodBoolean) {
|
|
15
|
-
return 'boolean';
|
|
16
|
-
}
|
|
17
|
-
else if (schema instanceof zod_1.ZodNullable || schema instanceof zod_1.ZodOptional) {
|
|
18
|
-
return getSimplifiedType(schema.unwrap());
|
|
19
|
-
}
|
|
20
|
-
return 'string';
|
|
21
|
-
};
|
|
22
|
-
const getParametersDescription = (parameters) => parameters
|
|
23
|
-
.map(([name, schema]) => { var _a; return `${name}: (description: ${(_a = schema.description) !== null && _a !== void 0 ? _a : ''}, type: ${getSimplifiedType(schema)}, required: ${!schema.isOptional()})`; })
|
|
24
|
-
.join(',\n ');
|
|
25
|
-
const prepareFallbackToolDescription = (toolDescription, schema) => {
|
|
26
|
-
let description = `${toolDescription}`;
|
|
27
|
-
const toolParameters = Object.entries(schema.shape);
|
|
28
|
-
if (toolParameters.length) {
|
|
29
|
-
description += `
|
|
30
|
-
Tool expects valid stringified JSON object with ${toolParameters.length} properties.
|
|
31
|
-
Property names with description, type and required status:
|
|
32
|
-
${getParametersDescription(toolParameters)}
|
|
33
|
-
ALL parameters marked as required must be provided`;
|
|
34
|
-
}
|
|
35
|
-
return description;
|
|
36
|
-
};
|
|
37
|
-
exports.prepareFallbackToolDescription = prepareFallbackToolDescription;
|
|
38
|
-
class N8nTool extends tools_1.DynamicStructuredTool {
|
|
39
|
-
constructor(context, fields) {
|
|
40
|
-
super(fields);
|
|
41
|
-
this.context = context;
|
|
42
|
-
}
|
|
43
|
-
asDynamicTool() {
|
|
44
|
-
const { name, func, schema, context, description } = this;
|
|
45
|
-
if (!(schema instanceof zod_1.ZodObject)) {
|
|
46
|
-
throw new Error('Schema must be a ZodObject');
|
|
47
|
-
}
|
|
48
|
-
const zodSchema = schema;
|
|
49
|
-
const wrappedFunc = async function (query) {
|
|
50
|
-
let parsedQuery;
|
|
51
|
-
let dataToValidate;
|
|
52
|
-
try {
|
|
53
|
-
dataToValidate = (0, n8n_workflow_1.jsonParse)(query, { acceptJSObject: true });
|
|
54
|
-
}
|
|
55
|
-
catch (error) {
|
|
56
|
-
if (Object.keys(zodSchema.shape).length === 1) {
|
|
57
|
-
const parameterName = Object.keys(zodSchema.shape)[0];
|
|
58
|
-
dataToValidate = { [parameterName]: query };
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
throw new n8n_workflow_1.NodeOperationError(context.getNode(), `Input is not a valid JSON: ${error.message}`);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
try {
|
|
65
|
-
parsedQuery = zodSchema.parse(dataToValidate);
|
|
66
|
-
}
|
|
67
|
-
catch (error) {
|
|
68
|
-
throw new n8n_workflow_1.NodeOperationError(context.getNode(), `Input validation failed: ${error.message}`);
|
|
69
|
-
}
|
|
70
|
-
try {
|
|
71
|
-
const result = await func(parsedQuery);
|
|
72
|
-
return result;
|
|
73
|
-
}
|
|
74
|
-
catch (e) {
|
|
75
|
-
const { index } = context.addInputData(n8n_workflow_1.NodeConnectionTypes.AiTool, [[{ json: { query } }]]);
|
|
76
|
-
void context.addOutputData(n8n_workflow_1.NodeConnectionTypes.AiTool, index, e);
|
|
77
|
-
return e.toString();
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
return new tools_1.DynamicTool({
|
|
81
|
-
name,
|
|
82
|
-
description: (0, exports.prepareFallbackToolDescription)(description, schema),
|
|
83
|
-
func: wrappedFunc,
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
exports.N8nTool = N8nTool;
|
|
88
|
-
//# sourceMappingURL=N8nTool.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"N8nTool.js","sourceRoot":"","sources":["../../utils/N8nTool.ts"],"names":[],"mappings":";;;AACA,iDAA2E;AAE3E,+CAAkF;AAElF,6BAAiF;AAEjF,MAAM,iBAAiB,GAAG,CAAC,MAAkB,EAAE,EAAE;IAChD,IAAI,MAAM,YAAY,eAAS,EAAE,C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AAC;gBAEJ,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,CAAC;gBAEvC,OAAO,MAAM,CAAC;YACf,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACZ,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,YAAY,CAAC,kCAAmB,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;gBAC5F,KAAK,OAAO,CAAC,aAAa,CAAC,kCAAmB,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;gBAEjE,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC;YACrB,CAAC;QACF,CAAC,CAAC;QAEF,OAAO,IAAI,mBAAW,CAAC;YACtB,IAAI;YACJ,WAAW,EAAE,IAAA,sCAA8B,EAAC,WAAW,EAAE,MAAM,CAAC;YAChE,IAAI,EAAE,WAAW;SACjB,CAAC,CAAC;IACJ,CAAC;CACD;AAtED,0BAsEC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { DisplayCondition, INodeProperties, NodeParameterValue } from 'n8n-workflow';
|
|
2
|
-
export declare const schemaTypeField: INodeProperties;
|
|
3
|
-
export declare const buildJsonSchemaExampleField: (props?: {
|
|
4
|
-
showExtraProps?: Record<string, Array<NodeParameterValue | DisplayCondition> | undefined>;
|
|
5
|
-
}) => INodeProperties;
|
|
6
|
-
export declare const jsonSchemaExampleField: INodeProperties;
|
|
7
|
-
export declare const buildInputSchemaField: (props?: {
|
|
8
|
-
showExtraProps?: Record<string, Array<NodeParameterValue | DisplayCondition> | undefined>;
|
|
9
|
-
}) => INodeProperties;
|
|
10
|
-
export declare const inputSchemaField: INodeProperties;
|
|
11
|
-
export declare const promptTypeOptions: INodeProperties;
|
|
12
|
-
export declare const textInput: INodeProperties;
|
|
13
|
-
export declare const textFromPreviousNode: INodeProperties;
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.textFromPreviousNode = exports.textInput = exports.promptTypeOptions = exports.inputSchemaField = exports.buildInputSchemaField = exports.jsonSchemaExampleField = exports.buildJsonSchemaExampleField = exports.schemaTypeField = void 0;
|
|
4
|
-
exports.schemaTypeField = {
|
|
5
|
-
displayName: 'Schema Type',
|
|
6
|
-
name: 'schemaType',
|
|
7
|
-
type: 'options',
|
|
8
|
-
noDataExpression: true,
|
|
9
|
-
options: [
|
|
10
|
-
{
|
|
11
|
-
name: 'Generate From JSON Example',
|
|
12
|
-
value: 'fromJson',
|
|
13
|
-
description: 'Generate a schema from an example JSON object',
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
name: 'Define Below',
|
|
17
|
-
value: 'manual',
|
|
18
|
-
description: 'Define the JSON schema manually',
|
|
19
|
-
},
|
|
20
|
-
],
|
|
21
|
-
default: 'fromJson',
|
|
22
|
-
description: 'How to specify the schema for the function',
|
|
23
|
-
};
|
|
24
|
-
const buildJsonSchemaExampleField = (props) => ({
|
|
25
|
-
displayName: 'JSON Example',
|
|
26
|
-
name: 'jsonSchemaExample',
|
|
27
|
-
type: 'json',
|
|
28
|
-
default: `{
|
|
29
|
-
"some_input": "some_value"
|
|
30
|
-
}`,
|
|
31
|
-
noDataExpression: true,
|
|
32
|
-
typeOptions: {
|
|
33
|
-
rows: 10,
|
|
34
|
-
},
|
|
35
|
-
displayOptions: {
|
|
36
|
-
show: {
|
|
37
|
-
...props === null || props === void 0 ? void 0 : props.showExtraProps,
|
|
38
|
-
schemaType: ['fromJson'],
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
description: 'Example JSON object to use to generate the schema',
|
|
42
|
-
});
|
|
43
|
-
exports.buildJsonSchemaExampleField = buildJsonSchemaExampleField;
|
|
44
|
-
exports.jsonSchemaExampleField = (0, exports.buildJsonSchemaExampleField)();
|
|
45
|
-
const buildInputSchemaField = (props) => ({
|
|
46
|
-
displayName: 'Input Schema',
|
|
47
|
-
name: 'inputSchema',
|
|
48
|
-
type: 'json',
|
|
49
|
-
default: `{
|
|
50
|
-
"type": "object",
|
|
51
|
-
"properties": {
|
|
52
|
-
"some_input": {
|
|
53
|
-
"type": "string",
|
|
54
|
-
"description": "Some input to the function"
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}`,
|
|
58
|
-
noDataExpression: true,
|
|
59
|
-
typeOptions: {
|
|
60
|
-
rows: 10,
|
|
61
|
-
},
|
|
62
|
-
displayOptions: {
|
|
63
|
-
show: {
|
|
64
|
-
...props === null || props === void 0 ? void 0 : props.showExtraProps,
|
|
65
|
-
schemaType: ['manual'],
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
description: 'Schema to use for the function',
|
|
69
|
-
});
|
|
70
|
-
exports.buildInputSchemaField = buildInputSchemaField;
|
|
71
|
-
exports.inputSchemaField = (0, exports.buildInputSchemaField)();
|
|
72
|
-
exports.promptTypeOptions = {
|
|
73
|
-
displayName: 'Source for Prompt (User Message)',
|
|
74
|
-
name: 'promptType',
|
|
75
|
-
type: 'options',
|
|
76
|
-
options: [
|
|
77
|
-
{
|
|
78
|
-
name: 'Connected Chat Trigger Node',
|
|
79
|
-
value: 'auto',
|
|
80
|
-
description: "Looks for an input field called 'chatInput' that is coming from a directly connected Chat Trigger",
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
name: 'Define below',
|
|
84
|
-
value: 'define',
|
|
85
|
-
description: 'Use an expression to reference data in previous nodes or enter static text',
|
|
86
|
-
},
|
|
87
|
-
],
|
|
88
|
-
default: 'auto',
|
|
89
|
-
};
|
|
90
|
-
exports.textInput = {
|
|
91
|
-
displayName: 'Prompt (User Message)',
|
|
92
|
-
name: 'text',
|
|
93
|
-
type: 'string',
|
|
94
|
-
required: true,
|
|
95
|
-
default: '',
|
|
96
|
-
placeholder: 'e.g. Hello, how can you help me?',
|
|
97
|
-
typeOptions: {
|
|
98
|
-
rows: 2,
|
|
99
|
-
},
|
|
100
|
-
};
|
|
101
|
-
exports.textFromPreviousNode = {
|
|
102
|
-
displayName: 'Prompt (User Message)',
|
|
103
|
-
name: 'text',
|
|
104
|
-
type: 'string',
|
|
105
|
-
required: true,
|
|
106
|
-
default: '={{ $json.chatInput }}',
|
|
107
|
-
typeOptions: {
|
|
108
|
-
rows: 2,
|
|
109
|
-
},
|
|
110
|
-
disabledOptions: { show: { promptType: ['auto'] } },
|
|
111
|
-
};
|
|
112
|
-
//# sourceMappingURL=descriptions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"descriptions.js","sourceRoot":"","sources":["../../utils/descriptions.ts"],"names":[],"mappings":";;;AAEa,QAAA,eAAe,GAAoB;IAC/C,WAAW,EAAE,aAAa;IAC1B,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,SAAS;IACf,gBAAgB,EAAE,IAAI;IACtB,OAAO,EAAE;QACR;YACC,IAAI,EAAE,4BAA4B;YAClC,KAAK,EAAE,UAAU;YACjB,WAAW,EAAE,+CAA+C;SAC5D;QACD;YACC,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,QAAQ;YACf,WAAW,EAAE,iCAAiC;SAC9C;KACD;IACD,OAAO,EAAE,UAAU;IACnB,WAAW,EAAE,4CAA4C;CACzD,CAAC;AAEK,MAAM,2BAA2B,GAAG,CAAC,KAE3C,EAAmB,EAAE,CAAC,CAAC;IACvB,WAAW,EAAE,cAAc;IAC3B,IAAI,EAAE,mBAAmB;IACzB,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE;;EAER;IACD,gBAAgB,EAAE,IAAI;IACtB,WAAW,EAAE;QACZ,IAAI,EAAE,EAAE;KACR;IACD,cAAc,EAAE;QACf,IAAI,EAAE;YACL,GAAG,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,cAAc;YACxB,UAAU,EAAE,CAAC,UAAU,CAAC;SACxB;KACD;IACD,WAAW,EAAE,mDAAmD;CA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,EAAE,MAAM;IACZ,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,wBAAwB;IACjC,WAAW,EAAE;QACZ,IAAI,EAAE,CAAC;KACP;IACD,eAAe,EAAE,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE;CACnD,CAAC"}
|
package/dist/utils/helpers.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { BaseChatMessageHistory } from '@langchain/core/chat_history';
|
|
2
|
-
import type { BaseChatModel } from '@langchain/core/language_models/chat_models';
|
|
3
|
-
import type { BaseMessage } from '@langchain/core/messages';
|
|
4
|
-
import type { Tool } from '@langchain/core/tools';
|
|
5
|
-
import type { BaseChatMemory } from '@langchain/community/memory/chat_memory';
|
|
6
|
-
import type { AiEvent, IDataObject, IExecuteFunctions, ISupplyDataFunctions, IWebhookFunctions } from 'n8n-workflow';
|
|
7
|
-
export declare function getMetadataFiltersValues(ctx: IExecuteFunctions | ISupplyDataFunctions, itemIndex: number): Record<string, never> | undefined;
|
|
8
|
-
export declare function isBaseChatMemory(obj: unknown): obj is BaseChatMemory;
|
|
9
|
-
export declare function isBaseChatMessageHistory(obj: unknown): obj is BaseChatMessageHistory;
|
|
10
|
-
export declare function isChatInstance(model: unknown): model is BaseChatModel;
|
|
11
|
-
export declare function isToolsInstance(model: unknown): model is Tool;
|
|
12
|
-
export declare function getPromptInputByType(options: {
|
|
13
|
-
ctx: IExecuteFunctions;
|
|
14
|
-
i: number;
|
|
15
|
-
promptTypeKey: string;
|
|
16
|
-
inputKey: string;
|
|
17
|
-
}): string;
|
|
18
|
-
export declare function getSessionId(ctx: ISupplyDataFunctions | IWebhookFunctions, itemIndex: number, selectorKey?: string, autoSelect?: string, customKey?: string): string;
|
|
19
|
-
export declare function logAiEvent(executeFunctions: IExecuteFunctions | ISupplyDataFunctions, event: AiEvent, data?: IDataObject): void;
|
|
20
|
-
export declare function serializeChatHistory(chatHistory: BaseMessage[]): string;
|
|
21
|
-
export declare function escapeSingleCurlyBrackets(text?: string): string | undefined;
|
|
22
|
-
export declare const getConnectedTools: (ctx: IExecuteFunctions, enforceUniqueNames: boolean, convertStructuredTool?: boolean, escapeCurlyBrackets?: boolean) => Promise<Tool<any>[]>;
|
|
23
|
-
export declare function unwrapNestedOutput(output: Record<string, unknown>): Record<string, unknown>;
|
package/dist/utils/helpers.js
DELETED
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getConnectedTools = void 0;
|
|
4
|
-
exports.getMetadataFiltersValues = getMetadataFiltersValues;
|
|
5
|
-
exports.isBaseChatMemory = isBaseChatMemory;
|
|
6
|
-
exports.isBaseChatMessageHistory = isBaseChatMessageHistory;
|
|
7
|
-
exports.isChatInstance = isChatInstance;
|
|
8
|
-
exports.isToolsInstance = isToolsInstance;
|
|
9
|
-
exports.getPromptInputByType = getPromptInputByType;
|
|
10
|
-
exports.getSessionId = getSessionId;
|
|
11
|
-
exports.logAiEvent = logAiEvent;
|
|
12
|
-
exports.serializeChatHistory = serializeChatHistory;
|
|
13
|
-
exports.escapeSingleCurlyBrackets = escapeSingleCurlyBrackets;
|
|
14
|
-
exports.unwrapNestedOutput = unwrapNestedOutput;
|
|
15
|
-
const n8n_workflow_1 = require("n8n-workflow");
|
|
16
|
-
const N8nTool_1 = require("./N8nTool");
|
|
17
|
-
function hasMethods(obj, ...methodNames) {
|
|
18
|
-
return methodNames.every((methodName) => typeof obj === 'object' &&
|
|
19
|
-
obj !== null &&
|
|
20
|
-
methodName in obj &&
|
|
21
|
-
typeof obj[methodName] === 'function');
|
|
22
|
-
}
|
|
23
|
-
function getMetadataFiltersValues(ctx, itemIndex) {
|
|
24
|
-
const options = ctx.getNodeParameter('options', itemIndex, {});
|
|
25
|
-
if (options.metadata) {
|
|
26
|
-
const { metadataValues: metadata } = options.metadata;
|
|
27
|
-
if (metadata.length > 0) {
|
|
28
|
-
return metadata.reduce((acc, { name, value }) => ({ ...acc, [name]: value }), {});
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
if (options.searchFilterJson) {
|
|
32
|
-
return ctx.getNodeParameter('options.searchFilterJson', itemIndex, '', {
|
|
33
|
-
ensureType: 'object',
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
return undefined;
|
|
37
|
-
}
|
|
38
|
-
function isBaseChatMemory(obj) {
|
|
39
|
-
return hasMethods(obj, 'loadMemoryVariables', 'saveContext');
|
|
40
|
-
}
|
|
41
|
-
function isBaseChatMessageHistory(obj) {
|
|
42
|
-
return hasMethods(obj, 'getMessages', 'addMessage');
|
|
43
|
-
}
|
|
44
|
-
function isChatInstance(model) {
|
|
45
|
-
var _a;
|
|
46
|
-
const namespace = (_a = model === null || model === void 0 ? void 0 : model.lc_namespace) !== null && _a !== void 0 ? _a : [];
|
|
47
|
-
return namespace.includes('chat_models');
|
|
48
|
-
}
|
|
49
|
-
function isToolsInstance(model) {
|
|
50
|
-
var _a;
|
|
51
|
-
const namespace = (_a = model === null || model === void 0 ? void 0 : model.lc_namespace) !== null && _a !== void 0 ? _a : [];
|
|
52
|
-
return namespace.includes('tools');
|
|
53
|
-
}
|
|
54
|
-
function getPromptInputByType(options) {
|
|
55
|
-
const { ctx, i, promptTypeKey, inputKey } = options;
|
|
56
|
-
const prompt = ctx.getNodeParameter(promptTypeKey, i);
|
|
57
|
-
let input;
|
|
58
|
-
if (prompt === 'auto') {
|
|
59
|
-
input = ctx.evaluateExpression('{{ $json["chatInput"] }}', i);
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
input = ctx.getNodeParameter(inputKey, i);
|
|
63
|
-
}
|
|
64
|
-
if (input === undefined) {
|
|
65
|
-
throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), 'No prompt specified', {
|
|
66
|
-
description: "Expected to find the prompt in an input field called 'chatInput' (this is what the chat trigger node outputs). To use something else, change the 'Prompt' parameter",
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
return input;
|
|
70
|
-
}
|
|
71
|
-
function getSessionId(ctx, itemIndex, selectorKey = 'sessionIdType', autoSelect = 'fromInput', customKey = 'sessionKey') {
|
|
72
|
-
var _a;
|
|
73
|
-
let sessionId = '';
|
|
74
|
-
const selectorType = ctx.getNodeParameter(selectorKey, itemIndex);
|
|
75
|
-
if (selectorType === autoSelect) {
|
|
76
|
-
if ('getBodyData' in ctx) {
|
|
77
|
-
const bodyData = (_a = ctx.getBodyData()) !== null && _a !== void 0 ? _a : {};
|
|
78
|
-
sessionId = bodyData.sessionId;
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
sessionId = ctx.evaluateExpression('{{ $json.sessionId }}', itemIndex);
|
|
82
|
-
}
|
|
83
|
-
if (sessionId === '' || sessionId === undefined) {
|
|
84
|
-
throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), 'No session ID found', {
|
|
85
|
-
description: "Expected to find the session ID in an input field called 'sessionId' (this is what the chat trigger node outputs). To use something else, change the 'Session ID' parameter",
|
|
86
|
-
itemIndex,
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
sessionId = ctx.getNodeParameter(customKey, itemIndex, '');
|
|
92
|
-
if (sessionId === '' || sessionId === undefined) {
|
|
93
|
-
throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), 'Key parameter is empty', {
|
|
94
|
-
description: "Provide a key to use as session ID in the 'Key' parameter or use the 'Connected Chat Trigger Node' option to use the session ID from your Chat Trigger",
|
|
95
|
-
itemIndex,
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
return sessionId;
|
|
100
|
-
}
|
|
101
|
-
function logAiEvent(executeFunctions, event, data) {
|
|
102
|
-
try {
|
|
103
|
-
executeFunctions.logAiEvent(event, data ? (0, n8n_workflow_1.jsonStringify)(data) : undefined);
|
|
104
|
-
}
|
|
105
|
-
catch (error) {
|
|
106
|
-
executeFunctions.logger.debug(`Error logging AI event: ${event}`);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
function serializeChatHistory(chatHistory) {
|
|
110
|
-
return chatHistory
|
|
111
|
-
.map((chatMessage) => {
|
|
112
|
-
if (chatMessage._getType() === 'human') {
|
|
113
|
-
return `Human: ${chatMessage.content}`;
|
|
114
|
-
}
|
|
115
|
-
else if (chatMessage._getType() === 'ai') {
|
|
116
|
-
return `Assistant: ${chatMessage.content}`;
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
119
|
-
return `${chatMessage.content}`;
|
|
120
|
-
}
|
|
121
|
-
})
|
|
122
|
-
.join('\n');
|
|
123
|
-
}
|
|
124
|
-
function escapeSingleCurlyBrackets(text) {
|
|
125
|
-
if (text === undefined)
|
|
126
|
-
return undefined;
|
|
127
|
-
let result = text;
|
|
128
|
-
result = result
|
|
129
|
-
.replace(/(?<!{){{{(?!{)/g, '{{{{')
|
|
130
|
-
.replace(/(?<!})}}}(?!})/g, '}}}}')
|
|
131
|
-
.replace(/(?<!{){(?!{)/g, '{{')
|
|
132
|
-
.replace(/(?<!})}(?!})/g, '}}');
|
|
133
|
-
return result;
|
|
134
|
-
}
|
|
135
|
-
const getConnectedTools = async (ctx, enforceUniqueNames, convertStructuredTool = true, escapeCurlyBrackets = false) => {
|
|
136
|
-
var _a;
|
|
137
|
-
const connectedTools = (await ctx.getInputConnectionData(n8n_workflow_1.NodeConnectionTypes.AiTool, 0)) || [];
|
|
138
|
-
if (!enforceUniqueNames)
|
|
139
|
-
return connectedTools;
|
|
140
|
-
const seenNames = new Set();
|
|
141
|
-
const finalTools = [];
|
|
142
|
-
for (const tool of connectedTools) {
|
|
143
|
-
const { name } = tool;
|
|
144
|
-
if (seenNames.has(name)) {
|
|
145
|
-
throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), `You have multiple tools with the same name: '${name}', please rename them to avoid conflicts`);
|
|
146
|
-
}
|
|
147
|
-
seenNames.add(name);
|
|
148
|
-
if (escapeCurlyBrackets) {
|
|
149
|
-
tool.description = (_a = escapeSingleCurlyBrackets(tool.description)) !== null && _a !== void 0 ? _a : tool.description;
|
|
150
|
-
}
|
|
151
|
-
if (convertStructuredTool && tool instanceof N8nTool_1.N8nTool) {
|
|
152
|
-
finalTools.push(tool.asDynamicTool());
|
|
153
|
-
}
|
|
154
|
-
else {
|
|
155
|
-
finalTools.push(tool);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
return finalTools;
|
|
159
|
-
};
|
|
160
|
-
exports.getConnectedTools = getConnectedTools;
|
|
161
|
-
function unwrapNestedOutput(output) {
|
|
162
|
-
if ('output' in output &&
|
|
163
|
-
Object.keys(output).length === 1 &&
|
|
164
|
-
typeof output.output === 'object' &&
|
|
165
|
-
output.output !== null &&
|
|
166
|
-
'output' in output.output &&
|
|
167
|
-
Object.keys(output.output).length === 1) {
|
|
168
|
-
return output.output;
|
|
169
|
-
}
|
|
170
|
-
return output;
|
|
171
|
-
}
|
|
172
|
-
//# sourceMappingURL=helpers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../utils/helpers.ts"],"names":[],"mappings":";;;AA2BA,4DAyBC;AAED,4CAEC;AAED,4DAEC;AAED,wCAIC;AAED,0CAIC;AAED,oDAwBC;AAED,oCAuCC;AAED,gCAUC;AAED,oDAYC;AAED,8DAgBC;AA6CD,gDAaC;AA3OD,+CAAsF;AAStF,uCAAoC;AAEpC,SAAS,UAAU,CAAI,GAAY,EAAE,GAAG,WAAmC;IAC1E,OAAO,WAAW,CAAC,KAAK,CACvB,CAAC,UAAU,EAAE,EAAE,CACd,OAAO,GAAG,KAAK,QAAQ;QACvB,GAAG,KAAK,IAAI;QACZ,UAAU,IAAI,GAAG;QACjB,OAAQ,GAAwC,CAAC,UAAU,CAAC,KAAK,UAAU,CAC5E,CAAC;AACH,CAAC;AAED,SAAgB,wBAA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OAAO,EAAE,EACb,gDAAgD,IAAI,0CAA0C,CAC9F,CAAC;QACH,CAAC;QACD,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAEpB,IAAI,mBAAmB,EAAE,CAAC;YACzB,IAAI,CAAC,WAAW,GAAG,MAAA,yBAAyB,CAAC,IAAI,CAAC,WAAW,CAAC,mCAAI,IAAI,CAAC,WAAW,CAAC;QACpF,CAAC;QAED,IAAI,qBAAqB,IAAI,IAAI,YAAY,iBAAO,EAAE,CAAC;YACtD,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;QACvC,CAAC;aAAM,CAAC;YACP,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvB,CAAC;IACF,CAAC;IAED,OAAO,UAAU,CAAC;AACnB,CAAC,CAAC;AArCW,QAAA,iBAAiB,qBAqC5B;AAMF,SAAgB,kBAAkB,CAAC,MAA+B;IACjE,IACC,QAAQ,IAAI,MAAM;QAClB,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC;QAChC,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ;QACjC,MAAM,CAAC,MAAM,KAAK,IAAI;QACtB,QAAQ,IAAI,MAAM,CAAC,MAAM;QACzB,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC,EACtC,CAAC;QACF,OAAO,MAAM,CAAC,MAAiC,CAAC;IACjD,CAAC;IAED,OAAO,MAAM,CAAC;AACf,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { BaseChatMemory } from '@langchain/community/memory/chat_memory';
|
|
2
|
-
import type { BaseChatMessageHistory } from '@langchain/core/chat_history';
|
|
3
|
-
import type { Document } from '@langchain/core/documents';
|
|
4
|
-
import { Embeddings } from '@langchain/core/embeddings';
|
|
5
|
-
import { BaseRetriever } from '@langchain/core/retrievers';
|
|
6
|
-
import type { Tool } from '@langchain/core/tools';
|
|
7
|
-
import { VectorStore } from '@langchain/core/vectorstores';
|
|
8
|
-
import { TextSplitter } from '@langchain/textsplitters';
|
|
9
|
-
import type { BaseDocumentLoader } from '@langchain/classic/document_loaders/base';
|
|
10
|
-
import type { IExecuteFunctions, ISupplyDataFunctions, NodeConnectionType } from 'n8n-workflow';
|
|
11
|
-
import { N8nBinaryLoader } from './N8nBinaryLoader';
|
|
12
|
-
import { N8nJsonLoader } from './N8nJsonLoader';
|
|
13
|
-
export declare function callMethodAsync<T>(this: T, parameters: {
|
|
14
|
-
executeFunctions: IExecuteFunctions | ISupplyDataFunctions;
|
|
15
|
-
connectionType: NodeConnectionType;
|
|
16
|
-
currentNodeRunIndex: number;
|
|
17
|
-
method: (...args: unknown[]) => Promise<unknown>;
|
|
18
|
-
arguments: unknown[];
|
|
19
|
-
}): Promise<unknown>;
|
|
20
|
-
export declare function callMethodSync<T>(this: T, parameters: {
|
|
21
|
-
executeFunctions: IExecuteFunctions;
|
|
22
|
-
connectionType: NodeConnectionType;
|
|
23
|
-
currentNodeRunIndex: number;
|
|
24
|
-
method: (...args: any[]) => T;
|
|
25
|
-
arguments: unknown[];
|
|
26
|
-
}): unknown;
|
|
27
|
-
export declare function logWrapper(originalInstance: Tool | BaseChatMemory | BaseChatMessageHistory | BaseRetriever | Embeddings | Document[] | Document | BaseDocumentLoader | TextSplitter | VectorStore | N8nBinaryLoader | N8nJsonLoader, executeFunctions: IExecuteFunctions | ISupplyDataFunctions): Document<Record<string, any>> | Document<Record<string, any>>[] | Tool<any> | BaseChatMemory | BaseChatMessageHistory | N8nBinaryLoader | TextSplitter | BaseDocumentLoader | N8nJsonLoader | BaseRetriever<Record<string, any>> | Embeddings<number[]> | VectorStore;
|