Versions in this module Expand all Collapse all v0 v0.1.3 Jul 4, 2026 v0.1.1 Jun 25, 2026 Changes in this version + const DefaultWarmInterval + var ErrRedisNil = errors.New("eyrie: redis nil reply") + type CacheBackend interface + Delete func(ctx context.Context, key string) error + Get func(ctx context.Context, key string) ([]byte, bool, error) + Set func(ctx context.Context, key string, val []byte, ttl time.Duration) error + type CacheStats struct + CacheHits int64 + CacheMisses int64 + EstimatedSavingsUSD float64 + LastWarmedAt time.Time + WarmingRequests int64 + type CacheWarmer struct + ChatFn func(ctx context.Context, messages []Message, opts ChatOptions) error + Enabled bool + Interval time.Duration + Model string + Provider string + Stats CacheStats + SystemPrompt string + func NewCacheWarmer(chatFn func(ctx context.Context, messages []Message, opts ChatOptions) error, ...) *CacheWarmer + func (cw *CacheWarmer) CacheBreakpoints(systemPrompt string, conversationPrefix []Message) []int + func (cw *CacheWarmer) EstimateSavings(inputTokens int, requestCount int) float64 + func (cw *CacheWarmer) ShouldWarm() bool + func (cw *CacheWarmer) Start(ctx context.Context) error + func (cw *CacheWarmer) Stop() + func (cw *CacheWarmer) Warm(ctx context.Context) error + type ChatOptions struct + EnableCaching bool + MaxTokens int + Model string + System string + type MemoryBackend struct + func NewMemoryBackend() *MemoryBackend + func (m *MemoryBackend) Delete(_ context.Context, key string) error + func (m *MemoryBackend) Get(_ context.Context, key string) ([]byte, bool, error) + func (m *MemoryBackend) Set(_ context.Context, key string, val []byte, ttl time.Duration) error + type Message struct + Content string + Role string + type RedisBackend struct + func NewRedisBackend(addr string, timeout time.Duration) *RedisBackend + func (r *RedisBackend) Close() error + func (r *RedisBackend) Delete(ctx context.Context, key string) error + func (r *RedisBackend) Get(ctx context.Context, key string) ([]byte, bool, error) + func (r *RedisBackend) Set(ctx context.Context, key string, val []byte, ttl time.Duration) error