Open keyboardAnt opened 1 year ago
No, the reason it's different is due to:
Printing the messages
without that decorator results in the full Pydantic object being printed, which is ugly.
You should access it directly, I'm not sure how to best display it since displaying the full ChatMessage
is ugly.
A compromise might be to do
def __str__(self) -> str:
return self.dict(exclude_none=True)
Comparing to
ai.get_session().dict()["messages"]
:Would it be safer to rename
messages
to_messages
to communicate you shouldn't access it directly?