Skip to content

Commit eba7e3f

Browse files
committed
feat: Add LangCache integration with full feature support
- Implement LangCacheWrapper as BaseLLMCache extension - Support semantic and exact search strategies - Add distance_threshold support (converts to similarity_threshold) - Add attributes filtering for metadata-based searches - Fix SDK integration issues: - Use correct response model attributes (entry_id, data) - Remove incorrect context manager usage - Convert similarity to distance (1.0 - similarity) - Handle optional attributes in store operations - Add comprehensive unit tests (16 tests) - All 444 unit tests passing - Type checking, formatting, and linting passing
1 parent d152c3e commit eba7e3f

File tree

5 files changed

+3612
-2702
lines changed

5 files changed

+3612
-2702
lines changed

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "redisvl"
33
version = "0.9.1"
44
description = "Python client library and CLI for using Redis as a vector database"
55
authors = [{ name = "Redis Inc.", email = "[email protected]" }]
6-
requires-python = ">=3.9,<3.14"
6+
requires-python = ">=3.9.2,<3.14"
77
readme = "README.md"
88
license = "MIT"
99
keywords = [
@@ -39,6 +39,7 @@ nltk = ["nltk>=3.8.1,<4"]
3939
cohere = ["cohere>=4.44"]
4040
voyageai = ["voyageai>=0.2.2"]
4141
sentence-transformers = ["sentence-transformers>=3.4.0,<4"]
42+
langcache = ["langcache>=0.9.0"]
4243
vertexai = [
4344
"google-cloud-aiplatform>=1.26,<2.0.0",
4445
"protobuf>=5.28.0,<6.0.0",

redisvl/extensions/cache/llm/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,18 @@
44
This module provides LLM cache implementations for RedisVL.
55
"""
66

7+
from redisvl.extensions.cache.llm.langcache import LangCacheWrapper
78
from redisvl.extensions.cache.llm.schema import (
89
CacheEntry,
910
CacheHit,
1011
SemanticCacheIndexSchema,
1112
)
1213
from redisvl.extensions.cache.llm.semantic import SemanticCache
1314

14-
__all__ = ["SemanticCache", "CacheEntry", "CacheHit", "SemanticCacheIndexSchema"]
15+
__all__ = [
16+
"SemanticCache",
17+
"LangCacheWrapper",
18+
"CacheEntry",
19+
"CacheHit",
20+
"SemanticCacheIndexSchema",
21+
]

0 commit comments

Comments
 (0)