chroma-core / chroma

the AI-native open-source embedding database
https://www.trychroma.com/
Apache License 2.0
13.54k stars 1.15k forks source link

[Bug]: getCollection missing DefaultEmbeddingFunction (JavaScript client) #1746

Open globalexport opened 4 months ago

globalexport commented 4 months ago

What happened?

This is used in the method getOrCreateCollection but not in getCollection:

    if (embeddingFunction === void 0) {
      embeddingFunction = new DefaultEmbeddingFunction();
    }

Without it, we receive an error (please see below).

Is it a bug or did I miss something?

Versions

chromadb@1.8.1, chromadb-default-embed@2.13.2

Relevant log output

Error: embeddingFunction is undefined. Please configure an embedding function
    at Collection.query (file:///chroma/node_modules/.pnpm/chromadb@1.8.1/node_modules/chromadb/dist/chromadb.mjs:2094:15)
    at query (file:///chroma/app/lib/chroma.js:45:31)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async file:///chroma/app/index.js:19:16
xjamundx commented 2 months ago

I'm trying to do the most basic stuff and running into this. The docs I saw don't really tell you how to use chromadb-default-embed just that you should install it. is this what it's for. Feels like the docs are missing something (if not the function missing the default here)