Skip to content

created_at is not included in request body #133

@hongqn

Description

@hongqn
>>> import memobase
m>>> memobase.__version__
'0.0.24'
>>> from memobase import ChatBlob
>>> from datetime import datetime
>>> timestamp = datetime(2025, 9, 1)
>>> b = ChatBlob(messages=[
...     {"role": "user", "content": "Hi, I'm here again"},
...     {"role": "assistant", "content": "Hi, Gus! How can I help you?"}
... ], created_at=timestamp)
>>> b.to_request()
{'blob_type': <BlobType.chat: 'chat'>, 'fields': None, 'blob_data': {'messages': [{'role': 'user', 'content': "Hi, I'm here again", 'alias': None, 'created_at': None}, {'role': 'assistant', 'content': 'Hi, Gus! How can I help you?', 'alias': None, 'created_at': None}]}}

The generated request body sets created_at to None. This field is excluded during model_dump() according to this line of code. As the result, the created_at (and updated_at) fields defined in the API are not accessible through the Python SDK directly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions