File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed
src/main/java/com/plexpt/chatgpt/entity/chat Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,12 @@ public class ChatCompletion implements Serializable {
103103 */
104104 private String user ;
105105
106+ /**
107+ * 返回格式 当前只有gpt-3.5-turbo-1106和gpt-4-1106-preview 支持json_object格式返回
108+ */
109+ @ JsonProperty ("response_format" )
110+ private ResponseFormat responseFormat ;
111+
106112
107113 @ Getter
108114 @ AllArgsConstructor
Original file line number Diff line number Diff line change 1+ package com .plexpt .chatgpt .entity .chat ;
2+
3+ import com .fasterxml .jackson .annotation .JsonIgnoreProperties ;
4+ import com .fasterxml .jackson .annotation .JsonInclude ;
5+ import lombok .*;
6+ import lombok .extern .slf4j .Slf4j ;
7+
8+ /**
9+ * @author hq
10+ * @version 1.0
11+ * @date 2023/12/11
12+ */
13+
14+ @ Data
15+ @ Builder
16+ @ AllArgsConstructor
17+ @ NoArgsConstructor (force = true )
18+ @ JsonInclude (JsonInclude .Include .NON_NULL )
19+ @ JsonIgnoreProperties (ignoreUnknown = true )
20+ public class ResponseFormat {
21+
22+ public String type = Type .TEXT .getValue ();
23+
24+ @ Getter
25+ @ AllArgsConstructor
26+ public enum Type {
27+ JSON_OBJECT ("json_object" ),
28+ TEXT ("text" );
29+ private final String value ;
30+ }
31+ }
You can’t perform that action at this time.
0 commit comments