This repository was archived by the owner on Jun 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathBatch.java
143 lines (118 loc) · 3.22 KB
/
Batch.java
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
package com.theokanning.openai.batch;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import java.util.List;
import java.util.Map;
/**
* @Author: acone.wu
* @date: 2024/5/15 13:51
*/
@NoArgsConstructor
@AllArgsConstructor
@Data
public class Batch {
@NonNull
private String id;
/**
* The time frame within which the batch should be processed.
*/
@NonNull
@JsonProperty("completion_window")
private String completionWindow;
/**
* The Unix timestamp (in seconds) for when the batch was created.
*/
@NonNull
@JsonProperty("created_at")
private Integer createdAt;
/**
* The OpenAI API endpoint used by the batch.
*/
@NonNull
private String endpoint;
/**
* The ID of the input file for the batch.
*/
@NonNull
@JsonProperty("input_file_id")
private String inputFileId;
/**
* The object type, which is always `batch`.
*/
private String object = "batch";
/**
* The current status of the batch.
* */
private Status status;
/**
* The Unix timestamp (in seconds) for when the batch was cancelled.
* */
@JsonProperty("cancelled_at")
private Integer cancelledAt;
/**
* The Unix timestamp (in seconds) for when the batch started cancelling.
* */
@JsonProperty("cancelling_at")
private Integer cancellingAt;
/**
* The Unix timestamp (in seconds) for when the batch was completed.
* */
@JsonProperty("completed_at")
private Integer completedAt;
/**
* The ID of the file containing the outputs of requests with errors.
* */
@JsonProperty("error_file_id")
private String errorFileId;
/**
* Errors associated with batch processing.
* */
private Errors errors;
/**
* The Unix timestamp (in seconds) for when the batch expired.
* */
@JsonProperty("expired_at")
private Integer expiredAt;
/**
* The Unix timestamp (in seconds) for when the batch will expire.
* */
@JsonProperty("expires_at")
private Integer expiresAt;
/**
* The Unix timestamp (in seconds) for when the batch failed.
* */
@JsonProperty("failed_at")
private Integer failedAt;
/**
* The Unix timestamp (in seconds) for when the batch started finalizing.
* */
@JsonProperty("finalizing_at")
private Integer finalizingAt;
/**
* The Unix timestamp (in seconds) for when the batch started processing.
* */
@JsonProperty("in_progress_at")
private Integer inProgressAt;
/**
* Metadata for storing additional information about the object.
* */
private Map<String, Object> metadata;
/**
* The ID of the file containing the outputs of successfully executed requests.
* */
@JsonProperty("output_file_id")
private String outputFileId;
/**
* The request counts for different statuses within the batch.
* */
@JsonProperty("request_counts")
private BatchRequestCounts requestCounts;
@Data
public static class Errors {
private List<BatchError> data;
private String object;
}
}