langchain/libs/partners/chroma
Trayan Azarov ba7d53689c
community: Chroma Adding create_collection_if_not_exists flag to Chroma constructor (#21420)
- **Description:** Adds the ability to either `get_or_create` or simply
`get_collection`. This is useful when dealing with read-only Chroma
instances where users are constraint to using `get_collection`. Targeted
at Http/CloudClients mostly.
- **Issue:** chroma-core/chroma#2163
- **Dependencies:** N/A
- **Twitter handle:** `@t_azarov`




| Collection Exists | create_collection_if_not_exists | Outcome | test |

|-------------------|---------------------------------|----------------------------------------------------------------|----------------------------------------------------------|
| True | False | No errors, collection state unchanged |
`test_create_collection_if_not_exist_false_existing` |
| True | True | No errors, collection state unchanged |
`test_create_collection_if_not_exist_true_existing` |
| False | False | Error, `get_collection()` fails |
`test_create_collection_if_not_exist_false_non_existing` |
| False | True | No errors, `get_or_create_collection()` creates the
collection | `test_create_collection_if_not_exist_true_non_existing` |
2024-05-09 11:45:10 -04:00
..
langchain_chroma community: Chroma Adding create_collection_if_not_exists flag to Chroma constructor (#21420) 2024-05-09 11:45:10 -04:00
scripts chroma: Add chroma partner package (#19292) 2024-04-10 19:33:45 +00:00
tests community: Chroma Adding create_collection_if_not_exists flag to Chroma constructor (#21420) 2024-05-09 11:45:10 -04:00
.gitignore chroma: Add chroma partner package (#19292) 2024-04-10 19:33:45 +00:00
LICENSE chroma: Add chroma partner package (#19292) 2024-04-10 19:33:45 +00:00
Makefile chroma: Add chroma partner package (#19292) 2024-04-10 19:33:45 +00:00
poetry.lock community: Updated Chroma version range to include 0.5.0 release (#21224) 2024-05-06 13:31:40 -07:00
pyproject.toml community: Updated Chroma version range to include 0.5.0 release (#21224) 2024-05-06 13:31:40 -07:00
README.md chroma: Add chroma partner package (#19292) 2024-04-10 19:33:45 +00:00

langchain-chroma

This package contains the LangChain integration with Chroma.

Installation

pip install -U langchain-chroma

Usage

The Chroma class exposes the connection to the Chroma vector store.

from langchain_chroma import Chroma

embeddings = ... # use a LangChain Embeddings class

vectorstore = Chroma(embeddings=embeddings)