diff --git a/packages/components/nodes/vectorstores/Weaviate_Existing/Weaviate_Existing.ts b/packages/components/nodes/vectorstores/Weaviate_Existing/Weaviate_Existing.ts index 1f573eff8..ba0ab502c 100644 --- a/packages/components/nodes/vectorstores/Weaviate_Existing/Weaviate_Existing.ts +++ b/packages/components/nodes/vectorstores/Weaviate_Existing/Weaviate_Existing.ts @@ -32,14 +32,24 @@ class Weaviate_Existing_VectorStores implements INode { { label: 'Weaviate Scheme', name: 'weaviateScheme', - type: 'string', - default: 'https' + type: 'options', + default: 'https', + options: [ + { + label: 'https', + name: 'https' + }, + { + label: 'http', + name: 'http' + } + ] }, { label: 'Weaviate Host', name: 'weaviateHost', type: 'string', - default: 'localhost' + placeholder: 'localhost:8080' }, { label: 'Weaviate Index', @@ -96,11 +106,13 @@ class Weaviate_Existing_VectorStores implements INode { const embeddings = nodeData.inputs?.embeddings as Embeddings const output = nodeData.outputs?.output as string - const client: WeaviateClient = weaviate.client({ - scheme: weaviateScheme || 'https', - host: weaviateHost || 'localhost', - apiKey: new ApiKey(weaviateApiKey || 'default') - }) + const clientConfig: any = { + scheme: weaviateScheme, + host: weaviateHost + } + if (weaviateApiKey) clientConfig.apiKey = new ApiKey(weaviateApiKey) + + const client: WeaviateClient = weaviate.client(clientConfig) const obj: WeaviateLibArgs = { client, diff --git a/packages/components/nodes/vectorstores/Weaviate_Upsert/Weaviate_Upsert.ts b/packages/components/nodes/vectorstores/Weaviate_Upsert/Weaviate_Upsert.ts index 1477e51ee..6d31338bf 100644 --- a/packages/components/nodes/vectorstores/Weaviate_Upsert/Weaviate_Upsert.ts +++ b/packages/components/nodes/vectorstores/Weaviate_Upsert/Weaviate_Upsert.ts @@ -38,14 +38,24 @@ class WeaviateUpsert_VectorStores implements INode { { label: 'Weaviate Scheme', name: 'weaviateScheme', - type: 'string', - default: 'https' + type: 'options', + default: 'https', + options: [ + { + label: 'https', + name: 'https' + }, + { + label: 'http', + name: 'http' + } + ] }, { label: 'Weaviate Host', name: 'weaviateHost', type: 'string', - default: 'localhost' + placeholder: 'localhost:8080' }, { label: 'Weaviate Index', @@ -103,11 +113,13 @@ class WeaviateUpsert_VectorStores implements INode { const embeddings = nodeData.inputs?.embeddings as Embeddings const output = nodeData.outputs?.output as string - const client: WeaviateClient = weaviate.client({ - scheme: weaviateScheme || 'https', - host: weaviateHost || 'localhost', - apiKey: new ApiKey(weaviateApiKey || 'default') - }) + const clientConfig: any = { + scheme: weaviateScheme, + host: weaviateHost + } + if (weaviateApiKey) clientConfig.apiKey = new ApiKey(weaviateApiKey) + + const client: WeaviateClient = weaviate.client(clientConfig) const finalDocs = [] for (let i = 0; i < docs.length; i += 1) { diff --git a/packages/components/package.json b/packages/components/package.json index 1fc01047b..884d02e6c 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -29,7 +29,7 @@ "express": "^4.17.3", "form-data": "^4.0.0", "graphql": "^16.6.0", - "langchain": "^0.0.63", + "langchain": "^0.0.66", "mammoth": "^1.5.1", "moment": "^2.29.3", "node-fetch": "2",