This repository has been 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
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(assistant-run): run ans run-step (#408)
- Loading branch information
Showing
20 changed files
with
455 additions
and
87 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
api/src/main/java/com/theokanning/openai/common/LastError.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.theokanning.openai.common; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
/** | ||
* @description: | ||
* @author: vacuity | ||
* @create: 2023-11-16 22:27 | ||
**/ | ||
|
||
|
||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class LastError { | ||
|
||
private String code; | ||
|
||
private String message; | ||
} |
39 changes: 39 additions & 0 deletions
39
api/src/main/java/com/theokanning/openai/runs/CreateThreadAndRunRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.theokanning.openai.runs; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.theokanning.openai.assistants.Tool; | ||
import com.theokanning.openai.threads.ThreadRequest; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
/** | ||
* @description: | ||
* @author: vacuity | ||
* @create: 2023-11-16 23:08 | ||
**/ | ||
|
||
|
||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class CreateThreadAndRunRequest { | ||
|
||
@JsonProperty("assistant_id") | ||
private String assistantId; | ||
|
||
private ThreadRequest thread; | ||
|
||
private String model; | ||
|
||
private String instructions; | ||
|
||
private List<Tool> tools; | ||
|
||
private Map<String, String> metadata; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
api/src/main/java/com/theokanning/openai/runs/RequiredAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.theokanning.openai.runs; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
/** | ||
* @description: | ||
* @author: vacuity | ||
* @create: 2023-11-16 22:44 | ||
**/ | ||
|
||
|
||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class RequiredAction { | ||
|
||
private String type; | ||
|
||
@JsonProperty("submit_tool_outputs") | ||
private SubmitToolOutputs submitToolOutputs; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
api/src/main/java/com/theokanning/openai/runs/RunImage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.theokanning.openai.runs; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
/** | ||
* @description: | ||
* @author: vacuity | ||
* @create: 2023-11-16 22:33 | ||
**/ | ||
|
||
|
||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class RunImage { | ||
|
||
@JsonProperty("file_id") | ||
private String fileId; | ||
} |
61 changes: 40 additions & 21 deletions
61
api/src/main/java/com/theokanning/openai/runs/RunStep.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,58 @@ | ||
package com.theokanning.openai.runs; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.theokanning.openai.common.LastError; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.Map; | ||
|
||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Data | ||
public class RunStep { | ||
|
||
@JsonProperty("assistant_id") | ||
String assistantId; | ||
@JsonProperty("canelled_at") | ||
Long cancelledAt; | ||
@JsonProperty("completed_at") | ||
Long completedAt; | ||
private String id; | ||
|
||
private String object; | ||
|
||
@JsonProperty("created_at") | ||
Long createdAt; | ||
@JsonProperty("expired_at") | ||
Long expiredAt; | ||
@JsonProperty("failed_at") | ||
Long failedAt; | ||
String id; | ||
@JsonProperty("last_error") | ||
String lastError; | ||
String object; | ||
private Integer createdAt; | ||
|
||
@JsonProperty("assistant_id") | ||
private String assistantId; | ||
|
||
@JsonProperty("thread_id") | ||
private String threadId; | ||
|
||
@JsonProperty("run_id") | ||
String runId; | ||
String status; | ||
private String runId; | ||
|
||
private String type; | ||
|
||
private String status; | ||
|
||
@JsonProperty("step_details") | ||
StepDetails stepDetails; | ||
@JsonProperty("thread_id") | ||
String threadId; | ||
String type; | ||
private StepDetails stepDetails; | ||
|
||
@JsonProperty("last_error") | ||
private LastError lastError; | ||
|
||
@JsonProperty("expired_at") | ||
private Integer expiredAt; | ||
|
||
@JsonProperty("cancelled_at") | ||
private Integer cancelledAt; | ||
|
||
@JsonProperty("failed_at") | ||
private Integer failedAt; | ||
|
||
@JsonProperty("completed_at") | ||
private Integer completedAt; | ||
|
||
private Map<String, String> metadata; | ||
|
||
} |
17 changes: 0 additions & 17 deletions
17
api/src/main/java/com/theokanning/openai/runs/RunSteps.java
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.