mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 23:01:09 +03:00
Merge branch 'FlowiseAI:main' into main
This commit is contained in:
-16
@@ -2,22 +2,6 @@
|
|||||||
Version 2.0, January 2004
|
Version 2.0, January 2004
|
||||||
http://www.apache.org/licenses/
|
http://www.apache.org/licenses/
|
||||||
|
|
||||||
Flowise is governed by the Apache License 2.0, with additional terms and conditions outlined below:
|
|
||||||
|
|
||||||
Flowise can be used for commercial purposes for "backend-as-a-service" for your applications or as a development platform for enterprises. However, under specific conditions, you must reach out to the project's administrators to secure a commercial license:
|
|
||||||
|
|
||||||
a. Multi-tenant SaaS service: Unless you have explicit written authorization from Flowise, you may not utilize the Flowise source code to operate a multi-tenant SaaS service that closely resembles the Flowise cloud-based services.
|
|
||||||
b. Logo and copyright information: While using Flowise in commercial application, you are prohibited from removing or altering the LOGO or copyright information displayed in the Flowise console and UI.
|
|
||||||
|
|
||||||
For inquiries regarding licensing matters, please contact hello@flowiseai.com via email.
|
|
||||||
|
|
||||||
Contributors are required to consent to the following terms related to their contributed code:
|
|
||||||
|
|
||||||
a. The project maintainers have the authority to modify the open-source agreement to be more stringent or lenient.
|
|
||||||
b. Contributed code can be used for commercial purposes, including Flowise's cloud-based services.
|
|
||||||
|
|
||||||
All other rights and restrictions are in accordance with the Apache License 2.0.
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
1. Definitions.
|
1. Definitions.
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class Postgres_VectorStores implements INode {
|
|||||||
constructor() {
|
constructor() {
|
||||||
this.label = 'Postgres'
|
this.label = 'Postgres'
|
||||||
this.name = 'postgres'
|
this.name = 'postgres'
|
||||||
this.version = 1.0
|
this.version = 2.0
|
||||||
this.type = 'Postgres'
|
this.type = 'Postgres'
|
||||||
this.icon = 'postgres.svg'
|
this.icon = 'postgres.svg'
|
||||||
this.category = 'Vector Stores'
|
this.category = 'Vector Stores'
|
||||||
@@ -60,6 +60,13 @@ class Postgres_VectorStores implements INode {
|
|||||||
name: 'database',
|
name: 'database',
|
||||||
type: 'string'
|
type: 'string'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: 'SSL Connection',
|
||||||
|
name: 'sslConnection',
|
||||||
|
type: 'boolean',
|
||||||
|
default: false,
|
||||||
|
optional: false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: 'Port',
|
label: 'Port',
|
||||||
name: 'port',
|
name: 'port',
|
||||||
@@ -117,6 +124,7 @@ class Postgres_VectorStores implements INode {
|
|||||||
const docs = nodeData.inputs?.document as Document[]
|
const docs = nodeData.inputs?.document as Document[]
|
||||||
const embeddings = nodeData.inputs?.embeddings as Embeddings
|
const embeddings = nodeData.inputs?.embeddings as Embeddings
|
||||||
const additionalConfig = nodeData.inputs?.additionalConfig as string
|
const additionalConfig = nodeData.inputs?.additionalConfig as string
|
||||||
|
const sslConnection = nodeData.inputs?.sslConnection as boolean
|
||||||
|
|
||||||
let additionalConfiguration = {}
|
let additionalConfiguration = {}
|
||||||
if (additionalConfig) {
|
if (additionalConfig) {
|
||||||
@@ -134,7 +142,8 @@ class Postgres_VectorStores implements INode {
|
|||||||
port: nodeData.inputs?.port as number,
|
port: nodeData.inputs?.port as number,
|
||||||
username: user,
|
username: user,
|
||||||
password: password,
|
password: password,
|
||||||
database: nodeData.inputs?.database as string
|
database: nodeData.inputs?.database as string,
|
||||||
|
ssl: sslConnection
|
||||||
}
|
}
|
||||||
|
|
||||||
const args = {
|
const args = {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class Postgres_Existing_VectorStores implements INode {
|
|||||||
constructor() {
|
constructor() {
|
||||||
this.label = 'Postgres Load Existing Index'
|
this.label = 'Postgres Load Existing Index'
|
||||||
this.name = 'postgresExistingIndex'
|
this.name = 'postgresExistingIndex'
|
||||||
this.version = 1.0
|
this.version = 2.0
|
||||||
this.type = 'Postgres'
|
this.type = 'Postgres'
|
||||||
this.icon = 'postgres.svg'
|
this.icon = 'postgres.svg'
|
||||||
this.category = 'Vector Stores'
|
this.category = 'Vector Stores'
|
||||||
@@ -52,6 +52,13 @@ class Postgres_Existing_VectorStores implements INode {
|
|||||||
name: 'database',
|
name: 'database',
|
||||||
type: 'string'
|
type: 'string'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: 'SSL Connection',
|
||||||
|
name: 'sslConnection',
|
||||||
|
type: 'boolean',
|
||||||
|
default: false,
|
||||||
|
optional: false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: 'Port',
|
label: 'Port',
|
||||||
name: 'port',
|
name: 'port',
|
||||||
@@ -109,6 +116,7 @@ class Postgres_Existing_VectorStores implements INode {
|
|||||||
const output = nodeData.outputs?.output as string
|
const output = nodeData.outputs?.output as string
|
||||||
const topK = nodeData.inputs?.topK as string
|
const topK = nodeData.inputs?.topK as string
|
||||||
const k = topK ? parseFloat(topK) : 4
|
const k = topK ? parseFloat(topK) : 4
|
||||||
|
const sslConnection = nodeData.inputs?.sslConnection as boolean
|
||||||
|
|
||||||
let additionalConfiguration = {}
|
let additionalConfiguration = {}
|
||||||
if (additionalConfig) {
|
if (additionalConfig) {
|
||||||
@@ -126,7 +134,8 @@ class Postgres_Existing_VectorStores implements INode {
|
|||||||
port: nodeData.inputs?.port as number,
|
port: nodeData.inputs?.port as number,
|
||||||
username: user,
|
username: user,
|
||||||
password: password,
|
password: password,
|
||||||
database: nodeData.inputs?.database as string
|
database: nodeData.inputs?.database as string,
|
||||||
|
ssl: sslConnection
|
||||||
}
|
}
|
||||||
|
|
||||||
const args = {
|
const args = {
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class PostgresUpsert_VectorStores implements INode {
|
|||||||
constructor() {
|
constructor() {
|
||||||
this.label = 'Postgres Upsert Document'
|
this.label = 'Postgres Upsert Document'
|
||||||
this.name = 'postgresUpsert'
|
this.name = 'postgresUpsert'
|
||||||
this.version = 1.0
|
this.version = 2.0
|
||||||
this.type = 'Postgres'
|
this.type = 'Postgres'
|
||||||
this.icon = 'postgres.svg'
|
this.icon = 'postgres.svg'
|
||||||
this.category = 'Vector Stores'
|
this.category = 'Vector Stores'
|
||||||
@@ -59,6 +59,13 @@ class PostgresUpsert_VectorStores implements INode {
|
|||||||
name: 'database',
|
name: 'database',
|
||||||
type: 'string'
|
type: 'string'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: 'SSL Connection',
|
||||||
|
name: 'sslConnection',
|
||||||
|
type: 'boolean',
|
||||||
|
default: false,
|
||||||
|
optional: false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: 'Port',
|
label: 'Port',
|
||||||
name: 'port',
|
name: 'port',
|
||||||
@@ -117,6 +124,7 @@ class PostgresUpsert_VectorStores implements INode {
|
|||||||
const output = nodeData.outputs?.output as string
|
const output = nodeData.outputs?.output as string
|
||||||
const topK = nodeData.inputs?.topK as string
|
const topK = nodeData.inputs?.topK as string
|
||||||
const k = topK ? parseFloat(topK) : 4
|
const k = topK ? parseFloat(topK) : 4
|
||||||
|
const sslConnection = nodeData.inputs?.sslConnection as boolean
|
||||||
|
|
||||||
let additionalConfiguration = {}
|
let additionalConfiguration = {}
|
||||||
if (additionalConfig) {
|
if (additionalConfig) {
|
||||||
@@ -134,7 +142,8 @@ class PostgresUpsert_VectorStores implements INode {
|
|||||||
port: nodeData.inputs?.port as number,
|
port: nodeData.inputs?.port as number,
|
||||||
username: user,
|
username: user,
|
||||||
password: password,
|
password: password,
|
||||||
database: nodeData.inputs?.database as string
|
database: nodeData.inputs?.database as string,
|
||||||
|
ssl: sslConnection
|
||||||
}
|
}
|
||||||
|
|
||||||
const args = {
|
const args = {
|
||||||
|
|||||||
@@ -149,9 +149,12 @@ class Qdrant_VectorStores implements INode {
|
|||||||
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
|
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
|
||||||
const qdrantApiKey = getCredentialParam('qdrantApiKey', credentialData, nodeData)
|
const qdrantApiKey = getCredentialParam('qdrantApiKey', credentialData, nodeData)
|
||||||
|
|
||||||
|
const port = Qdrant_VectorStores.determinePortByUrl(qdrantServerUrl)
|
||||||
|
|
||||||
const client = new QdrantClient({
|
const client = new QdrantClient({
|
||||||
url: qdrantServerUrl,
|
url: qdrantServerUrl,
|
||||||
apiKey: qdrantApiKey
|
apiKey: qdrantApiKey,
|
||||||
|
port: port
|
||||||
})
|
})
|
||||||
|
|
||||||
const flattenDocs = docs && docs.length ? flatten(docs) : []
|
const flattenDocs = docs && docs.length ? flatten(docs) : []
|
||||||
@@ -198,9 +201,12 @@ class Qdrant_VectorStores implements INode {
|
|||||||
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
|
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
|
||||||
const qdrantApiKey = getCredentialParam('qdrantApiKey', credentialData, nodeData)
|
const qdrantApiKey = getCredentialParam('qdrantApiKey', credentialData, nodeData)
|
||||||
|
|
||||||
|
const port = Qdrant_VectorStores.determinePortByUrl(qdrantServerUrl)
|
||||||
|
|
||||||
const client = new QdrantClient({
|
const client = new QdrantClient({
|
||||||
url: qdrantServerUrl,
|
url: qdrantServerUrl,
|
||||||
apiKey: qdrantApiKey
|
apiKey: qdrantApiKey,
|
||||||
|
port: port
|
||||||
})
|
})
|
||||||
|
|
||||||
const dbConfig: QdrantLibArgs = {
|
const dbConfig: QdrantLibArgs = {
|
||||||
@@ -242,6 +248,28 @@ class Qdrant_VectorStores implements INode {
|
|||||||
}
|
}
|
||||||
return vectorStore
|
return vectorStore
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine the port number from the given URL.
|
||||||
|
*
|
||||||
|
* The problem is when not doing this the qdrant-client.js will fall back on 6663 when you enter a port 443 and 80.
|
||||||
|
* See: https://stackoverflow.com/questions/59104197/nodejs-new-url-urlhttps-myurl-com80-lists-the-port-as-empty
|
||||||
|
* @param qdrantServerUrl the url to get the port from
|
||||||
|
*/
|
||||||
|
static determinePortByUrl(qdrantServerUrl: string): number {
|
||||||
|
const parsedUrl = new URL(qdrantServerUrl)
|
||||||
|
|
||||||
|
let port = parsedUrl.port ? parseInt(parsedUrl.port) : 6663
|
||||||
|
|
||||||
|
if (parsedUrl.protocol === 'https:' && parsedUrl.port === '') {
|
||||||
|
port = 443
|
||||||
|
}
|
||||||
|
if (parsedUrl.protocol === 'http:' && parsedUrl.port === '') {
|
||||||
|
port = 80
|
||||||
|
}
|
||||||
|
|
||||||
|
return port
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = { nodeClass: Qdrant_VectorStores }
|
module.exports = { nodeClass: Qdrant_VectorStores }
|
||||||
|
|||||||
Reference in New Issue
Block a user