From 0ac2ac10db1d8466ed49270e46af04c60566c915 Mon Sep 17 00:00:00 2001 From: Vivian Fang Date: Tue, 31 Oct 2023 00:35:09 -0700 Subject: [PATCH] Fix conversation_date_search async bug (#215) * Fix conversation_date_search async bug * Also catch TypeError --- memgpt/memory.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/memgpt/memory.py b/memgpt/memory.py index 6fee869f..f9631b15 100644 --- a/memgpt/memory.py +++ b/memgpt/memory.py @@ -539,7 +539,7 @@ class DummyRecallMemory(RecallMemory): try: datetime.datetime.strptime(date_str, "%Y-%m-%d") return True - except ValueError: + except (ValueError, TypeError): return False def _extract_date_from_timestamp(self, timestamp): @@ -576,7 +576,7 @@ class DummyRecallMemory(RecallMemory): else: return matches, len(matches) - def a_date_search(self, start_date, end_date, count=None, start=None): + async def a_date_search(self, start_date, end_date, count=None, start=None): return self.date_search(start_date, end_date, count, start)