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] update zilliz db #1186

Merged
merged 2 commits into from
Jan 23, 2024
Merged

[Bugfix] update zilliz db #1186

merged 2 commits into from
Jan 23, 2024

Conversation

deven298
Copy link
Contributor

Description

This PR includes following changes:

  • 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": "zilliz",
        "config": {
            "uri": "https://xxx.zillizcloud.com",
            "token": "xxx",
            "vector_dim": 1536,
            "metric_type": "L2",
            "collection_name": "zilliz_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`.

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

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 18, 2024
Copy link

codecov bot commented Jan 18, 2024

Codecov Report

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

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

Files Patch % Lines
embedchain/vectordb/zilliz.py 29.03% 22 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           main    #1186       +/-   ##
=========================================
+ Coverage      0   57.02%   +57.02%     
=========================================
  Files         0      143      +143     
  Lines         0     5727     +5727     
=========================================
+ Hits          0     3266     +3266     
- Misses        0     2461     +2461     

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

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.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 23, 2024
@taranjeet taranjeet merged commit 22e14b5 into main Jan 23, 2024
5 checks passed
@taranjeet taranjeet deleted the fix/zilliz_db 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:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants