Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: patch #1355 #1373

Merged
merged 2 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions memgpt/agent_store/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,15 +532,15 @@ def update(self, record: RecordType):
# Commit the changes to the database
session.commit()

def str_to_datetime(self, str_date):
def str_to_datetime(self, str_date: str) -> datetime:
val = str_date.split("-")
_datetime = datetime(int(val[0]), int(val[1]), int(val[2]))
return _datetime

def query_date(self, start_date, end_date, limit=None, offset=0):
filters = self.get_filters({})
_start_date = self.str_to_datetime(start_date)
_end_date = self.str_to_datetime(end_date)
_start_date = self.str_to_datetime(start_date) if isinstance(start_date, str) else start_date
_end_date = self.str_to_datetime(end_date) if isinstance(end_date, str) else end_date
with self.session_maker() as session:
query = (
session.query(self.db_model)
Expand Down
2 changes: 1 addition & 1 deletion memgpt/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def memgpt_pg_uri(self) -> str:
# add this property to avoid being returned the default
# reference: https://github.com/cpacker/MemGPT/issues/1362
@property
def memgpt_pt_uri_no_default(self) -> str:
def memgpt_pg_uri_no_default(self) -> str:
if self.pg_uri:
return self.pg_uri
elif self.pg_db and self.pg_user and self.pg_password and self.pg_host and self.pg_port:
Expand Down
Loading