Share via


ThreadMessageOptions interface

A single message within an agent thread, as provided during that thread's creation for its initial state.

Properties

attachments

A list of files attached to the message, and the tools they should be added to.

content

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).

metadata

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.

role

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).

Property Details

attachments

A list of files attached to the message, and the tools they should be added to.

attachments?: null | MessageAttachment[]

Property Value

content

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).

content: MessageInputContent

Property Value

metadata

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.

metadata?: null | Record<string, string>

Property Value

null | Record<string, string>

role

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).

role: MessageRole

Property Value