diff --git a/packages/components/nodes/retrievers/HydeRetriever/HydeRetriever.ts b/packages/components/nodes/retrievers/HydeRetriever/HydeRetriever.ts index 2baf677e..9ec7ada0 100644 --- a/packages/components/nodes/retrievers/HydeRetriever/HydeRetriever.ts +++ b/packages/components/nodes/retrievers/HydeRetriever/HydeRetriever.ts @@ -104,7 +104,7 @@ class HydeRetriever_Retrievers implements INode { const promptKey = nodeData.inputs?.promptKey as PromptKey const customPrompt = nodeData.inputs?.customPrompt as string const topK = nodeData.inputs?.topK as string - const k = topK ? parseInt(topK, 10) : 4 + const k = topK ? parseFloat(topK) : 4 const obj: HydeRetrieverOptions = { llm, diff --git a/packages/components/nodes/vectorstores/Chroma/Chroma.ts b/packages/components/nodes/vectorstores/Chroma/Chroma.ts index eef2db79..6e1cfa67 100644 --- a/packages/components/nodes/vectorstores/Chroma/Chroma.ts +++ b/packages/components/nodes/vectorstores/Chroma/Chroma.ts @@ -27,7 +27,7 @@ class Chroma_VectorStores implements INode { this.type = 'Chroma' this.icon = 'chroma.svg' this.category = 'Vector Stores' - this.description = 'Upsert or Load data to Chroma Vector Database' + this.description = 'Upsert embedded data and perform similarity search upon query using Chroma, an open-source embedding database' this.baseClasses = [this.type, 'VectorStoreRetriever', 'BaseRetriever'] this.badge = 'NEW' this.credential = { diff --git a/packages/components/nodes/vectorstores/Elasticsearch/Elasticsearch.ts b/packages/components/nodes/vectorstores/Elasticsearch/Elasticsearch.ts index e7915b3e..5f3cf206 100644 --- a/packages/components/nodes/vectorstores/Elasticsearch/Elasticsearch.ts +++ b/packages/components/nodes/vectorstores/Elasticsearch/Elasticsearch.ts @@ -24,7 +24,8 @@ class Elasticsearch_VectorStores implements INode { this.label = 'Elasticsearch' this.name = 'elasticsearch' this.version = 1.0 - this.description = 'Upsert or Load data to Elasticsearch Vector Database' + this.description = + 'Upsert embedded data and perform similarity search upon query using Elasticsearch, a distributed search and analytics engine' this.type = 'Elasticsearch' this.icon = 'elasticsearch.png' this.category = 'Vector Stores' diff --git a/packages/components/nodes/vectorstores/Faiss/Faiss.ts b/packages/components/nodes/vectorstores/Faiss/Faiss.ts index e2c1512e..4120a57e 100644 --- a/packages/components/nodes/vectorstores/Faiss/Faiss.ts +++ b/packages/components/nodes/vectorstores/Faiss/Faiss.ts @@ -25,7 +25,7 @@ class Faiss_VectorStores implements INode { this.type = 'Faiss' this.icon = 'faiss.svg' this.category = 'Vector Stores' - this.description = 'Upsert or Load data to Faiss Vector Store' + this.description = 'Upsert embedded data and perform similarity search upon query using Faiss library from Meta' this.baseClasses = [this.type, 'VectorStoreRetriever', 'BaseRetriever'] this.badge = 'NEW' this.inputs = [ diff --git a/packages/components/nodes/vectorstores/Milvus/Milvus.ts b/packages/components/nodes/vectorstores/Milvus/Milvus.ts index b937be1e..090f35f7 100644 --- a/packages/components/nodes/vectorstores/Milvus/Milvus.ts +++ b/packages/components/nodes/vectorstores/Milvus/Milvus.ts @@ -31,7 +31,7 @@ class Milvus_VectorStores implements INode { this.type = 'Milvus' this.icon = 'milvus.svg' this.category = 'Vector Stores' - this.description = 'Upsert or Load data to Milvus Vector Database' + this.description = `Upsert embedded data and perform similarity search upon query using Milvus, world's most advanced open-source vector database` this.baseClasses = [this.type, 'VectorStoreRetriever', 'BaseRetriever'] this.badge = 'NEW' this.credential = { @@ -159,7 +159,7 @@ class Milvus_VectorStores implements INode { const output = nodeData.outputs?.output as string // format data - const k = topK ? parseInt(topK, 10) : 4 + const k = topK ? parseFloat(topK) : 4 // credential const credentialData = await getCredentialData(nodeData.credential ?? '', options) diff --git a/packages/components/nodes/vectorstores/OpenSearch/OpenSearch.ts b/packages/components/nodes/vectorstores/OpenSearch/OpenSearch.ts index 66f04143..e3e18ce1 100644 --- a/packages/components/nodes/vectorstores/OpenSearch/OpenSearch.ts +++ b/packages/components/nodes/vectorstores/OpenSearch/OpenSearch.ts @@ -26,7 +26,7 @@ class OpenSearch_VectorStores implements INode { this.type = 'OpenSearch' this.icon = 'opensearch.png' this.category = 'Vector Stores' - this.description = 'Upsert or Load data to OpenSearch Vector Database' + this.description = `Upsert embedded data and perform similarity search upon query using OpenSearch, an open-source, all-in-one vector database` this.baseClasses = [this.type, 'VectorStoreRetriever', 'BaseRetriever'] this.badge = 'NEW' this.inputs = [ diff --git a/packages/components/nodes/vectorstores/Pinecone/Pinecone.ts b/packages/components/nodes/vectorstores/Pinecone/Pinecone.ts index e4ef9fb7..4ece4720 100644 --- a/packages/components/nodes/vectorstores/Pinecone/Pinecone.ts +++ b/packages/components/nodes/vectorstores/Pinecone/Pinecone.ts @@ -27,7 +27,7 @@ class Pinecone_VectorStores implements INode { this.type = 'Pinecone' this.icon = 'pinecone.png' this.category = 'Vector Stores' - this.description = 'Upsert or Load data to Pinecone Vector Database' + this.description = `Upsert embedded data and perform similarity search upon query using Pinecone, a leading fully managed hosted vector database` this.baseClasses = [this.type, 'VectorStoreRetriever', 'BaseRetriever'] this.badge = 'NEW' this.credential = { diff --git a/packages/components/nodes/vectorstores/Postgres/Postgres.ts b/packages/components/nodes/vectorstores/Postgres/Postgres.ts index 0609d0b5..ac4b80c3 100644 --- a/packages/components/nodes/vectorstores/Postgres/Postgres.ts +++ b/packages/components/nodes/vectorstores/Postgres/Postgres.ts @@ -28,7 +28,7 @@ class Postgres_VectorStores implements INode { this.type = 'Postgres' this.icon = 'postgres.svg' this.category = 'Vector Stores' - this.description = 'Upsert or Load data to Postgres using pgvector' + this.description = 'Upsert embedded data and perform similarity search upon query using pgvector on Postgres' this.baseClasses = [this.type, 'VectorStoreRetriever', 'BaseRetriever'] this.badge = 'NEW' this.credential = { diff --git a/packages/components/nodes/vectorstores/Qdrant/Qdrant.ts b/packages/components/nodes/vectorstores/Qdrant/Qdrant.ts index 6de2c186..6413f8bf 100644 --- a/packages/components/nodes/vectorstores/Qdrant/Qdrant.ts +++ b/packages/components/nodes/vectorstores/Qdrant/Qdrant.ts @@ -30,7 +30,8 @@ class Qdrant_VectorStores implements INode { this.type = 'Qdrant' this.icon = 'qdrant.png' this.category = 'Vector Stores' - this.description = 'Upsert or Load data to Qdrant Vector Database' + this.description = + 'Upsert embedded data and perform similarity search upon query using Qdrant, a scalable open source vector database written in Rust' this.baseClasses = [this.type, 'VectorStoreRetriever', 'BaseRetriever'] this.badge = 'NEW' this.credential = { diff --git a/packages/components/nodes/vectorstores/Redis/Redis.ts b/packages/components/nodes/vectorstores/Redis/Redis.ts index d857e225..dc993b86 100644 --- a/packages/components/nodes/vectorstores/Redis/Redis.ts +++ b/packages/components/nodes/vectorstores/Redis/Redis.ts @@ -25,7 +25,8 @@ class Redis_VectorStores implements INode { this.label = 'Redis' this.name = 'redis' this.version = 1.0 - this.description = 'Upsert or Load data to Redis' + this.description = + 'Upsert embedded data and perform similarity search upon query using Redis, an open source, in-memory data structure store' this.type = 'Redis' this.icon = 'redis.svg' this.category = 'Vector Stores' diff --git a/packages/components/nodes/vectorstores/Singlestore/Singlestore.ts b/packages/components/nodes/vectorstores/Singlestore/Singlestore.ts index 3597f41e..d16252ac 100644 --- a/packages/components/nodes/vectorstores/Singlestore/Singlestore.ts +++ b/packages/components/nodes/vectorstores/Singlestore/Singlestore.ts @@ -26,7 +26,8 @@ class SingleStore_VectorStores implements INode { this.type = 'SingleStore' this.icon = 'singlestore.svg' this.category = 'Vector Stores' - this.description = 'Upsert or Load data to SingleStore Vector Database' + this.description = + 'Upsert embedded data and perform similarity search upon query using SingleStore, a fast and distributed cloud relational database' this.baseClasses = [this.type, 'VectorStoreRetriever', 'BaseRetriever'] this.badge = 'NEW' this.credential = { @@ -180,9 +181,7 @@ class SingleStore_VectorStores implements INode { const topK = nodeData.inputs?.topK as string const k = topK ? parseFloat(topK) : 4 - let vectorStore: SingleStoreVectorStore - - vectorStore = new SingleStoreVectorStore(embeddings, singleStoreConnectionConfig) + const vectorStore = new SingleStoreVectorStore(embeddings, singleStoreConnectionConfig) if (output === 'retriever') { const retriever = vectorStore.asRetriever(k) diff --git a/packages/components/nodes/vectorstores/Supabase/Supabase.ts b/packages/components/nodes/vectorstores/Supabase/Supabase.ts index a7de3211..13840ab7 100644 --- a/packages/components/nodes/vectorstores/Supabase/Supabase.ts +++ b/packages/components/nodes/vectorstores/Supabase/Supabase.ts @@ -27,7 +27,7 @@ class Supabase_VectorStores implements INode { this.type = 'Supabase' this.icon = 'supabase.svg' this.category = 'Vector Stores' - this.description = 'Upsert or Load data to Supabase using pgvector' + this.description = 'Upsert embedded data and perform similarity search upon query using Supabase via pgvector extension' this.baseClasses = [this.type, 'VectorStoreRetriever', 'BaseRetriever'] this.badge = 'NEW' this.credential = { @@ -112,7 +112,9 @@ class Supabase_VectorStores implements INode { const flattenDocs = docs && docs.length ? flatten(docs) : [] const finalDocs = [] for (let i = 0; i < flattenDocs.length; i += 1) { - finalDocs.push(new Document(flattenDocs[i])) + if (flattenDocs[i] && flattenDocs[i].pageContent) { + finalDocs.push(new Document(flattenDocs[i])) + } } try { diff --git a/packages/components/nodes/vectorstores/Vectara/Vectara.ts b/packages/components/nodes/vectorstores/Vectara/Vectara.ts index f12dc4a2..7460c586 100644 --- a/packages/components/nodes/vectorstores/Vectara/Vectara.ts +++ b/packages/components/nodes/vectorstores/Vectara/Vectara.ts @@ -26,7 +26,7 @@ class Vectara_VectorStores implements INode { this.type = 'Vectara' this.icon = 'vectara.png' this.category = 'Vector Stores' - this.description = 'Upsert or Load data to Vectara Vector Database' + this.description = 'Upsert embedded data and perform similarity search upon query using Vectara, a LLM-powered search-as-a-service' this.baseClasses = [this.type, 'VectorStoreRetriever', 'BaseRetriever'] this.badge = 'NEW' this.credential = { @@ -65,6 +65,7 @@ class Vectara_VectorStores implements INode { name: 'sentencesBefore', description: 'Number of sentences to fetch before the matched sentence. Defaults to 2.', type: 'number', + default: 2, additionalParams: true, optional: true }, @@ -73,6 +74,7 @@ class Vectara_VectorStores implements INode { name: 'sentencesAfter', description: 'Number of sentences to fetch after the matched sentence. Defaults to 2.', type: 'number', + default: 2, additionalParams: true, optional: true }, @@ -189,7 +191,7 @@ class Vectara_VectorStores implements INode { const lambda = nodeData.inputs?.lambda as number const output = nodeData.outputs?.output as string const topK = nodeData.inputs?.topK as string - const k = topK ? parseInt(topK, 10) : 4 + const k = topK ? parseFloat(topK) : 4 const vectaraArgs: VectaraLibArgs = { apiKey: apiKey, diff --git a/packages/components/nodes/vectorstores/Weaviate/Weaviate.ts b/packages/components/nodes/vectorstores/Weaviate/Weaviate.ts index e54d122b..5c31c737 100644 --- a/packages/components/nodes/vectorstores/Weaviate/Weaviate.ts +++ b/packages/components/nodes/vectorstores/Weaviate/Weaviate.ts @@ -27,7 +27,8 @@ class Weaviate_VectorStores implements INode { this.type = 'Weaviate' this.icon = 'weaviate.png' this.category = 'Vector Stores' - this.description = 'Upsert or Load data to Weaviate Vector Database' + this.description = + 'Upsert embedded data and perform similarity search upon query using Weaviate, a scalable open-source vector database' this.baseClasses = [this.type, 'VectorStoreRetriever', 'BaseRetriever'] this.badge = 'NEW' this.credential = { diff --git a/packages/components/nodes/vectorstores/Zep/Zep.ts b/packages/components/nodes/vectorstores/Zep/Zep.ts index ce863a9e..21c885b4 100644 --- a/packages/components/nodes/vectorstores/Zep/Zep.ts +++ b/packages/components/nodes/vectorstores/Zep/Zep.ts @@ -27,7 +27,8 @@ class Zep_VectorStores implements INode { this.type = 'Zep' this.icon = 'zep.png' this.category = 'Vector Stores' - this.description = 'Upsert or Load data to Zep Vector Database' + this.description = + 'Upsert embedded data and perform similarity search upon query using Zep, a fast and scalable building block for LLM apps' this.baseClasses = [this.type, 'VectorStoreRetriever', 'BaseRetriever'] this.badge = 'NEW' this.credential = { diff --git a/packages/server/marketplaces/chatflows/AutoGPT.json b/packages/server/marketplaces/chatflows/AutoGPT.json index 5f388da6..150fe17e 100644 --- a/packages/server/marketplaces/chatflows/AutoGPT.json +++ b/packages/server/marketplaces/chatflows/AutoGPT.json @@ -511,7 +511,7 @@ "type": "Pinecone", "baseClasses": ["Pinecone", "VectorStoreRetriever", "BaseRetriever"], "category": "Vector Stores", - "description": "Upsert or Load data to Pinecone Vector Database", + "description": "Upsert embedded data and perform similarity search upon query using Pinecone, a leading fully managed hosted vector database", "inputParams": [ { "label": "Connect Credential", diff --git a/packages/server/marketplaces/chatflows/BabyAGI.json b/packages/server/marketplaces/chatflows/BabyAGI.json index 211e9e42..ab387205 100644 --- a/packages/server/marketplaces/chatflows/BabyAGI.json +++ b/packages/server/marketplaces/chatflows/BabyAGI.json @@ -166,7 +166,7 @@ "type": "Pinecone", "baseClasses": ["Pinecone", "VectorStoreRetriever", "BaseRetriever"], "category": "Vector Stores", - "description": "Upsert or Load data to Pinecone Vector Database", + "description": "Upsert embedded data and perform similarity search upon query using Pinecone, a leading fully managed hosted vector database", "inputParams": [ { "label": "Connect Credential", diff --git a/packages/server/marketplaces/chatflows/Conversational Retrieval Agent.json b/packages/server/marketplaces/chatflows/Conversational Retrieval Agent.json index dd4cf3b1..aafc8e8e 100644 --- a/packages/server/marketplaces/chatflows/Conversational Retrieval Agent.json +++ b/packages/server/marketplaces/chatflows/Conversational Retrieval Agent.json @@ -301,7 +301,7 @@ "type": "Pinecone", "baseClasses": ["Pinecone", "VectorStoreRetriever", "BaseRetriever"], "category": "Vector Stores", - "description": "Upsert or Load data to Pinecone Vector Database", + "description": "Upsert embedded data and perform similarity search upon query using Pinecone, a leading fully managed hosted vector database", "inputParams": [ { "label": "Connect Credential", diff --git a/packages/server/marketplaces/chatflows/Conversational Retrieval QA Chain.json b/packages/server/marketplaces/chatflows/Conversational Retrieval QA Chain.json index e775846c..5c55d833 100644 --- a/packages/server/marketplaces/chatflows/Conversational Retrieval QA Chain.json +++ b/packages/server/marketplaces/chatflows/Conversational Retrieval QA Chain.json @@ -553,7 +553,7 @@ "type": "Pinecone", "baseClasses": ["Pinecone", "VectorStoreRetriever", "BaseRetriever"], "category": "Vector Stores", - "description": "Upsert or Load data to Pinecone Vector Database", + "description": "Upsert embedded data and perform similarity search upon query using Pinecone, a leading fully managed hosted vector database", "inputParams": [ { "label": "Connect Credential", diff --git a/packages/server/marketplaces/chatflows/Local QnA.json b/packages/server/marketplaces/chatflows/Local QnA.json index fcf8593c..e24ad7ca 100644 --- a/packages/server/marketplaces/chatflows/Local QnA.json +++ b/packages/server/marketplaces/chatflows/Local QnA.json @@ -555,7 +555,7 @@ "type": "Faiss", "baseClasses": ["Faiss", "VectorStoreRetriever", "BaseRetriever"], "category": "Vector Stores", - "description": "Upsert or Load data to Faiss Vector Store", + "description": "Upsert embedded data and perform similarity search upon query using Faiss library from Meta", "inputParams": [ { "label": "Base Path to load", diff --git a/packages/server/marketplaces/chatflows/Long Term Memory.json b/packages/server/marketplaces/chatflows/Long Term Memory.json index f5ff2dca..c508b480 100644 --- a/packages/server/marketplaces/chatflows/Long Term Memory.json +++ b/packages/server/marketplaces/chatflows/Long Term Memory.json @@ -351,7 +351,7 @@ "type": "Qdrant", "baseClasses": ["Qdrant", "VectorStoreRetriever", "BaseRetriever"], "category": "Vector Stores", - "description": "Upsert or Load data to Qdrant Vector Database", + "description": "Upsert embedded data and perform similarity search upon query using Qdrant, a scalable open source vector database written in Rust", "inputParams": [ { "label": "Connect Credential", diff --git a/packages/server/marketplaces/chatflows/Metadata Filter.json b/packages/server/marketplaces/chatflows/Metadata Filter.json index f594a2b6..9865ae70 100644 --- a/packages/server/marketplaces/chatflows/Metadata Filter.json +++ b/packages/server/marketplaces/chatflows/Metadata Filter.json @@ -634,7 +634,7 @@ "type": "Pinecone", "baseClasses": ["Pinecone", "VectorStoreRetriever", "BaseRetriever"], "category": "Vector Stores", - "description": "Upsert or Load data to Pinecone Vector Database", + "description": "Upsert embedded data and perform similarity search upon query using Pinecone, a leading fully managed hosted vector database", "inputParams": [ { "label": "Connect Credential", diff --git a/packages/server/marketplaces/chatflows/Multi Retrieval QA Chain.json b/packages/server/marketplaces/chatflows/Multi Retrieval QA Chain.json index 9032122b..5388d965 100644 --- a/packages/server/marketplaces/chatflows/Multi Retrieval QA Chain.json +++ b/packages/server/marketplaces/chatflows/Multi Retrieval QA Chain.json @@ -560,7 +560,7 @@ "type": "Pinecone", "baseClasses": ["Pinecone", "VectorStoreRetriever", "BaseRetriever"], "category": "Vector Stores", - "description": "Upsert or Load data to Pinecone Vector Database", + "description": "Upsert embedded data and perform similarity search upon query using Pinecone, a leading fully managed hosted vector database", "inputParams": [ { "label": "Connect Credential", @@ -678,7 +678,7 @@ "type": "Chroma", "baseClasses": ["Chroma", "VectorStoreRetriever", "BaseRetriever"], "category": "Vector Stores", - "description": "Upsert or Load data to Chroma Vector Database", + "description": "Upsert embedded data and perform similarity search upon query using Chroma, an open-source embedding database", "inputParams": [ { "label": "Connect Credential", @@ -796,7 +796,7 @@ "type": "Supabase", "baseClasses": ["Supabase", "VectorStoreRetriever", "BaseRetriever"], "category": "Vector Stores", - "description": "Upsert or Load data to Supabase using pgvector", + "description": "Upsert embedded data and perform similarity search upon query using Supabase via pgvector extension", "inputParams": [ { "label": "Connect Credential", diff --git a/packages/server/marketplaces/chatflows/Multiple VectorDB.json b/packages/server/marketplaces/chatflows/Multiple VectorDB.json index 723b510e..e7718616 100644 --- a/packages/server/marketplaces/chatflows/Multiple VectorDB.json +++ b/packages/server/marketplaces/chatflows/Multiple VectorDB.json @@ -634,7 +634,7 @@ "type": "Redis", "baseClasses": ["Redis", "VectorStoreRetriever", "BaseRetriever"], "category": "Vector Stores", - "description": "Upsert or Load data to Redis", + "description": "Upsert embedded data and perform similarity search upon query using Redis, an open source, in-memory data structure store", "inputParams": [ { "label": "Connect Credential", @@ -776,7 +776,7 @@ "type": "Faiss", "baseClasses": ["Faiss", "VectorStoreRetriever", "BaseRetriever"], "category": "Vector Stores", - "description": "Upsert or Load data to Faiss Vector Store", + "description": "Upsert embedded data and perform similarity search upon query using Faiss library from Meta", "inputParams": [ { "label": "Base Path to load", diff --git a/packages/server/marketplaces/chatflows/Prompt Chaining with VectorStore.json b/packages/server/marketplaces/chatflows/Prompt Chaining with VectorStore.json index fca62a76..0ddec74f 100644 --- a/packages/server/marketplaces/chatflows/Prompt Chaining with VectorStore.json +++ b/packages/server/marketplaces/chatflows/Prompt Chaining with VectorStore.json @@ -792,7 +792,7 @@ "type": "SingleStore", "baseClasses": ["SingleStore", "VectorStoreRetriever", "BaseRetriever"], "category": "Vector Stores", - "description": "Upsert or Load data to SingleStore Vector Database", + "description": "Upsert embedded data and perform similarity search upon query using SingleStore, a fast and distributed cloud relational database", "inputParams": [ { "label": "Connect Credential", diff --git a/packages/server/marketplaces/chatflows/Vectara LLM Chain Upload.json b/packages/server/marketplaces/chatflows/Vectara LLM Chain Upload.json index 4f35bd4c..d9f9fb49 100644 --- a/packages/server/marketplaces/chatflows/Vectara LLM Chain Upload.json +++ b/packages/server/marketplaces/chatflows/Vectara LLM Chain Upload.json @@ -305,7 +305,7 @@ "type": "Vectara", "baseClasses": ["Vectara", "VectorStoreRetriever", "BaseRetriever"], "category": "Vector Stores", - "description": "Upsert or Load data to Vectara Vector Database", + "description": "Upsert embedded data and perform similarity search upon query using Vectara, a LLM-powered search-as-a-service", "inputParams": [ { "label": "Connect Credential", diff --git a/packages/server/marketplaces/chatflows/WebPage QnA.json b/packages/server/marketplaces/chatflows/WebPage QnA.json index da05721b..9b1119b9 100644 --- a/packages/server/marketplaces/chatflows/WebPage QnA.json +++ b/packages/server/marketplaces/chatflows/WebPage QnA.json @@ -654,7 +654,7 @@ "type": "Pinecone", "baseClasses": ["Pinecone", "VectorStoreRetriever", "BaseRetriever"], "category": "Vector Stores", - "description": "Upsert or Load data to Pinecone Vector Database", + "description": "Upsert embedded data and perform similarity search upon query using Pinecone, a leading fully managed hosted vector database", "inputParams": [ { "label": "Connect Credential", diff --git a/packages/ui/src/ui-component/dialog/NodeInfoDialog.js b/packages/ui/src/ui-component/dialog/NodeInfoDialog.js index 5abdb035..6f3bec5d 100644 --- a/packages/ui/src/ui-component/dialog/NodeInfoDialog.js +++ b/packages/ui/src/ui-component/dialog/NodeInfoDialog.js @@ -106,6 +106,32 @@ const NodeInfoDialog = ({ show, dialogProps, onCancel }) => { version {dialogProps.data.version} )} + {dialogProps.data.badge && ( +
+ + {dialogProps.data.badge} + +
+ )} diff --git a/packages/ui/src/views/canvas/AddNodes.js b/packages/ui/src/views/canvas/AddNodes.js index e0e639d1..44030d0e 100644 --- a/packages/ui/src/views/canvas/AddNodes.js +++ b/packages/ui/src/views/canvas/AddNodes.js @@ -57,6 +57,22 @@ const AddNodes = ({ nodesData, node }) => { const prevOpen = useRef(open) const ps = useRef() + // Temporary method to handle Deprecating Vector Store and New ones + const categorizeVectorStores = (nodes) => { + const obj = { ...nodes } + const vsNodes = obj['Vector Stores'] ?? [] + const deprecatingNodes = [] + const newNodes = [] + for (const vsNode of vsNodes) { + if (vsNode.badge === 'DEPRECATING') deprecatingNodes.push(vsNode) + else newNodes.push(vsNode) + } + delete obj['Vector Stores'] + obj['Vector Stores;DEPRECATING'] = deprecatingNodes + obj['Vector Stores;NEW'] = newNodes + setNodes(obj) + } + const scrollTop = () => { const curr = ps.current if (curr) { @@ -96,6 +112,7 @@ const AddNodes = ({ nodesData, node }) => { return r }, Object.create(null)) setNodes(result) + categorizeVectorStores(result) setCategoryExpanded(accordianCategories) } @@ -138,6 +155,8 @@ const AddNodes = ({ nodesData, node }) => { groupByCategory(nodesData) dispatch({ type: SET_COMPONENT_NODES, componentNodes: nodesData }) } + + // eslint-disable-next-line react-hooks/exhaustive-deps }, [nodesData, dispatch]) return ( @@ -250,99 +269,135 @@ const AddNodes = ({ nodesData, node }) => { > {Object.keys(nodes) .sort() - .map((category) => ( - - } - aria-controls={`nodes-accordian-${category}`} - id={`nodes-accordian-header-${category}`} + .map((category) => + category === 'Vector Stores' ? ( + <> + ) : ( + - {category} - - - {nodes[category].map((node, index) => ( -
onDragStart(event, node)} - draggable - > - } + aria-controls={`nodes-accordian-${category}`} + id={`nodes-accordian-header-${category}`} + > + {category.split(';').length > 1 ? ( +
- - -
- {node.name} -
-
- {category.split(';')[0]} +   + +
+ ) : ( + {category} + )} + + + {nodes[category].map((node, index) => ( +
onDragStart(event, node)} + draggable + > + + +
- {node.label} -   - {node.badge && ( - - )} + {node.name}
- } - secondary={node.description} - /> -
-
- {index === nodes[category].length - 1 ? null : } -
- ))} -
- - ))} + + + {node.label} +   + {node.badge && ( + + )} +
+ } + secondary={node.description} + /> + + + {index === nodes[category].length - 1 ? null : } + + ))} +
+
+ ) + )} diff --git a/packages/ui/src/views/canvas/CanvasNode.js b/packages/ui/src/views/canvas/CanvasNode.js index cabe2329..4455afc0 100644 --- a/packages/ui/src/views/canvas/CanvasNode.js +++ b/packages/ui/src/views/canvas/CanvasNode.js @@ -83,8 +83,10 @@ const CanvasNode = ({ data }) => { if (componentNode) { if (!data.version) { setWarningMessage(nodeVersionEmptyMessage(componentNode.version)) - } else { - if (componentNode.version > data.version) setWarningMessage(nodeOutdatedMessage(data.version, componentNode.version)) + } else if (data.version && componentNode.version > data.version) { + setWarningMessage(nodeOutdatedMessage(data.version, componentNode.version)) + } else if (componentNode.badge === 'DEPRECATING') { + setWarningMessage('This node will be deprecated in the next release. Change to a new node tagged with NEW') } } }, [canvas.componentNodes, data.name, data.version])