Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: JS client - getCollection requires the embedding function as a param #3730

Open
rohanprichard opened this issue Feb 7, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@rohanprichard
Copy link

What happened?

Just wanted to discuss something I had noticed while using chroma with the JS client.

When you call client.createCollection or client.getOrCreateCollection, the type CreateCollectionParams is used. This has name as a required parameter, and metadata and embedding function as optional ones.

type CreateCollectionParams = {
  name: string;
  metadata?: CollectionMetadata;
  embeddingFunction?: IEmbeddingFunction;
};

type GetOrCreateCollectionParams = CreateCollectionParams;

However, for client.getCollection, the type GetCollectionParams is used. This has the name as well as embedding function as a required parameter. Even if using the default embedding function, this is what is seen.

GetCollectionParams = {
  name: string;
  embeddingFunction: IEmbeddingFunction;
};

These snippets are from chroma/clients/js/src/types.ts

After looking around in the source code, I have not been able to figure out why it is made required, so wanted to log it as a possible bug.

If this is all a mistake on my part I am sorry, but just wanted to log something I had noticed. Let me know if I can make a fix and contribute to this!

Versions

chromadb 1.10.4, python 3.9, macos 15.3

Relevant log output

@rohanprichard rohanprichard added the bug Something isn't working label Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant