Skip to content

Commit

Permalink
Merge branch 'main' into feature/postgres-ssl-flag-option
Browse files Browse the repository at this point in the history
  • Loading branch information
tuxBurner committed Jan 5, 2024
2 parents b833cb8 + d913699 commit c2735b1
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 24 deletions.
16 changes: 0 additions & 16 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,6 @@
Version 2.0, January 2004
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 [email protected] 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

1. Definitions.
Expand Down
32 changes: 30 additions & 2 deletions packages/components/nodes/vectorstores/Qdrant/Qdrant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,12 @@ class Qdrant_VectorStores implements INode {
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
const qdrantApiKey = getCredentialParam('qdrantApiKey', credentialData, nodeData)

const port = Qdrant_VectorStores.determinePortByUrl(qdrantServerUrl)

const client = new QdrantClient({
url: qdrantServerUrl,
apiKey: qdrantApiKey
apiKey: qdrantApiKey,
port: port
})

const flattenDocs = docs && docs.length ? flatten(docs) : []
Expand Down Expand Up @@ -198,9 +201,12 @@ class Qdrant_VectorStores implements INode {
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
const qdrantApiKey = getCredentialParam('qdrantApiKey', credentialData, nodeData)

const port = Qdrant_VectorStores.determinePortByUrl(qdrantServerUrl)

const client = new QdrantClient({
url: qdrantServerUrl,
apiKey: qdrantApiKey
apiKey: qdrantApiKey,
port: port
})

const dbConfig: QdrantLibArgs = {
Expand Down Expand Up @@ -242,6 +248,28 @@ class Qdrant_VectorStores implements INode {
}
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 }
6 changes: 3 additions & 3 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@
"husky": "^8.0.3",
"ioredis": "^5.3.2",
"langchain": "^0.0.214",
"langfuse": "^1.2.0",
"langfuse-langchain": "^1.0.31",
"langsmith": "^0.0.53",
"langfuse": "2.0.2",
"langfuse-langchain": "2.0.2",
"langsmith": "0.0.53",
"linkifyjs": "^4.1.1",
"llmonitor": "^0.5.5",
"mammoth": "^1.5.1",
Expand Down
6 changes: 3 additions & 3 deletions packages/components/src/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ export class AnalyticHandler {
if (trace) {
const generation = trace.generation({
name,
prompt: input
input: input
})
this.handlers['langFuse'].generation = { [generation.id]: generation }
returnIds['langFuse'].generation = generation.id
Expand Down Expand Up @@ -583,7 +583,7 @@ export class AnalyticHandler {
const generation: LangfuseGenerationClient | undefined = this.handlers['langFuse'].generation[returnIds['langFuse'].generation]
if (generation) {
generation.end({
completion: output
output: output
})
}
}
Expand Down Expand Up @@ -618,7 +618,7 @@ export class AnalyticHandler {
const generation: LangfuseGenerationClient | undefined = this.handlers['langFuse'].generation[returnIds['langFuse'].generation]
if (generation) {
generation.end({
completion: error
output: error
})
}
}
Expand Down

0 comments on commit c2735b1

Please sign in to comment.