mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
Merge 5e9eab8142 into f285229b51
This commit is contained in:
commit
f272b6f116
2 changed files with 10 additions and 1 deletions
|
|
@ -24,7 +24,11 @@ from typing import Any, Final
|
|||
from redis import Redis
|
||||
from redis.asyncio import Redis as AsyncRedis
|
||||
from redis.commands.search.field import TagField, VectorField
|
||||
from redis.commands.search.indexDefinition import IndexDefinition, IndexType
|
||||
|
||||
try:
|
||||
from redis.commands.search.index_definition import IndexDefinition, IndexType
|
||||
except ModuleNotFoundError:
|
||||
from redis.commands.search.indexDefinition import IndexDefinition, IndexType
|
||||
from redis.commands.search.query import Query
|
||||
|
||||
from litellm._logging import print_verbose
|
||||
|
|
|
|||
|
|
@ -99,6 +99,11 @@ def test_build_valkey_url_uses_rediss_scheme_when_ssl(monkeypatch):
|
|||
).startswith("redis://")
|
||||
|
||||
|
||||
def test_index_definition_uses_supported_redis_search_types():
|
||||
definition = _make_cache()._index_definition()
|
||||
assert definition.args[:5] == ["ON", "HASH", "PREFIX", 1, "test_index:"]
|
||||
|
||||
|
||||
def test_init_requires_similarity_threshold():
|
||||
with pytest.raises(ValueError, match="similarity_threshold must be provided"):
|
||||
ValkeySemanticCache(sync_client=MagicMock(), async_client=AsyncMock())
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue