Add Valkey backend support with conditional SORTBY handling
This PR introduces Valkey integration for the Redis-based vector store in GPTCache. https://github.com/zilliztech/GPTCache/issues/673.
Key changes include:
Valkey compatibility:
- Detects Valkey vs Redis behavior for FT.SEARCH.
- Handles cases where Valkey does not support SORTBY (https://github.com/valkey-io/valkey-search/issues/48.).
Conditional SORTBY logic:
- Adds runtime capability check before appending .sort_by("score") to queries.
- Falls back gracefully when SORTBY is unsupported (avoids query errors).
No breaking changes:
- Existing Redis functionality remains unchanged.
- Valkey support is transparent to callers.
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: daric93
To complete the pull request process, please assign xiaofan-luan after the PR has been reviewed.
You can assign the PR to them by writing /assign @xiaofan-luan in a comment when ready.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
Welcome @daric93! It looks like this is your first PR to zilliztech/GPTCache 🎉