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

chore: bump version #1269

Merged
merged 6 commits into from
Apr 18, 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
2 changes: 1 addition & 1 deletion memgpt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.3.10"
__version__ = "0.3.11"

from memgpt.client.client import create_client
from memgpt.client.admin import Admin
23 changes: 16 additions & 7 deletions memgpt/server/rest_api/agents/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,22 @@ class UserMessageRequest(BaseModel):
description="Timestamp to tag the message with (in ISO format). If null, timestamp will be created server-side on receipt of message.",
)

@validator("timestamp")
def validate_timestamp(cls, value: Any) -> Any:
if value.tzinfo is None or value.tzinfo.utcoffset(value) is None:
raise ValueError("Timestamp must include timezone information.")
if value.tzinfo.utcoffset(value) != datetime.fromtimestamp(timezone.utc).utcoffset():
raise ValueError("Timestamp must be in UTC.")
return value
# @validator("timestamp", pre=True, always=True)
# def validate_timestamp(cls, value: Optional[datetime]) -> Optional[datetime]:
# if value is None:
# return value # If the timestamp is None, just return None, implying default handling to set server-side

# if not isinstance(value, datetime):
# raise TypeError("Timestamp must be a datetime object with timezone information.")

# if value.tzinfo is None or value.tzinfo.utcoffset(value) is None:
# raise ValueError("Timestamp must be timezone-aware.")

# # Convert timestamp to UTC if it's not already in UTC
# if value.tzinfo.utcoffset(value) != timezone.utc.utcoffset(value):
# value = value.astimezone(timezone.utc)

# return value


class UserMessageResponse(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pymemgpt"
version = "0.3.10"
version = "0.3.11"
packages = [
{include = "memgpt"}
]
Expand Down
Loading