-
Notifications
You must be signed in to change notification settings - Fork 62
Llmcache ttl configuration #28
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
Conversation
Codecov Report
@@ Coverage Diff @@
## main #28 +/- ##
==========================================
+ Coverage 88.05% 88.56% +0.50%
==========================================
Files 11 11
Lines 536 551 +15
==========================================
+ Hits 472 488 +16
+ Misses 64 63 -1
|
Spartee
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.
Minor comments. Looks great.
redisvl/index.py
Outdated
| for record in data: | ||
| key = f"{self._prefix}:{self._get_key_field(record)}" | ||
| self._redis_conn.hset(key, mapping=record) # type: ignore | ||
| # TODO -- should we return a count of the upserts? or some kind of metadata? |
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.
Todo outside comments. these become docs
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.
fixed!
Spartee
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
Enables TTL for loading data to Redis using RedisVL. This TTL is an optional kwarg for the underlying
loadfunction. This is particularly useful for clients and abstractions like SemanticCache that lean on Redis support for ephemeral data.Also adds a
clearmethod to the LLM cache class that invalidates all data from the cache, but does not disturb the index itself.