Expand description
Redis integration for the Synaptic framework.
This crate provides two Redis-backed implementations:
RedisStore— implements theStoretrait for persistent key-value storage with namespace support.RedisCache— implements theLlmCachetrait for caching LLM responses with optional TTL expiration.
§Quick start
use synaptic_redis::{RedisStore, RedisStoreConfig, RedisCache, RedisCacheConfig};
// Store
let store = RedisStore::from_url("redis://127.0.0.1/")?;
// Cache with 1-hour TTL
let config = RedisCacheConfig { ttl: Some(3600), ..Default::default() };
let cache = RedisCache::from_url_with_config("redis://127.0.0.1/", config)?;Structs§
- Chat
Response - A response from a chat model containing the AI message and optional token usage statistics.
- Item
- A stored item in the key-value store.
- Redis
Cache - Redis-backed implementation of the
LlmCachetrait. - Redis
Cache Config - Configuration for
RedisCache. - Redis
Store - Redis-backed implementation of the
Storetrait. - Redis
Store Config - Configuration for
RedisStore.