Class ThreadMessage
java.lang.Object
com.azure.ai.agents.persistent.models.ThreadMessage
- All Implemented Interfaces:
com.azure.json.JsonSerializable<ThreadMessage>
public final class ThreadMessage
extends Object
implements com.azure.json.JsonSerializable<ThreadMessage>
A single, existing message within an agent thread.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ThreadMessagefromJson(com.azure.json.JsonReader jsonReader) Reads an instance of ThreadMessage from the JsonReader.Get the assistantId property: If applicable, the ID of the agent that authored this message.Get the attachments property: A list of files attached to the message, and the tools they were added to.Get the completedAt property: The Unix timestamp (in seconds) for when the message was completed.Get the content property: The list of content items associated with the agent thread message.Get the createdAt property: The Unix timestamp, in seconds, representing when this object was created.getId()Get the id property: The identifier, which can be referenced in API endpoints.Get the incompleteAt property: The Unix timestamp (in seconds) for when the message was marked as incomplete.Get the incompleteDetails property: On an incomplete message, details about why the message is incomplete.Get the metadata property: A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format.Get the object property: The object type, which is always 'thread.message'.getRole()Get the role property: The role associated with the agent thread message.getRunId()Get the runId property: If applicable, the ID of the run associated with the authoring of this message.Get the status property: The status of the message.Get the threadId property: The ID of the thread that this message belongs to.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Method Details
-
getId
Get the id property: The identifier, which can be referenced in API endpoints.- Returns:
- the id value.
-
getObject
Get the object property: The object type, which is always 'thread.message'.- Returns:
- the object value.
-
getCreatedAt
Get the createdAt property: The Unix timestamp, in seconds, representing when this object was created.- Returns:
- the createdAt value.
-
getThreadId
Get the threadId property: The ID of the thread that this message belongs to.- Returns:
- the threadId value.
-
getStatus
Get the status property: The status of the message.- Returns:
- the status value.
-
getIncompleteDetails
Get the incompleteDetails property: On an incomplete message, details about why the message is incomplete.- Returns:
- the incompleteDetails value.
-
getCompletedAt
Get the completedAt property: The Unix timestamp (in seconds) for when the message was completed.- Returns:
- the completedAt value.
-
getIncompleteAt
Get the incompleteAt property: The Unix timestamp (in seconds) for when the message was marked as incomplete.- Returns:
- the incompleteAt value.
-
getRole
Get the role property: The role associated with the agent thread message.- Returns:
- the role value.
-
getContent
Get the content property: The list of content items associated with the agent thread message.- Returns:
- the content value.
-
getAssistantId
Get the assistantId property: If applicable, the ID of the agent that authored this message.- Returns:
- the assistantId value.
-
getRunId
Get the runId property: If applicable, the ID of the run associated with the authoring of this message.- Returns:
- the runId value.
-
getAttachments
Get the attachments property: A list of files attached to the message, and the tools they were added to.- Returns:
- the attachments value.
-
getMetadata
Get the metadata property: A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.- Returns:
- the metadata value.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<ThreadMessage>- Throws:
IOException
-
fromJson
Reads an instance of ThreadMessage from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of ThreadMessage if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
- Throws:
IllegalStateException- If the deserialized JSON object was missing any required properties.IOException- If an error occurs while reading the ThreadMessage.
-