You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the OpenAIEmbeddingFunction() is executed, the api_key provided as an argument overwrites the openai.api_key that is referenced globally throughout the application. This behavior prevents the application from being able to differentiate between the API key used for embeddings and the API key used for regular chat operations.
2024-10-21 17:34:25 [2024-10-21 08:34:25,464] INFO in internal_chatbot_documents_controller: openai.api_key: pTV4
2024-10-21 17:34:25 [2024-10-21 08:34:25,464] INFO in internal_chatbot_documents_controller: ANOHTER_OPENAI_API_KEY: -EsA
2024-10-21 17:34:25 [2024-10-21 08:34:25,483] INFO in internal_chatbot_documents_controller: openai.api_key: -EsA
The text was updated successfully, but these errors were encountered:
## Description of changes
*Summarize the changes made by this PR.*
- Improvements & Bug fixes
Allow multiple openAI API keys #2979
Removed direct assignment to global openai.api_key to prevent unintended
side effects.
## Test plan
*How are these changes tested?*
- [ ] Tests pass locally with `pytest` for python, `yarn test` for js,
`cargo test` for rust
It seems that `cargo test` is failing due to a build issue. #2294
Both `pytest` and `yarn test` succeed.
## Documentation Changes
*Are all docstrings for user-facing APIs updated if required? Do we need
to make documentation changes in the [docs
repository](https://github.com/chroma-core/docs)?*
What happened?
When the
OpenAIEmbeddingFunction()
is executed, the api_key provided as an argument overwrites the openai.api_key that is referenced globally throughout the application. This behavior prevents the application from being able to differentiate between the API key used for embeddings and the API key used for regular chat operations.Here's a snippet of the affected code:
Versions
chroma v0.5.5
flask v2.3.2
python 3.11.6
Relevant log output
The text was updated successfully, but these errors were encountered: