Junjie
2 天以前 63b01db83d9aad8a15276b4236a9a22e4aeef065
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package com.zy.ai.entity;
 
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
 
import java.util.ArrayList;
import java.util.List;
 
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ResponsesApiResponse {
 
    private String id;
    private String object = "response";
    private String model;
    private String status = "completed";
    private List<OutputItem> output;
 
    @JsonProperty("created_at")
    private Long createdAt;
 
    @JsonProperty("output_text")
    private String outputText;
 
    private Usage usage;
 
    @Data
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class OutputItem {
        private String id;
        private String type = "message";
        private String status = "completed";
        private String role = "assistant";
        private List<ContentItem> content;
    }
 
    @Data
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class ContentItem {
        private String type = "output_text";
        private String text;
        private List<Object> annotations = new ArrayList<>();
    }
 
    @Data
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class Usage {
        @JsonProperty("input_tokens")
        private Integer inputTokens;
 
        @JsonProperty("output_tokens")
        private Integer outputTokens;
 
        @JsonProperty("total_tokens")
        private Integer totalTokens;
    }
}