Fix the prompt cache window - use settings.PROMPT_CACHE_WINDOW_HOURS (#769)

This commit is contained in:
Shuchang Zheng
2024-09-02 21:32:57 -07:00
committed by GitHub
parent 0d39e62df6
commit 63ebe759c4
2 changed files with 2 additions and 3 deletions

View File

@@ -1423,7 +1423,7 @@ class AgentDB:
async def get_task_generation_by_prompt_hash(
self,
user_prompt_hash: str,
query_window_hours: int = settings.PROMPT_ACTION_HISTORY_WINDOW,
query_window_hours: int = settings.PROMPT_CACHE_WINDOW_HOURS,
) -> TaskGeneration | None:
before_time = datetime.utcnow() - timedelta(hours=query_window_hours)
async with self.Session() as session: