- Add cache::ai module with Redis rate limiting for AI generations
- Add functions: check_ai_rate_limit, get_ai_usage, cache_ai_response,
get_cached_ai_response, invalidate_ai_cache, reset_daily_usage
- Update check_and_increment_usage to use Redis fast-path before DB
- Redis key pattern: ai:rate:{user_id} for 24hr sliding window counter
|
||
|---|---|---|
| .. | ||
| auth | ||
| cache | ||
| contracts | ||
| db | ||
| db-migrate | ||
| storage | ||