File tree Expand file tree Collapse file tree 6 files changed +25
-9
lines changed
src/main/java/com/theokanning/openai/queue Expand file tree Collapse file tree 6 files changed +25
-9
lines changed Original file line number Diff line number Diff line change 66 <parent >
77 <groupId >top.bella</groupId >
88 <artifactId >openai-java</artifactId >
9- <version >0.23.41 </version >
9+ <version >0.23.42 </version >
1010 </parent >
1111 <packaging >jar</packaging >
1212 <artifactId >openai-api</artifactId >
Original file line number Diff line number Diff line change @@ -28,10 +28,9 @@ public class Put {
2828 private String queue ;
2929
3030 /**
31- * The priority level of the task in the queue (default: 0)
31+ * Used for fine-grained priority control in callback mode Lower numbers have higher priority (1 > 2 > 3) Currently not supported
3232 */
33- @ Builder .Default
34- private Integer level = 0 ;
33+ private Integer level ;
3534
3635 /**
3736 * The data payload to be processed
Original file line number Diff line number Diff line change @@ -47,7 +47,8 @@ public class Task {
4747 /**
4848 * The priority level of the task in the queue
4949 */
50- private Integer level ;
50+ @ Builder .Default
51+ private Integer level = 0 ;
5152
5253 /**
5354 * The data payload for the task
@@ -82,6 +83,12 @@ public class Task {
8283 @ JsonProperty ("running_time" )
8384 private long runningTime ;
8485
86+ /**
87+ * Timestamp when the task is set to expire
88+ */
89+ @ JsonProperty ("expire_time" )
90+ private long expireTime ;
91+
8592 /**
8693 * Timestamp when the task completed execution
8794 */
@@ -117,6 +124,16 @@ public String getFullQueueName() {
117124 */
118125 @ JsonIgnore
119126 public boolean isFinish () {
120- return "succeeded" .equals (status ) || "failed" .equals (status ) || "cancelled" .equals (status );
127+ return "succeeded" .equals (status ) || "failed" .equals (status ) || "cancelled" .equals (status ) || "timeout" .equals (status );
128+ }
129+
130+ /**
131+ * Checks if the task has expired based on the current time and its expireTime
132+ *
133+ * @return true if the task is expired
134+ */
135+ @ JsonIgnore
136+ public boolean isExpire () {
137+ return System .currentTimeMillis () > expireTime ;
121138 }
122139}
Original file line number Diff line number Diff line change 66 <parent >
77 <groupId >top.bella</groupId >
88 <artifactId >openai-java</artifactId >
9- <version >0.23.41 </version >
9+ <version >0.23.42 </version >
1010 </parent >
1111 <packaging >jar</packaging >
1212
Original file line number Diff line number Diff line change 55
66 <groupId >top.bella</groupId >
77 <artifactId >openai-java</artifactId >
8- <version >0.23.41 </version >
8+ <version >0.23.42 </version >
99 <packaging >pom</packaging >
1010 <description >openai java 版本</description >
1111 <name >openai-java</name >
Original file line number Diff line number Diff line change 66 <parent >
77 <groupId >top.bella</groupId >
88 <artifactId >openai-java</artifactId >
9- <version >0.23.41 </version >
9+ <version >0.23.42 </version >
1010 </parent >
1111 <packaging >jar</packaging >
1212
You can’t perform that action at this time.
0 commit comments