diff --git a/src/crewai/memory/storage/llm_response_cache_storage.py b/src/crewai/memory/storage/llm_response_cache_storage.py index 3481f030d..1af7fab62 100644 --- a/src/crewai/memory/storage/llm_response_cache_storage.py +++ b/src/crewai/memory/storage/llm_response_cache_storage.py @@ -228,10 +228,11 @@ class LLMResponseCacheStorage: logger.info("Deleting all cache entries (max_age_days <= 0)") else: cursor.execute( - f""" - DELETE FROM llm_response_cache - WHERE timestamp < datetime('now', '-{max_age_days} days') """ + DELETE FROM llm_response_cache + WHERE timestamp < datetime('now', ? || ' days') + """, + (f"-{max_age_days}",) ) deleted_count = cursor.rowcount