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

[Bugfix] fix qdrant and weaviate db integration #1181

Merged
merged 8 commits into from
Jan 23, 2024

Conversation

deven298
Copy link
Contributor

@deven298 deven298 commented Jan 17, 2024

Description

This PR fixes bugs related to qdrant and weaviate db integration. Specifically, it enables two functionalities with Qdrant and Weaviate.

  • It skips embedding data when the content has not changed for the same source.
  • Makes the query work with metadata filtering. For ex -
from embedchain import App

config = {
    "vectordb": {
        "provider": "qdrant",
        "config": {
            "collection_name": "my_qdrant_index"
        },
    }
}

app = App.from_config(config=config)

app.add("https://www.forbes.com/profile/elon-musk", metadata={"source": "forbes"})
app.add("https://en.wikipedia.org/wiki/Elon_Musk", metadata={"source": "wikipedia"})

response, context = app.query("which companies does elon own?", where={"source": "forbes"}, citations=True)
print(response)
print(list(map(lambda x: x[1]["url"], context)))
# The response will be coming from filtered documents where `source==forbes`.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (does not change functionality, e.g. code style improvements, linting)
  • Documentation update

How Has This Been Tested?

  • Unit Test
  • Test Script (see above)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Maintainer Checklist

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Made sure Checks passed

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jan 17, 2024
Copy link

codecov bot commented Jan 17, 2024

Codecov Report

Attention: 40 lines in your changes are missing coverage. Please review.

Comparison is base (2784bae) 0.00% compared to head (bab6ba6) 56.86%.
Report is 1 commits behind head on main.

Files Patch % Lines
embedchain/vectordb/weaviate.py 19.51% 33 Missing ⚠️
embedchain/vectordb/qdrant.py 66.66% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           main    #1181       +/-   ##
=========================================
+ Coverage      0   56.86%   +56.86%     
=========================================
  Files         0      143      +143     
  Lines         0     5750     +5750     
=========================================
+ Hits          0     3270     +3270     
- Misses        0     2480     +2480     

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

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Jan 17, 2024
Copy link
Member

@taranjeet taranjeet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks good. thanks

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 23, 2024
@taranjeet taranjeet merged commit 2d9fbd4 into main Jan 23, 2024
5 checks passed
@taranjeet taranjeet deleted the fix/vectordb_integrations branch January 23, 2024 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants