@n8n/n8n-nodes-langchain 0.0.2 → 0.2.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.
- package/README.md +1 -1
- package/dist/build.tsbuildinfo +1 -0
- package/dist/known/credentials.json +87 -0
- package/dist/known/nodes.json +214 -0
- package/dist/nodes/agents/Agent/agents/ConversationalAgent/description.js +1 -0
- package/dist/nodes/agents/Agent/agents/ConversationalAgent/description.js.map +1 -1
- package/dist/nodes/agents/Agent/agents/ConversationalAgent/execute.js +3 -0
- package/dist/nodes/agents/Agent/agents/ConversationalAgent/execute.js.map +1 -1
- package/dist/nodes/agents/Agent/agents/OpenAiFunctionsAgent/description.js +1 -0
- package/dist/nodes/agents/Agent/agents/OpenAiFunctionsAgent/description.js.map +1 -1
- package/dist/nodes/agents/Agent/agents/OpenAiFunctionsAgent/execute.js +3 -0
- package/dist/nodes/agents/Agent/agents/OpenAiFunctionsAgent/execute.js.map +1 -1
- package/dist/nodes/agents/Agent/agents/ReActAgent/description.js +1 -0
- package/dist/nodes/agents/Agent/agents/ReActAgent/description.js.map +1 -1
- package/dist/nodes/agents/Agent/agents/ReActAgent/execute.js +4 -0
- package/dist/nodes/agents/Agent/agents/ReActAgent/execute.js.map +1 -1
- package/dist/nodes/agents/Agent/agents/SqlAgent/execute.js +3 -0
- package/dist/nodes/agents/Agent/agents/SqlAgent/execute.js.map +1 -1
- package/dist/nodes/chains/ChainLLM/ChainLlm.node.js +24 -22
- package/dist/nodes/chains/ChainLLM/ChainLlm.node.js.map +1 -1
- package/dist/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.js +7 -2
- package/dist/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.js.map +1 -1
- package/dist/nodes/code/Code.node.d.ts +1 -1
- package/dist/nodes/code/Code.node.js +7 -8
- package/dist/nodes/code/Code.node.js.map +1 -1
- package/dist/nodes/document_loaders/DocumentGithubLoader/DocumentGithubLoader.node.d.ts +1 -1
- package/dist/nodes/document_loaders/DocumentGithubLoader/DocumentGithubLoader.node.js +3 -3
- package/dist/nodes/document_loaders/DocumentGithubLoader/DocumentGithubLoader.node.js.map +1 -1
- package/dist/nodes/document_loaders/DocumentJSONInputLoader/DocumentJsonInputLoader.node.js.map +1 -1
- package/dist/nodes/embeddings/EmbeddingsCohere/EmbeddingsCohere.node.d.ts +1 -1
- package/dist/nodes/embeddings/EmbeddingsCohere/EmbeddingsCohere.node.js +2 -2
- package/dist/nodes/embeddings/EmbeddingsCohere/EmbeddingsCohere.node.js.map +1 -1
- package/dist/nodes/embeddings/EmbeddingsGooglePalm/EmbeddingsGooglePalm.node.d.ts +1 -1
- package/dist/nodes/embeddings/EmbeddingsGooglePalm/EmbeddingsGooglePalm.node.js +2 -2
- package/dist/nodes/embeddings/EmbeddingsGooglePalm/EmbeddingsGooglePalm.node.js.map +1 -1
- package/dist/nodes/embeddings/EmbeddingsHuggingFaceInference/EmbeddingsHuggingFaceInference.node.d.ts +1 -1
- package/dist/nodes/embeddings/EmbeddingsHuggingFaceInference/EmbeddingsHuggingFaceInference.node.js +2 -2
- package/dist/nodes/embeddings/EmbeddingsHuggingFaceInference/EmbeddingsHuggingFaceInference.node.js.map +1 -1
- package/dist/nodes/embeddings/EmbeddingsOpenAI/EmbeddingsOpenAi.node.d.ts +1 -1
- package/dist/nodes/embeddings/EmbeddingsOpenAI/EmbeddingsOpenAi.node.js +13 -3
- package/dist/nodes/embeddings/EmbeddingsOpenAI/EmbeddingsOpenAi.node.js.map +1 -1
- package/dist/nodes/llms/LMChatAnthropic/LmChatAnthropic.node.d.ts +1 -1
- package/dist/nodes/llms/LMChatAnthropic/LmChatAnthropic.node.js +1 -2
- package/dist/nodes/llms/LMChatAnthropic/LmChatAnthropic.node.js.map +1 -1
- package/dist/nodes/llms/LMChatOllama/LmChatOllama.node.d.ts +1 -1
- package/dist/nodes/llms/LMChatOllama/LmChatOllama.node.js +45 -20
- package/dist/nodes/llms/LMChatOllama/LmChatOllama.node.js.map +1 -1
- package/dist/nodes/llms/LMChatOpenAi/LmChatOpenAi.node.d.ts +1 -1
- package/dist/nodes/llms/LMChatOpenAi/LmChatOpenAi.node.js +15 -4
- package/dist/nodes/llms/LMChatOpenAi/LmChatOpenAi.node.js.map +1 -1
- package/dist/nodes/llms/LMCohere/LmCohere.node.d.ts +1 -1
- package/dist/nodes/llms/LMCohere/LmCohere.node.js +1 -2
- package/dist/nodes/llms/LMCohere/LmCohere.node.js.map +1 -1
- package/dist/nodes/llms/LMOllama/LmOllama.node.d.ts +1 -1
- package/dist/nodes/llms/LMOllama/LmOllama.node.js +45 -20
- package/dist/nodes/llms/LMOllama/LmOllama.node.js.map +1 -1
- package/dist/nodes/llms/LMOpenAi/LmOpenAi.node.d.ts +1 -1
- package/dist/nodes/llms/LMOpenAi/LmOpenAi.node.js +15 -4
- package/dist/nodes/llms/LMOpenAi/LmOpenAi.node.js.map +1 -1
- package/dist/nodes/llms/LMOpenHuggingFaceInference/LmOpenHuggingFaceInference.node.d.ts +1 -1
- package/dist/nodes/llms/LMOpenHuggingFaceInference/LmOpenHuggingFaceInference.node.js +1 -2
- package/dist/nodes/llms/LMOpenHuggingFaceInference/LmOpenHuggingFaceInference.node.js.map +1 -1
- package/dist/nodes/llms/LmChatGooglePalm/LmChatGooglePalm.node.d.ts +1 -1
- package/dist/nodes/llms/LmChatGooglePalm/LmChatGooglePalm.node.js +3 -3
- package/dist/nodes/llms/LmChatGooglePalm/LmChatGooglePalm.node.js.map +1 -1
- package/dist/nodes/llms/LmGooglePalm/LmGooglePalm.node.d.ts +1 -1
- package/dist/nodes/llms/LmGooglePalm/LmGooglePalm.node.js +3 -3
- package/dist/nodes/llms/LmGooglePalm/LmGooglePalm.node.js.map +1 -1
- package/dist/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.d.ts +1 -1
- package/dist/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.js +8 -8
- package/dist/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.js.map +1 -1
- package/dist/nodes/memory/MemoryMotorhead/MemoryMotorhead.node.d.ts +1 -1
- package/dist/nodes/memory/MemoryMotorhead/MemoryMotorhead.node.js +1 -2
- package/dist/nodes/memory/MemoryMotorhead/MemoryMotorhead.node.js.map +1 -1
- package/dist/nodes/memory/MemoryRedisChat/MemoryRedisChat.node.d.ts +1 -1
- package/dist/nodes/memory/MemoryRedisChat/MemoryRedisChat.node.js +3 -3
- package/dist/nodes/memory/MemoryRedisChat/MemoryRedisChat.node.js.map +1 -1
- package/dist/nodes/memory/MemoryXata/MemoryXata.node.d.ts +1 -1
- package/dist/nodes/memory/MemoryXata/MemoryXata.node.js +1 -2
- package/dist/nodes/memory/MemoryXata/MemoryXata.node.js.map +1 -1
- package/dist/nodes/memory/MemoryZep/MemoryZep.node.d.ts +1 -1
- package/dist/nodes/memory/MemoryZep/MemoryZep.node.js +1 -2
- package/dist/nodes/memory/MemoryZep/MemoryZep.node.js.map +1 -1
- package/dist/nodes/output_parser/OutputParserAutofixing/OutputParserAutofixing.node.d.ts +1 -1
- package/dist/nodes/output_parser/OutputParserAutofixing/OutputParserAutofixing.node.js +3 -3
- package/dist/nodes/output_parser/OutputParserAutofixing/OutputParserAutofixing.node.js.map +1 -1
- package/dist/nodes/output_parser/OutputParserItemList/OutputParserItemList.node.d.ts +1 -1
- package/dist/nodes/output_parser/OutputParserItemList/OutputParserItemList.node.js +1 -2
- package/dist/nodes/output_parser/OutputParserItemList/OutputParserItemList.node.js.map +1 -1
- package/dist/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.d.ts +1 -1
- package/dist/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.js +1 -2
- package/dist/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.js.map +1 -1
- package/dist/nodes/retrievers/RetrieverContextualCompression/RetrieverContextualCompression.node.d.ts +1 -1
- package/dist/nodes/retrievers/RetrieverContextualCompression/RetrieverContextualCompression.node.js +3 -3
- package/dist/nodes/retrievers/RetrieverContextualCompression/RetrieverContextualCompression.node.js.map +1 -1
- package/dist/nodes/retrievers/RetrieverMultiQuery/RetrieverMultiQuery.node.d.ts +1 -1
- package/dist/nodes/retrievers/RetrieverMultiQuery/RetrieverMultiQuery.node.js +3 -4
- package/dist/nodes/retrievers/RetrieverMultiQuery/RetrieverMultiQuery.node.js.map +1 -1
- package/dist/nodes/retrievers/RetrieverVectorStore/RetrieverVectorStore.node.d.ts +1 -1
- package/dist/nodes/retrievers/RetrieverVectorStore/RetrieverVectorStore.node.js +3 -3
- package/dist/nodes/retrievers/RetrieverVectorStore/RetrieverVectorStore.node.js.map +1 -1
- package/dist/nodes/retrievers/RetrieverWorkflow/RetrieverWorkflow.node.d.ts +1 -1
- package/dist/nodes/retrievers/RetrieverWorkflow/RetrieverWorkflow.node.js +4 -5
- package/dist/nodes/retrievers/RetrieverWorkflow/RetrieverWorkflow.node.js.map +1 -1
- package/dist/nodes/text_splitters/TextSplitterCharacterTextSplitter/TextSplitterCharacterTextSplitter.node.d.ts +1 -1
- package/dist/nodes/text_splitters/TextSplitterCharacterTextSplitter/TextSplitterCharacterTextSplitter.node.js +1 -2
- package/dist/nodes/text_splitters/TextSplitterCharacterTextSplitter/TextSplitterCharacterTextSplitter.node.js.map +1 -1
- package/dist/nodes/text_splitters/TextSplitterRecursiveCharacterTextSplitter/TextSplitterRecursiveCharacterTextSplitter.node.d.ts +1 -1
- package/dist/nodes/text_splitters/TextSplitterRecursiveCharacterTextSplitter/TextSplitterRecursiveCharacterTextSplitter.node.js +3 -3
- package/dist/nodes/text_splitters/TextSplitterRecursiveCharacterTextSplitter/TextSplitterRecursiveCharacterTextSplitter.node.js.map +1 -1
- package/dist/nodes/text_splitters/TextSplitterTokenSplitter/TextSplitterTokenSplitter.node.d.ts +1 -1
- package/dist/nodes/text_splitters/TextSplitterTokenSplitter/TextSplitterTokenSplitter.node.js +1 -2
- package/dist/nodes/text_splitters/TextSplitterTokenSplitter/TextSplitterTokenSplitter.node.js.map +1 -1
- package/dist/nodes/tools/ToolCode/ToolCode.node.d.ts +1 -1
- package/dist/nodes/tools/ToolCode/ToolCode.node.js +2 -3
- package/dist/nodes/tools/ToolCode/ToolCode.node.js.map +1 -1
- package/dist/nodes/tools/ToolGoogleCalendar/ToolGoogleCalendar.node.js +2 -0
- package/dist/nodes/tools/ToolGoogleCalendar/ToolGoogleCalendar.node.js.map +1 -0
- package/dist/nodes/tools/ToolGoogleCalendar/googleCalendar.svg +1 -0
- package/dist/nodes/tools/ToolSerpApi/ToolSerpApi.node.d.ts +1 -1
- package/dist/nodes/tools/ToolSerpApi/ToolSerpApi.node.js +1 -2
- package/dist/nodes/tools/ToolSerpApi/ToolSerpApi.node.js.map +1 -1
- package/dist/nodes/tools/ToolWorkflow/ToolWorkflow.node.d.ts +1 -1
- package/dist/nodes/tools/ToolWorkflow/ToolWorkflow.node.js +5 -6
- package/dist/nodes/tools/ToolWorkflow/ToolWorkflow.node.js.map +1 -1
- package/dist/nodes/vector_store/VectorStoreInMemoryInsert/VectorStoreInMemoryInsert.node.d.ts +5 -0
- package/dist/nodes/vector_store/VectorStoreInMemoryInsert/VectorStoreInMemoryInsert.node.js +85 -0
- package/dist/nodes/vector_store/VectorStoreInMemoryInsert/VectorStoreInMemoryInsert.node.js.map +1 -0
- package/dist/nodes/vector_store/VectorStoreInMemoryLoad/VectorStoreInMemoryLoad.node.d.ts +5 -0
- package/dist/nodes/vector_store/VectorStoreInMemoryLoad/VectorStoreInMemoryLoad.node.js +64 -0
- package/dist/nodes/vector_store/VectorStoreInMemoryLoad/VectorStoreInMemoryLoad.node.js.map +1 -0
- package/dist/nodes/vector_store/VectorStorePineconeInsert/VectorStorePineconeInsert.node.js +2 -12
- package/dist/nodes/vector_store/VectorStorePineconeInsert/VectorStorePineconeInsert.node.js.map +1 -1
- package/dist/nodes/vector_store/VectorStorePineconeLoad/VectorStorePineconeLoad.node.d.ts +1 -1
- package/dist/nodes/vector_store/VectorStorePineconeLoad/VectorStorePineconeLoad.node.js +4 -4
- package/dist/nodes/vector_store/VectorStorePineconeLoad/VectorStorePineconeLoad.node.js.map +1 -1
- package/dist/nodes/vector_store/VectorStoreSupabaseInsert/VectorStoreSupabaseInsert.node.js +2 -12
- package/dist/nodes/vector_store/VectorStoreSupabaseInsert/VectorStoreSupabaseInsert.node.js.map +1 -1
- package/dist/nodes/vector_store/VectorStoreSupabaseLoad/VectorStoreSupabaseLoad.node.d.ts +1 -1
- package/dist/nodes/vector_store/VectorStoreSupabaseLoad/VectorStoreSupabaseLoad.node.js +4 -4
- package/dist/nodes/vector_store/VectorStoreSupabaseLoad/VectorStoreSupabaseLoad.node.js.map +1 -1
- package/dist/nodes/vector_store/VectorStoreZepInsert/VectorStoreZepInsert.node.js +3 -12
- package/dist/nodes/vector_store/VectorStoreZepInsert/VectorStoreZepInsert.node.js.map +1 -1
- package/dist/nodes/vector_store/VectorStoreZepLoad/VectorStoreZepLoad.node.d.ts +1 -1
- package/dist/nodes/vector_store/VectorStoreZepLoad/VectorStoreZepLoad.node.js +4 -3
- package/dist/nodes/vector_store/VectorStoreZepLoad/VectorStoreZepLoad.node.js.map +1 -1
- package/dist/nodes/vector_store/shared/MemoryVectorStoreManager.d.ts +12 -0
- package/dist/nodes/vector_store/shared/MemoryVectorStoreManager.js +34 -0
- package/dist/nodes/vector_store/shared/MemoryVectorStoreManager.js.map +1 -0
- package/dist/nodes/vector_store/shared/processDocuments.d.ts +12 -0
- package/dist/nodes/vector_store/shared/processDocuments.js +23 -0
- package/dist/nodes/vector_store/shared/processDocuments.js.map +1 -0
- package/dist/types/nodes.json +13 -12
- package/dist/utils/logWrapper.d.ts +1 -2
- package/dist/utils/logWrapper.js +4 -2
- package/dist/utils/logWrapper.js.map +1 -1
- package/package.json +8 -5
- package/dist/nodes/agents/ConversationalAgent/ConversationalAgent.node.js +0 -2
- package/dist/nodes/agents/ConversationalAgent/ConversationalAgent.node.js.map +0 -1
- package/dist/nodes/retrievers/RetrieverContextualCompression copy/RetrieverContextualCompression.node.d.ts +0 -5
- package/dist/nodes/retrievers/RetrieverContextualCompression copy/RetrieverContextualCompression.node.js +0 -71
- package/dist/nodes/retrievers/RetrieverContextualCompression copy/RetrieverContextualCompression.node.js.map +0 -1
- package/dist/nodes/retrievers/RetrieverMultiQuery/RetrieverContextualCompression.node.d.ts +0 -5
- package/dist/nodes/retrievers/RetrieverMultiQuery/RetrieverContextualCompression.node.js +0 -71
- package/dist/nodes/retrievers/RetrieverMultiQuery/RetrieverContextualCompression.node.js.map +0 -1
- package/dist/nodes/retrievers/RetrieverMultiQuery copy/RetrieverMultiQuery.node.d.ts +0 -5
- package/dist/nodes/retrievers/RetrieverMultiQuery copy/RetrieverMultiQuery.node.js +0 -69
- package/dist/nodes/retrievers/RetrieverMultiQuery copy/RetrieverMultiQuery.node.js.map +0 -1
- package/dist/nodes/retrievers/RetrieverWorkflow/RetrieverMultiQuery.node.d.ts +0 -5
- package/dist/nodes/retrievers/RetrieverWorkflow/RetrieverMultiQuery.node.js +0 -69
- package/dist/nodes/retrievers/RetrieverWorkflow/RetrieverMultiQuery.node.js.map +0 -1
- package/dist/nodes/vector_store/VectorStoreInMemory/VectorStoreInMemory.node.d.ts +0 -5
- package/dist/nodes/vector_store/VectorStoreInMemory/VectorStoreInMemory.node.js +0 -66
- package/dist/nodes/vector_store/VectorStoreInMemory/VectorStoreInMemory.node.js.map +0 -1
- package/dist/tsconfig.build.tsbuildinfo +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- /package/dist/nodes/{agents/ConversationalAgent/ConversationalAgent.node.d.ts → tools/ToolGoogleCalendar/ToolGoogleCalendar.node.d.ts} +0 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VectorStoreInMemoryLoad = void 0;
|
|
4
|
+
const MemoryVectorStoreManager_1 = require("../shared/MemoryVectorStoreManager");
|
|
5
|
+
const logWrapper_1 = require("../../../utils/logWrapper");
|
|
6
|
+
class VectorStoreInMemoryLoad {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.description = {
|
|
9
|
+
displayName: 'In Memory Vector Store Load',
|
|
10
|
+
name: 'vectorStoreInMemoryLoad',
|
|
11
|
+
icon: 'fa:database',
|
|
12
|
+
group: ['transform'],
|
|
13
|
+
version: 1,
|
|
14
|
+
description: 'Load embedded data from an in-memory vector store',
|
|
15
|
+
defaults: {
|
|
16
|
+
name: 'In Memory Vector Store Load',
|
|
17
|
+
},
|
|
18
|
+
codex: {
|
|
19
|
+
categories: ['AI'],
|
|
20
|
+
subcategories: {
|
|
21
|
+
AI: ['Vector Stores'],
|
|
22
|
+
},
|
|
23
|
+
resources: {
|
|
24
|
+
primaryDocumentation: [
|
|
25
|
+
{
|
|
26
|
+
url: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.vectorstoreinmemory/',
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
inputs: [
|
|
32
|
+
{
|
|
33
|
+
displayName: 'Embedding',
|
|
34
|
+
maxConnections: 1,
|
|
35
|
+
type: "ai_embedding",
|
|
36
|
+
required: true,
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
outputs: ["ai_vectorStore"],
|
|
40
|
+
outputNames: ['Vector Store'],
|
|
41
|
+
properties: [
|
|
42
|
+
{
|
|
43
|
+
displayName: 'Memory Key',
|
|
44
|
+
name: 'memoryKey',
|
|
45
|
+
type: 'string',
|
|
46
|
+
default: 'vector_store_key',
|
|
47
|
+
description: 'The key to use to store the vector memory in the workflow data. The key will be prefixed with the workflow ID to avoid collisions.',
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
async supplyData(itemIndex) {
|
|
53
|
+
const embeddings = (await this.getInputConnectionData("ai_embedding", itemIndex));
|
|
54
|
+
const workflowId = this.getWorkflow().id;
|
|
55
|
+
const memoryKey = this.getNodeParameter('memoryKey', 0);
|
|
56
|
+
const vectorStoreSingleton = MemoryVectorStoreManager_1.MemoryVectorStoreManager.getInstance(embeddings);
|
|
57
|
+
const vectorStoreInstance = await vectorStoreSingleton.getVectorStore(`${workflowId}__${memoryKey}`);
|
|
58
|
+
return {
|
|
59
|
+
response: (0, logWrapper_1.logWrapper)(vectorStoreInstance, this),
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.VectorStoreInMemoryLoad = VectorStoreInMemoryLoad;
|
|
64
|
+
//# sourceMappingURL=VectorStoreInMemoryLoad.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VectorStoreInMemoryLoad.node.js","sourceRoot":"","sources":["../../../../nodes/vector_store/VectorStoreInMemoryLoad/VectorStoreInMemoryLoad.node.ts"],"names":[],"mappings":";;;AASA,iFAA8E;AAC9E,0DAAuD;AAEvD,MAAa,uBAAuB;IAApC;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,6BAA6B;YAC1C,IAAI,EAAE,yBAAyB;YAC/B,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,mDAAmD;YAChE,QAAQ,EAAE;gBACT,IAAI,EAAE,6BAA6B;aACnC;YACD,KAAK,EAAE;gBACN,UAAU,EAAE,CAAC,IAAI,CAAC;gBAClB,aAAa,EAAE;oBACd,EAAE,EAAE,CAAC,eAAe,CAAC;iBACrB;gBACD,SAAS,EAAE;oBACV,oBAAoB,EAAE;wBACrB;4BACC,GAAG,EAAE,2GAA2G;yBAChH;qBACD;iBACD;aACD;YAED,MAAM,EAAE;gBACP;oBACC,WAAW,EAAE,WAAW;oBACxB,cAAc,EAAE,CAAC;oBACjB,IAAI,gBAAgC;oBACpC,QAAQ,EAAE,IAAI;iBACd;aACD;YACD,OAAO,EAAE,kBAAkC;YAC3C,WAAW,EAAE,CAAC,cAAc,CAAC;YAC7B,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,YAAY;oBACzB,IAAI,EAAE,WAAW;oBACjB,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,kBAAkB;oBAC3B,WAAW,EACV,oIAAoI;iBACrI;aACD;SACD,CAAC;IAoBH,CAAC;IAlBA,KAAK,CAAC,UAAU,CAA0B,SAAiB;QAC1D,MAAM,UAAU,GAAG,CAAC,MAAM,IAAI,CAAC,sBAAsB,iBAEpD,SAAS,CACT,CAAe,CAAC;QAEjB,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC;QACzC,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC,CAAW,CAAC;QAElE,MAAM,oBAAoB,GAAG,mDAAwB,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAC9E,MAAM,mBAAmB,GAAG,MAAM,oBAAoB,CAAC,cAAc,CACpE,GAAG,UAAU,KAAK,SAAS,EAAE,CAC7B,CAAC;QAEF,OAAO;YACN,QAAQ,EAAE,IAAA,uBAAU,EAAC,mBAAmB,EAAE,IAAI,CAAC;SAC/C,CAAC;IACH,CAAC;CACD;AAjED,0DAiEC"}
|
|
@@ -3,8 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.VectorStorePineconeInsert = void 0;
|
|
4
4
|
const pinecone_1 = require("langchain/vectorstores/pinecone");
|
|
5
5
|
const pinecone_2 = require("@pinecone-database/pinecone");
|
|
6
|
-
const
|
|
7
|
-
const N8nBinaryLoader_1 = require("../../../utils/N8nBinaryLoader");
|
|
6
|
+
const processDocuments_1 = require("../shared/processDocuments");
|
|
8
7
|
class VectorStorePineconeInsert {
|
|
9
8
|
constructor() {
|
|
10
9
|
this.description = {
|
|
@@ -101,20 +100,11 @@ class VectorStorePineconeInsert {
|
|
|
101
100
|
if (namespace && clearNamespace) {
|
|
102
101
|
await pineconeIndex.delete1({ deleteAll: true, namespace });
|
|
103
102
|
}
|
|
104
|
-
|
|
105
|
-
if (documentInput instanceof N8nJsonLoader_1.N8nJsonLoader || documentInput instanceof N8nBinaryLoader_1.N8nBinaryLoader) {
|
|
106
|
-
processedDocuments = await documentInput.process(items);
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
processedDocuments = documentInput;
|
|
110
|
-
}
|
|
103
|
+
const { processedDocuments, serializedDocuments } = await (0, processDocuments_1.processDocuments)(documentInput, items);
|
|
111
104
|
await pinecone_1.PineconeStore.fromDocuments(processedDocuments, embeddings, {
|
|
112
105
|
namespace: namespace || undefined,
|
|
113
106
|
pineconeIndex,
|
|
114
107
|
});
|
|
115
|
-
const serializedDocuments = processedDocuments.map(({ metadata, pageContent }) => ({
|
|
116
|
-
json: { metadata, pageContent },
|
|
117
|
-
}));
|
|
118
108
|
return this.prepareOutputData(serializedDocuments);
|
|
119
109
|
}
|
|
120
110
|
}
|
package/dist/nodes/vector_store/VectorStorePineconeInsert/VectorStorePineconeInsert.node.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VectorStorePineconeInsert.node.js","sourceRoot":"","sources":["../../../../nodes/vector_store/VectorStorePineconeInsert/VectorStorePineconeInsert.node.ts"],"names":[],"mappings":";;;AAOA,8DAAgE;AAChE,0DAA6D;
|
|
1
|
+
{"version":3,"file":"VectorStorePineconeInsert.node.js","sourceRoot":"","sources":["../../../../nodes/vector_store/VectorStorePineconeInsert/VectorStorePineconeInsert.node.ts"],"names":[],"mappings":";;;AAOA,8DAAgE;AAChE,0DAA6D;AAI7D,iEAA8D;AAE9D,MAAa,yBAAyB;IAAtC;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,kBAAkB;YAC/B,IAAI,EAAE,2BAA2B;YACjC,IAAI,EAAE,mBAAmB;YACzB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,8CAA8C;YAC3D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C,CAAC;QAEH,OAAO,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,CAAC;IACpD,CAAC;CACD;AAzHD,8DAyHC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type IExecuteFunctions, type INodeType, type INodeTypeDescription, type SupplyData } from 'n8n-workflow';
|
|
2
2
|
export declare class VectorStorePineconeLoad implements INodeType {
|
|
3
3
|
description: INodeTypeDescription;
|
|
4
|
-
supplyData(this: IExecuteFunctions): Promise<SupplyData>;
|
|
4
|
+
supplyData(this: IExecuteFunctions, itemIndex: number): Promise<SupplyData>;
|
|
5
5
|
}
|
|
@@ -62,12 +62,12 @@ class VectorStorePineconeLoad {
|
|
|
62
62
|
],
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
|
-
async supplyData() {
|
|
65
|
+
async supplyData(itemIndex) {
|
|
66
66
|
this.logger.verbose('Supplying data for Pinecone Load Vector Store');
|
|
67
|
-
const namespace = this.getNodeParameter('pineconeNamespace',
|
|
68
|
-
const index = this.getNodeParameter('pineconeIndex',
|
|
67
|
+
const namespace = this.getNodeParameter('pineconeNamespace', itemIndex);
|
|
68
|
+
const index = this.getNodeParameter('pineconeIndex', itemIndex);
|
|
69
69
|
const credentials = await this.getCredentials('pineconeApi');
|
|
70
|
-
const embeddings = (await this.getInputConnectionData("ai_embedding",
|
|
70
|
+
const embeddings = (await this.getInputConnectionData("ai_embedding", itemIndex));
|
|
71
71
|
const client = new pinecone_2.PineconeClient();
|
|
72
72
|
await client.init({
|
|
73
73
|
apiKey: credentials.apiKey,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VectorStorePineconeLoad.node.js","sourceRoot":"","sources":["../../../../nodes/vector_store/VectorStorePineconeLoad/VectorStorePineconeLoad.node.ts"],"names":[],"mappings":";;;AAOA,8DAAgE;AAChE,0DAA6D;AAE7D,0DAAuD;AAEvD,MAAa,uBAAuB;IAApC;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,gBAAgB;YAC7B,IAAI,EAAE,yBAAyB;YAC/B,IAAI,EAAE,mBAAmB;YACzB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,4CAA4C;YACzD,QAAQ,EAAE;gBACT,IAAI,EAAE,gBAAgB;aACtB;YACD,KAAK,EAAE;gBACN,UAAU,EAAE,CAAC,IAAI,CAAC;gBAClB,aAAa,EAAE;oBACd,EAAE,EAAE,CAAC,eAAe,CAAC;iBACrB;gBACD,SAAS,EAAE;oBACV,oBAAoB,EAAE;wBACrB;4BACC,GAAG,EAAE,+GAA+G;yBACpH;qBACD;iBACD;aACD;YACD,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,aAAa;oBACnB,QAAQ,EAAE,IAAI;iBACd;aACD;YACD,MAAM,EAAE;gBACP;oBACC,WAAW,EAAE,WAAW;oBACxB,cAAc,EAAE,CAAC;oBACjB,IAAI,gBAAgC;oBACpC,QAAQ,EAAE,IAAI;iBACd;aACD;YACD,OAAO,EAAE,kBAAkC;YAC3C,WAAW,EAAE,CAAC,cAAc,CAAC;YAC7B,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,gBAAgB;oBAC7B,IAAI,EAAE,eAAe;oBACrB,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,EAAE;oBACX,QAAQ,EAAE,IAAI;iBACd;gBACD;oBACC,WAAW,EAAE,oBAAoB;oBACjC,IAAI,EAAE,mBAAmB;oBACzB,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,EAAE;iBACX;aACD;SACD,CAAC;
|
|
1
|
+
{"version":3,"file":"VectorStorePineconeLoad.node.js","sourceRoot":"","sources":["../../../../nodes/vector_store/VectorStorePineconeLoad/VectorStorePineconeLoad.node.ts"],"names":[],"mappings":";;;AAOA,8DAAgE;AAChE,0DAA6D;AAE7D,0DAAuD;AAEvD,MAAa,uBAAuB;IAApC;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,gBAAgB;YAC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E,SAAS,CAAW,CAAC;QAE1E,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;QAC7D,MAAM,UAAU,GAAG,CAAC,MAAM,IAAI,CAAC,sBAAsB,iBAEpD,SAAS,CACT,CAAe,CAAC;QAEjB,MAAM,MAAM,GAAG,IAAI,yBAAc,EAAE,CAAC;QACpC,MAAM,MAAM,CAAC,IAAI,CAAC;YACjB,MAAM,EAAE,WAAW,CAAC,MAAgB;YACpC,WAAW,EAAE,WAAW,CAAC,WAAqB;SAC9C,CAAC,CAAC;QAEH,MAAM,aAAa,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC1C,MAAM,WAAW,GAAG,MAAM,wBAAa,CAAC,iBAAiB,CAAC,UAAU,EAAE;YACrE,SAAS,EAAE,SAAS,IAAI,SAAS;YACjC,aAAa;SACb,CAAC,CAAC;QAEH,OAAO;YACN,QAAQ,EAAE,IAAA,uBAAU,EAAC,WAAW,EAAE,IAAI,CAAC;SACvC,CAAC;IACH,CAAC;CACD;AArFD,0DAqFC"}
|
|
@@ -3,8 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.VectorStoreSupabaseInsert = void 0;
|
|
4
4
|
const supabase_js_1 = require("@supabase/supabase-js");
|
|
5
5
|
const supabase_1 = require("langchain/vectorstores/supabase");
|
|
6
|
-
const
|
|
7
|
-
const N8nBinaryLoader_1 = require("../../../utils/N8nBinaryLoader");
|
|
6
|
+
const processDocuments_1 = require("../shared/processDocuments");
|
|
8
7
|
class VectorStoreSupabaseInsert {
|
|
9
8
|
constructor() {
|
|
10
9
|
this.description = {
|
|
@@ -93,21 +92,12 @@ class VectorStoreSupabaseInsert {
|
|
|
93
92
|
const documentInput = (await this.getInputConnectionData("ai_document", 0));
|
|
94
93
|
const embeddings = (await this.getInputConnectionData("ai_embedding", 0));
|
|
95
94
|
const client = (0, supabase_js_1.createClient)(credentials.host, credentials.serviceRole);
|
|
96
|
-
|
|
97
|
-
if (documentInput instanceof N8nJsonLoader_1.N8nJsonLoader || documentInput instanceof N8nBinaryLoader_1.N8nBinaryLoader) {
|
|
98
|
-
processedDocuments = await documentInput.process(items);
|
|
99
|
-
}
|
|
100
|
-
else {
|
|
101
|
-
processedDocuments = documentInput;
|
|
102
|
-
}
|
|
95
|
+
const { processedDocuments, serializedDocuments } = await (0, processDocuments_1.processDocuments)(documentInput, items);
|
|
103
96
|
await supabase_1.SupabaseVectorStore.fromDocuments(processedDocuments, embeddings, {
|
|
104
97
|
client,
|
|
105
98
|
tableName,
|
|
106
99
|
queryName,
|
|
107
100
|
});
|
|
108
|
-
const serializedDocuments = processedDocuments.map(({ metadata, pageContent }) => ({
|
|
109
|
-
json: { metadata, pageContent },
|
|
110
|
-
}));
|
|
111
101
|
return this.prepareOutputData(serializedDocuments);
|
|
112
102
|
}
|
|
113
103
|
}
|
package/dist/nodes/vector_store/VectorStoreSupabaseInsert/VectorStoreSupabaseInsert.node.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VectorStoreSupabaseInsert.node.js","sourceRoot":"","sources":["../../../../nodes/vector_store/VectorStoreSupabaseInsert/VectorStoreSupabaseInsert.node.ts"],"names":[],"mappings":";;;AASA,uDAAqD;AACrD,8DAAsE;
|
|
1
|
+
{"version":3,"file":"VectorStoreSupabaseInsert.node.js","sourceRoot":"","sources":["../../../../nodes/vector_store/VectorStoreSupabaseInsert/VectorStoreSupabaseInsert.node.ts"],"names":[],"mappings":";;;AASA,uDAAqD;AACrD,8DAAsE;AAGtE,iEAA8D;AAE9D,MAAa,yBAAyB;IAAtC;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,kBAAkB;YAC/B,IAAI,EAAE,2BAA2B;YACjC,IAAI,EAAE,mBAAmB;YACzB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,WAAW,EACV,8FAA8F;YAC/F,QAAQ,EA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OAAO;QACZ,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,iDAAiD,CAAC,CAAC;QAEvE,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QACnC,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC,CAAW,CAAC;QAClE,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC,CAAW,CAAC;QAClE,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;QAE7D,MAAM,aAAa,GAAG,CAAC,MAAM,IAAI,CAAC,sBAAsB,gBAAgC,CAAC,CAAC,CAE/C,CAAC;QAE5C,MAAM,UAAU,GAAG,CAAC,MAAM,IAAI,CAAC,sBAAsB,iBAEpD,CAAC,CACD,CAAe,CAAC;QACjB,MAAM,MAAM,GAAG,IAAA,0BAAY,EAAC,WAAW,CAAC,IAAc,EAAE,WAAW,CAAC,WAAqB,CAAC,CAAC;QAE3F,MAAM,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,GAAG,MAAM,IAAA,mCAAgB,EACzE,aAAa,EACb,KAAK,CACL,CAAC;QAEF,MAAM,8BAAmB,CAAC,aAAa,CAAC,kBAAkB,EAAE,UAAU,EAAE;YACvE,MAAM;YACN,SAAS;YACT,SAAS;SACT,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,CAAC;IACpD,CAAC;CACD;AA/GD,8DA+GC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type IExecuteFunctions, type INodeType, type INodeTypeDescription, type SupplyData } from 'n8n-workflow';
|
|
2
2
|
export declare class VectorStoreSupabaseLoad implements INodeType {
|
|
3
3
|
description: INodeTypeDescription;
|
|
4
|
-
supplyData(this: IExecuteFunctions): Promise<SupplyData>;
|
|
4
|
+
supplyData(this: IExecuteFunctions, itemIndex: number): Promise<SupplyData>;
|
|
5
5
|
}
|
|
@@ -84,11 +84,11 @@ class VectorStoreSupabaseLoad {
|
|
|
84
84
|
],
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
|
-
async supplyData() {
|
|
87
|
+
async supplyData(itemIndex) {
|
|
88
88
|
this.logger.verbose('Supply Supabase Load Vector Store');
|
|
89
|
-
const tableName = this.getNodeParameter('tableName',
|
|
90
|
-
const queryName = this.getNodeParameter('queryName',
|
|
91
|
-
const options = this.getNodeParameter('options',
|
|
89
|
+
const tableName = this.getNodeParameter('tableName', itemIndex);
|
|
90
|
+
const queryName = this.getNodeParameter('queryName', itemIndex);
|
|
91
|
+
const options = this.getNodeParameter('options', itemIndex, {});
|
|
92
92
|
const credentials = await this.getCredentials('supabaseApi');
|
|
93
93
|
const embeddings = (await this.getInputConnectionData("ai_embedding", 0));
|
|
94
94
|
const client = (0, supabase_js_1.createClient)(credentials.host, credentials.serviceRole);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VectorStoreSupabaseLoad.node.js","sourceRoot":"","sources":["../../../../nodes/vector_store/VectorStoreSupabaseLoad/VectorStoreSupabaseLoad.node.ts"],"names":[],"mappings":";;;AASA,uDAAqD;AACrD,8DAAsE;AACtE,0DAAuD;AAEvD,MAAa,uBAAuB;IAApC;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,gBAAgB;YAC7B,IAAI,EAAE,yBAAyB;YAC/B,IAAI,EAAE,mBAAmB;YACzB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,4CAA4C;YACzD,QAAQ,EAAE;gBACT,IAAI,EAAE,gBAAgB;aACtB;YACD,KAAK,EAAE;gBACN,UAAU,EAAE,CAAC,IAAI,CAAC;gBAClB,aAAa,EAAE;oBACd,EAAE,EAAE,CAAC,eAAe,CAAC;iBACrB;gBACD,SAAS,EAAE;oBACV,oBAAoB,EAAE;wBACrB;4BACC,GAAG,EAAE,+GAA+G;yBACpH;qBACD;iBACD;aACD;YACD,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,aAAa;oBACnB,QAAQ,EAAE,IAAI;iBACd;aACD;YACD,MAAM,EAAE;gBACP;oBACC,WAAW,EAAE,WAAW;oBACxB,cAAc,EAAE,CAAC;oBACjB,IAAI,gBAAgC;oBACpC,QAAQ,EAAE,IAAI;iBACd;aACD;YACD,OAAO,EAAE,kBAAkC;YAC3C,WAAW,EAAE,CAAC,cAAc,CAAC;YAC7B,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,YAAY;oBACzB,IAAI,EAAE,WAAW;oBACjB,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,EAAE;oBACX,QAAQ,EAAE,IAAI;oBACd,WAAW,EAAE,gCAAgC;iBAC7C;gBACD;oBACC,WAAW,EAAE,YAAY;oBACzB,IAAI,EAAE,WAAW;oBACjB,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,iBAAiB;oBAC1B,QAAQ,EAAE,IAAI;oBACd,WAAW,EAAE,iDAAiD;iBAC9D;gBACD;oBACC,WAAW,EAAE,SAAS;oBACtB,IAAI,EAAE,SAAS;oBACf,IAAI,EAAE,YAAY;oBAClB,WAAW,EAAE,YAAY;oBACzB,OAAO,EAAE,EAAE;oBACX,OAAO,EAAE;wBACR;4BACC,WAAW,EAAE,iBAAiB;4BAC9B,IAAI,EAAE,QAAQ;4BACd,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE;gCACZ,MAAM,EAAE,MAAM;gCACd,cAAc,EAAE,MAAM;6BACtB;4BACD,OAAO,EAAE,EAAE;yBACX;qBACD;iBACD;aACD;SACD,CAAC;IA+BH,CAAC;IA7BA,KAAK,CAAC,UAAU;
|
|
1
|
+
{"version":3,"file":"VectorStoreSupabaseLoad.node.js","sourceRoot":"","sources":["../../../../nodes/vector_store/VectorStoreSupabaseLoad/VectorStoreSupabaseLoad.node.ts"],"names":[],"mappings":";;;AASA,uDAAqD;AACrD,8DAAsE;AACt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", { value: true });
|
|
3
3
|
exports.VectorStoreZepInsert = void 0;
|
|
4
4
|
const zep_1 = require("langchain/vectorstores/zep");
|
|
5
|
-
const
|
|
6
|
-
const N8nBinaryLoader_1 = require("../../../utils/N8nBinaryLoader");
|
|
5
|
+
const processDocuments_1 = require("../shared/processDocuments");
|
|
7
6
|
class VectorStoreZepInsert {
|
|
8
7
|
constructor() {
|
|
9
8
|
this.description = {
|
|
@@ -100,23 +99,15 @@ class VectorStoreZepInsert {
|
|
|
100
99
|
const credentials = (await this.getCredentials('zepApi'));
|
|
101
100
|
const documentInput = (await this.getInputConnectionData("ai_document", 0));
|
|
102
101
|
const embeddings = (await this.getInputConnectionData("ai_embedding", 0));
|
|
103
|
-
|
|
104
|
-
if (documentInput instanceof N8nJsonLoader_1.N8nJsonLoader || documentInput instanceof N8nBinaryLoader_1.N8nBinaryLoader) {
|
|
105
|
-
processedDocuments = await documentInput.process(items);
|
|
106
|
-
}
|
|
107
|
-
else {
|
|
108
|
-
processedDocuments = documentInput;
|
|
109
|
-
}
|
|
102
|
+
const { processedDocuments, serializedDocuments } = await (0, processDocuments_1.processDocuments)(documentInput, items);
|
|
110
103
|
const zepConfig = {
|
|
111
104
|
apiUrl: credentials.apiUrl,
|
|
105
|
+
apiKey: credentials.apiKey,
|
|
112
106
|
collectionName,
|
|
113
107
|
embeddingDimensions: (_a = options.embeddingDimensions) !== null && _a !== void 0 ? _a : 1536,
|
|
114
108
|
isAutoEmbedded: (_b = options.isAutoEmbedded) !== null && _b !== void 0 ? _b : true,
|
|
115
109
|
};
|
|
116
110
|
await zep_1.ZepVectorStore.fromDocuments(processedDocuments, embeddings, zepConfig);
|
|
117
|
-
const serializedDocuments = processedDocuments.map(({ metadata, pageContent }) => ({
|
|
118
|
-
json: { metadata, pageContent },
|
|
119
|
-
}));
|
|
120
111
|
return this.prepareOutputData(serializedDocuments);
|
|
121
112
|
}
|
|
122
113
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VectorStoreZepInsert.node.js","sourceRoot":"","sources":["../../../../nodes/vector_store/VectorStoreZepInsert/VectorStoreZepInsert.node.ts"],"names":[],"mappings":";;;AAOA,oDAA4D;
|
|
1
|
+
{"version":3,"file":"VectorStoreZepInsert.node.js","sourceRoot":"","sources":["../../../../nodes/vector_store/VectorStoreZepInsert/VectorStoreZepInsert.node.ts"],"names":[],"mappings":";;;AAOA,oDAA4D;AAI5D,iEAA8D;AAE9D,MAAa,oBAAoB;IAAjC;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,0BAA0B;YACvC,IAAI,EAAE,sBAAsB;YAE5B,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,yCAAyC;YACtD,QAAQ,EAAE;gBACT,IAAI,EAAE,aAAa;aACnB;YACD,KAAK,EAAE;gBACN,UAAU,EAAE,CAAC,IAAI,CAAC;gBAClB,aAAa,EAAE;oBACd,EAAE,EAAE,CAAC,eAAe,CAAC;iBACrB;gBACD,SAAS,EAAE;oBACV,oBAAoB,EAAE;wBACrB;4BACC,GAAG,EAAE,4GAA4G;yBACjH;qBACD;iBACD;aACD;YACD,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,IAAI;iBACd;aACD;YACD,MAAM,EAAE;;gBAEP;oBACC,WAAW,EAAE,UAAU;oBACvB,cAAc,EAAE,CAAC;oBACjB,IAAI,eAA+B;oBACnC,QAAQ,EAAE,IAAI;iBACd;gBACD;oBACC,WAAW,EAAE,WAAW;oBACxB,cAAc,EAAE,CAAC;oBACjB,IAAI,gBAAgC;oBACpC,QAAQ,EAAE,IAAI;iBACd;aACD;YACD,OAAO,EAAE,QAAyB;YAClC,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,iBAAiB;oBAC9B,IAAI,EAAE,gBAAgB;oBACtB,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,EAAE;oB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AM,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,GAAG,MAAM,IAAA,mCAAgB,EACzE,aAAa,EACb,KAAK,CACL,CAAC;QAEF,MAAM,SAAS,GAAG;YACjB,MAAM,EAAE,WAAW,CAAC,MAAM;YAC1B,MAAM,EAAE,WAAW,CAAC,MAAM;YAC1B,cAAc;YACd,mBAAmB,EAAE,MAAA,OAAO,CAAC,mBAAmB,mCAAI,IAAI;YACxD,cAAc,EAAE,MAAA,OAAO,CAAC,cAAc,mCAAI,IAAI;SAC9C,CAAC;QAEF,MAAM,oBAAc,CAAC,aAAa,CAAC,kBAAkB,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;QAE9E,OAAO,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,CAAC;IACpD,CAAC;CACD;AAlID,oDAkIC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type IExecuteFunctions, type INodeType, type INodeTypeDescription, type SupplyData } from 'n8n-workflow';
|
|
2
2
|
export declare class VectorStoreZepLoad implements INodeType {
|
|
3
3
|
description: INodeTypeDescription;
|
|
4
|
-
supplyData(this: IExecuteFunctions): Promise<SupplyData>;
|
|
4
|
+
supplyData(this: IExecuteFunctions, itemIndex: number): Promise<SupplyData>;
|
|
5
5
|
}
|
|
@@ -71,15 +71,16 @@ class VectorStoreZepLoad {
|
|
|
71
71
|
],
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
|
-
async supplyData() {
|
|
74
|
+
async supplyData(itemIndex) {
|
|
75
75
|
var _a;
|
|
76
76
|
this.logger.verbose('Supplying data for Zep Load Vector Store');
|
|
77
|
-
const collectionName = this.getNodeParameter('collectionName',
|
|
78
|
-
const options = this.getNodeParameter('options',
|
|
77
|
+
const collectionName = this.getNodeParameter('collectionName', itemIndex);
|
|
78
|
+
const options = this.getNodeParameter('options', itemIndex) || {};
|
|
79
79
|
const credentials = (await this.getCredentials('zepApi'));
|
|
80
80
|
const embeddings = (await this.getInputConnectionData("ai_embedding", 0));
|
|
81
81
|
const zepConfig = {
|
|
82
82
|
apiUrl: credentials.apiUrl,
|
|
83
|
+
apiKey: credentials.apiKey,
|
|
83
84
|
collectionName,
|
|
84
85
|
embeddingDimensions: (_a = options.embeddingDimensions) !== null && _a !== void 0 ? _a : 1536,
|
|
85
86
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VectorStoreZepLoad.node.js","sourceRoot":"","sources":["../../../../nodes/vector_store/VectorStoreZepLoad/VectorStoreZepLoad.node.ts"],"names":[],"mappings":";;;AAOA,oDAA4D;AAE5D,0DAAuD;AAEvD,MAAa,kBAAkB;IAA/B;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,wBAAwB;YACrC,IAAI,EAAE,oBAAoB;YAE1B,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,uCAAuC;YACpD,QAAQ,EAAE;gBACT,IAAI,EAAE,WAAW;aACjB;YACD,KAAK,EAAE;gBACN,UAAU,EAAE,CAAC,IAAI,CAAC;gBAClB,aAAa,EAAE;oBACd,EAAE,EAAE,CAAC,eAAe,CAAC;iBACrB;gBACD,SAAS,EAAE;oBACV,oBAAoB,EAAE;wBACrB;4BACC,GAAG,EAAE,0GAA0G;yBAC/G;qBACD;iBACD;aACD;YACD,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,IAAI;iBACd;aACD;YACD,MAAM,EAAE;gBACP;oBACC,WAAW,EAAE,WAAW;oBACxB,cAAc,EAAE,CAAC;oBACjB,IAAI,gBAAgC;oBACpC,QAAQ,EAAE,IAAI;iBACd;aACD;YACD,OAAO,EAAE,kBAAkC;YAC3C,WAAW,EAAE,CAAC,cAAc,CAAC;YAC7B,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,iBAAiB;oBAC9B,IAAI,EAAE,gBAAgB;oBACtB,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,EAAE;oBACX,QAAQ,EAAE,IAAI;iBACd;gBACD;oBACC,WAAW,EAAE,SAAS;oBACtB,IAAI,EAAE,SAAS;oBACf,IAAI,EAAE,YAAY;oBAClB,WAAW,EAAE,YAAY;oBACzB,OAAO,EAAE,EAAE;oBACX,OAAO,EAAE;wBACR;4BACC,WAAW,EAAE,sBAAsB;4BACnC,IAAI,EAAE,qBAAqB;4BAC3B,IAAI,EAAE,QAAQ;4BACd,OAAO,EAAE,IAAI;4BACb,WAAW,EAAE,qEAAqE;yBAClF;qBACD;iBACD;aACD;SACD,CAAC;
|
|
1
|
+
{"version":3,"file":"VectorStoreZepLoad.node.js","sourceRoot":"","sources":["../../../../nodes/vector_store/VectorStoreZepLoad/VectorStoreZepLoad.node.ts"],"names":[],"mappings":";;;AAOA,oDAA4D;AAE5D,0DAAuD;AAEvD,MAAa,kBAAkB;IAA/B;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,wBAAwB;YACrC,IAAI,EAAE,oBAAoB;YAE1B,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,uCAAuC;YACpD,QAAQ,EAAE;gBACT,IAAI,EAAE,WAAW;aACjB;YACD,KAAK,EAAE;gBACN,UAAU,EAAE,CAAC,IAAI,CAAC;gBAClB,aAAa,EAAE;oBACd,EAAE,EAAE,CAAC,eAAe,CAAC;iBACrB;gBACD,SAAS,EAAE;oBACV,oBAAoB,EAAE;wBACrB;4BACC,GAAG,EAAE,0GAA0G;yBAC/G;qBACD;iBACD;aACD;YACD,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,IAAI;iBACd;aACD;YACD,MAAM,EAAE;gBACP;oBACC,WAAW,EAAE,WAAW;oBACxB,cAAc,EAAE,CAAC;oBACjB,IAAI,gBAAgC;oBACpC,QAAQ,EAAE,IAAI;iBACd;aACD;YACD,OA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C,UAAU,EAAE,SAAS,CAAC,CAAC;QAE9D,OAAO;YACN,QAAQ,EAAE,IAAA,uBAAU,EAAC,WAAW,EAAE,IAAI,CAAC;SACvC,CAAC;IACH,CAAC;CACD;AApGD,gDAoGC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Document } from 'langchain/document';
|
|
2
|
+
import type { Embeddings } from 'langchain/embeddings/base';
|
|
3
|
+
import { MemoryVectorStore } from 'langchain/vectorstores/memory';
|
|
4
|
+
export declare class MemoryVectorStoreManager {
|
|
5
|
+
private static instance;
|
|
6
|
+
private vectorStoreBuffer;
|
|
7
|
+
private embeddings;
|
|
8
|
+
private constructor();
|
|
9
|
+
static getInstance(embeddings: Embeddings): MemoryVectorStoreManager;
|
|
10
|
+
getVectorStore(memoryKey: string): Promise<MemoryVectorStore>;
|
|
11
|
+
addDocuments(memoryKey: string, documents: Document[], clearStore?: boolean): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MemoryVectorStoreManager = void 0;
|
|
4
|
+
const memory_1 = require("langchain/vectorstores/memory");
|
|
5
|
+
class MemoryVectorStoreManager {
|
|
6
|
+
constructor(embeddings) {
|
|
7
|
+
this.vectorStoreBuffer = new Map();
|
|
8
|
+
this.embeddings = embeddings;
|
|
9
|
+
}
|
|
10
|
+
static getInstance(embeddings) {
|
|
11
|
+
if (!MemoryVectorStoreManager.instance) {
|
|
12
|
+
MemoryVectorStoreManager.instance = new MemoryVectorStoreManager(embeddings);
|
|
13
|
+
}
|
|
14
|
+
return MemoryVectorStoreManager.instance;
|
|
15
|
+
}
|
|
16
|
+
async getVectorStore(memoryKey) {
|
|
17
|
+
let vectorStoreInstance = this.vectorStoreBuffer.get(memoryKey);
|
|
18
|
+
if (!vectorStoreInstance) {
|
|
19
|
+
vectorStoreInstance = await memory_1.MemoryVectorStore.fromExistingIndex(this.embeddings);
|
|
20
|
+
this.vectorStoreBuffer.set(memoryKey, vectorStoreInstance);
|
|
21
|
+
}
|
|
22
|
+
return vectorStoreInstance;
|
|
23
|
+
}
|
|
24
|
+
async addDocuments(memoryKey, documents, clearStore) {
|
|
25
|
+
if (clearStore) {
|
|
26
|
+
this.vectorStoreBuffer.delete(memoryKey);
|
|
27
|
+
}
|
|
28
|
+
const vectorStoreInstance = await this.getVectorStore(memoryKey);
|
|
29
|
+
await vectorStoreInstance.addDocuments(documents);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.MemoryVectorStoreManager = MemoryVectorStoreManager;
|
|
33
|
+
MemoryVectorStoreManager.instance = null;
|
|
34
|
+
//# sourceMappingURL=MemoryVectorStoreManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MemoryVectorStoreManager.js","sourceRoot":"","sources":["../../../../nodes/vector_store/shared/MemoryVectorStoreManager.ts"],"names":[],"mappings":";;;AAEA,0DAAkE;AAElE,MAAa,wBAAwB;IAOpC,YAAoB,UAAsB;QACzC,IAAI,CAAC,iBAAiB,GAAG,IAAI,GAAG,EAAE,CAAC;QACnC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC9B,CAAC;IAEM,MAAM,CAAC,WAAW,CAAC,UAAsB;QAC/C,IAAI,CAAC,wBAAwB,CAAC,QAAQ,EAAE;YACvC,wBAAwB,CAAC,QAAQ,GAAG,IAAI,wBAAwB,CAAC,UAAU,CAAC,CAAC;SAC7E;QACD,OAAO,wBAAwB,CAAC,QAAQ,CAAC;IAC1C,CAAC;IAEM,KAAK,CAAC,cAAc,CAAC,SAAiB;QAC5C,IAAI,mBAAmB,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAEhE,IAAI,CAAC,mBAAmB,EAAE;YACzB,mBAAmB,GAAG,MAAM,0BAAiB,CAAC,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YACjF,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC;SAC3D;QAED,OAAO,mBAAmB,CAAC;IAC5B,CAAC;IAEM,KAAK,CAAC,YAAY,CACxB,SAAiB,EACjB,SAAqB,EACrB,UAAoB;QAEpB,IAAI,UAAU,EAAE;YACf,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;SACzC;QACD,MAAM,mBAAmB,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;QACjE,MAAM,mBAAmB,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IACnD,CAAC;;AAxCF,4DAyCC;AAxCe,iCAAQ,GAAoC,IAAI,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Document } from 'langchain/document';
|
|
2
|
+
import type { INodeExecutionData } from 'n8n-workflow';
|
|
3
|
+
import { N8nJsonLoader } from '../../../utils/N8nJsonLoader';
|
|
4
|
+
export declare function processDocuments(documentInput: N8nJsonLoader | Array<Document<Record<string, unknown>>>, inputItems: INodeExecutionData[]): Promise<{
|
|
5
|
+
processedDocuments: Document<Record<string, any>>[];
|
|
6
|
+
serializedDocuments: {
|
|
7
|
+
json: {
|
|
8
|
+
metadata: Record<string, any>;
|
|
9
|
+
pageContent: string;
|
|
10
|
+
};
|
|
11
|
+
}[];
|
|
12
|
+
}>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.processDocuments = void 0;
|
|
4
|
+
const N8nJsonLoader_1 = require("../../../utils/N8nJsonLoader");
|
|
5
|
+
const N8nBinaryLoader_1 = require("../../../utils/N8nBinaryLoader");
|
|
6
|
+
async function processDocuments(documentInput, inputItems) {
|
|
7
|
+
let processedDocuments;
|
|
8
|
+
if (documentInput instanceof N8nJsonLoader_1.N8nJsonLoader || documentInput instanceof N8nBinaryLoader_1.N8nBinaryLoader) {
|
|
9
|
+
processedDocuments = await documentInput.process(inputItems);
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
processedDocuments = documentInput;
|
|
13
|
+
}
|
|
14
|
+
const serializedDocuments = processedDocuments.map(({ metadata, pageContent }) => ({
|
|
15
|
+
json: { metadata, pageContent },
|
|
16
|
+
}));
|
|
17
|
+
return {
|
|
18
|
+
processedDocuments,
|
|
19
|
+
serializedDocuments,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
exports.processDocuments = processDocuments;
|
|
23
|
+
//# sourceMappingURL=processDocuments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processDocuments.js","sourceRoot":"","sources":["../../../../nodes/vector_store/shared/processDocuments.ts"],"names":[],"mappings":";;;AAEA,gEAA6D;AAC7D,oEAAiE;AAE1D,KAAK,UAAU,gBAAgB,CACrC,aAAuE,EACvE,UAAgC;IAEhC,IAAI,kBAA8B,CAAC;IAEnC,IAAI,aAAa,YAAY,6BAAa,IAAI,aAAa,YAAY,iCAAe,EAAE;QACvF,kBAAkB,GAAG,MAAM,aAAa,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;KAC7D;SAAM;QACN,kBAAkB,GAAG,aAAa,CAAC;KACnC;IAED,MAAM,mBAAmB,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;QAClF,IAAI,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE;KAC/B,CAAC,CAAC,CAAC;IAEJ,OAAO;QACN,kBAAkB;QAClB,mBAAmB;KACnB,CAAC;AACH,CAAC;AApBD,4CAoBC"}
|