Class
ChatTextMessage

Represents a chat message that contains text content and optionally file attachments.

Definition

Constructors

ChatTextMessage(string, Author, DateTime)

Initializes a new instance of the ChatTextMessage class with the specified message content, author, and timestamp.

Declaration

cs-api-definition
public ChatTextMessage(string message, Author author, DateTime timeStamp)

Parameters

message

string

The text content of the chat message. Cannot be null.

author

Author

The author of the chat message. Cannot be null.

timeStamp

DateTime

The date and time when the message was sent.

ChatTextMessage(string, Author, DateTime, object)

Initializes a new instance of the ChatTextMessage class with the specified message content, author, timestamp, and user data.

Declaration

cs-api-definition
public ChatTextMessage(string message, Author author, DateTime timeStamp, object userData)

Parameters

message

string

The text content of the chat message.

author

Author

The author of the chat message. Cannot be null.

timeStamp

DateTime

The date and time when the message was created.

userData

object

An object containing additional user-defined data associated with the message. Can be null.

ChatTextMessage(string, IEnumerable<PromptInputAttachedFile>, Author, DateTime)

Initializes a new instance of the ChatTextMessage class with the specified message content, attachments, author, and timestamp.

Declaration

cs-api-definition
public ChatTextMessage(string message, IEnumerable<PromptInputAttachedFile> attachments, Author author, DateTime timeStamp)

Parameters

message

string

The text content of the chat message. Can be null when attachments are provided.

attachments

IEnumerable<PromptInputAttachedFile>

The file attachments associated with this message. Can be null.

author

Author

The author of the chat message. Cannot be null.

timeStamp

DateTime

The date and time when the message was sent.

ChatTextMessage(string, IEnumerable<PromptInputAttachedFile>, Author, DateTime, object)

Initializes a new instance of the ChatTextMessage class with the specified message content, attachments, author, timestamp, and user data.

Declaration

cs-api-definition
public ChatTextMessage(string message, IEnumerable<PromptInputAttachedFile> attachments, Author author, DateTime timeStamp, object userData)

Parameters

message

string

The text content of the chat message. Can be null when attachments are provided.

attachments

IEnumerable<PromptInputAttachedFile>

The file attachments associated with this message. Can be null.

author

Author

The author of the chat message. Cannot be null.

timeStamp

DateTime

The date and time when the message was created.

userData

object

An object containing additional user-defined data associated with the message. Can be null.

Properties

Attachments

Gets the file attachments associated with this message. The collection is mutable to allow callers to add or remove attachments before sending the message.

Declaration

cs-api-definition
public IList<PromptInputAttachedFile> Attachments { get; }

Property Value

IList<PromptInputAttachedFile>

HasAttachments

Gets a value indicating whether this message has any file attachments.

Declaration

cs-api-definition
public bool HasAttachments { get; }

Property Value

bool

HasText

Gets a value indicating whether this message has any text content.

Declaration

cs-api-definition
public bool HasText { get; }

Property Value

bool

Message

Gets or sets the message content associated with this instance.

Declaration

cs-api-definition
public string Message { get; set; }

Property Value

string