你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

ThreadMessage Class

Definition

A single, existing message within an agent thread.

public class ThreadMessage : System.ClientModel.Primitives.IJsonModel<Azure.AI.Projects.ThreadMessage>, System.ClientModel.Primitives.IPersistableModel<Azure.AI.Projects.ThreadMessage>
type ThreadMessage = class
    interface IJsonModel<ThreadMessage>
    interface IPersistableModel<ThreadMessage>
Public Class ThreadMessage
Implements IJsonModel(Of ThreadMessage), IPersistableModel(Of ThreadMessage)
Inheritance
ThreadMessage
Implements

Constructors

ThreadMessage(String, DateTimeOffset, String, MessageStatus, MessageIncompleteDetails, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>, MessageRole, IEnumerable<MessageContent>, String, String, IEnumerable<MessageAttachment>, IDictionary<String,String>)

Initializes a new instance of ThreadMessage.

Properties

AssistantId

If applicable, the ID of the agent that authored this message.

Attachments

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

CompletedAt

The Unix timestamp (in seconds) for when the message was completed.

ContentItems

The list of content items associated with the agent thread message. Please note MessageContent is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. The available derived classes include MessageImageFileContent and MessageTextContent.

CreatedAt

The Unix timestamp, in seconds, representing when this object was created.

Id

The identifier, which can be referenced in API endpoints.

IncompleteAt

The Unix timestamp (in seconds) for when the message was marked as incomplete.

IncompleteDetails

On an incomplete message, details about why the message is incomplete.

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 associated with the agent thread message.

RunId

If applicable, the ID of the run associated with the authoring of this message.

Status

The status of the message.

ThreadId

The ID of the thread that this message belongs to.

Methods

JsonModelWriteCore(Utf8JsonWriter, ModelReaderWriterOptions)

Explicit Interface Implementations

IJsonModel<ThreadMessage>.Create(Utf8JsonReader, ModelReaderWriterOptions)

Reads one JSON value (including objects or arrays) from the provided reader and converts it to a model.

IJsonModel<ThreadMessage>.Write(Utf8JsonWriter, ModelReaderWriterOptions)

Writes the model to the provided Utf8JsonWriter.

IPersistableModel<ThreadMessage>.Create(BinaryData, ModelReaderWriterOptions)

Converts the provided BinaryData into a model.

IPersistableModel<ThreadMessage>.GetFormatFromOptions(ModelReaderWriterOptions)

Gets the data interchange format (JSON, Xml, etc) that the model uses when communicating with the service.

IPersistableModel<ThreadMessage>.Write(ModelReaderWriterOptions)

Writes the model into a BinaryData.

Applies to