com.alibaba.dashscope.threads.messages.ThreadMessage Maven / Gradle / Ivy
package com.alibaba.dashscope.threads.messages;
import com.alibaba.dashscope.common.FlattenResultBase;
import com.alibaba.dashscope.common.Role;
import com.alibaba.dashscope.threads.ContentBase;
import com.google.gson.annotations.SerializedName;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import lombok.Data;
import lombok.EqualsAndHashCode;
/** Message */
@Data
@EqualsAndHashCode(callSuper = true)
public final class ThreadMessage extends FlattenResultBase {
/**
* Id
*
* (Required)
*/
@SerializedName("id")
private String id;
/**
* Object
*
*
(Required)
*/
@SerializedName("object")
private String object = "thread.message";
/** Completed At */
@SerializedName("created_at")
private Long createdAt = null;
/**
* Thread Id
*
*
(Required)
*/
@SerializedName("thread_id")
private String threadId;
/**
* Status
*
*
(Required)
*/
@SerializedName("status")
private ThreadMessage.Status status;
@SerializedName("incomplete_details")
private Object incompleteDetails = null;
@SerializedName("completed_at")
private Long completedAt;
@SerializedName("incomplete_at")
private Long incompleteAt;
/**
* Role
*
*
(Required)
*/
@SerializedName("role")
private Role role;
private List content;
/** Assistant Id */
@SerializedName("assistant_id")
private String assistantId = null;
/** Run Id */
@SerializedName("run_id")
private String runId = null;
/**
* File Ids
*
* (Required)
*/
@SerializedName("file_ids")
private List fileIds;
/** Metadata */
@SerializedName("metadata")
private Map metadata;
/** Status */
public enum Status {
@SerializedName("in_progress")
IN_PROGRESS("in_progress"),
@SerializedName("incomplete")
INCOMPLETE("incomplete"),
@SerializedName("completed")
COMPLETED("completed");
private final String value;
private static final Map CONSTANTS =
new HashMap();
static {
for (ThreadMessage.Status c : values()) {
CONSTANTS.put(c.value, c);
}
}
Status(String value) {
this.value = value;
}
@Override
public String toString() {
return this.value;
}
public String value() {
return this.value;
}
public static ThreadMessage.Status fromValue(String value) {
ThreadMessage.Status constant = CONSTANTS.get(value);
if (constant == null) {
throw new IllegalArgumentException(value);
} else {
return constant;
}
}
}
}