update weaviate client config
This commit is contained in:
parent
c51e12943d
commit
7febe204df
|
|
@ -32,14 +32,24 @@ class Weaviate_Existing_VectorStores implements INode {
|
||||||
{
|
{
|
||||||
label: 'Weaviate Scheme',
|
label: 'Weaviate Scheme',
|
||||||
name: 'weaviateScheme',
|
name: 'weaviateScheme',
|
||||||
type: 'string',
|
type: 'options',
|
||||||
default: 'https'
|
default: 'https',
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
label: 'https',
|
||||||
|
name: 'https'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'http',
|
||||||
|
name: 'http'
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Weaviate Host',
|
label: 'Weaviate Host',
|
||||||
name: 'weaviateHost',
|
name: 'weaviateHost',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
default: 'localhost'
|
placeholder: 'localhost:8080'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Weaviate Index',
|
label: 'Weaviate Index',
|
||||||
|
|
@ -96,11 +106,13 @@ class Weaviate_Existing_VectorStores implements INode {
|
||||||
const embeddings = nodeData.inputs?.embeddings as Embeddings
|
const embeddings = nodeData.inputs?.embeddings as Embeddings
|
||||||
const output = nodeData.outputs?.output as string
|
const output = nodeData.outputs?.output as string
|
||||||
|
|
||||||
const client: WeaviateClient = weaviate.client({
|
const clientConfig: any = {
|
||||||
scheme: weaviateScheme || 'https',
|
scheme: weaviateScheme,
|
||||||
host: weaviateHost || 'localhost',
|
host: weaviateHost
|
||||||
apiKey: new ApiKey(weaviateApiKey || 'default')
|
}
|
||||||
})
|
if (weaviateApiKey) clientConfig.apiKey = new ApiKey(weaviateApiKey)
|
||||||
|
|
||||||
|
const client: WeaviateClient = weaviate.client(clientConfig)
|
||||||
|
|
||||||
const obj: WeaviateLibArgs = {
|
const obj: WeaviateLibArgs = {
|
||||||
client,
|
client,
|
||||||
|
|
|
||||||
|
|
@ -38,14 +38,24 @@ class WeaviateUpsert_VectorStores implements INode {
|
||||||
{
|
{
|
||||||
label: 'Weaviate Scheme',
|
label: 'Weaviate Scheme',
|
||||||
name: 'weaviateScheme',
|
name: 'weaviateScheme',
|
||||||
type: 'string',
|
type: 'options',
|
||||||
default: 'https'
|
default: 'https',
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
label: 'https',
|
||||||
|
name: 'https'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'http',
|
||||||
|
name: 'http'
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Weaviate Host',
|
label: 'Weaviate Host',
|
||||||
name: 'weaviateHost',
|
name: 'weaviateHost',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
default: 'localhost'
|
placeholder: 'localhost:8080'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Weaviate Index',
|
label: 'Weaviate Index',
|
||||||
|
|
@ -103,11 +113,13 @@ class WeaviateUpsert_VectorStores implements INode {
|
||||||
const embeddings = nodeData.inputs?.embeddings as Embeddings
|
const embeddings = nodeData.inputs?.embeddings as Embeddings
|
||||||
const output = nodeData.outputs?.output as string
|
const output = nodeData.outputs?.output as string
|
||||||
|
|
||||||
const client: WeaviateClient = weaviate.client({
|
const clientConfig: any = {
|
||||||
scheme: weaviateScheme || 'https',
|
scheme: weaviateScheme,
|
||||||
host: weaviateHost || 'localhost',
|
host: weaviateHost
|
||||||
apiKey: new ApiKey(weaviateApiKey || 'default')
|
}
|
||||||
})
|
if (weaviateApiKey) clientConfig.apiKey = new ApiKey(weaviateApiKey)
|
||||||
|
|
||||||
|
const client: WeaviateClient = weaviate.client(clientConfig)
|
||||||
|
|
||||||
const finalDocs = []
|
const finalDocs = []
|
||||||
for (let i = 0; i < docs.length; i += 1) {
|
for (let i = 0; i < docs.length; i += 1) {
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
"express": "^4.17.3",
|
"express": "^4.17.3",
|
||||||
"form-data": "^4.0.0",
|
"form-data": "^4.0.0",
|
||||||
"graphql": "^16.6.0",
|
"graphql": "^16.6.0",
|
||||||
"langchain": "^0.0.63",
|
"langchain": "^0.0.66",
|
||||||
"mammoth": "^1.5.1",
|
"mammoth": "^1.5.1",
|
||||||
"moment": "^2.29.3",
|
"moment": "^2.29.3",
|
||||||
"node-fetch": "2",
|
"node-fetch": "2",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue