-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Python: Introducing Vector Search to Weaviate and adding the ability …
…to have unnamed vectors (#9684) ### 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. --> This PR adds vector search to Weaviate. All three types of search are supported, however vectorizable_text_search depends on a setup outside SK. Also adds a parameter to the Weaviate Collection called 'named_vectors', default is True. When set to False it uses unnamed vectors instead of named. Because of this there is a slight difference in how vectors are represented to Weaviate which might be breaking. ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> The breaking change is that, vector were set to have the name of the content that it vectorized, for instance: With a datamodel like this (shortened some of the class names): ```python class DataModel: content: Annotated[str, Data Field(embedding_property_name="vector")] vector: Annotated[list[float], VectorField()] ``` This would be set as `DataObject(vector: {"content": [vector content]})`, while it will now set this to `DataObject(vector: {"vector": [vector content]})` Where DataObject is the Weaviate object used to insert items. Closes #6839 ### 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 - [ ] I didn't break anyone 😄
- Loading branch information
1 parent
5d8d738
commit a83abb9
Showing
12 changed files
with
892 additions
and
490 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.