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

Add support for hybrid extension #969

Merged
merged 31 commits into from
May 3, 2024
Merged

Add support for hybrid extension #969

merged 31 commits into from
May 3, 2024

Conversation

dirkkul
Copy link
Collaborator

@dirkkul dirkkul commented Mar 19, 2024

core PR: weaviate/weaviate#4477

examples:

    hybrid_objs2 = collection.query.hybrid(
        query=None,
        vector=wvc.query.HybridNearVector(
            vector=obj.vector["default"], distance=near_vec[0].metadata.distance + 0.001
        ),
        return_metadata=MetadataQuery.full(),
    ).objects
    hybrid_objs2 = collection.query.hybrid(
        query=None,
        vector=wvc.query.HybridNearText(
            text="banana",
            move_to=wvc.query.Move(concepts="pudding", force=0.1),
            move_away=wvc.query.Move(concepts="smoothie", force=0.1),
        ),
        return_metadata=MetadataQuery.full(),
    ).objects

@databyjp
Copy link
Contributor

databyjp commented Mar 19, 2024

@dirkkul wdyt about consolidating these helper classes to HybridNear and adding methods like .text, .vector, .object etc.? If we need to extend that class to support other modalities it would be easier cleaner too.

    hybrid_objs2 = collection.query.hybrid(
        query=None,
        vector=wvc.query.HybridNear.text(
            text="banana",
            move_to=wvc.query.Move(concepts="pudding", force=0.1),
            move_away=wvc.query.Move(concepts="smoothie", force=0.1),
        ),
        return_metadata=MetadataQuery.full(),
    ).objects

I think otherwise it looks good!

@dirkkul dirkkul requested a review from a team as a code owner March 20, 2024 11:46
@tsmith023 tsmith023 changed the base branch from main to dev/1.25 March 25, 2024 16:26
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 81.13208% with 20 lines in your changes are missing coverage. Please review.

Project coverage is 94.92%. Comparing base (339f7ad) to head (05a5c96).

Files Patch % Lines
integration/test_collection.py 76.62% 18 Missing ⚠️
weaviate/collections/grpc/query.py 83.33% 1 Missing ⚠️
weaviate/exceptions.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           dev/1.25     #969      +/-   ##
============================================
- Coverage     95.00%   94.92%   -0.08%     
============================================
  Files           175      175              
  Lines         18022    18123     +101     
============================================
+ Hits          17122    17204      +82     
- Misses          900      919      +19     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dirkkul dirkkul merged commit b58761f into dev/1.25 May 3, 2024
41 of 43 checks passed
@dirkkul dirkkul deleted the hybrid_extension branch May 3, 2024 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants