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

community: Chroma Adding create_collection_if_not_exists flag to Chroma constructor #21420

Conversation

tazarov
Copy link
Contributor

@tazarov tazarov commented May 8, 2024

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

Adds the ability to either get_or_create or simply get collection. This is useful when dealing wit read-only Chroma instances where users can only get_collection. Targeted at Http/CloudClients mostly.

Closes chroma-core/chroma#2163
@efriis efriis added the partner label May 8, 2024
@efriis efriis self-assigned this May 8, 2024
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label May 8, 2024
Copy link

vercel bot commented May 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview May 9, 2024 7:49am

@dosubot dosubot bot added Ɑ: vector store Related to vector store module 🔌: chroma Primarily related to ChromaDB integrations 🤖:improvement Medium size change to existing code to handle new use-cases labels May 8, 2024
@dosubot dosubot bot added the lgtm PR looks good. Use to confirm that a PR is ready for merging. label May 8, 2024
@tazarov
Copy link
Contributor Author

tazarov commented May 9, 2024

@ccurme, I've added truth table with test case mapping in description to make it a little easier to understand

@ccurme ccurme merged commit ba7d536 into langchain-ai:master May 9, 2024
21 checks passed
Narapady pushed a commit to Narapady/langchain that referenced this pull request May 9, 2024
…ma constructor (langchain-ai#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` |
kyle-cassidy pushed a commit to kyle-cassidy/langchain that referenced this pull request May 10, 2024
…ma constructor (langchain-ai#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` |
@harshal-cuminai
Copy link

@efriis We are taking dependency on langchain-chroma and have to publish a package to pypi that needs this change. Can we expedite the next release of this partner package to pypi ? When is the planned release ?

kyle-cassidy pushed a commit to kyle-cassidy/langchain that referenced this pull request May 16, 2024
…ma constructor (langchain-ai#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` |
@ccurme
Copy link
Collaborator

ccurme commented May 16, 2024

@harshal-cuminai langchain-chroma 0.1.1 was released yesterday.

@tazarov tazarov deleted the feature/chroma_create_collection_if_not_exist_flag branch May 16, 2024 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔌: chroma Primarily related to ChromaDB integrations 🤖:improvement Medium size change to existing code to handle new use-cases lgtm PR looks good. Use to confirm that a PR is ready for merging. partner size:L This PR changes 100-499 lines, ignoring generated files. Ɑ: vector store Related to vector store module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants