Class Message
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
Message.Builder
A builder for Message.
public final class
Message.Attachment
public final class
Message.IncompleteDetails
On an incomplete message, details about why the message is incomplete.
public final class
Message.Metadata
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
public final class
Message.Role
The entity that produced the message. One of
user
orassistant
.public final class
Message.Status
The status of the message, which can be either
in_progress
,incomplete
, orcompleted
.
-
Method Summary
Modifier and Type Method Description final String
id()
The identifier, which can be referenced in API endpoints. final Optional<String>
assistantId()
If applicable, the ID of the assistant that authored this message. final Optional<List<Message.Attachment>>
attachments()
A list of files attached to the message, and the tools they were added to. final Optional<Long>
completedAt()
The Unix timestamp (in seconds) for when the message was completed. final List<MessageContent>
content()
The content of the message in array of text and/or images. final Long
createdAt()
The Unix timestamp (in seconds) for when the message was created. final Optional<Long>
incompleteAt()
The Unix timestamp (in seconds) for when the message was marked as incomplete. final Optional<Message.IncompleteDetails>
incompleteDetails()
On an incomplete message, details about why the message is incomplete. final Optional<Message.Metadata>
metadata()
Set of 16 key-value pairs that can be attached to an object. final JsonValue
_object_()
The object type, which is always thread.message
.final Message.Role
role()
The entity that produced the message. final Optional<String>
runId()
The ID of the run associated with the creation of this message. final Message.Status
status()
The status of the message, which can be either in_progress
,incomplete
, orcompleted
.final String
threadId()
The thread ID that this message belongs to. final JsonField<String>
_id()
Returns the raw JSON value of id. final JsonField<String>
_assistantId()
Returns the raw JSON value of assistantId. final JsonField<List<Message.Attachment>>
_attachments()
Returns the raw JSON value of attachments. final JsonField<Long>
_completedAt()
Returns the raw JSON value of completedAt. final JsonField<List<MessageContent>>
_content()
Returns the raw JSON value of content. final JsonField<Long>
_createdAt()
Returns the raw JSON value of createdAt. final JsonField<Long>
_incompleteAt()
Returns the raw JSON value of incompleteAt. final JsonField<Message.IncompleteDetails>
_incompleteDetails()
Returns the raw JSON value of incompleteDetails. final JsonField<Message.Metadata>
_metadata()
Returns the raw JSON value of metadata. final JsonField<Message.Role>
_role()
Returns the raw JSON value of role. final JsonField<String>
_runId()
Returns the raw JSON value of runId. final JsonField<Message.Status>
_status()
Returns the raw JSON value of status. final JsonField<String>
_threadId()
Returns the raw JSON value of threadId. final Map<String, JsonValue>
_additionalProperties()
final Message.Builder
toBuilder()
final Message
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static Message.Builder
builder()
Returns a mutable builder for constructing an instance of Message. -
-
Method Detail
-
assistantId
final Optional<String> assistantId()
If applicable, the ID of the assistant that authored this message.
-
attachments
final Optional<List<Message.Attachment>> attachments()
A list of files attached to the message, and the tools they were added to.
-
completedAt
final Optional<Long> completedAt()
The Unix timestamp (in seconds) for when the message was completed.
-
content
final List<MessageContent> content()
The content of the message in array of text and/or images.
-
incompleteAt
final Optional<Long> incompleteAt()
The Unix timestamp (in seconds) for when the message was marked as incomplete.
-
incompleteDetails
final Optional<Message.IncompleteDetails> incompleteDetails()
On an incomplete message, details about why the message is incomplete.
-
metadata
final Optional<Message.Metadata> metadata()
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
-
_object_
final JsonValue _object_()
The object type, which is always
thread.message
.Expected to always return the following:
JsonValue.from("thread.message")
However, this method can be useful for debugging and logging (e.g. if the server responded with an unexpected value).
-
role
final Message.Role role()
The entity that produced the message. One of
user
orassistant
.
-
runId
final Optional<String> runId()
The ID of the run associated with the creation of this message. Value is
null
when messages are created manually using the create message or create thread endpoints.
-
status
final Message.Status status()
The status of the message, which can be either
in_progress
,incomplete
, orcompleted
.
-
_id
final JsonField<String> _id()
Returns the raw JSON value of id.
Unlike id, this method doesn't throw if the JSON field has an unexpected type.
-
_assistantId
final JsonField<String> _assistantId()
Returns the raw JSON value of assistantId.
Unlike assistantId, this method doesn't throw if the JSON field has an unexpected type.
-
_attachments
final JsonField<List<Message.Attachment>> _attachments()
Returns the raw JSON value of attachments.
Unlike attachments, this method doesn't throw if the JSON field has an unexpected type.
-
_completedAt
final JsonField<Long> _completedAt()
Returns the raw JSON value of completedAt.
Unlike completedAt, this method doesn't throw if the JSON field has an unexpected type.
-
_content
final JsonField<List<MessageContent>> _content()
Returns the raw JSON value of content.
Unlike content, this method doesn't throw if the JSON field has an unexpected type.
-
_createdAt
final JsonField<Long> _createdAt()
Returns the raw JSON value of createdAt.
Unlike createdAt, this method doesn't throw if the JSON field has an unexpected type.
-
_incompleteAt
final JsonField<Long> _incompleteAt()
Returns the raw JSON value of incompleteAt.
Unlike incompleteAt, this method doesn't throw if the JSON field has an unexpected type.
-
_incompleteDetails
final JsonField<Message.IncompleteDetails> _incompleteDetails()
Returns the raw JSON value of incompleteDetails.
Unlike incompleteDetails, this method doesn't throw if the JSON field has an unexpected type.
-
_metadata
final JsonField<Message.Metadata> _metadata()
Returns the raw JSON value of metadata.
Unlike metadata, this method doesn't throw if the JSON field has an unexpected type.
-
_role
final JsonField<Message.Role> _role()
Returns the raw JSON value of role.
Unlike role, this method doesn't throw if the JSON field has an unexpected type.
-
_runId
final JsonField<String> _runId()
Returns the raw JSON value of runId.
Unlike runId, this method doesn't throw if the JSON field has an unexpected type.
-
_status
final JsonField<Message.Status> _status()
Returns the raw JSON value of status.
Unlike status, this method doesn't throw if the JSON field has an unexpected type.
-
_threadId
final JsonField<String> _threadId()
Returns the raw JSON value of threadId.
Unlike threadId, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final Message.Builder toBuilder()
-
builder
final static Message.Builder builder()
Returns a mutable builder for constructing an instance of Message.
The following fields are required:
.id() .assistantId() .attachments() .completedAt() .content() .createdAt() .incompleteAt() .incompleteDetails() .metadata() .role() .runId() .status() .threadId()
-
-
-
-