@n8n/n8n-nodes-langchain 1.100.0 → 1.101.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/dist/credentials/WeaviateApi.credentials.js +164 -0
- package/dist/credentials/WeaviateApi.credentials.js.map +1 -0
- package/dist/known/credentials.json +7 -0
- package/dist/known/nodes.json +4 -0
- package/dist/nodes/agents/Agent/Agent.node.js +5 -2
- package/dist/nodes/agents/Agent/Agent.node.js.map +1 -1
- package/dist/nodes/agents/Agent/V1/AgentV1.node.js +1 -4
- package/dist/nodes/agents/Agent/V1/AgentV1.node.js.map +1 -1
- package/dist/nodes/agents/Agent/V2/AgentV2.node.js +23 -6
- package/dist/nodes/agents/Agent/V2/AgentV2.node.js.map +1 -1
- package/dist/nodes/agents/Agent/agents/SqlAgent/description.js +0 -1
- package/dist/nodes/agents/Agent/agents/SqlAgent/description.js.map +1 -1
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V2/description.js +29 -1
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V2/description.js.map +1 -1
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V2/execute.js +94 -4
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V2/execute.js.map +1 -1
- package/dist/nodes/agents/Agent/agents/ToolsAgent/common.js.map +1 -1
- package/dist/nodes/agents/OpenAiAssistant/OpenAiAssistant.node.js +0 -1
- package/dist/nodes/agents/OpenAiAssistant/OpenAiAssistant.node.js.map +1 -1
- package/dist/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.js +0 -1
- package/dist/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.js.map +1 -1
- package/dist/nodes/chains/ChainSummarization/V1/ChainSummarizationV1.node.js +0 -1
- package/dist/nodes/chains/ChainSummarization/V1/ChainSummarizationV1.node.js.map +1 -1
- package/dist/nodes/chains/ChainSummarization/V2/ChainSummarizationV2.node.js +0 -1
- package/dist/nodes/chains/ChainSummarization/V2/ChainSummarizationV2.node.js.map +1 -1
- package/dist/nodes/code/Code.node.js.map +1 -1
- package/dist/nodes/document_loaders/DocumentBinaryInputLoader/DocumentBinaryInputLoader.node.js +0 -2
- package/dist/nodes/document_loaders/DocumentBinaryInputLoader/DocumentBinaryInputLoader.node.js.map +1 -1
- package/dist/nodes/document_loaders/DocumentDefaultDataLoader/DocumentDefaultDataLoader.node.js +0 -2
- package/dist/nodes/document_loaders/DocumentDefaultDataLoader/DocumentDefaultDataLoader.node.js.map +1 -1
- package/dist/nodes/document_loaders/DocumentGithubLoader/DocumentGithubLoader.node.js +0 -2
- package/dist/nodes/document_loaders/DocumentGithubLoader/DocumentGithubLoader.node.js.map +1 -1
- package/dist/nodes/document_loaders/DocumentJSONInputLoader/DocumentJsonInputLoader.node.js +0 -2
- package/dist/nodes/document_loaders/DocumentJSONInputLoader/DocumentJsonInputLoader.node.js.map +1 -1
- package/dist/nodes/embeddings/EmbeddingsAwsBedrock/EmbeddingsAwsBedrock.node.js +0 -2
- package/dist/nodes/embeddings/EmbeddingsAwsBedrock/EmbeddingsAwsBedrock.node.js.map +1 -1
- package/dist/nodes/embeddings/EmbeddingsAzureOpenAi/EmbeddingsAzureOpenAi.node.js +0 -2
- package/dist/nodes/embeddings/EmbeddingsAzureOpenAi/EmbeddingsAzureOpenAi.node.js.map +1 -1
- package/dist/nodes/embeddings/EmbeddingsCohere/EmbeddingsCohere.node.js +0 -2
- package/dist/nodes/embeddings/EmbeddingsCohere/EmbeddingsCohere.node.js.map +1 -1
- package/dist/nodes/embeddings/EmbeddingsGoogleGemini/EmbeddingsGoogleGemini.node.js +0 -2
- package/dist/nodes/embeddings/EmbeddingsGoogleGemini/EmbeddingsGoogleGemini.node.js.map +1 -1
- package/dist/nodes/embeddings/EmbeddingsGoogleVertex/EmbeddingsGoogleVertex.node.js +0 -2
- package/dist/nodes/embeddings/EmbeddingsGoogleVertex/EmbeddingsGoogleVertex.node.js.map +1 -1
- package/dist/nodes/embeddings/EmbeddingsHuggingFaceInference/EmbeddingsHuggingFaceInference.node.js +0 -2
- package/dist/nodes/embeddings/EmbeddingsHuggingFaceInference/EmbeddingsHuggingFaceInference.node.js.map +1 -1
- package/dist/nodes/embeddings/EmbeddingsMistralCloud/EmbeddingsMistralCloud.node.js +0 -2
- package/dist/nodes/embeddings/EmbeddingsMistralCloud/EmbeddingsMistralCloud.node.js.map +1 -1
- package/dist/nodes/embeddings/EmbeddingsOllama/EmbeddingsOllama.node.js +0 -2
- package/dist/nodes/embeddings/EmbeddingsOllama/EmbeddingsOllama.node.js.map +1 -1
- package/dist/nodes/embeddings/EmbeddingsOpenAI/EmbeddingsOpenAi.node.js +0 -2
- package/dist/nodes/embeddings/EmbeddingsOpenAI/EmbeddingsOpenAi.node.js.map +1 -1
- package/dist/nodes/llms/LMChatAnthropic/LmChatAnthropic.node.js +4 -5
- package/dist/nodes/llms/LMChatAnthropic/LmChatAnthropic.node.js.map +1 -1
- package/dist/nodes/llms/LMChatOllama/LmChatOllama.node.js +0 -3
- package/dist/nodes/llms/LMChatOllama/LmChatOllama.node.js.map +1 -1
- package/dist/nodes/llms/LMChatOpenAi/LmChatOpenAi.node.js +6 -6
- package/dist/nodes/llms/LMChatOpenAi/LmChatOpenAi.node.js.map +1 -1
- package/dist/nodes/llms/LMChatOpenAi/methods/loadModels.js +3 -1
- package/dist/nodes/llms/LMChatOpenAi/methods/loadModels.js.map +1 -1
- package/dist/nodes/llms/LMCohere/LmCohere.node.js +0 -3
- package/dist/nodes/llms/LMCohere/LmCohere.node.js.map +1 -1
- package/dist/nodes/llms/LMOllama/LmOllama.node.js +0 -3
- package/dist/nodes/llms/LMOllama/LmOllama.node.js.map +1 -1
- package/dist/nodes/llms/LMOpenAi/LmOpenAi.node.js +3 -4
- package/dist/nodes/llms/LMOpenAi/LmOpenAi.node.js.map +1 -1
- package/dist/nodes/llms/LMOpenHuggingFaceInference/LmOpenHuggingFaceInference.node.js +0 -3
- package/dist/nodes/llms/LMOpenHuggingFaceInference/LmOpenHuggingFaceInference.node.js.map +1 -1
- package/dist/nodes/llms/LmChatAwsBedrock/LmChatAwsBedrock.node.js +1 -5
- package/dist/nodes/llms/LmChatAwsBedrock/LmChatAwsBedrock.node.js.map +1 -1
- package/dist/nodes/llms/LmChatAzureOpenAi/LmChatAzureOpenAi.node.js +3 -4
- package/dist/nodes/llms/LmChatAzureOpenAi/LmChatAzureOpenAi.node.js.map +1 -1
- package/dist/nodes/llms/LmChatDeepSeek/LmChatDeepSeek.node.js +3 -4
- package/dist/nodes/llms/LmChatDeepSeek/LmChatDeepSeek.node.js.map +1 -1
- package/dist/nodes/llms/LmChatGoogleGemini/LmChatGoogleGemini.node.js +0 -3
- package/dist/nodes/llms/LmChatGoogleGemini/LmChatGoogleGemini.node.js.map +1 -1
- package/dist/nodes/llms/LmChatGoogleVertex/LmChatGoogleVertex.node.js +0 -3
- package/dist/nodes/llms/LmChatGoogleVertex/LmChatGoogleVertex.node.js.map +1 -1
- package/dist/nodes/llms/LmChatGroq/LmChatGroq.node.js +1 -4
- package/dist/nodes/llms/LmChatGroq/LmChatGroq.node.js.map +1 -1
- package/dist/nodes/llms/LmChatMistralCloud/LmChatMistralCloud.node.js +0 -3
- package/dist/nodes/llms/LmChatMistralCloud/LmChatMistralCloud.node.js.map +1 -1
- package/dist/nodes/llms/LmChatOpenRouter/LmChatOpenRouter.node.js +3 -3
- package/dist/nodes/llms/LmChatOpenRouter/LmChatOpenRouter.node.js.map +1 -1
- package/dist/nodes/llms/LmChatXAiGrok/LmChatXAiGrok.node.js +3 -4
- package/dist/nodes/llms/LmChatXAiGrok/LmChatXAiGrok.node.js.map +1 -1
- package/dist/nodes/llms/N8nLlmTracing.js.map +1 -1
- package/dist/nodes/llms/N8nNonEstimatingTracing.js.map +1 -1
- package/dist/nodes/llms/n8nDefaultFailedAttemptHandler.js +1 -1
- package/dist/nodes/llms/n8nDefaultFailedAttemptHandler.js.map +1 -1
- package/dist/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.js +0 -2
- package/dist/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.js.map +1 -1
- package/dist/nodes/memory/MemoryChatRetriever/MemoryChatRetriever.node.js +0 -2
- package/dist/nodes/memory/MemoryChatRetriever/MemoryChatRetriever.node.js.map +1 -1
- package/dist/nodes/memory/MemoryManager/MemoryManager.node.js +0 -2
- package/dist/nodes/memory/MemoryManager/MemoryManager.node.js.map +1 -1
- package/dist/nodes/memory/MemoryMotorhead/MemoryMotorhead.node.js +0 -2
- package/dist/nodes/memory/MemoryMotorhead/MemoryMotorhead.node.js.map +1 -1
- package/dist/nodes/memory/MemoryPostgresChat/MemoryPostgresChat.node.js +0 -2
- package/dist/nodes/memory/MemoryPostgresChat/MemoryPostgresChat.node.js.map +1 -1
- package/dist/nodes/memory/MemoryRedisChat/MemoryRedisChat.node.js +0 -2
- package/dist/nodes/memory/MemoryRedisChat/MemoryRedisChat.node.js.map +1 -1
- package/dist/nodes/memory/MemoryXata/MemoryXata.node.js +0 -2
- package/dist/nodes/memory/MemoryXata/MemoryXata.node.js.map +1 -1
- package/dist/nodes/memory/MemoryZep/MemoryZep.node.js +0 -2
- package/dist/nodes/memory/MemoryZep/MemoryZep.node.js.map +1 -1
- package/dist/nodes/output_parser/OutputParserAutofixing/OutputParserAutofixing.node.js +0 -2
- package/dist/nodes/output_parser/OutputParserAutofixing/OutputParserAutofixing.node.js.map +1 -1
- package/dist/nodes/output_parser/OutputParserItemList/OutputParserItemList.node.js +0 -2
- package/dist/nodes/output_parser/OutputParserItemList/OutputParserItemList.node.js.map +1 -1
- package/dist/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.js +0 -1
- package/dist/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.js.map +1 -1
- package/dist/nodes/rerankers/RerankerCohere/RerankerCohere.node.js.map +1 -1
- package/dist/nodes/retrievers/RetrieverContextualCompression/RetrieverContextualCompression.node.js +0 -1
- package/dist/nodes/retrievers/RetrieverContextualCompression/RetrieverContextualCompression.node.js.map +1 -1
- package/dist/nodes/retrievers/RetrieverMultiQuery/RetrieverMultiQuery.node.js +0 -1
- package/dist/nodes/retrievers/RetrieverMultiQuery/RetrieverMultiQuery.node.js.map +1 -1
- package/dist/nodes/retrievers/RetrieverVectorStore/RetrieverVectorStore.node.js +0 -2
- package/dist/nodes/retrievers/RetrieverVectorStore/RetrieverVectorStore.node.js.map +1 -1
- package/dist/nodes/retrievers/RetrieverWorkflow/RetrieverWorkflow.node.js.map +1 -1
- package/dist/nodes/text_splitters/TextSplitterCharacterTextSplitter/TextSplitterCharacterTextSplitter.node.js +0 -2
- package/dist/nodes/text_splitters/TextSplitterCharacterTextSplitter/TextSplitterCharacterTextSplitter.node.js.map +1 -1
- package/dist/nodes/text_splitters/TextSplitterRecursiveCharacterTextSplitter/TextSplitterRecursiveCharacterTextSplitter.node.js +0 -2
- package/dist/nodes/text_splitters/TextSplitterRecursiveCharacterTextSplitter/TextSplitterRecursiveCharacterTextSplitter.node.js.map +1 -1
- package/dist/nodes/text_splitters/TextSplitterTokenSplitter/TextSplitterTokenSplitter.node.js +0 -2
- package/dist/nodes/text_splitters/TextSplitterTokenSplitter/TextSplitterTokenSplitter.node.js.map +1 -1
- package/dist/nodes/text_splitters/TextSplitterTokenSplitter/TokenTextSplitter.js.map +1 -1
- package/dist/nodes/tools/ToolCalculator/ToolCalculator.node.js +0 -2
- package/dist/nodes/tools/ToolCalculator/ToolCalculator.node.js.map +1 -1
- package/dist/nodes/tools/ToolCode/ToolCode.node.js +0 -2
- package/dist/nodes/tools/ToolCode/ToolCode.node.js.map +1 -1
- package/dist/nodes/tools/ToolHttpRequest/ToolHttpRequest.node.js +0 -2
- package/dist/nodes/tools/ToolHttpRequest/ToolHttpRequest.node.js.map +1 -1
- package/dist/nodes/tools/ToolHttpRequest/utils.js.map +1 -1
- package/dist/nodes/tools/ToolSerpApi/ToolSerpApi.node.js +0 -2
- package/dist/nodes/tools/ToolSerpApi/ToolSerpApi.node.js.map +1 -1
- package/dist/nodes/tools/ToolThink/ToolThink.node.js.map +1 -1
- package/dist/nodes/tools/ToolVectorStore/ToolVectorStore.node.js +0 -2
- package/dist/nodes/tools/ToolVectorStore/ToolVectorStore.node.js.map +1 -1
- package/dist/nodes/tools/ToolWikipedia/ToolWikipedia.node.js +0 -2
- package/dist/nodes/tools/ToolWikipedia/ToolWikipedia.node.js.map +1 -1
- package/dist/nodes/tools/ToolWolframAlpha/ToolWolframAlpha.node.js +0 -2
- package/dist/nodes/tools/ToolWolframAlpha/ToolWolframAlpha.node.js.map +1 -1
- package/dist/nodes/tools/ToolWorkflow/v1/versionDescription.js +0 -2
- package/dist/nodes/tools/ToolWorkflow/v1/versionDescription.js.map +1 -1
- package/dist/nodes/tools/ToolWorkflow/v2/versionDescription.js.map +1 -1
- package/dist/nodes/trigger/ChatTrigger/ChatTrigger.node.js +215 -153
- package/dist/nodes/trigger/ChatTrigger/ChatTrigger.node.js.map +1 -1
- package/dist/nodes/vector_store/VectorStoreInMemory/VectorStoreInMemory.node.js +1 -1
- package/dist/nodes/vector_store/VectorStoreInMemory/VectorStoreInMemory.node.js.map +1 -1
- package/dist/nodes/vector_store/VectorStoreInMemoryInsert/VectorStoreInMemoryInsert.node.js +0 -1
- package/dist/nodes/vector_store/VectorStoreInMemoryInsert/VectorStoreInMemoryInsert.node.js.map +1 -1
- package/dist/nodes/vector_store/VectorStoreInMemoryLoad/VectorStoreInMemoryLoad.node.js +0 -1
- package/dist/nodes/vector_store/VectorStoreInMemoryLoad/VectorStoreInMemoryLoad.node.js.map +1 -1
- package/dist/nodes/vector_store/VectorStorePGVector/VectorStorePGVector.node.js +2 -2
- package/dist/nodes/vector_store/VectorStorePGVector/VectorStorePGVector.node.js.map +1 -1
- package/dist/nodes/vector_store/VectorStoreQdrant/VectorStoreQdrant.node.js.map +1 -1
- package/dist/nodes/vector_store/VectorStoreSupabaseLoad/VectorStoreSupabaseLoad.node.js.map +1 -1
- package/dist/nodes/vector_store/VectorStoreWeaviate/VectorStoreWeaviate.node.js +242 -0
- package/dist/nodes/vector_store/VectorStoreWeaviate/VectorStoreWeaviate.node.js.map +1 -0
- package/dist/nodes/vector_store/VectorStoreWeaviate/Weaviate.utils.js +127 -0
- package/dist/nodes/vector_store/VectorStoreWeaviate/Weaviate.utils.js.map +1 -0
- package/dist/nodes/vector_store/VectorStoreWeaviate/weaviate.svg +2 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.js +0 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.js.map +1 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/methods/listSearch.js +15 -2
- package/dist/nodes/vector_store/shared/createVectorStoreNode/methods/listSearch.js.map +1 -1
- package/dist/nodes/vector_store/shared/descriptions.js +26 -2
- package/dist/nodes/vector_store/shared/descriptions.js.map +1 -1
- package/dist/nodes/vendors/OpenAi/actions/assistant/message.operation.js +0 -1
- package/dist/nodes/vendors/OpenAi/actions/assistant/message.operation.js.map +1 -1
- package/dist/nodes/vendors/OpenAi/actions/versionDescription.js.map +1 -1
- package/dist/types/credentials.json +1 -0
- package/dist/types/nodes.json +4 -3
- package/dist/utils/httpProxyAgent.js +20 -6
- package/dist/utils/httpProxyAgent.js.map +1 -1
- package/dist/utils/logWrapper.js.map +1 -1
- package/package.json +21 -15
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var VectorStoreWeaviate_node_exports = {};
|
|
20
|
+
__export(VectorStoreWeaviate_node_exports, {
|
|
21
|
+
VectorStoreWeaviate: () => VectorStoreWeaviate
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(VectorStoreWeaviate_node_exports);
|
|
24
|
+
var import_weaviate = require("@langchain/weaviate");
|
|
25
|
+
var import_Weaviate = require("./Weaviate.utils");
|
|
26
|
+
var import_createVectorStoreNode = require("../shared/createVectorStoreNode/createVectorStoreNode");
|
|
27
|
+
var import_listSearch = require("../shared/createVectorStoreNode/methods/listSearch");
|
|
28
|
+
var import_descriptions = require("../shared/descriptions");
|
|
29
|
+
class ExtendedWeaviateVectorStore extends import_weaviate.WeaviateStore {
|
|
30
|
+
static async fromExistingCollection(embeddings, args, defaultFilter) {
|
|
31
|
+
if (defaultFilter) {
|
|
32
|
+
ExtendedWeaviateVectorStore.defaultFilter = defaultFilter;
|
|
33
|
+
}
|
|
34
|
+
return await super.fromExistingIndex(embeddings, args);
|
|
35
|
+
}
|
|
36
|
+
async similaritySearchVectorWithScore(query, k, filter) {
|
|
37
|
+
filter = filter ?? ExtendedWeaviateVectorStore.defaultFilter;
|
|
38
|
+
if (filter) {
|
|
39
|
+
const composedFilter = (0, import_Weaviate.parseCompositeFilter)(filter);
|
|
40
|
+
return await super.similaritySearchVectorWithScore(query, k, composedFilter);
|
|
41
|
+
} else {
|
|
42
|
+
return await super.similaritySearchVectorWithScore(query, k, void 0);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const sharedFields = [import_descriptions.weaviateCollectionRLC];
|
|
47
|
+
const shared_options = [
|
|
48
|
+
{
|
|
49
|
+
displayName: "Tenant Name",
|
|
50
|
+
name: "tenant",
|
|
51
|
+
type: "string",
|
|
52
|
+
default: void 0,
|
|
53
|
+
validateType: "string",
|
|
54
|
+
description: "Tenant Name. Collection must have been created with tenant support enabled."
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
displayName: "Text Key",
|
|
58
|
+
name: "textKey",
|
|
59
|
+
type: "string",
|
|
60
|
+
default: "text",
|
|
61
|
+
validateType: "string",
|
|
62
|
+
description: "The key in the document that contains the embedded text"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
displayName: "Skip Init Checks",
|
|
66
|
+
name: "skip_init_checks",
|
|
67
|
+
type: "boolean",
|
|
68
|
+
default: false,
|
|
69
|
+
validateType: "boolean",
|
|
70
|
+
description: "Whether to skip init checks while instantiating the client"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
displayName: "Init Timeout",
|
|
74
|
+
name: "timeout_init",
|
|
75
|
+
type: "number",
|
|
76
|
+
default: 2,
|
|
77
|
+
validateType: "number",
|
|
78
|
+
description: "Number of timeout seconds for initial checks"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
displayName: "Insert Timeout",
|
|
82
|
+
name: "timeout_insert",
|
|
83
|
+
type: "number",
|
|
84
|
+
default: 90,
|
|
85
|
+
validateType: "number",
|
|
86
|
+
description: "Number of timeout seconds for inserts"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
displayName: "Query Timeout",
|
|
90
|
+
name: "timeout_query",
|
|
91
|
+
type: "number",
|
|
92
|
+
default: 30,
|
|
93
|
+
validateType: "number",
|
|
94
|
+
description: "Number of timeout seconds for queries"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
displayName: "GRPC Proxy",
|
|
98
|
+
name: "proxy_grpc",
|
|
99
|
+
type: "string",
|
|
100
|
+
default: void 0,
|
|
101
|
+
validateType: "string",
|
|
102
|
+
description: "Proxy to use for GRPC"
|
|
103
|
+
}
|
|
104
|
+
];
|
|
105
|
+
const insertFields = [
|
|
106
|
+
{
|
|
107
|
+
displayName: "Options",
|
|
108
|
+
name: "options",
|
|
109
|
+
type: "collection",
|
|
110
|
+
placeholder: "Add Option",
|
|
111
|
+
default: {},
|
|
112
|
+
options: [
|
|
113
|
+
...shared_options,
|
|
114
|
+
{
|
|
115
|
+
displayName: "Clear Data",
|
|
116
|
+
name: "clearStore",
|
|
117
|
+
type: "boolean",
|
|
118
|
+
default: false,
|
|
119
|
+
description: "Whether to clear the Collection/Tenant before inserting new data"
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
];
|
|
124
|
+
const retrieveFields = [
|
|
125
|
+
{
|
|
126
|
+
displayName: "Options",
|
|
127
|
+
name: "options",
|
|
128
|
+
type: "collection",
|
|
129
|
+
placeholder: "Add Option",
|
|
130
|
+
default: {},
|
|
131
|
+
options: [
|
|
132
|
+
{
|
|
133
|
+
displayName: "Search Filters",
|
|
134
|
+
name: "searchFilterJson",
|
|
135
|
+
type: "json",
|
|
136
|
+
typeOptions: {
|
|
137
|
+
rows: 5
|
|
138
|
+
},
|
|
139
|
+
default: '{\n "OR": [\n {\n "path": ["pdf_info_Author"],\n "operator": "Equal",\n "valueString": "Elis"\n },\n {\n "path": ["pdf_info_Author"],\n "operator": "Equal",\n "valueString": "Pinnacle"\n } \n ]\n}',
|
|
140
|
+
validateType: "object",
|
|
141
|
+
description: 'Filter pageContent or metadata using this <a href="https://weaviate.io/" target="_blank">filtering syntax</a>'
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
displayName: "Metadata Keys",
|
|
145
|
+
name: "metadataKeys",
|
|
146
|
+
type: "string",
|
|
147
|
+
default: "source,page",
|
|
148
|
+
validateType: "string",
|
|
149
|
+
description: "Select the metadata to retrieve along the content"
|
|
150
|
+
},
|
|
151
|
+
...shared_options
|
|
152
|
+
]
|
|
153
|
+
}
|
|
154
|
+
];
|
|
155
|
+
class VectorStoreWeaviate extends (0, import_createVectorStoreNode.createVectorStoreNode)({
|
|
156
|
+
meta: {
|
|
157
|
+
displayName: "Weaviate Vector Store",
|
|
158
|
+
name: "vectorStoreWeaviate",
|
|
159
|
+
description: "Work with your data in a Weaviate Cluster",
|
|
160
|
+
icon: "file:weaviate.svg",
|
|
161
|
+
docsUrl: "https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoreweaviate/",
|
|
162
|
+
credentials: [
|
|
163
|
+
{
|
|
164
|
+
name: "weaviateApi",
|
|
165
|
+
required: true
|
|
166
|
+
}
|
|
167
|
+
]
|
|
168
|
+
},
|
|
169
|
+
methods: {
|
|
170
|
+
listSearch: { weaviateCollectionsSearch: import_listSearch.weaviateCollectionsSearch }
|
|
171
|
+
},
|
|
172
|
+
loadFields: retrieveFields,
|
|
173
|
+
insertFields,
|
|
174
|
+
sharedFields,
|
|
175
|
+
retrieveFields,
|
|
176
|
+
async getVectorStoreClient(context, filter, embeddings, itemIndex) {
|
|
177
|
+
const collection = context.getNodeParameter("weaviateCollection", itemIndex, "", {
|
|
178
|
+
extractValue: true
|
|
179
|
+
});
|
|
180
|
+
const options = context.getNodeParameter("options", itemIndex, {});
|
|
181
|
+
const credentials = await context.getCredentials("weaviateApi");
|
|
182
|
+
const timeout = {
|
|
183
|
+
query: options.timeout_query,
|
|
184
|
+
init: options.timeout_init,
|
|
185
|
+
insert: options.timeout_insert
|
|
186
|
+
};
|
|
187
|
+
const proxies = {
|
|
188
|
+
grpc: options.proxy_grpc
|
|
189
|
+
};
|
|
190
|
+
const client = await (0, import_Weaviate.createWeaviateClient)(
|
|
191
|
+
credentials,
|
|
192
|
+
timeout,
|
|
193
|
+
proxies,
|
|
194
|
+
options.skip_init_checks
|
|
195
|
+
);
|
|
196
|
+
const metadataKeys = options.metadataKeys ? options.metadataKeys.split(",") : [];
|
|
197
|
+
const config = {
|
|
198
|
+
client,
|
|
199
|
+
indexName: collection,
|
|
200
|
+
tenant: options.tenant ? options.tenant : void 0,
|
|
201
|
+
textKey: options.textKey ? options.textKey : "text",
|
|
202
|
+
metadataKeys
|
|
203
|
+
};
|
|
204
|
+
const validFilter = filter && Object.keys(filter).length > 0 ? filter : void 0;
|
|
205
|
+
return await ExtendedWeaviateVectorStore.fromExistingCollection(
|
|
206
|
+
embeddings,
|
|
207
|
+
config,
|
|
208
|
+
validFilter
|
|
209
|
+
);
|
|
210
|
+
},
|
|
211
|
+
async populateVectorStore(context, embeddings, documents, itemIndex) {
|
|
212
|
+
const collectionName = context.getNodeParameter("weaviateCollection", itemIndex, "", {
|
|
213
|
+
extractValue: true
|
|
214
|
+
});
|
|
215
|
+
const options = context.getNodeParameter("options", itemIndex, {});
|
|
216
|
+
const credentials = await context.getCredentials("weaviateApi");
|
|
217
|
+
const metadataKeys = options.metadataKeys ? options.metadataKeys.split(",") : [];
|
|
218
|
+
const client = await (0, import_Weaviate.createWeaviateClient)(credentials);
|
|
219
|
+
const config = {
|
|
220
|
+
client,
|
|
221
|
+
indexName: collectionName,
|
|
222
|
+
tenant: options.tenant ? options.tenant : void 0,
|
|
223
|
+
textKey: options.textKey ? options.textKey : "text",
|
|
224
|
+
metadataKeys
|
|
225
|
+
};
|
|
226
|
+
if (options.clearStore) {
|
|
227
|
+
if (!options.tenant) {
|
|
228
|
+
await client.collections.delete(collectionName);
|
|
229
|
+
} else {
|
|
230
|
+
const collection = client.collections.get(collectionName);
|
|
231
|
+
await collection.tenants.remove([{ name: options.tenant }]);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
await import_weaviate.WeaviateStore.fromDocuments(documents, embeddings, config);
|
|
235
|
+
}
|
|
236
|
+
}) {
|
|
237
|
+
}
|
|
238
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
239
|
+
0 && (module.exports = {
|
|
240
|
+
VectorStoreWeaviate
|
|
241
|
+
});
|
|
242
|
+
//# sourceMappingURL=VectorStoreWeaviate.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../nodes/vector_store/VectorStoreWeaviate/VectorStoreWeaviate.node.ts"],"sourcesContent":["import type { Embeddings } from '@langchain/core/embeddings';\nimport { WeaviateStore } from '@langchain/weaviate';\nimport type { WeaviateLibArgs } from '@langchain/weaviate';\nimport type {\n\tIDataObject,\n\tINodeProperties,\n\tINodePropertyCollection,\n\tINodePropertyOptions,\n} from 'n8n-workflow';\nimport { type ProxiesParams, type TimeoutParams } from 'weaviate-client';\n\nimport type { WeaviateCompositeFilter, WeaviateCredential } from './Weaviate.utils';\nimport { createWeaviateClient, parseCompositeFilter } from './Weaviate.utils';\nimport { createVectorStoreNode } from '../shared/createVectorStoreNode/createVectorStoreNode';\nimport { weaviateCollectionsSearch } from '../shared/createVectorStoreNode/methods/listSearch';\nimport { weaviateCollectionRLC } from '../shared/descriptions';\n\nclass ExtendedWeaviateVectorStore extends WeaviateStore {\n\tprivate static defaultFilter: WeaviateCompositeFilter;\n\n\tstatic async fromExistingCollection(\n\t\tembeddings: Embeddings,\n\t\targs: WeaviateLibArgs,\n\t\tdefaultFilter?: WeaviateCompositeFilter,\n\t): Promise<WeaviateStore> {\n\t\tif (defaultFilter) {\n\t\t\tExtendedWeaviateVectorStore.defaultFilter = defaultFilter;\n\t\t}\n\t\treturn await super.fromExistingIndex(embeddings, args);\n\t}\n\n\tasync similaritySearchVectorWithScore(query: number[], k: number, filter?: IDataObject) {\n\t\tfilter = filter ?? ExtendedWeaviateVectorStore.defaultFilter;\n\t\tif (filter) {\n\t\t\tconst composedFilter = parseCompositeFilter(filter as WeaviateCompositeFilter);\n\t\t\treturn await super.similaritySearchVectorWithScore(query, k, composedFilter);\n\t\t} else {\n\t\t\treturn await super.similaritySearchVectorWithScore(query, k, undefined);\n\t\t}\n\t}\n}\n\nconst sharedFields: INodeProperties[] = [weaviateCollectionRLC];\n\nconst shared_options: Array<INodePropertyOptions | INodeProperties | INodePropertyCollection> = [\n\t{\n\t\tdisplayName: 'Tenant Name',\n\t\tname: 'tenant',\n\t\ttype: 'string',\n\t\tdefault: undefined,\n\t\tvalidateType: 'string',\n\t\tdescription: 'Tenant Name. Collection must have been created with tenant support enabled.',\n\t},\n\t{\n\t\tdisplayName: 'Text Key',\n\t\tname: 'textKey',\n\t\ttype: 'string',\n\t\tdefault: 'text',\n\t\tvalidateType: 'string',\n\t\tdescription: 'The key in the document that contains the embedded text',\n\t},\n\t{\n\t\tdisplayName: 'Skip Init Checks',\n\t\tname: 'skip_init_checks',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tvalidateType: 'boolean',\n\t\tdescription: 'Whether to skip init checks while instantiating the client',\n\t},\n\t{\n\t\tdisplayName: 'Init Timeout',\n\t\tname: 'timeout_init',\n\t\ttype: 'number',\n\t\tdefault: 2,\n\t\tvalidateType: 'number',\n\t\tdescription: 'Number of timeout seconds for initial checks',\n\t},\n\t{\n\t\tdisplayName: 'Insert Timeout',\n\t\tname: 'timeout_insert',\n\t\ttype: 'number',\n\t\tdefault: 90,\n\t\tvalidateType: 'number',\n\t\tdescription: 'Number of timeout seconds for inserts',\n\t},\n\t{\n\t\tdisplayName: 'Query Timeout',\n\t\tname: 'timeout_query',\n\t\ttype: 'number',\n\t\tdefault: 30,\n\t\tvalidateType: 'number',\n\t\tdescription: 'Number of timeout seconds for queries',\n\t},\n\t{\n\t\tdisplayName: 'GRPC Proxy',\n\t\tname: 'proxy_grpc',\n\t\ttype: 'string',\n\t\tdefault: undefined,\n\t\tvalidateType: 'string',\n\t\tdescription: 'Proxy to use for GRPC',\n\t},\n];\n\nconst insertFields: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Options',\n\t\tname: 'options',\n\t\ttype: 'collection',\n\t\tplaceholder: 'Add Option',\n\t\tdefault: {},\n\t\toptions: [\n\t\t\t...shared_options,\n\t\t\t{\n\t\t\t\tdisplayName: 'Clear Data',\n\t\t\t\tname: 'clearStore',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: false,\n\t\t\t\tdescription: 'Whether to clear the Collection/Tenant before inserting new data',\n\t\t\t},\n\t\t],\n\t},\n];\n\nconst retrieveFields: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Options',\n\t\tname: 'options',\n\t\ttype: 'collection',\n\t\tplaceholder: 'Add Option',\n\t\tdefault: {},\n\t\toptions: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Search Filters',\n\t\t\t\tname: 'searchFilterJson',\n\t\t\t\ttype: 'json',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\trows: 5,\n\t\t\t\t},\n\t\t\t\tdefault:\n\t\t\t\t\t'{\\n \"OR\": [\\n {\\n \"path\": [\"pdf_info_Author\"],\\n \"operator\": \"Equal\",\\n \"valueString\": \"Elis\"\\n },\\n {\\n \"path\": [\"pdf_info_Author\"],\\n \"operator\": \"Equal\",\\n \"valueString\": \"Pinnacle\"\\n } \\n ]\\n}',\n\t\t\t\tvalidateType: 'object',\n\t\t\t\tdescription:\n\t\t\t\t\t'Filter pageContent or metadata using this <a href=\"https://weaviate.io/\" target=\"_blank\">filtering syntax</a>',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Metadata Keys',\n\t\t\t\tname: 'metadataKeys',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: 'source,page',\n\t\t\t\tvalidateType: 'string',\n\t\t\t\tdescription: 'Select the metadata to retrieve along the content',\n\t\t\t},\n\t\t\t...shared_options,\n\t\t],\n\t},\n];\n\nexport class VectorStoreWeaviate extends createVectorStoreNode<ExtendedWeaviateVectorStore>({\n\tmeta: {\n\t\tdisplayName: 'Weaviate Vector Store',\n\t\tname: 'vectorStoreWeaviate',\n\t\tdescription: 'Work with your data in a Weaviate Cluster',\n\t\ticon: 'file:weaviate.svg',\n\t\tdocsUrl:\n\t\t\t'https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoreweaviate/',\n\t\tcredentials: [\n\t\t\t{\n\t\t\t\tname: 'weaviateApi',\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t],\n\t},\n\tmethods: {\n\t\tlistSearch: { weaviateCollectionsSearch },\n\t},\n\tloadFields: retrieveFields,\n\tinsertFields,\n\tsharedFields,\n\tretrieveFields,\n\tasync getVectorStoreClient(context, filter, embeddings, itemIndex) {\n\t\tconst collection = context.getNodeParameter('weaviateCollection', itemIndex, '', {\n\t\t\textractValue: true,\n\t\t}) as string;\n\n\t\tconst options = context.getNodeParameter('options', itemIndex, {}) as {\n\t\t\ttenant?: string;\n\t\t\ttextKey?: string;\n\t\t\ttimeout_init: number;\n\t\t\ttimeout_insert: number;\n\t\t\ttimeout_query: number;\n\t\t\tskip_init_checks: boolean;\n\t\t\tproxy_grpc: string;\n\t\t\tmetadataKeys?: string;\n\t\t};\n\t\t// check if textKey is valid\n\n\t\tconst credentials = await context.getCredentials('weaviateApi');\n\n\t\tconst timeout = {\n\t\t\tquery: options.timeout_query,\n\t\t\tinit: options.timeout_init,\n\t\t\tinsert: options.timeout_insert,\n\t\t};\n\n\t\tconst proxies = {\n\t\t\tgrpc: options.proxy_grpc,\n\t\t};\n\n\t\tconst client = await createWeaviateClient(\n\t\t\tcredentials as WeaviateCredential,\n\t\t\ttimeout as TimeoutParams,\n\t\t\tproxies as ProxiesParams,\n\t\t\toptions.skip_init_checks as boolean,\n\t\t);\n\n\t\tconst metadataKeys = options.metadataKeys ? options.metadataKeys.split(',') : [];\n\t\tconst config: WeaviateLibArgs = {\n\t\t\tclient,\n\t\t\tindexName: collection,\n\t\t\ttenant: options.tenant ? options.tenant : undefined,\n\t\t\ttextKey: options.textKey ? options.textKey : 'text',\n\t\t\tmetadataKeys: metadataKeys as string[] | undefined,\n\t\t};\n\n\t\tconst validFilter = (filter && Object.keys(filter).length > 0 ? filter : undefined) as\n\t\t\t| WeaviateCompositeFilter\n\t\t\t| undefined;\n\t\treturn await ExtendedWeaviateVectorStore.fromExistingCollection(\n\t\t\tembeddings,\n\t\t\tconfig,\n\t\t\tvalidFilter,\n\t\t);\n\t},\n\tasync populateVectorStore(context, embeddings, documents, itemIndex) {\n\t\tconst collectionName = context.getNodeParameter('weaviateCollection', itemIndex, '', {\n\t\t\textractValue: true,\n\t\t}) as string;\n\n\t\tconst options = context.getNodeParameter('options', itemIndex, {}) as {\n\t\t\ttenant?: string;\n\t\t\ttextKey?: string;\n\t\t\tclearStore?: boolean;\n\t\t\tmetadataKeys?: string;\n\t\t};\n\n\t\tconst credentials = await context.getCredentials('weaviateApi');\n\n\t\tconst metadataKeys = options.metadataKeys ? options.metadataKeys.split(',') : [];\n\n\t\tconst client = await createWeaviateClient(credentials as WeaviateCredential);\n\n\t\tconst config: WeaviateLibArgs = {\n\t\t\tclient,\n\t\t\tindexName: collectionName,\n\t\t\ttenant: options.tenant ? options.tenant : undefined,\n\t\t\ttextKey: options.textKey ? options.textKey : 'text',\n\t\t\tmetadataKeys: metadataKeys as string[] | undefined,\n\t\t};\n\n\t\tif (options.clearStore) {\n\t\t\tif (!options.tenant) {\n\t\t\t\tawait client.collections.delete(collectionName);\n\t\t\t} else {\n\t\t\t\tconst collection = client.collections.get(collectionName);\n\t\t\t\tawait collection.tenants.remove([{ name: options.tenant }]);\n\t\t\t}\n\t\t}\n\n\t\tawait WeaviateStore.fromDocuments(documents, embeddings, config);\n\t},\n}) {}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,sBAA8B;AAW9B,sBAA2D;AAC3D,mCAAsC;AACtC,wBAA0C;AAC1C,0BAAsC;AAEtC,MAAM,oCAAoC,8BAAc;AAAA,EAGvD,aAAa,uBACZ,YACA,MACA,eACyB;AACzB,QAAI,eAAe;AAClB,kCAA4B,gBAAgB;AAAA,IAC7C;AACA,WAAO,MAAM,MAAM,kBAAkB,YAAY,IAAI;AAAA,EACtD;AAAA,EAEA,MAAM,gCAAgC,OAAiB,GAAW,QAAsB;AACvF,aAAS,UAAU,4BAA4B;AAC/C,QAAI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AC/C,OAAO;AACN,cAAM,aAAa,OAAO,YAAY,IAAI,cAAc;AACxD,cAAM,WAAW,QAAQ,OAAO,CAAC,EAAE,MAAM,QAAQ,OAAO,CAAC,CAAC;AAAA,MAC3D;AAAA,IACD;AAEA,UAAM,8BAAc,cAAc,WAAW,YAAY,MAAM;AAAA,EAChE;AACD,CAAC,EAAE;AAAC;","names":[]}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var Weaviate_utils_exports = {};
|
|
30
|
+
__export(Weaviate_utils_exports, {
|
|
31
|
+
createWeaviateClient: () => createWeaviateClient,
|
|
32
|
+
parseCompositeFilter: () => parseCompositeFilter
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Weaviate_utils_exports);
|
|
35
|
+
var import_n8n_workflow = require("n8n-workflow");
|
|
36
|
+
var import_weaviate_client = __toESM(require("weaviate-client"));
|
|
37
|
+
async function createWeaviateClient(credentials, timeout, proxies, skipInitChecks = false) {
|
|
38
|
+
if (credentials.weaviate_cloud_endpoint) {
|
|
39
|
+
const weaviateClient = await import_weaviate_client.default.connectToWeaviateCloud(
|
|
40
|
+
credentials.weaviate_cloud_endpoint,
|
|
41
|
+
{
|
|
42
|
+
authCredentials: new import_weaviate_client.default.ApiKey(credentials.weaviate_api_key),
|
|
43
|
+
timeout,
|
|
44
|
+
skipInitChecks
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
return weaviateClient;
|
|
48
|
+
} else {
|
|
49
|
+
const weaviateClient = await import_weaviate_client.default.connectToCustom({
|
|
50
|
+
httpHost: credentials.custom_connection_http_host,
|
|
51
|
+
httpPort: credentials.custom_connection_http_port,
|
|
52
|
+
grpcHost: credentials.custom_connection_grpc_host,
|
|
53
|
+
grpcPort: credentials.custom_connection_grpc_port,
|
|
54
|
+
grpcSecure: credentials.custom_connection_grpc_secure,
|
|
55
|
+
httpSecure: credentials.custom_connection_http_secure,
|
|
56
|
+
authCredentials: credentials.weaviate_api_key ? new import_weaviate_client.default.ApiKey(credentials.weaviate_api_key) : void 0,
|
|
57
|
+
timeout,
|
|
58
|
+
proxies,
|
|
59
|
+
skipInitChecks
|
|
60
|
+
});
|
|
61
|
+
return weaviateClient;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function buildFilter(filter) {
|
|
65
|
+
const { path, operator } = filter;
|
|
66
|
+
const property = import_weaviate_client.default.filter.byProperty(path[0]);
|
|
67
|
+
switch (operator.toLowerCase()) {
|
|
68
|
+
case "equal":
|
|
69
|
+
if (filter.valueString !== void 0) return property.equal(filter.valueString);
|
|
70
|
+
if (filter.valueNumber !== void 0) return property.equal(filter.valueNumber);
|
|
71
|
+
break;
|
|
72
|
+
case "like":
|
|
73
|
+
if (filter.valueString === void 0) {
|
|
74
|
+
throw new import_n8n_workflow.OperationalError("Missing 'valueString' for 'like' operator.");
|
|
75
|
+
}
|
|
76
|
+
return property.like(filter.valueString);
|
|
77
|
+
case "containsany":
|
|
78
|
+
if (filter.valueTextArray === void 0) {
|
|
79
|
+
throw new import_n8n_workflow.OperationalError("Missing 'valueTextArray' for 'containsAny' operator.");
|
|
80
|
+
}
|
|
81
|
+
return property.containsAny(filter.valueTextArray);
|
|
82
|
+
case "containsall":
|
|
83
|
+
if (filter.valueTextArray === void 0) {
|
|
84
|
+
throw new import_n8n_workflow.OperationalError("Missing 'valueTextArray' for 'containsAll' operator.");
|
|
85
|
+
}
|
|
86
|
+
return property.containsAll(filter.valueTextArray);
|
|
87
|
+
case "greaterthan":
|
|
88
|
+
if (filter.valueNumber === void 0) {
|
|
89
|
+
throw new import_n8n_workflow.OperationalError("Missing 'valueNumber' for 'greaterThan' operator.");
|
|
90
|
+
}
|
|
91
|
+
return property.greaterThan(filter.valueNumber);
|
|
92
|
+
case "lessthan":
|
|
93
|
+
if (filter.valueNumber === void 0) {
|
|
94
|
+
throw new import_n8n_workflow.OperationalError("Missing 'valueNumber' for 'lessThan' operator.");
|
|
95
|
+
}
|
|
96
|
+
return property.lessThan(filter.valueNumber);
|
|
97
|
+
case "isnull":
|
|
98
|
+
if (filter.valueBoolean === void 0) {
|
|
99
|
+
throw new import_n8n_workflow.OperationalError("Missing 'valueBoolean' for 'isNull' operator.");
|
|
100
|
+
}
|
|
101
|
+
return property.isNull(filter.valueBoolean);
|
|
102
|
+
case "withingeorange":
|
|
103
|
+
if (!filter.valueGeoCoordinates) {
|
|
104
|
+
throw new import_n8n_workflow.OperationalError("Missing 'valueGeoCoordinates' for 'withinGeoRange' operator.");
|
|
105
|
+
}
|
|
106
|
+
return property.withinGeoRange(filter.valueGeoCoordinates);
|
|
107
|
+
default:
|
|
108
|
+
throw new import_n8n_workflow.OperationalError(`Unsupported operator: ${operator}`);
|
|
109
|
+
}
|
|
110
|
+
throw new import_n8n_workflow.OperationalError(`No valid filter value provided for operator: ${operator}`);
|
|
111
|
+
}
|
|
112
|
+
function parseCompositeFilter(filter) {
|
|
113
|
+
if (typeof filter === "object" && ("AND" in filter || "OR" in filter)) {
|
|
114
|
+
if ("AND" in filter) {
|
|
115
|
+
return import_weaviate_client.Filters.and(...filter.AND.map(buildFilter));
|
|
116
|
+
} else if ("OR" in filter) {
|
|
117
|
+
return import_weaviate_client.Filters.or(...filter.OR.map(buildFilter));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return buildFilter(filter);
|
|
121
|
+
}
|
|
122
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
123
|
+
0 && (module.exports = {
|
|
124
|
+
createWeaviateClient,
|
|
125
|
+
parseCompositeFilter
|
|
126
|
+
});
|
|
127
|
+
//# sourceMappingURL=Weaviate.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../nodes/vector_store/VectorStoreWeaviate/Weaviate.utils.ts"],"sourcesContent":["import { OperationalError } from 'n8n-workflow';\nimport type {\n\tFilterValue,\n\tGeoRangeFilter,\n\tProxiesParams,\n\tTimeoutParams,\n\tWeaviateClient,\n} from 'weaviate-client';\nimport weaviate, { Filters } from 'weaviate-client';\n\nexport type WeaviateCredential = {\n\tweaviate_cloud_endpoint: string;\n\tweaviate_api_key: string;\n\tcustom_connection_http_host: string;\n\tcustom_connection_http_port: number;\n\tcustom_connection_http_secure: boolean;\n\tcustom_connection_grpc_host: string;\n\tcustom_connection_grpc_port: number;\n\tcustom_connection_grpc_secure: boolean;\n};\n\nexport async function createWeaviateClient(\n\tcredentials: WeaviateCredential,\n\ttimeout?: TimeoutParams,\n\tproxies?: ProxiesParams,\n\tskipInitChecks: boolean = false,\n): Promise<WeaviateClient> {\n\tif (credentials.weaviate_cloud_endpoint) {\n\t\tconst weaviateClient: WeaviateClient = await weaviate.connectToWeaviateCloud(\n\t\t\tcredentials.weaviate_cloud_endpoint,\n\t\t\t{\n\t\t\t\tauthCredentials: new weaviate.ApiKey(credentials.weaviate_api_key),\n\t\t\t\ttimeout,\n\t\t\t\tskipInitChecks,\n\t\t\t},\n\t\t);\n\t\treturn weaviateClient;\n\t} else {\n\t\tconst weaviateClient: WeaviateClient = await weaviate.connectToCustom({\n\t\t\thttpHost: credentials.custom_connection_http_host,\n\t\t\thttpPort: credentials.custom_connection_http_port,\n\t\t\tgrpcHost: credentials.custom_connection_grpc_host,\n\t\t\tgrpcPort: credentials.custom_connection_grpc_port,\n\t\t\tgrpcSecure: credentials.custom_connection_grpc_secure,\n\t\t\thttpSecure: credentials.custom_connection_http_secure,\n\t\t\tauthCredentials: credentials.weaviate_api_key\n\t\t\t\t? new weaviate.ApiKey(credentials.weaviate_api_key)\n\t\t\t\t: undefined,\n\t\t\ttimeout,\n\t\t\tproxies,\n\t\t\tskipInitChecks,\n\t\t});\n\t\treturn weaviateClient;\n\t}\n}\ntype WeaviateFilterUnit = {\n\tpath: string[];\n\toperator: string;\n\tvalueString?: string;\n\tvalueTextArray?: string[];\n\tvalueBoolean?: boolean;\n\tvalueNumber?: number;\n\tvalueGeoCoordinates?: GeoRangeFilter;\n};\n\nexport type WeaviateCompositeFilter = { AND: WeaviateFilterUnit[] } | { OR: WeaviateFilterUnit[] };\n\nfunction buildFilter(filter: WeaviateFilterUnit): FilterValue {\n\tconst { path, operator } = filter;\n\tconst property = weaviate.filter.byProperty(path[0]);\n\n\tswitch (operator.toLowerCase()) {\n\t\tcase 'equal':\n\t\t\tif (filter.valueString !== undefined) return property.equal(filter.valueString);\n\t\t\tif (filter.valueNumber !== undefined) return property.equal(filter.valueNumber);\n\t\t\tbreak;\n\n\t\tcase 'like':\n\t\t\tif (filter.valueString === undefined) {\n\t\t\t\tthrow new OperationalError(\"Missing 'valueString' for 'like' operator.\");\n\t\t\t}\n\t\t\treturn property.like(filter.valueString);\n\n\t\tcase 'containsany':\n\t\t\tif (filter.valueTextArray === undefined) {\n\t\t\t\tthrow new OperationalError(\"Missing 'valueTextArray' for 'containsAny' operator.\");\n\t\t\t}\n\t\t\treturn property.containsAny(filter.valueTextArray);\n\n\t\tcase 'containsall':\n\t\t\tif (filter.valueTextArray === undefined) {\n\t\t\t\tthrow new OperationalError(\"Missing 'valueTextArray' for 'containsAll' operator.\");\n\t\t\t}\n\t\t\treturn property.containsAll(filter.valueTextArray);\n\n\t\tcase 'greaterthan':\n\t\t\tif (filter.valueNumber === undefined) {\n\t\t\t\tthrow new OperationalError(\"Missing 'valueNumber' for 'greaterThan' operator.\");\n\t\t\t}\n\t\t\treturn property.greaterThan(filter.valueNumber);\n\n\t\tcase 'lessthan':\n\t\t\tif (filter.valueNumber === undefined) {\n\t\t\t\tthrow new OperationalError(\"Missing 'valueNumber' for 'lessThan' operator.\");\n\t\t\t}\n\t\t\treturn property.lessThan(filter.valueNumber);\n\n\t\tcase 'isnull':\n\t\t\tif (filter.valueBoolean === undefined) {\n\t\t\t\tthrow new OperationalError(\"Missing 'valueBoolean' for 'isNull' operator.\");\n\t\t\t}\n\t\t\treturn property.isNull(filter.valueBoolean);\n\n\t\tcase 'withingeorange':\n\t\t\tif (!filter.valueGeoCoordinates) {\n\t\t\t\tthrow new OperationalError(\"Missing 'valueGeoCoordinates' for 'withinGeoRange' operator.\");\n\t\t\t}\n\t\t\treturn property.withinGeoRange(filter.valueGeoCoordinates);\n\n\t\tdefault:\n\t\t\tthrow new OperationalError(`Unsupported operator: ${operator}`);\n\t}\n\n\tthrow new OperationalError(`No valid filter value provided for operator: ${operator}`);\n}\n\nexport function parseCompositeFilter(\n\tfilter: WeaviateCompositeFilter | WeaviateFilterUnit,\n): FilterValue {\n\t// Handle composite filters (AND/OR)\n\tif (typeof filter === 'object' && ('AND' in filter || 'OR' in filter)) {\n\t\tif ('AND' in filter) {\n\t\t\treturn Filters.and(...filter.AND.map(buildFilter));\n\t\t} else if ('OR' in filter) {\n\t\t\treturn Filters.or(...filter.OR.map(buildFilter));\n\t\t}\n\t}\n\n\t// Handle individual filter units\n\treturn buildFilter(filter);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAiC;AAQjC,6BAAkC;AAalC,eAAsB,qBACrB,aACA,SACA,SACA,iBAA0B,OACA;AAC1B,MAAI,YAAY,yBAAyB;AACxC,UAAM,iBAAiC,MAAM,uBAAAA,QAAS;AAAA,MACrD,YAAY;AAAA,MACZ;AAAA,QACC,iBAAiB,IAAI,uBAAAA,QAAS,OAAO,YAAY,gBAAgB;AAAA,QACjE;AAAA,QACA;AAAA,MACD;AAAA,IACD;AACA,WAAO;AAAA,EACR,OAAO;AACN,UAAM,iBAAiC,MAAM,uBAAAA,QAAS,gBAAgB;AAAA,MACrE,UAAU,YAAY;AAAA,MACtB,UAAU,YAAY;AAAA,MACtB,UAAU,YAAY;AAAA,MACtB,UAAU,YAAY;AAAA,MACtB,YAAY,YAAY;AAAA,MACxB,YAAY,YAAY;AAAA,MACxB,iBAAiB,YAAY,mBAC1B,IAAI,uBAAAA,QAAS,OAAO,YAAY,gBAAgB,IAChD;AAAA,MACH;AAAA,MACA;AAAA,MACA;AAAA,IACD,CAAC;AACD,WAAO;AAAA,EACR;AACD;AAaA,SAAS,YAAY,QAAyC;AAC7D,QAAM,EAAE,MAAM,SAAS,IAAI;AAC3B,QAAM,WAAW,uBAAAA,QAAS,OAAO,WAAW,KAAK,CAAC,CAAC;AAEnD,UAAQ,SAAS,YAAY,GAAG;AAAA,IAC/B,KAAK;AACJ,UAAI,OAAO,gBAAgB,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U,QAAQ,SAAS;AACtE,QAAI,SAAS,QAAQ;AACpB,aAAO,+BAAQ,IAAI,GAAG,OAAO,IAAI,IAAI,WAAW,CAAC;AAAA,IAClD,WAAW,QAAQ,QAAQ;AAC1B,aAAO,+BAAQ,GAAG,GAAG,OAAO,GAAG,IAAI,WAAW,CAAC;AAAA,IAChD;AAAA,EACD;AAGA,SAAO,YAAY,MAAM;AAC1B;","names":["weaviate"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<svg width="256px" height="296px" viewBox="0 0 256 296" version="1.1" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid" xmlns:bx="https://boxy-svg.com"><title>qdrant</title><defs><linearGradient id="linear-gradient" x1="39.84" y1="-2385.28" x2="34.01" y2="-2442.48" gradientTransform="translate(0 2433.92)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#75be2c"/><stop offset="0.86" stop-color="#9dc03b"/></linearGradient><linearGradient id="linear-gradient-2" x1="37.06" y1="-2409.12" x2="37.06" y2="-2390.37" gradientTransform="translate(0 2433.92)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#238d37"/><stop offset="0.94" stop-color="#35537f"/></linearGradient><linearGradient id="linear-gradient-3" x1="35.07" y1="-2418.83" x2="37.98" y2="-2399.75" gradientTransform="translate(0 2433.92)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#67d84d"/><stop offset="1" stop-color="#348522"/></linearGradient><linearGradient id="linear-gradient-4" x1="64.03" y1="-2433.87" x2="64.03" y2="-2400.61" gradientTransform="translate(0 2433.92)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#e4d00a"/><stop offset="0.56" stop-color="#c4d132"/></linearGradient><linearGradient id="linear-gradient-5" x1="10.04" y1="-2433.87" x2="10.04" href="#linear-gradient-4"/><linearGradient id="linear-gradient-6" x1="56.43" y1="-2400.25" x2="56.43" y2="-2389.16" gradientTransform="translate(0 2433.92)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#8ab11b"/><stop offset="1" stop-color="#6eaf02"/></linearGradient><linearGradient id="linear-gradient-7" x1="64.51" y1="-2413.64" x2="62.18" y2="-2394.97" href="#linear-gradient"/><linearGradient id="linear-gradient-8" x1="17.64" y1="-2400.21" x2="17.64" y2="-2389.17" href="#linear-gradient-6"/><linearGradient id="linear-gradient-9" x1="11.82" y1="-2413.55" x2="9.53" y2="-2391.1" href="#linear-gradient"/><bx:export><bx:file format="svg" path="qdrant.svg"/></bx:export></defs><g transform="matrix(3.331938, 0, 0, 3.331938, 3.665985, 60.223675)" style=""><path class="cls-1" d="M71.67,7.95L58.85.5c-2.15-1.25-4.85.31-4.85,2.79v18.84l-9.1-5.24c-4.88-2.81-10.88-2.8-15.74.02l-9.06,5.24V3.28c0-2.49-2.69-4.04-4.85-2.79L2.4,7.94c-1.49.86-2.4,2.46-2.4,4.18v17.71c0,1.24.31,2.42.88,3.46h0c.58,1.07,1.42,1.98,2.48,2.66l6.61,4.22,5.06,3.22c3.04,1.93,6.95,1.78,9.83-.39l.38-.3s.07-.06.11-.08l7.63-5.82c2.23-1.71,5.88-1.71,8.12,0l7.61,5.8s.03.02.04.03l.47.37c2.87,2.17,6.79,2.32,9.83.39l5.06-3.23,6.63-4.22c1.04-.67,1.88-1.59,2.46-2.64s.89-2.23.89-3.47V12.13h0c0-1.72-.91-3.32-2.4-4.18h.01Z" style="fill: url("#linear-gradient"); stroke-width: 0px;"/><path class="cls-3" d="M54.1,33.62v6.36c0,1.96-1.41,3.56-3.11,3.56-.67,0-1.51-.34-2.29-.93l-7.61-5.8c-2.23-1.71-5.88-1.71-8.12,0l-7.63,5.82c-.76.57-1.25.74-1.97.74-1.77.02-3.35-1.31-3.35-3.39v-6.34l10.9-7.04c3.74-2.41,8.52-2.41,12.25,0l10.92,6.88v.13h0Z" style="fill: url("#linear-gradient-2"); stroke-width: 0px;"/><path class="cls-4" d="M54,22.13l.03,11.59-10.84-6.93c-3.73-2.39-8.51-2.39-12.25,0l-10.87,6.94.02-11.58,9.07-5.25c4.86-2.82,10.86-2.82,15.74-.02l9.1,5.24h0Z" style="fill: url("#linear-gradient-3"); stroke-width: 0px;"/><path class="cls-2" d="M74.07,12.13v17.7c0,1.25-.31,2.42-.89,3.47l-19.19-11.17V3.28c0-2.49,2.7-4.04,4.85-2.79l12.82,7.46c1.49.86,2.4,2.46,2.4,4.18h0Z" style="fill: url("#linear-gradient-4"); stroke-width: 0px;"/><path class="cls-8" d="M20.08,3.28v18.87L.88,33.31C.31,32.26,0,31.08,0,29.84V12.13C0,10.41.91,8.81,2.4,7.95L15.23.49c2.15-1.25,4.85.31,4.85,2.79h0Z" style="fill: url("#linear-gradient-5"); stroke-width: 0px;"/><path class="cls-9" d="M50.72,43.32c1.7,0,3.3-1.34,3.3-3.28v-6.36s10.13,6.47,10.13,6.47l-5.12,3.26c-3.04,1.93-6.95,1.79-9.83-.39l-.48-.38c.72.49,1.33.68,2,.68h0Z" style="fill: url("#linear-gradient-6"); stroke-width: 0px;"/><path class="cls-7" d="M73.18,33.31c-.58,1.05-1.42,1.97-2.46,2.64l-6.63,4.22-10.08-6.45-.03-11.59,19.19,11.18h0Z" style="fill: url("#linear-gradient-7"); stroke-width: 0px;"/><path class="cls-5" d="M20.08,40.03c0,1.94,1.61,3.47,3.3,3.28.75-.09,1.34-.2,1.94-.66l-.46.36c-2.87,2.16-6.79,2.32-9.83.39l-5.06-3.23h0s10.11-6.46,10.11-6.46v6.31h0Z" style="fill: url("#linear-gradient-8"); stroke-width: 0px;"/><path class="cls-6" d="M20.08,22.15v11.57l-10.11,6.45h0s-6.61-4.2-6.61-4.2c-1.05-.67-1.9-1.59-2.48-2.66l19.19-11.16h0Z" style="fill: url("#linear-gradient-9"); stroke-width: 0px;"/></g></svg>
|
|
@@ -68,7 +68,6 @@ const createVectorStoreNode = (args) => class VectorStoreNodeType {
|
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
70
|
credentials: args.meta.credentials,
|
|
71
|
-
// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node
|
|
72
71
|
inputs: `={{
|
|
73
72
|
((parameters) => {
|
|
74
73
|
const mode = parameters?.mode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-filename-against-convention */\n/* eslint-disable n8n-nodes-base/node-dirname-against-convention */\nimport type { Embeddings } from '@langchain/core/embeddings';\nimport type { VectorStore } from '@langchain/core/vectorstores';\nimport { NodeConnectionTypes, NodeOperationError } from 'n8n-workflow';\nimport type {\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tINodeTypeDescription,\n\tSupplyData,\n\tISupplyDataFunctions,\n\tINodeType,\n\tINodeProperties,\n} from 'n8n-workflow';\n\nimport { getConnectionHintNoticeField } from '@utils/sharedFields';\n\n// Import custom types\nimport {\n\thandleLoadOperation,\n\thandleInsertOperation,\n\thandleUpdateOperation,\n\thandleRetrieveOperation,\n\thandleRetrieveAsToolOperation,\n} from './operations';\nimport type { NodeOperationMode, VectorStoreNodeConstructorArgs } from './types';\n// Import utility functions\nimport { transformDescriptionForOperationMode, getOperationModeOptions } from './utils';\n\nconst ragStarterCallout: INodeProperties = {\n\tdisplayName: 'Tip: Get a feel for vector stores in n8n with our',\n\tname: 'ragStarterCallout',\n\ttype: 'callout',\n\ttypeOptions: {\n\t\tcalloutAction: {\n\t\t\tlabel: 'RAG starter template',\n\t\t\ttype: 'openRagStarterTemplate',\n\t\t},\n\t},\n\tdefault: '',\n};\n\n/**\n * Creates a vector store node with the given configuration\n * This factory function produces a complete node class that implements all vector store operations\n */\nexport const createVectorStoreNode = <T extends VectorStore = VectorStore>(\n\targs: VectorStoreNodeConstructorArgs<T>,\n) =>\n\tclass VectorStoreNodeType implements INodeType {\n\t\tdescription: INodeTypeDescription = {\n\t\t\tdisplayName: args.meta.displayName,\n\t\t\tname: args.meta.name,\n\t\t\tdescription: args.meta.description,\n\t\t\ticon: args.meta.icon,\n\t\t\ticonColor: args.meta.iconColor,\n\t\t\tgroup: ['transform'],\n\t\t\t// 1.2 has changes to VectorStoreInMemory node.\n\t\t\t// 1.3 drops `toolName` and uses node name as the tool name.\n\t\t\tversion: [1, 1.1, 1.2, 1.3],\n\t\t\tdefaults: {\n\t\t\t\tname: args.meta.displayName,\n\t\t\t},\n\t\t\tcodex: {\n\t\t\t\tcategories: args.meta.categories ?? ['AI'],\n\t\t\t\tsubcategories: args.meta.subcategories ?? {\n\t\t\t\t\tAI: ['Vector Stores', 'Tools', 'Root Nodes'],\n\t\t\t\t\t'Vector Stores': ['Other Vector Stores'],\n\t\t\t\t\tTools: ['Other Tools'],\n\t\t\t\t},\n\t\t\t\tresources: {\n\t\t\t\t\tprimaryDocumentation: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\turl: args.meta.docsUrl,\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t},\n\t\t\tcredentials: args.meta.credentials,\n\t\t\t// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node\n\t\t\tinputs: `={{\n\t\t\t((parameters) => {\n\t\t\t\tconst mode = parameters?.mode;\n\t\t\t\tconst useReranker = parameters?.useReranker;\n\t\t\t\tconst inputs = [{ displayName: \"Embedding\", type: \"${NodeConnectionTypes.AiEmbedding}\", required: true, maxConnections: 1}]\n\n\t\t\t\tif (['load', 'retrieve', 'retrieve-as-tool'].includes(mode) && useReranker) {\n\t\t\t\t\tinputs.push({ displayName: \"Reranker\", type: \"${NodeConnectionTypes.AiReranker}\", required: true, maxConnections: 1})\n\t\t\t\t}\n\n\t\t\t\tif (mode === 'retrieve-as-tool') {\n\t\t\t\t\treturn inputs;\n\t\t\t\t}\n\n\t\t\t\tif (['insert', 'load', 'update'].includes(mode)) {\n\t\t\t\t\tinputs.push({ displayName: \"\", type: \"${NodeConnectionTypes.Main}\"})\n\t\t\t\t}\n\n\t\t\t\tif (['insert'].includes(mode)) {\n\t\t\t\t\tinputs.push({ displayName: \"Document\", type: \"${NodeConnectionTypes.AiDocument}\", required: true, maxConnections: 1})\n\t\t\t\t}\n\t\t\t\treturn inputs\n\t\t\t})($parameter)\n\t\t}}`,\n\t\t\toutputs: `={{\n\t\t\t((parameters) => {\n\t\t\t\tconst mode = parameters?.mode ?? 'retrieve';\n\n\t\t\t\tif (mode === 'retrieve-as-tool') {\n\t\t\t\t\treturn [{ displayName: \"Tool\", type: \"${NodeConnectionTypes.AiTool}\"}]\n\t\t\t\t}\n\n\t\t\t\tif (mode === 'retrieve') {\n\t\t\t\t\treturn [{ displayName: \"Vector Store\", type: \"${NodeConnectionTypes.AiVectorStore}\"}]\n\t\t\t\t}\n\t\t\t\treturn [{ displayName: \"\", type: \"${NodeConnectionTypes.Main}\"}]\n\t\t\t})($parameter)\n\t\t}}`,\n\t\t\tproperties: [\n\t\t\t\tragStarterCallout,\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Operation Mode',\n\t\t\t\t\tname: 'mode',\n\t\t\t\t\ttype: 'options',\n\t\t\t\t\tnoDataExpression: true,\n\t\t\t\t\tdefault: 'retrieve',\n\t\t\t\t\toptions: getOperationModeOptions(args),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...getConnectionHintNoticeField([NodeConnectionTypes.AiRetriever]),\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tmode: ['retrieve'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Name',\n\t\t\t\t\tname: 'toolName',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\trequired: true,\n\t\t\t\t\tdescription: 'Name of the vector store',\n\t\t\t\t\tplaceholder: 'e.g. company_knowledge_base',\n\t\t\t\t\tvalidateType: 'string-alphanumeric',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t'@version': [{ _cnd: { lte: 1.2 } }],\n\t\t\t\t\t\t\tmode: ['retrieve-as-tool'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Description',\n\t\t\t\t\tname: 'toolDescription',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\trequired: true,\n\t\t\t\t\ttypeOptions: { rows: 2 },\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Explain to the LLM what this tool does, a good, specific description would allow LLMs to produce expected results much more often',\n\t\t\t\t\tplaceholder: `e.g. ${args.meta.description}`,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tmode: ['retrieve-as-tool'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t...args.sharedFields,\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Embedding Batch Size',\n\t\t\t\t\tname: 'embeddingBatchSize',\n\t\t\t\t\ttype: 'number',\n\t\t\t\t\tdefault: 200,\n\t\t\t\t\tdescription: 'Number of documents to embed in a single batch',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tmode: ['insert'],\n\t\t\t\t\t\t\t'@version': [{ _cnd: { gte: 1.1 } }],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t...transformDescriptionForOperationMode(args.insertFields ?? [], 'insert'),\n\t\t\t\t// Prompt and topK are always used for the load operation\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Prompt',\n\t\t\t\t\tname: 'prompt',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\trequired: true,\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Search prompt to retrieve matching documents from the vector store using similarity-based ranking',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tmode: ['load'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Limit',\n\t\t\t\t\tname: 'topK',\n\t\t\t\t\ttype: 'number',\n\t\t\t\t\tdefault: 4,\n\t\t\t\t\tdescription: 'Number of top results to fetch from vector store',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tmode: ['load', 'retrieve-as-tool'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Include Metadata',\n\t\t\t\t\tname: 'includeDocumentMetadata',\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tdescription: 'Whether or not to include document metadata',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tmode: ['load', 'retrieve-as-tool'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Rerank Results',\n\t\t\t\t\tname: 'useReranker',\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: false,\n\t\t\t\t\tdescription: 'Whether or not to rerank results',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tmode: ['load', 'retrieve', 'retrieve-as-tool'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t// ID is always used for update operation\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'ID',\n\t\t\t\t\tname: 'id',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\trequired: true,\n\t\t\t\t\tdescription: 'ID of an embedding entry',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tmode: ['update'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t...transformDescriptionForOperationMode(args.loadFields ?? [], [\n\t\t\t\t\t'load',\n\t\t\t\t\t'retrieve-as-tool',\n\t\t\t\t]),\n\t\t\t\t...transformDescriptionForOperationMode(args.retrieveFields ?? [], 'retrieve'),\n\t\t\t\t...transformDescriptionForOperationMode(args.updateFields ?? [], 'update'),\n\t\t\t],\n\t\t};\n\n\t\tmethods = args.methods;\n\n\t\t/**\n\t\t * Method to execute the node in regular workflow mode\n\t\t * Supports 'load', 'insert', and 'update' operation modes\n\t\t */\n\t\tasync execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {\n\t\t\tconst mode = this.getNodeParameter('mode', 0) as NodeOperationMode;\n\t\t\t// Get the embeddings model connected to this node\n\t\t\tconst embeddings = (await this.getInputConnectionData(\n\t\t\t\tNodeConnectionTypes.AiEmbedding,\n\t\t\t\t0,\n\t\t\t)) as Embeddings;\n\n\t\t\t// Handle each operation mode with dedicated modules\n\t\t\tif (mode === 'load') {\n\t\t\t\tconst items = this.getInputData(0);\n\t\t\t\tconst resultData = [];\n\n\t\t\t\tfor (let itemIndex = 0; itemIndex < items.length; itemIndex++) {\n\t\t\t\t\tconst docs = await handleLoadOperation(this, args, embeddings, itemIndex);\n\t\t\t\t\tresultData.push(...docs);\n\t\t\t\t}\n\n\t\t\t\treturn [resultData];\n\t\t\t}\n\n\t\t\tif (mode === 'insert') {\n\t\t\t\tconst resultData = await handleInsertOperation(this, args, embeddings);\n\t\t\t\treturn [resultData];\n\t\t\t}\n\n\t\t\tif (mode === 'update') {\n\t\t\t\tconst resultData = await handleUpdateOperation(this, args, embeddings);\n\t\t\t\treturn [resultData];\n\t\t\t}\n\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tthis.getNode(),\n\t\t\t\t'Only the \"load\", \"update\" and \"insert\" operation modes are supported with execute',\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Method to supply data to AI nodes\n\t\t * Supports 'retrieve' and 'retrieve-as-tool' operation modes\n\t\t */\n\t\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\t\tconst mode = this.getNodeParameter('mode', 0) as NodeOperationMode;\n\n\t\t\t// Get the embeddings model connected to this node\n\t\t\tconst embeddings = (await this.getInputConnectionData(\n\t\t\t\tNodeConnectionTypes.AiEmbedding,\n\t\t\t\t0,\n\t\t\t)) as Embeddings;\n\n\t\t\t// Handle each supply data operation mode with dedicated modules\n\t\t\tif (mode === 'retrieve') {\n\t\t\t\treturn await handleRetrieveOperation(this, args, embeddings, itemIndex);\n\t\t\t}\n\n\t\t\tif (mode === 'retrieve-as-tool') {\n\t\t\t\treturn await handleRetrieveAsToolOperation(this, args, embeddings, itemIndex);\n\t\t\t}\n\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tthis.getNode(),\n\t\t\t\t'Only the \"retrieve\" and \"retrieve-as-tool\" operation mode is supported to supply data',\n\t\t\t);\n\t\t}\n\t};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,0BAAwD;AAWxD,0BAA6C;AAG7C,wBAMO;AAGP,mBAA8E;AAE9E,MAAM,oBAAqC;AAAA,EAC1C,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,aAAa;AAAA,IACZ,eAAe;AAAA,MACd,OAAO;AAAA,MACP,MAAM;AAAA,IACP;AAAA,EACD;AAAA,EACA,SAAS;AACV;AAMO,MAAM,wBAAwB,CACpC,SAEA,MAAM,oBAAyC;AAAA,EAA/C;AACC,uBAAoC;AAAA,MACnC,aAAa,KAAK,KAAK;AAAA,MACvB,MAAM,KAAK,KAAK;AAAA,MAChB,aAAa,KAAK,KAAK;AAAA,MACvB,MAAM,KAAK,KAAK;AAAA,MAChB,WAAW,KAAK,KAAK;AAAA,MACrB,O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,IACD;AAGA,QAAI,SAAS,QAAQ;AACpB,YAAM,QAAQ,KAAK,aAAa,CAAC;AACjC,YAAM,aAAa,CAAC;AAEpB,eAAS,YAAY,GAAG,YAAY,MAAM,QAAQ,aAAa;AAC9D,cAAM,OAAO,UAAM,uCAAoB,MAAM,MAAM,YAAY,SAAS;AACxE,mBAAW,KAAK,GAAG,IAAI;AAAA,MACxB;AAEA,aAAO,CAAC,UAAU;AAAA,IACnB;AAEA,QAAI,SAAS,UAAU;AACtB,YAAM,aAAa,UAAM,yCAAsB,MAAM,MAAM,UAAU;AACrE,aAAO,CAAC,UAAU;AAAA,IACnB;AAEA,QAAI,SAAS,UAAU;AACtB,YAAM,aAAa,UAAM,yCAAsB,MAAM,MAAM,UAAU;AACrE,aAAO,CAAC,UAAU;AAAA,IACnB;AAEA,UAAM,IAAI;AAAA,MACT,KAAK,QAAQ;AAAA,MACb;AAAA,IACD;AAAA,EACD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,WAAuC,WAAwC;AACpF,UAAM,OAAO,KAAK,iBAAiB,QAAQ,CAAC;AAG5C,UAAM,aAAc,MAAM,KAAK;AAAA,MAC9B,wCAAoB;AAAA,MACpB;AAAA,IACD;AAGA,QAAI,SAAS,YAAY;AACxB,aAAO,UAAM,2CAAwB,MAAM,MAAM,YAAY,SAAS;AAAA,IACvE;AAEA,QAAI,SAAS,oBAAoB;AAChC,aAAO,UAAM,iDAA8B,MAAM,MAAM,YAAY,SAAS;AAAA,IAC7E;AAEA,UAAM,IAAI;AAAA,MACT,KAAK,QAAQ;AAAA,MACb;AAAA,IACD;AAAA,EACD;AACD;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../../nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.ts"],"sourcesContent":["import type { Embeddings } from '@langchain/core/embeddings';\nimport type { VectorStore } from '@langchain/core/vectorstores';\nimport { NodeConnectionTypes, NodeOperationError } from 'n8n-workflow';\nimport type {\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tINodeTypeDescription,\n\tSupplyData,\n\tISupplyDataFunctions,\n\tINodeType,\n\tINodeProperties,\n} from 'n8n-workflow';\n\nimport { getConnectionHintNoticeField } from '@utils/sharedFields';\n\n// Import custom types\nimport {\n\thandleLoadOperation,\n\thandleInsertOperation,\n\thandleUpdateOperation,\n\thandleRetrieveOperation,\n\thandleRetrieveAsToolOperation,\n} from './operations';\nimport type { NodeOperationMode, VectorStoreNodeConstructorArgs } from './types';\n// Import utility functions\nimport { transformDescriptionForOperationMode, getOperationModeOptions } from './utils';\n\nconst ragStarterCallout: INodeProperties = {\n\tdisplayName: 'Tip: Get a feel for vector stores in n8n with our',\n\tname: 'ragStarterCallout',\n\ttype: 'callout',\n\ttypeOptions: {\n\t\tcalloutAction: {\n\t\t\tlabel: 'RAG starter template',\n\t\t\ttype: 'openRagStarterTemplate',\n\t\t},\n\t},\n\tdefault: '',\n};\n\n/**\n * Creates a vector store node with the given configuration\n * This factory function produces a complete node class that implements all vector store operations\n */\nexport const createVectorStoreNode = <T extends VectorStore = VectorStore>(\n\targs: VectorStoreNodeConstructorArgs<T>,\n) =>\n\tclass VectorStoreNodeType implements INodeType {\n\t\tdescription: INodeTypeDescription = {\n\t\t\tdisplayName: args.meta.displayName,\n\t\t\tname: args.meta.name,\n\t\t\tdescription: args.meta.description,\n\t\t\ticon: args.meta.icon,\n\t\t\ticonColor: args.meta.iconColor,\n\t\t\tgroup: ['transform'],\n\t\t\t// 1.2 has changes to VectorStoreInMemory node.\n\t\t\t// 1.3 drops `toolName` and uses node name as the tool name.\n\t\t\tversion: [1, 1.1, 1.2, 1.3],\n\t\t\tdefaults: {\n\t\t\t\tname: args.meta.displayName,\n\t\t\t},\n\t\t\tcodex: {\n\t\t\t\tcategories: args.meta.categories ?? ['AI'],\n\t\t\t\tsubcategories: args.meta.subcategories ?? {\n\t\t\t\t\tAI: ['Vector Stores', 'Tools', 'Root Nodes'],\n\t\t\t\t\t'Vector Stores': ['Other Vector Stores'],\n\t\t\t\t\tTools: ['Other Tools'],\n\t\t\t\t},\n\t\t\t\tresources: {\n\t\t\t\t\tprimaryDocumentation: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\turl: args.meta.docsUrl,\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t},\n\t\t\tcredentials: args.meta.credentials,\n\n\t\t\tinputs: `={{\n\t\t\t((parameters) => {\n\t\t\t\tconst mode = parameters?.mode;\n\t\t\t\tconst useReranker = parameters?.useReranker;\n\t\t\t\tconst inputs = [{ displayName: \"Embedding\", type: \"${NodeConnectionTypes.AiEmbedding}\", required: true, maxConnections: 1}]\n\n\t\t\t\tif (['load', 'retrieve', 'retrieve-as-tool'].includes(mode) && useReranker) {\n\t\t\t\t\tinputs.push({ displayName: \"Reranker\", type: \"${NodeConnectionTypes.AiReranker}\", required: true, maxConnections: 1})\n\t\t\t\t}\n\n\t\t\t\tif (mode === 'retrieve-as-tool') {\n\t\t\t\t\treturn inputs;\n\t\t\t\t}\n\n\t\t\t\tif (['insert', 'load', 'update'].includes(mode)) {\n\t\t\t\t\tinputs.push({ displayName: \"\", type: \"${NodeConnectionTypes.Main}\"})\n\t\t\t\t}\n\n\t\t\t\tif (['insert'].includes(mode)) {\n\t\t\t\t\tinputs.push({ displayName: \"Document\", type: \"${NodeConnectionTypes.AiDocument}\", required: true, maxConnections: 1})\n\t\t\t\t}\n\t\t\t\treturn inputs\n\t\t\t})($parameter)\n\t\t}}`,\n\t\t\toutputs: `={{\n\t\t\t((parameters) => {\n\t\t\t\tconst mode = parameters?.mode ?? 'retrieve';\n\n\t\t\t\tif (mode === 'retrieve-as-tool') {\n\t\t\t\t\treturn [{ displayName: \"Tool\", type: \"${NodeConnectionTypes.AiTool}\"}]\n\t\t\t\t}\n\n\t\t\t\tif (mode === 'retrieve') {\n\t\t\t\t\treturn [{ displayName: \"Vector Store\", type: \"${NodeConnectionTypes.AiVectorStore}\"}]\n\t\t\t\t}\n\t\t\t\treturn [{ displayName: \"\", type: \"${NodeConnectionTypes.Main}\"}]\n\t\t\t})($parameter)\n\t\t}}`,\n\t\t\tproperties: [\n\t\t\t\tragStarterCallout,\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Operation Mode',\n\t\t\t\t\tname: 'mode',\n\t\t\t\t\ttype: 'options',\n\t\t\t\t\tnoDataExpression: true,\n\t\t\t\t\tdefault: 'retrieve',\n\t\t\t\t\toptions: getOperationModeOptions(args),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...getConnectionHintNoticeField([NodeConnectionTypes.AiRetriever]),\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tmode: ['retrieve'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Name',\n\t\t\t\t\tname: 'toolName',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\trequired: true,\n\t\t\t\t\tdescription: 'Name of the vector store',\n\t\t\t\t\tplaceholder: 'e.g. company_knowledge_base',\n\t\t\t\t\tvalidateType: 'string-alphanumeric',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t'@version': [{ _cnd: { lte: 1.2 } }],\n\t\t\t\t\t\t\tmode: ['retrieve-as-tool'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Description',\n\t\t\t\t\tname: 'toolDescription',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\trequired: true,\n\t\t\t\t\ttypeOptions: { rows: 2 },\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Explain to the LLM what this tool does, a good, specific description would allow LLMs to produce expected results much more often',\n\t\t\t\t\tplaceholder: `e.g. ${args.meta.description}`,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tmode: ['retrieve-as-tool'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t...args.sharedFields,\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Embedding Batch Size',\n\t\t\t\t\tname: 'embeddingBatchSize',\n\t\t\t\t\ttype: 'number',\n\t\t\t\t\tdefault: 200,\n\t\t\t\t\tdescription: 'Number of documents to embed in a single batch',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tmode: ['insert'],\n\t\t\t\t\t\t\t'@version': [{ _cnd: { gte: 1.1 } }],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t...transformDescriptionForOperationMode(args.insertFields ?? [], 'insert'),\n\t\t\t\t// Prompt and topK are always used for the load operation\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Prompt',\n\t\t\t\t\tname: 'prompt',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\trequired: true,\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Search prompt to retrieve matching documents from the vector store using similarity-based ranking',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tmode: ['load'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Limit',\n\t\t\t\t\tname: 'topK',\n\t\t\t\t\ttype: 'number',\n\t\t\t\t\tdefault: 4,\n\t\t\t\t\tdescription: 'Number of top results to fetch from vector store',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tmode: ['load', 'retrieve-as-tool'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Include Metadata',\n\t\t\t\t\tname: 'includeDocumentMetadata',\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tdescription: 'Whether or not to include document metadata',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tmode: ['load', 'retrieve-as-tool'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Rerank Results',\n\t\t\t\t\tname: 'useReranker',\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: false,\n\t\t\t\t\tdescription: 'Whether or not to rerank results',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tmode: ['load', 'retrieve', 'retrieve-as-tool'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t// ID is always used for update operation\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'ID',\n\t\t\t\t\tname: 'id',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\trequired: true,\n\t\t\t\t\tdescription: 'ID of an embedding entry',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tmode: ['update'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t...transformDescriptionForOperationMode(args.loadFields ?? [], [\n\t\t\t\t\t'load',\n\t\t\t\t\t'retrieve-as-tool',\n\t\t\t\t]),\n\t\t\t\t...transformDescriptionForOperationMode(args.retrieveFields ?? [], 'retrieve'),\n\t\t\t\t...transformDescriptionForOperationMode(args.updateFields ?? [], 'update'),\n\t\t\t],\n\t\t};\n\n\t\tmethods = args.methods;\n\n\t\t/**\n\t\t * Method to execute the node in regular workflow mode\n\t\t * Supports 'load', 'insert', and 'update' operation modes\n\t\t */\n\t\tasync execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {\n\t\t\tconst mode = this.getNodeParameter('mode', 0) as NodeOperationMode;\n\t\t\t// Get the embeddings model connected to this node\n\t\t\tconst embeddings = (await this.getInputConnectionData(\n\t\t\t\tNodeConnectionTypes.AiEmbedding,\n\t\t\t\t0,\n\t\t\t)) as Embeddings;\n\n\t\t\t// Handle each operation mode with dedicated modules\n\t\t\tif (mode === 'load') {\n\t\t\t\tconst items = this.getInputData(0);\n\t\t\t\tconst resultData = [];\n\n\t\t\t\tfor (let itemIndex = 0; itemIndex < items.length; itemIndex++) {\n\t\t\t\t\tconst docs = await handleLoadOperation(this, args, embeddings, itemIndex);\n\t\t\t\t\tresultData.push(...docs);\n\t\t\t\t}\n\n\t\t\t\treturn [resultData];\n\t\t\t}\n\n\t\t\tif (mode === 'insert') {\n\t\t\t\tconst resultData = await handleInsertOperation(this, args, embeddings);\n\t\t\t\treturn [resultData];\n\t\t\t}\n\n\t\t\tif (mode === 'update') {\n\t\t\t\tconst resultData = await handleUpdateOperation(this, args, embeddings);\n\t\t\t\treturn [resultData];\n\t\t\t}\n\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tthis.getNode(),\n\t\t\t\t'Only the \"load\", \"update\" and \"insert\" operation modes are supported with execute',\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Method to supply data to AI nodes\n\t\t * Supports 'retrieve' and 'retrieve-as-tool' operation modes\n\t\t */\n\t\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\t\tconst mode = this.getNodeParameter('mode', 0) as NodeOperationMode;\n\n\t\t\t// Get the embeddings model connected to this node\n\t\t\tconst embeddings = (await this.getInputConnectionData(\n\t\t\t\tNodeConnectionTypes.AiEmbedding,\n\t\t\t\t0,\n\t\t\t)) as Embeddings;\n\n\t\t\t// Handle each supply data operation mode with dedicated modules\n\t\t\tif (mode === 'retrieve') {\n\t\t\t\treturn await handleRetrieveOperation(this, args, embeddings, itemIndex);\n\t\t\t}\n\n\t\t\tif (mode === 'retrieve-as-tool') {\n\t\t\t\treturn await handleRetrieveAsToolOperation(this, args, embeddings, itemIndex);\n\t\t\t}\n\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tthis.getNode(),\n\t\t\t\t'Only the \"retrieve\" and \"retrieve-as-tool\" operation mode is supported to supply data',\n\t\t\t);\n\t\t}\n\t};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,0BAAwD;AAWxD,0BAA6C;AAG7C,wBAMO;AAGP,mBAA8E;AAE9E,MAAM,oBAAqC;AAAA,EAC1C,aAAa;AAAA,EACb,MAAM;AAAA,EACN,MAAM;AAAA,EACN,aAAa;AAAA,IACZ,eAAe;AAAA,MACd,OAAO;AAAA,MACP,MAAM;AAAA,IACP;AAAA,EACD;AAAA,EACA,SAAS;AACV;AAMO,MAAM,wBAAwB,CACpC,SAEA,MAAM,oBAAyC;AAAA,EAA/C;AACC,uBAAoC;AAAA,MACnC,aAAa,KAAK,KAAK;AAAA,MACvB,MAAM,KAAK,KAAK;AAAA,MAChB,aAAa,KAAK,KAAK;AAAA,MACvB,MAAM,KAAK,KAAK;AAAA,MAChB,WAAW,KAAK,KAAK;AAAA,MACrB,OAAO,CAAC,WAAW;AAAA;AAAA;AAAA,MAGnB,SAAS,CAAC,GAAG,KAAK,KAAK,GAAG;AAAA,MAC1B,UAAU;AAAA,QACT,MAAM,KAAK,KAAK;AAAA,MACjB;AAAA,MACA,OAAO;AAAA,QACN,YAAY,KAAK,KAAK,cAAc,CAAC,IAAI;AAAA,QACzC,eAAe,KAAK,KAAK,iBAAiB;AAAA,UACzC,IAAI,CAAC,iBAAiB,SAAS,YAAY;AAAA,UAC3C,iBAAiB,CAAC,qBAAqB;AAAA,UACvC,OAAO,CAAC,aAAa;AAAA,QACtB;AAAA,QACA,WAAW;AAAA,UACV,sBAAsB;AAAA,YACrB;AAAA,cACC,KAAK,KAAK,KAAK;AAAA,YAChB;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,MACA,aAAa,KAAK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,IAAI;AAAA,MACT,KAAK,QAAQ;AAAA,MACb;AAAA,IACD;AAAA,EACD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,WAAuC,WAAwC;AACpF,UAAM,OAAO,KAAK,iBAAiB,QAAQ,CAAC;AAG5C,UAAM,aAAc,MAAM,KAAK;AAAA,MAC9B,wCAAoB;AAAA,MACpB;AAAA,IACD;AAGA,QAAI,SAAS,YAAY;AACxB,aAAO,UAAM,2CAAwB,MAAM,MAAM,YAAY,SAAS;AAAA,IACvE;AAEA,QAAI,SAAS,oBAAoB;AAChC,aAAO,UAAM,iDAA8B,MAAM,MAAM,YAAY,SAAS;AAAA,IAC7E;AAEA,UAAM,IAAI;AAAA,MACT,KAAK,QAAQ;AAAA,MACb;AAAA,IACD;AAAA,EACD;AACD;","names":[]}
|
|
@@ -21,13 +21,15 @@ __export(listSearch_exports, {
|
|
|
21
21
|
milvusCollectionsSearch: () => milvusCollectionsSearch,
|
|
22
22
|
pineconeIndexSearch: () => pineconeIndexSearch,
|
|
23
23
|
qdrantCollectionsSearch: () => qdrantCollectionsSearch,
|
|
24
|
-
supabaseTableNameSearch: () => supabaseTableNameSearch
|
|
24
|
+
supabaseTableNameSearch: () => supabaseTableNameSearch,
|
|
25
|
+
weaviateCollectionsSearch: () => weaviateCollectionsSearch
|
|
25
26
|
});
|
|
26
27
|
module.exports = __toCommonJS(listSearch_exports);
|
|
27
28
|
var import_pinecone = require("@pinecone-database/pinecone");
|
|
28
29
|
var import_milvus2_sdk_node = require("@zilliz/milvus2-sdk-node");
|
|
29
30
|
var import_n8n_workflow = require("n8n-workflow");
|
|
30
31
|
var import_Qdrant = require("../../../VectorStoreQdrant/Qdrant.utils");
|
|
32
|
+
var import_Weaviate = require("../../../VectorStoreWeaviate/Weaviate.utils");
|
|
31
33
|
async function pineconeIndexSearch() {
|
|
32
34
|
const credentials = await this.getCredentials("pineconeApi");
|
|
33
35
|
const client = new import_pinecone.Pinecone({
|
|
@@ -86,11 +88,22 @@ async function milvusCollectionsSearch() {
|
|
|
86
88
|
}));
|
|
87
89
|
return { results };
|
|
88
90
|
}
|
|
91
|
+
async function weaviateCollectionsSearch() {
|
|
92
|
+
const credentials = await this.getCredentials("weaviateApi");
|
|
93
|
+
const client = await (0, import_Weaviate.createWeaviateClient)(credentials);
|
|
94
|
+
const collections = await client.collections.listAll();
|
|
95
|
+
const results = collections.map((collection) => ({
|
|
96
|
+
name: collection.name,
|
|
97
|
+
value: collection.name
|
|
98
|
+
}));
|
|
99
|
+
return { results };
|
|
100
|
+
}
|
|
89
101
|
// Annotate the CommonJS export names for ESM import in node:
|
|
90
102
|
0 && (module.exports = {
|
|
91
103
|
milvusCollectionsSearch,
|
|
92
104
|
pineconeIndexSearch,
|
|
93
105
|
qdrantCollectionsSearch,
|
|
94
|
-
supabaseTableNameSearch
|
|
106
|
+
supabaseTableNameSearch,
|
|
107
|
+
weaviateCollectionsSearch
|
|
95
108
|
});
|
|
96
109
|
//# sourceMappingURL=listSearch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../nodes/vector_store/shared/createVectorStoreNode/methods/listSearch.ts"],"sourcesContent":["import { Pinecone } from '@pinecone-database/pinecone';\nimport { MilvusClient } from '@zilliz/milvus2-sdk-node';\nimport { ApplicationError, type IDataObject, type ILoadOptionsFunctions } from 'n8n-workflow';\n\nimport type { QdrantCredential } from '../../../VectorStoreQdrant/Qdrant.utils';\nimport { createQdrantClient } from '../../../VectorStoreQdrant/Qdrant.utils';\n\nexport async function pineconeIndexSearch(this: ILoadOptionsFunctions) {\n\tconst credentials = await this.getCredentials('pineconeApi');\n\n\tconst client = new Pinecone({\n\t\tapiKey: credentials.apiKey as string,\n\t});\n\n\tconst indexes = await client.listIndexes();\n\n\tconst results = (indexes.indexes ?? []).map((index) => ({\n\t\tname: index.name,\n\t\tvalue: index.name,\n\t}));\n\n\treturn { results };\n}\n\nexport async function supabaseTableNameSearch(this: ILoadOptionsFunctions) {\n\tconst credentials = await this.getCredentials('supabaseApi');\n\n\tconst results = [];\n\n\tif (typeof credentials.host !== 'string') {\n\t\tthrow new ApplicationError('Expected Supabase credentials host to be a string');\n\t}\n\n\tconst { paths } = (await this.helpers.requestWithAuthentication.call(this, 'supabaseApi', {\n\t\theaders: {\n\t\t\tPrefer: 'return=representation',\n\t\t},\n\t\tmethod: 'GET',\n\t\turi: `${credentials.host}/rest/v1/`,\n\t\tjson: true,\n\t})) as { paths: IDataObject };\n\n\tfor (const path of Object.keys(paths)) {\n\t\t//omit introspection path\n\t\tif (path === '/') continue;\n\n\t\tresults.push({\n\t\t\tname: path.replace('/', ''),\n\t\t\tvalue: path.replace('/', ''),\n\t\t});\n\t}\n\n\treturn { results };\n}\n\nexport async function qdrantCollectionsSearch(this: ILoadOptionsFunctions) {\n\tconst credentials = await this.getCredentials('qdrantApi');\n\n\tconst client = createQdrantClient(credentials as QdrantCredential);\n\n\tconst response = await client.getCollections();\n\n\tconst results = response.collections.map((collection) => ({\n\t\tname: collection.name,\n\t\tvalue: collection.name,\n\t}));\n\n\treturn { results };\n}\n\nexport async function milvusCollectionsSearch(this: ILoadOptionsFunctions) {\n\tconst credentials = await this.getCredentials<{\n\t\tbaseUrl: string;\n\t\tusername: string;\n\t\tpassword: string;\n\t}>('milvusApi');\n\n\tconst client = new MilvusClient({\n\t\taddress: credentials.baseUrl,\n\t\ttoken: `${credentials.username}:${credentials.password}`,\n\t});\n\n\tconst response = await client.listCollections();\n\n\tconst results = response.data.map((collection) => ({\n\t\tname: collection.name,\n\t\tvalue: collection.name,\n\t}));\n\n\treturn { results };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAyB;AACzB,8BAA6B;AAC7B,0BAA+E;AAG/E,oBAAmC;AAEnC,eAAsB,sBAAiD;AACtE,QAAM,cAAc,MAAM,KAAK,eAAe,aAAa;AAE3D,QAAM,SAAS,IAAI,yBAAS;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AAI,qCAAa;AAAA,IAC/B,SAAS,YAAY;AAAA,IACrB,OAAO,GAAG,YAAY,QAAQ,IAAI,YAAY,QAAQ;AAAA,EACvD,CAAC;AAED,QAAM,WAAW,MAAM,OAAO,gBAAgB;AAE9C,QAAM,UAAU,SAAS,KAAK,IAAI,CAAC,gBAAgB;AAAA,IAClD,MAAM,WAAW;AAAA,IACjB,OAAO,WAAW;AAAA,EACnB,EAAE;AAEF,SAAO,EAAE,QAAQ;AAClB;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../../../nodes/vector_store/shared/createVectorStoreNode/methods/listSearch.ts"],"sourcesContent":["import { Pinecone } from '@pinecone-database/pinecone';\nimport { MilvusClient } from '@zilliz/milvus2-sdk-node';\nimport { ApplicationError, type IDataObject, type ILoadOptionsFunctions } from 'n8n-workflow';\n\nimport type { QdrantCredential } from '../../../VectorStoreQdrant/Qdrant.utils';\nimport { createQdrantClient } from '../../../VectorStoreQdrant/Qdrant.utils';\nimport type { WeaviateCredential } from '../../../VectorStoreWeaviate/Weaviate.utils';\nimport { createWeaviateClient } from '../../../VectorStoreWeaviate/Weaviate.utils';\n\nexport async function pineconeIndexSearch(this: ILoadOptionsFunctions) {\n\tconst credentials = await this.getCredentials('pineconeApi');\n\n\tconst client = new Pinecone({\n\t\tapiKey: credentials.apiKey as string,\n\t});\n\n\tconst indexes = await client.listIndexes();\n\n\tconst results = (indexes.indexes ?? []).map((index) => ({\n\t\tname: index.name,\n\t\tvalue: index.name,\n\t}));\n\n\treturn { results };\n}\n\nexport async function supabaseTableNameSearch(this: ILoadOptionsFunctions) {\n\tconst credentials = await this.getCredentials('supabaseApi');\n\n\tconst results = [];\n\n\tif (typeof credentials.host !== 'string') {\n\t\tthrow new ApplicationError('Expected Supabase credentials host to be a string');\n\t}\n\n\tconst { paths } = (await this.helpers.requestWithAuthentication.call(this, 'supabaseApi', {\n\t\theaders: {\n\t\t\tPrefer: 'return=representation',\n\t\t},\n\t\tmethod: 'GET',\n\t\turi: `${credentials.host}/rest/v1/`,\n\t\tjson: true,\n\t})) as { paths: IDataObject };\n\n\tfor (const path of Object.keys(paths)) {\n\t\t//omit introspection path\n\t\tif (path === '/') continue;\n\n\t\tresults.push({\n\t\t\tname: path.replace('/', ''),\n\t\t\tvalue: path.replace('/', ''),\n\t\t});\n\t}\n\n\treturn { results };\n}\n\nexport async function qdrantCollectionsSearch(this: ILoadOptionsFunctions) {\n\tconst credentials = await this.getCredentials('qdrantApi');\n\n\tconst client = createQdrantClient(credentials as QdrantCredential);\n\n\tconst response = await client.getCollections();\n\n\tconst results = response.collections.map((collection) => ({\n\t\tname: collection.name,\n\t\tvalue: collection.name,\n\t}));\n\n\treturn { results };\n}\n\nexport async function milvusCollectionsSearch(this: ILoadOptionsFunctions) {\n\tconst credentials = await this.getCredentials<{\n\t\tbaseUrl: string;\n\t\tusername: string;\n\t\tpassword: string;\n\t}>('milvusApi');\n\n\tconst client = new MilvusClient({\n\t\taddress: credentials.baseUrl,\n\t\ttoken: `${credentials.username}:${credentials.password}`,\n\t});\n\n\tconst response = await client.listCollections();\n\n\tconst results = response.data.map((collection) => ({\n\t\tname: collection.name,\n\t\tvalue: collection.name,\n\t}));\n\n\treturn { results };\n}\n\nexport async function weaviateCollectionsSearch(this: ILoadOptionsFunctions) {\n\tconst credentials = await this.getCredentials('weaviateApi');\n\n\tconst client = await createWeaviateClient(credentials as WeaviateCredential);\n\n\tconst collections = await client.collections.listAll();\n\n\tconst results = collections.map((collection: { name: string }) => ({\n\t\tname: collection.name,\n\t\tvalue: collection.name,\n\t}));\n\n\treturn { results };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAyB;AACzB,8BAA6B;AAC7B,0BAA+E;AAG/E,oBAAmC;AAEnC,sBAAqC;AAErC,eAAsB,sBAAiD;AACtE,QAAM,cAAc,MAAM,KAAK,eAAe,aAAa;AAE3D,QAAM,SAAS,IA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AM,SAAS,IAAI,qCAAa;AAAA,IAC/B,SAAS,YAAY;AAAA,IACrB,OAAO,GAAG,YAAY,QAAQ,IAAI,YAAY,QAAQ;AAAA,EACvD,CAAC;AAED,QAAM,WAAW,MAAM,OAAO,gBAAgB;AAE9C,QAAM,UAAU,SAAS,KAAK,IAAI,CAAC,gBAAgB;AAAA,IAClD,MAAM,WAAW;AAAA,IACjB,OAAO,WAAW;AAAA,EACnB,EAAE;AAEF,SAAO,EAAE,QAAQ;AAClB;AAEA,eAAsB,4BAAuD;AAC5E,QAAM,cAAc,MAAM,KAAK,eAAe,aAAa;AAE3D,QAAM,SAAS,UAAM,sCAAqB,WAAiC;AAE3E,QAAM,cAAc,MAAM,OAAO,YAAY,QAAQ;AAErD,QAAM,UAAU,YAAY,IAAI,CAAC,gBAAkC;AAAA,IAClE,MAAM,WAAW;AAAA,IACjB,OAAO,WAAW;AAAA,EACnB,EAAE;AAEF,SAAO,EAAE,QAAQ;AAClB;","names":[]}
|
|
@@ -21,7 +21,8 @@ __export(descriptions_exports, {
|
|
|
21
21
|
milvusCollectionRLC: () => milvusCollectionRLC,
|
|
22
22
|
pineconeIndexRLC: () => pineconeIndexRLC,
|
|
23
23
|
qdrantCollectionRLC: () => qdrantCollectionRLC,
|
|
24
|
-
supabaseTableNameRLC: () => supabaseTableNameRLC
|
|
24
|
+
supabaseTableNameRLC: () => supabaseTableNameRLC,
|
|
25
|
+
weaviateCollectionRLC: () => weaviateCollectionRLC
|
|
25
26
|
});
|
|
26
27
|
module.exports = __toCommonJS(descriptions_exports);
|
|
27
28
|
const pineconeIndexRLC = {
|
|
@@ -112,11 +113,34 @@ const milvusCollectionRLC = {
|
|
|
112
113
|
}
|
|
113
114
|
]
|
|
114
115
|
};
|
|
116
|
+
const weaviateCollectionRLC = {
|
|
117
|
+
displayName: "Weaviate Collection",
|
|
118
|
+
name: "weaviateCollection",
|
|
119
|
+
type: "resourceLocator",
|
|
120
|
+
default: { mode: "list", value: "" },
|
|
121
|
+
required: true,
|
|
122
|
+
modes: [
|
|
123
|
+
{
|
|
124
|
+
displayName: "From List",
|
|
125
|
+
name: "list",
|
|
126
|
+
type: "list",
|
|
127
|
+
typeOptions: {
|
|
128
|
+
searchListMethod: "weaviateCollectionsSearch"
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
displayName: "ID",
|
|
133
|
+
name: "id",
|
|
134
|
+
type: "string"
|
|
135
|
+
}
|
|
136
|
+
]
|
|
137
|
+
};
|
|
115
138
|
// Annotate the CommonJS export names for ESM import in node:
|
|
116
139
|
0 && (module.exports = {
|
|
117
140
|
milvusCollectionRLC,
|
|
118
141
|
pineconeIndexRLC,
|
|
119
142
|
qdrantCollectionRLC,
|
|
120
|
-
supabaseTableNameRLC
|
|
143
|
+
supabaseTableNameRLC,
|
|
144
|
+
weaviateCollectionRLC
|
|
121
145
|
});
|
|
122
146
|
//# sourceMappingURL=descriptions.js.map
|