-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Python: Introducing the Chroma Connector with the new vector store design #10678
Conversation
d55030a
to
9930422
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (2)
python/semantic_kernel/connectors/memory/chroma/chroma.py:301
- [nitpick] The variable name 'filter' shadows Python’s built-in function. Consider renaming it (e.g., to 'filter_clause') to improve clarity.
for filter in options.filter.filters:
python/semantic_kernel/connectors/memory/chroma/chroma.py:205
- Using a try-except block to catch an IndexError for an empty 'ids' list may hide other issues. Consider explicitly checking if the 'ids' list is empty before accessing its first element.
if isinstance(results["ids"][0], str):
8aeb8d3
to
35b0feb
Compare
773789b
to
beda7e8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
python/semantic_kernel/connectors/memory/chroma/chroma.py:219
- The conversion logic in _unpack_results that wraps each value in a list may lead to nested lists if the results are already in list form. Consider refining the conversion check to handle both single and multiple result scenarios explicitly.
if isinstance(results["ids"][0], str):
…sign (#10678) ### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> Adds ChromaStore and ChromaConnector Closes: #9926 ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 😄 --------- Co-authored-by: Tao Chen <taochen@microsoft.com>
Add pytest unit tests for `ChromaCollection` and `ChromaStore` classes in `python/tests/unit/connectors/memory/chroma/test_chroma.py`. * **Initialization Tests** - Test `ChromaCollection` initialization. - Test `ChromaStore` initialization. * **Collection Management Tests** - Test `ChromaCollection` methods: `_get_collection`, `does_collection_exist`, `create_collection`, `delete_collection`. - Test `ChromaStore` methods: `get_collection`, `list_collection_names`, `create_collection`, `delete_collection`. * **Data Operation Tests** - Test `ChromaCollection` methods: `_inner_upsert`, `_inner_get`, `_inner_delete`, `_inner_search`. * **Filter Parsing Tests** - Test `_parse_filter` method in `ChromaCollection` with multiple filter types and varying number of filters. - Test `_parse_filter` method with no filters. - Test `_parse_filter` method with multiple filters.
Co-authored-by: Tao Chen <taochen@microsoft.com>
28838a9
to
db58831
Compare
Motivation and Context
Adds ChromaStore and ChromaConnector
Closes: #9926
Description
Contribution Checklist