Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions docs/VALKEY_SEARCH_INTEGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ Both are compatible with LangBot.

## Installation

Valkey Search support is included when you install LangBot — the `valkey-glide` dependency is
declared in `pyproject.toml`. To install manually:
Valkey Search support is included automatically on Linux and macOS. The official `valkey-glide`
client does not currently publish a Windows package, so LangBot skips this optional dependency on
Windows; LangBot remains usable there, but the Valkey Search backend is unavailable. To install the
client manually on a supported platform:

```bash
pip install 'valkey-glide>=2.4.1,<3.0.0'
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ dependencies = [
"pgvector>=0.4.1",
"botocore>=1.42.39",
"litellm>=1.0.0",
"valkey-glide>=2.4.1,<3.0.0",
"valkey-glide>=2.4.1,<3.0.0; sys_platform != 'win32'", # No Windows wheels are published
]
keywords = [
"bot",
Expand Down
3 changes: 2 additions & 1 deletion src/langbot/pkg/vector/vdbs/valkey_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ def supported_search_types(cls) -> list[SearchType]:
def __init__(self, ap: app.Application):
if not VALKEY_SEARCH_AVAILABLE:
raise ImportError(
"valkey-glide is not installed. Install it with: pip install 'valkey-glide>=2.4.1,<3.0.0'"
'valkey-glide is not installed or is unavailable on this platform. '
"On Linux or macOS, install it with: pip install 'valkey-glide>=2.4.1,<3.0.0'"
)

self.ap = ap
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/vector/test_valkey_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,12 @@ async def backend(valkey_config):
ValkeySearchVectorDatabase,
VALKEY_SEARCH_AVAILABLE,
)
from glide import ft

if not VALKEY_SEARCH_AVAILABLE:
pytest.skip('valkey-glide not installed')

from glide import ft

ap = _make_ap(valkey_config)
db = ValkeySearchVectorDatabase(ap)
client = await db._ensure_client()
Expand Down
11 changes: 7 additions & 4 deletions tests/unit_tests/vector/test_valkey_search_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,10 +357,13 @@ def _fake_credentials(**kwargs):
cred_calls.append(kwargs)
return ('CRED', kwargs)

monkeypatch.setattr(mod, 'GlideClient', _FakeClient)
monkeypatch.setattr(mod, 'ServerCredentials', _fake_credentials)
monkeypatch.setattr(mod, 'GlideClientConfiguration', lambda **kw: kw)
monkeypatch.setattr(mod, 'NodeAddress', lambda *a, **k: ('node', a, k))
# These names are absent when the optional valkey-glide dependency is
# unavailable (for example, on Windows), so allow the test doubles to
# create them on the module.
monkeypatch.setattr(mod, 'GlideClient', _FakeClient, raising=False)
monkeypatch.setattr(mod, 'ServerCredentials', _fake_credentials, raising=False)
monkeypatch.setattr(mod, 'GlideClientConfiguration', lambda **kw: kw, raising=False)
monkeypatch.setattr(mod, 'NodeAddress', lambda *a, **k: ('node', a, k), raising=False)
return backend, created, cred_calls, warnings

async def test_username_without_password_fails_closed(self, monkeypatch):
Expand Down
10 changes: 5 additions & 5 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading