fix namings, update description, show badge and node info

This commit is contained in:
Henry 2023-11-22 19:48:01 +00:00
parent 44cadc1cc3
commit 7d13b6323f
30 changed files with 214 additions and 123 deletions

View File

@ -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<any> = {
llm,

View File

@ -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 = {

View File

@ -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'

View File

@ -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 = [

View File

@ -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)

View File

@ -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 = [

View File

@ -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 = {

View File

@ -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 = {

View File

@ -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 = {

View File

@ -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'

View File

@ -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)

View File

@ -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 {

View File

@ -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,

View File

@ -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 = {

View File

@ -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 = {

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -106,6 +106,32 @@ const NodeInfoDialog = ({ show, dialogProps, onCancel }) => {
<span style={{ color: '#606c38', fontSize: '0.825rem' }}>version {dialogProps.data.version}</span>
</div>
)}
{dialogProps.data.badge && (
<div
style={{
display: 'flex',
flexDirection: 'row',
width: 'max-content',
borderRadius: 15,
background: dialogProps.data.badge === 'DEPRECATING' ? '#ffe57f' : '#52b69a',
padding: 5,
paddingLeft: 10,
paddingRight: 10,
marginTop: 5,
marginLeft: 10,
marginBottom: 5
}}
>
<span
style={{
color: dialogProps.data.badge !== 'DEPRECATING' ? 'white' : 'inherit',
fontSize: '0.825rem'
}}
>
{dialogProps.data.badge}
</span>
</div>
)}
</div>
</div>
</div>

View File

@ -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) => (
<Accordion
expanded={categoryExpanded[category] || false}
onChange={handleAccordionChange(category)}
key={category}
disableGutters
>
<AccordionSummary
expandIcon={<ExpandMoreIcon />}
aria-controls={`nodes-accordian-${category}`}
id={`nodes-accordian-header-${category}`}
.map((category) =>
category === 'Vector Stores' ? (
<></>
) : (
<Accordion
expanded={categoryExpanded[category] || false}
onChange={handleAccordionChange(category)}
key={category}
disableGutters
>
<Typography variant='h5'>{category}</Typography>
</AccordionSummary>
<AccordionDetails>
{nodes[category].map((node, index) => (
<div
key={node.name}
onDragStart={(event) => onDragStart(event, node)}
draggable
>
<ListItemButton
sx={{
p: 0,
borderRadius: `${customization.borderRadius}px`,
cursor: 'move'
<AccordionSummary
expandIcon={<ExpandMoreIcon />}
aria-controls={`nodes-accordian-${category}`}
id={`nodes-accordian-header-${category}`}
>
{category.split(';').length > 1 ? (
<div
style={{
display: 'flex',
flexDirection: 'row',
alignItems: 'center'
}}
>
<ListItem alignItems='center'>
<ListItemAvatar>
<div
style={{
width: 50,
height: 50,
borderRadius: '50%',
backgroundColor: 'white'
}}
>
<img
style={{
width: '100%',
height: '100%',
padding: 10,
objectFit: 'contain'
}}
alt={node.name}
src={`${baseURL}/api/v1/node-icon/${node.name}`}
/>
</div>
</ListItemAvatar>
<ListItemText
sx={{ ml: 1 }}
primary={
<Typography variant='h5'>{category.split(';')[0]}</Typography>
&nbsp;
<Chip
sx={{
width: 'max-content',
fontWeight: 700,
fontSize: '0.65rem',
background:
category.split(';')[1] === 'DEPRECATING'
? theme.palette.warning.main
: theme.palette.teal.main,
color:
category.split(';')[1] !== 'DEPRECATING'
? 'white'
: 'inherit'
}}
size='small'
label={category.split(';')[1]}
/>
</div>
) : (
<Typography variant='h5'>{category}</Typography>
)}
</AccordionSummary>
<AccordionDetails>
{nodes[category].map((node, index) => (
<div
key={node.name}
onDragStart={(event) => onDragStart(event, node)}
draggable
>
<ListItemButton
sx={{
p: 0,
borderRadius: `${customization.borderRadius}px`,
cursor: 'move'
}}
>
<ListItem alignItems='center'>
<ListItemAvatar>
<div
style={{
display: 'flex',
flexDirection: 'row',
alignItems: 'center'
width: 50,
height: 50,
borderRadius: '50%',
backgroundColor: 'white'
}}
>
<span>{node.label}</span>
&nbsp;
{node.badge && (
<Chip
sx={{
width: 'max-content',
fontWeight: 700,
fontSize: '0.65rem',
background:
node.badge === 'DEPRECATING'
? theme.palette.warning.main
: theme.palette.teal.main,
color:
node.badge !== 'DEPRECATING'
? 'white'
: 'inherit'
}}
size='small'
label={node.badge}
/>
)}
<img
style={{
width: '100%',
height: '100%',
padding: 10,
objectFit: 'contain'
}}
alt={node.name}
src={`${baseURL}/api/v1/node-icon/${node.name}`}
/>
</div>
}
secondary={node.description}
/>
</ListItem>
</ListItemButton>
{index === nodes[category].length - 1 ? null : <Divider />}
</div>
))}
</AccordionDetails>
</Accordion>
))}
</ListItemAvatar>
<ListItemText
sx={{ ml: 1 }}
primary={
<div
style={{
display: 'flex',
flexDirection: 'row',
alignItems: 'center'
}}
>
<span>{node.label}</span>
&nbsp;
{node.badge && (
<Chip
sx={{
width: 'max-content',
fontWeight: 700,
fontSize: '0.65rem',
background:
node.badge === 'DEPRECATING'
? theme.palette.warning
.main
: theme.palette.teal
.main,
color:
node.badge !== 'DEPRECATING'
? 'white'
: 'inherit'
}}
size='small'
label={node.badge}
/>
)}
</div>
}
secondary={node.description}
/>
</ListItem>
</ListItemButton>
{index === nodes[category].length - 1 ? null : <Divider />}
</div>
))}
</AccordionDetails>
</Accordion>
)
)}
</List>
</Box>
</PerfectScrollbar>

View File

@ -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])