get method
Gets a cached response if available and not expired.
Implementation
String? get(String prompt, String model, {List<String>? context}) {
final key = _generateKey(prompt, model, context);
final entry = _cache[key];
if (entry == null) {
return null;
}
if (DateTime.now().isAfter(entry.expiresAt)) {
_remove(key);
return null;
}
// Move to end of access order (most recently used)
_accessOrder.remove(key);
_accessOrder.add(key);
return entry.response;
}