-
Notifications
You must be signed in to change notification settings - Fork 62
Add support for item-specific TTLs; quote() and unquote() attributes #442
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: main
Are you sure you want to change the base?
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 support for item-specific TTLs to the LangCache semantic cache implementation and replaces custom fullwidth character encoding with standard URL percent-encoding for attribute values. The changes enable per-entry TTL overrides and improve the handling of special characters in attribute values.
Key changes:
- Added per-entry TTL support by converting seconds to milliseconds for the LangCache API
- Replaced custom fullwidth character encoding with URL percent-encoding (quote/unquote) for attribute values
- Updated unit and integration tests to verify TTL functionality and encoding behavior
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| redisvl/extensions/cache/llm/langcache.py | Implements TTL conversion to milliseconds, removes custom encoding functions, uses quote/unquote for attributes |
| tests/unit/test_langcache_semantic_cache.py | Adds unit tests for per-entry TTL, updates attribute encoding test expectations, improves import error test |
| tests/integration/test_langcache_semantic_cache_integration.py | Adds integration tests for TTL expiration behavior, updates encoding comments |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
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
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
rbs333
left a comment
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.
LGTM
This PR adds support for LangCache supports item-specific TTLs. We also begin using quote() and unquote() to manage the variety of characters that can disrupt queries that use attributes.