File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed
chatgpt-java-sdk/src/main/java/io/github/kezhenxu94/chatgpt Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ public List<Choice> choices() {
5656 return choices ;
5757 }
5858
59+ @ JsonIgnoreProperties (ignoreUnknown = true )
5960 public static class Usage {
6061 private final int promptTokens ;
6162 private final int completionTokens ;
@@ -84,6 +85,7 @@ public int totalTokens() {
8485 }
8586 }
8687
88+ @ JsonIgnoreProperties (ignoreUnknown = true )
8789 public static class Choice {
8890 private final Message message ;
8991 private final String finishReason ;
Original file line number Diff line number Diff line change 11package io .github .kezhenxu94 .chatgpt .message ;
22
3+ import com .fasterxml .jackson .annotation .JsonIgnoreProperties ;
34import com .fasterxml .jackson .annotation .JsonProperty ;
45import com .fasterxml .jackson .annotation .JsonSubTypes ;
56import com .fasterxml .jackson .annotation .JsonTypeInfo ;
67
8+ @ JsonIgnoreProperties (ignoreUnknown = true )
79@ JsonTypeInfo (use = JsonTypeInfo .Id .NAME , property = "role" )
810@ JsonSubTypes ({
911 @ JsonSubTypes .Type (value = UserMessage .class , name = "user" ),
You can’t perform that action at this time.
0 commit comments