Share via


ChatCompletionsOptions.Messages Property

Definition

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, ChatRequestFunctionMessage, ChatRequestSystemMessage, ChatRequestToolMessage and ChatRequestUserMessage.

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

Property Value

Remarks

This is the full set of chat messages for the history of a conversation between an assistant and user. 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 role and Assistant role.

Applies to