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 textual content of the initial message. Currently, robust input including images and annotated text may only be provided via a separate call to the create message API.

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: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages.
  • assistant: Indicates the message is generated by the agent. Use this value to insert messages from the agent into the conversation.

Possible values: "user", "assistant"

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 textual content of the initial message. Currently, robust input including images and annotated text may only be provided via a separate call to the create message API.

content: CreateMessageContent

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: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages.
  • assistant: Indicates the message is generated by the agent. Use this value to insert messages from the agent into the conversation.

Possible values: "user", "assistant"

role: string

Property Value

string