mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-22 11:01:22 +03:00
Merge pull request #950 from FlowiseAI/bugfix/ChromaInstall
Bugfix/Chroma installation fix
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { Chroma, ChromaLibArgs } from 'langchain/vectorstores/chroma'
|
||||
import { Embeddings } from 'langchain/embeddings/base'
|
||||
import type { Collection } from 'chromadb'
|
||||
import { ChromaClient } from 'chromadb'
|
||||
|
||||
interface ChromaAuth {
|
||||
chromaApiKey?: string
|
||||
@@ -23,7 +24,6 @@ export class ChromaExtended extends Chroma {
|
||||
async ensureCollection(): Promise<Collection> {
|
||||
if (!this.collection) {
|
||||
if (!this.index) {
|
||||
const { ChromaClient } = await Chroma.imports()
|
||||
const obj: any = {
|
||||
path: this.url
|
||||
}
|
||||
@@ -37,8 +37,9 @@ export class ChromaExtended extends Chroma {
|
||||
this.index = new ChromaClient(obj)
|
||||
}
|
||||
try {
|
||||
this.collection = await this.index.getOrCreateCollection({
|
||||
name: this.collectionName
|
||||
this.collection = await this.index!.getOrCreateCollection({
|
||||
name: this.collectionName,
|
||||
...(this.collectionMetadata && { metadata: this.collectionMetadata })
|
||||
})
|
||||
} catch (err) {
|
||||
throw new Error(`Chroma getOrCreateCollection error: ${err}`)
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
"apify-client": "^2.7.1",
|
||||
"axios": "^0.27.2",
|
||||
"cheerio": "^1.0.0-rc.12",
|
||||
"chromadb": "^1.5.3",
|
||||
"chromadb": "^1.5.11",
|
||||
"cohere-ai": "^6.2.0",
|
||||
"d3-dsv": "2",
|
||||
"dotenv": "^16.0.0",
|
||||
|
||||
Reference in New Issue
Block a user