-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Adding WITHATTRIBS option to vector set's vsim command. #3746
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
Conversation
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.
Pull Request Overview
This PR adds the WITHATTRIBS
option to the vector set's vsim
command, allowing users to retrieve attributes along with similarity results. This enhances the existing functionality by providing access to metadata associated with vector elements.
Key changes:
- Adds
with_attribs
parameter to thevsim
command interface - Implements parsing logic to handle attribute data in various combinations with scores
- Updates test suite to cover the new functionality across sync and async clients
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
redis/commands/vectorset/commands.py | Adds with_attribs parameter and WITHATTRIBS enum option to vsim command |
redis/commands/vectorset/utils.py | Implements parsing logic for attribute data in vsim results |
tests/test_vsets.py | Adds comprehensive test coverage for the new attribute functionality |
tests/test_asyncio/test_vsets.py | Adds async test coverage mirroring the sync tests |
docker-compose.yml | Updates Redis test image tags to support new functionality |
.github/workflows/integration.yaml | Updates CI configuration with new Redis versions |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
redis/commands/vectorset/commands.py
Outdated
@@ -131,14 +133,34 @@ def vsim( | |||
no_thread: Optional[bool] = False, | |||
epsilon: Optional[Number] = None, | |||
) -> Union[ | |||
Awaitable[Optional[List[Union[List[EncodableT], Dict[EncodableT, Number]]]]], | |||
Optional[List[Union[List[EncodableT], Dict[EncodableT, Number]]]], | |||
Awaitable[ |
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.
This typing looks evil 😆
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.
Yeah, absolutely unreadable... I was thinking to extract a separate type alias for this one and I forgot.. :) Now it's fixed.
Pull Request check-list
Please make sure to review and check all of these items:
NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.
Description of change
Adding WITHATTRIBS option to vector set's vsim command.
Closes #3743