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

vectorstores: Add support for OpenAI Organization ID header in Chroma #646

Merged
merged 2 commits into from
Mar 7, 2024

Conversation

AshDevFr
Copy link
Contributor

@AshDevFr AshDevFr commented Mar 4, 2024

  • Update chroma-go to the latest version (To include this PR
  • Add error handling to NewOpenAIEmbeddingFunction
  • Add a new property to the store (openaiOrganization) and pass it to chroma-go

The goal of this PR is to add support for the OpenAI Organization ID header in Chroma. It is already supported here by the OpenAI client in Langchain but it was missing from the chroma implementation.

PR Checklist

  • Read the Contributing documentation.
  • Read the Code of conduct documentation.
  • Name your Pull Request title clearly, concisely, and prefixed with the name of the primarily affected package you changed according to Good commit messages (such as memory: add interfaces for X, Y or util: add whizzbang helpers).
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. Fixes #123).
  • Describes the source of new concepts.
  • References existing implementations as appropriate.
  • Contains test coverage for new functions.
  • Passes all golangci-lint checks.

@AshDevFr AshDevFr force-pushed the chroma-openai-org-id branch from 22d650c to ed8dc02 Compare March 4, 2024 18:16
Copy link
Owner

@tmc tmc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you verify this chroma release is appropriate? cc @tazarov since #640 just went in

@tazarov
Copy link
Contributor

tazarov commented Mar 6, 2024

@tmc, I've just added a new release for Chroma-go (v.0.0.2) with the OpenAI org change that @AshDevFr , pushed a few days back - https://github.com/amikos-tech/chroma-go/releases/tag/v0.0.2

@AshDevFr, do you mind updating your go.mod/sum.

@AshDevFr AshDevFr force-pushed the chroma-openai-org-id branch from ed8dc02 to 7c2b90c Compare March 6, 2024 16:56
@AshDevFr
Copy link
Contributor Author

AshDevFr commented Mar 6, 2024

Updated the version

@AshDevFr
Copy link
Contributor Author

AshDevFr commented Mar 6, 2024

@tazarov I see that the v0.0.2 does not return 2 values to NewOpenAIEmbeddingFunction.

I'll update this PR soon

@AshDevFr AshDevFr force-pushed the chroma-openai-org-id branch from 7c2b90c to 602e574 Compare March 6, 2024 17:46
@AshDevFr
Copy link
Contributor Author

AshDevFr commented Mar 6, 2024

It should be good to go.

@tazarov
Copy link
Contributor

tazarov commented Mar 6, 2024

@AshDevFr, yeah, sorry about that. Since this was a breaking change I wanted to move it to 0.1.x tag.

Copy link
Owner

@tmc tmc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great! Can we make this "OpenAI" vs "OpenAi" in terms of exposed interface to be more consistent with existing code? (with that it can go in). (also needs rebase)

@AshDevFr
Copy link
Contributor Author

AshDevFr commented Mar 6, 2024

Do you mean changing WithOpenAIOrganizationID to WithOpenAiOrganizationID in chroma-go?

chroma-go uses OpenAI and langchaingo uses OpenAi in chroma.go for function names.

I don't mind refactoring the chroma.go file to use OpenAI if you want.

@AshDevFr AshDevFr force-pushed the chroma-openai-org-id branch from 602e574 to 434b4f1 Compare March 6, 2024 22:59
@tmc
Copy link
Owner

tmc commented Mar 6, 2024

we should be using "OpenAI" instead of "OpenAi"

* Update `chroma-go` to the latest version
* Add error handling to NewOpenAIEmbeddingFunction
* Add a new property to the store (`openaiOrganization`) and pass it to `chroma-go`
@AshDevFr AshDevFr force-pushed the chroma-openai-org-id branch from 434b4f1 to 94db963 Compare March 6, 2024 23:58
@AshDevFr
Copy link
Contributor Author

AshDevFr commented Mar 6, 2024

Ok I changed the whole Chroma interface to only use OpenAI instead of OpenAi but it will introduce a breaking change.

@AshDevFr AshDevFr force-pushed the chroma-openai-org-id branch from 94db963 to 7947f6d Compare March 7, 2024 00:05
@tmc
Copy link
Owner

tmc commented Mar 7, 2024

We could be really careful and alias and deprecate it but I think release notes will suffice. Once we get larger and more popular we can be more delicate with backwards incompatible changes.

Copy link
Owner

@tmc tmc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tmc tmc merged commit 3b7175c into tmc:main Mar 7, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants