ai-for-java / openai4j

Java client library for OpenAI API
Apache License 2.0
85 stars 34 forks source link

json deserialize problem #42

Open codexvn opened 2 months ago

codexvn commented 2 months ago

Cannot deserialize value of type java.lang.String from Array value (token JsonToken.START_ARRAY) at [Source: UNKNOWN; byte offset: #UNKNOWN] (through reference chain: xxx

dev.ai4j.openai4j.chat.ChatCompletionRequest$Builder["messages"]->java.util.ArrayList[0]->dev.ai4j.openai4j.chat.UserMessage$Builder["content"])

Does json deserialization not currently supported?

langchain4j commented 2 months ago

@codexvn I am not sure if deserialization of UserMessage is supported. Why do you _de_serialize it?

codexvn commented 1 month ago

@langchain4j I want to store the context of a session as a memory, but currently I cannot serialize and deserialize the object directly