Record Class ThreadMessage
java.lang.Object
java.lang.Record
io.github.stefanbratanov.jvm.openai.ThreadMessage
- All Implemented Interfaces:
AssistantStreamEvent.Data
public record ThreadMessage(String id, long createdAt, String threadId, String status, ThreadMessage.IncompleteDetails incompleteDetails, Long completedAt, Long incompleteAt, String role, List<ThreadMessage.Content> content, String assistantId, String runId, List<Attachment> attachments, Map<String,String> metadata)
extends Record
implements AssistantStreamEvent.Data
Represents a message within a thread.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic final recordOn an incomplete message, details about why the message is incomplete. -
Constructor Summary
ConstructorsConstructorDescriptionThreadMessage(String id, long createdAt, String threadId, String status, ThreadMessage.IncompleteDetails incompleteDetails, Long completedAt, Long incompleteAt, String role, List<ThreadMessage.Content> content, String assistantId, String runId, List<Attachment> attachments, Map<String, String> metadata) Creates an instance of aThreadMessagerecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theassistantIdrecord component.Returns the value of theattachmentsrecord component.Returns the value of thecompletedAtrecord component.content()Returns the value of thecontentrecord component.longReturns the value of thecreatedAtrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.Returns the value of theincompleteAtrecord component.Returns the value of theincompleteDetailsrecord component.metadata()Returns the value of themetadatarecord component.role()Returns the value of therolerecord component.runId()Returns the value of therunIdrecord component.status()Returns the value of thestatusrecord component.threadId()Returns the value of thethreadIdrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ThreadMessage
public ThreadMessage(String id, long createdAt, String threadId, String status, ThreadMessage.IncompleteDetails incompleteDetails, Long completedAt, Long incompleteAt, String role, List<ThreadMessage.Content> content, String assistantId, String runId, List<Attachment> attachments, Map<String, String> metadata) Creates an instance of aThreadMessagerecord class.- Parameters:
id- the value for theidrecord componentcreatedAt- the value for thecreatedAtrecord componentthreadId- the value for thethreadIdrecord componentstatus- the value for thestatusrecord componentincompleteDetails- the value for theincompleteDetailsrecord componentcompletedAt- the value for thecompletedAtrecord componentincompleteAt- the value for theincompleteAtrecord componentrole- the value for therolerecord componentcontent- the value for thecontentrecord componentassistantId- the value for theassistantIdrecord componentrunId- the value for therunIdrecord componentattachments- the value for theattachmentsrecord componentmetadata- the value for themetadatarecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
createdAt
public long createdAt()Returns the value of thecreatedAtrecord component.- Returns:
- the value of the
createdAtrecord component
-
threadId
Returns the value of thethreadIdrecord component.- Returns:
- the value of the
threadIdrecord component
-
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
incompleteDetails
Returns the value of theincompleteDetailsrecord component.- Returns:
- the value of the
incompleteDetailsrecord component
-
completedAt
Returns the value of thecompletedAtrecord component.- Returns:
- the value of the
completedAtrecord component
-
incompleteAt
Returns the value of theincompleteAtrecord component.- Returns:
- the value of the
incompleteAtrecord component
-
role
Returns the value of therolerecord component.- Returns:
- the value of the
rolerecord component
-
content
Returns the value of thecontentrecord component.- Returns:
- the value of the
contentrecord component
-
assistantId
Returns the value of theassistantIdrecord component.- Returns:
- the value of the
assistantIdrecord component
-
runId
Returns the value of therunIdrecord component.- Returns:
- the value of the
runIdrecord component
-
attachments
Returns the value of theattachmentsrecord component.- Returns:
- the value of the
attachmentsrecord component
-
metadata
Returns the value of themetadatarecord component.- Returns:
- the value of the
metadatarecord component
-