This repository has been archived by the owner on Jun 2, 2024. It is now read-only.
3.5.0 - JSON Serialization
JSON Serialization
When developing different implementations of GPT Turbo, I quickly noticed that a usage pattern emerged: I wanted to persist conversations in some way or another and load them at a later time. Before, this was done by creating a conversation and manually adding each message one after the other. Additionally, the code was almost exactly the same for each implementation.
This release brings new static and instance methods to handle the serialization and deserialization of Conversation objects (and other classes):
conversation.toJSON()
creates a JSON object from aConversation
instance.Conversation.fromJSON
creates aConversation
instance from a JSON object.
These were also implemented in all implementations of GPT Turbo, greatly reducing logic and repeated code.