simple-openai
simple-openai copied to clipboard
Make `ChatRequest` and `ChatResponse` object Jackson serde compatible.
Hi,
I want to cache OpenAI request/response pairs, and being able to serialize/deserialize these object natively using Jackson would be very helpful.
Ideally, we should be able to do
new ObjectMapper().readValue(cachedRequest, ChatRequest.class);
which currently fails with
Cannot construct instance of `io.github.sashirestela.openai.domain.chat.ChatRequest` (no Creators, like default constructor, exist): cannot deserialize from Object value (no delegate- or property-based Creator)
Thanks,