Share via


ChatCompletionsOptions.Messages Property

Definition

Overloads

Messages

The collection of context messages associated with this chat completions request. Typical usage begins with a chat message for the System role that provides instructions for the behavior of the assistant, followed by alternating messages between the User and Assistant roles. Please note ChatRequestMessage 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 ChatRequestAssistantMessage, ChatRequestSystemMessage, ChatRequestToolMessage and ChatRequestUserMessage.

Messages

The collection of context messages associated with this chat completions request. Typical usage begins with a chat message for the System role that provides instructions for the behavior of the assistant, followed by alternating messages between the User and Assistant roles. Please note ChatRequestMessage 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 ChatRequestAssistantMessage, ChatRequestSystemMessage, ChatRequestToolMessage and ChatRequestUserMessage.

public System.Collections.Generic.IList<Azure.AI.Inference.ChatRequestMessage> Messages { get; }
member this.Messages : System.Collections.Generic.IList<Azure.AI.Inference.ChatRequestMessage>
Public ReadOnly Property Messages As IList(Of ChatRequestMessage)

Property Value

Applies to