-
Notifications
You must be signed in to change notification settings - Fork 569
feat: remove vector data when corresponding cache data expires #675
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
base: dev
Are you sure you want to change the base?
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: kxbnb The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @kxbnb! It looks like this is your first PR to zilliztech/GPTCache 🎉 |
Signed-off-by: Emmanuel Ferdman <[email protected]> Signed-off-by: karthik <[email protected]>
Signed-off-by: karthik <[email protected]>
…been added (zilliztech#669) I think that using LLM for verification can yield better results in some cases where quality requirements are higher. Especially in the customer service field and the like, other users' questions may lead to privacy leaks or mention other brands, thus causing interference and so on. In terms of specific details, I maintained the operation of openai==0.28.0 on the interface and was compatible with the operation of openai>1.0.0 and above. I have added the test case, the example test file, and updated the example/readme.md. I upgraded the version of onnxruntime to 1.21.1 because the previous version 1.14.0 is no longer in use. Signed-off-by: karthik <[email protected]>
- Add logic in adapt() and aadapt() to delete vector data when get_scalar_data returns None - Addresses issue zilliztech#632 for cleaning up orphaned vector data in Redis TTL scenarios - Ensures consistency between scalar and vector stores Signed-off-by: karthik <[email protected]>
- Added test_vector_cleanup_on_expired_cache to verify issue zilliztech#632 fix - Mocks data manager to simulate vector data without scalar data - Ensures v.delete() is called when cache_data is None Signed-off-by: karthik <[email protected]>
0bd2ecf to
1b0e8ac
Compare
|
/assign @xiaofan-luan |
Summary
Add automatic cleanup of vector data when corresponding cache data expires to fix orphaned vectors in Redis TTL scenarios.
Changes
gptcache/adapter/adapter.pyin bothadapt()andaadapt()functionschat_cache.data_manager.v.delete([search_data[1]])whencache_data is NoneValidation
test_vector_cleanup_on_expired_cacheto verify the fixTesting
Closes #632