JsonProperties avoiding 'Unrecognized request argument supplied' erro…
…r in Image and Completion Requests
For developers that don't use the client library.
Example was made with RestTemplate.
EX. ERROR: org.springframework.web.client.HttpClientErrorException$BadRequest: 400 Bad Request: "{<EOL> "error": {<EOL> "message": "Unrecognized request argument supplied: logitBias",<EOL> "type": "invalid_request_error",<EOL> "param": null,<EOL> "code": null<EOL> }<EOL>}<EOL>"
Not that it makes a diff as it's personal pref, I've been using Gson instead of Jackson annotations.
GeneratedImage gen = gs.fromJson(response.body(), GeneratedImage.class);
public class @Data GeneratedImage {
Integer created = 0;
ArrayList<ImageLocation> data = null;
}
@cryptoapebot Sorry but the project already use Jackson library like in Image class (com.theokanning.openai.image), and if I would use existing models like CompletionRequest in the -api- module, I need they will be serialized/deserialized correctly.
Yes, of course. I'm not recommending switching, but because of my integration of calls with this library and w/ other projects, I've been forced to choose.
I'll go ahead and add these everywhere, then nobody will have to will worry about setting jackson to snake case anymore