from talk_box.conversation import Conversation
convo = Conversation()
convo.add_user_message("Test")
d = convo.to_dict()
list(d.keys())['conversation_id', 'created_at', 'metadata', 'max_context_length', 'messages']
Serialize the conversation to a plain dictionary.
Usage
The output is JSON-serializable and can be persisted or transmitted. Use from_dict() to reconstruct the conversation later.
dict[str, Any]"conversation_id", "created_at", "metadata", "max_context_length", and "messages".