Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>top.bella</groupId>
<artifactId>openai-java</artifactId>
<version>0.23.41</version>
<version>0.23.42</version>
</parent>
<packaging>jar</packaging>
<artifactId>openai-api</artifactId>
Expand Down
5 changes: 2 additions & 3 deletions api/src/main/java/com/theokanning/openai/queue/Put.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@ public class Put {
private String queue;

/**
* The priority level of the task in the queue (default: 0)
* Used for fine-grained priority control in callback mode Lower numbers have higher priority (1 > 2 > 3) Currently not supported
*/
@Builder.Default
private Integer level = 0;
private Integer level;

/**
* The data payload to be processed
Expand Down
21 changes: 19 additions & 2 deletions api/src/main/java/com/theokanning/openai/queue/Task.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public class Task {
/**
* The priority level of the task in the queue
*/
private Integer level;
@Builder.Default
private Integer level = 0;

/**
* The data payload for the task
Expand Down Expand Up @@ -82,6 +83,12 @@ public class Task {
@JsonProperty("running_time")
private long runningTime;

/**
* Timestamp when the task is set to expire
*/
@JsonProperty("expire_time")
private long expireTime;

/**
* Timestamp when the task completed execution
*/
Expand Down Expand Up @@ -117,6 +124,16 @@ public String getFullQueueName() {
*/
@JsonIgnore
public boolean isFinish() {
return "succeeded".equals(status) || "failed".equals(status) || "cancelled".equals(status);
return "succeeded".equals(status) || "failed".equals(status) || "cancelled".equals(status) || "timeout".equals(status);
}

/**
* Checks if the task has expired based on the current time and its expireTime
*
* @return true if the task is expired
*/
@JsonIgnore
public boolean isExpire() {
return System.currentTimeMillis() > expireTime;
}
}
2 changes: 1 addition & 1 deletion client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>top.bella</groupId>
<artifactId>openai-java</artifactId>
<version>0.23.41</version>
<version>0.23.42</version>
</parent>
<packaging>jar</packaging>

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>top.bella</groupId>
<artifactId>openai-java</artifactId>
<version>0.23.41</version>
<version>0.23.42</version>
<packaging>pom</packaging>
<description>openai java 版本</description>
<name>openai-java</name>
Expand Down
2 changes: 1 addition & 1 deletion service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>top.bella</groupId>
<artifactId>openai-java</artifactId>
<version>0.23.41</version>
<version>0.23.42</version>
</parent>
<packaging>jar</packaging>

Expand Down