ThreadMessageOptions Class
- java.
lang. Object - com.
azure. ai. agents. persistent. models. ThreadMessageOptions
- com.
Implements
public final class ThreadMessageOptions
implements JsonSerializable<ThreadMessageOptions>
A single message within an agent thread, as provided during that thread's creation for its initial state.
Constructor Summary
| Constructor | Description |
|---|---|
| ThreadMessageOptions(MessageRole role, BinaryData content) |
Creates an instance of Thread |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
|
static
Thread |
fromJson(JsonReader jsonReader)
Reads an instance of Thread |
|
List<Message |
getAttachments()
Get the attachments property: A list of files attached to the message, and the tools they should be added to. |
|
Binary |
getContent()
Get the content property: The content of the initial message. |
| Map<String,String> |
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. |
|
Message |
getRole()
Get the role property: The role of the entity that is creating the message. |
|
Thread |
setAttachments(List<MessageAttachment> attachments)
Set the attachments property: A list of files attached to the message, and the tools they should be added to. |
|
Thread |
setMetadata(Map<String,String> metadata)
Set 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. |
|
Json |
toJson(JsonWriter jsonWriter) |
Methods inherited from java.lang.Object
Constructor Details
ThreadMessageOptions
public ThreadMessageOptions(MessageRole role, BinaryData content)
Creates an instance of ThreadMessageOptions class.
Parameters:
Method Details
fromJson
public static ThreadMessageOptions fromJson(JsonReader jsonReader)
Reads an instance of ThreadMessageOptions from the JsonReader.
Parameters:
Returns:
Throws:
getAttachments
public List<MessageAttachment> getAttachments()
Get the attachments property: A list of files attached to the message, and the tools they should be added to.
Returns:
getContent
public BinaryData getContent()
Get the content property: The content of the initial message. This may be a basic string (if you only need text) or an array of typed content blocks (for example, text, image_file, image_url, and so on).
Returns:
getMetadata
public Map<String,String> 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:
getRole
public MessageRole getRole()
Get the role property: The role of the entity that is creating the message. Allowed values include: `user`, which indicates the message is sent by an actual user (and should be used in most cases to represent user-generated messages), and `assistant`, which indicates the message is generated by the agent (use this value to insert messages from the agent into the conversation).
Returns:
setAttachments
public ThreadMessageOptions setAttachments(List<MessageAttachment> attachments)
Set the attachments property: A list of files attached to the message, and the tools they should be added to.
Parameters:
Returns:
setMetadata
public ThreadMessageOptions setMetadata(Map<String,String> metadata)
Set 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.
Parameters:
Returns: