Skip to content

Commit

Permalink
Add missing fields to ThreadMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanBratanov committed Mar 28, 2024
1 parent 2308414 commit 30e5c6d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,19 @@ public record ThreadMessage(
String id,
long createdAt,
String threadId,
String status,
IncompleteDetails incompleteDetails,
Long completedAt,
Long incompleteAt,
String role,
List<Content> content,
String assistantId,
String runId,
List<String> fileIds,
Map<String, String> metadata) {

public record IncompleteDetails(String reason) {}

@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type")
@JsonSubTypes({
@JsonSubTypes.Type(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,11 @@ public ThreadMessage randomThreadMessage() {
randomString(6),
randomLong(1, 31_000),
randomString(8),
oneOf("in_progress", "incomplete", "completed"),
new ThreadMessage.IncompleteDetails(
oneOf("content_filter", "max_tokens", "run_cancelled", "run_expired", "run_failed")),
randomLong(1, 25_000),
randomLong(1, 24_000),
oneOf("user", "assistant"),
listOf(
randomInt(1, 8),
Expand Down

0 comments on commit 30e5c6d

Please sign in to comment.