Class ChatMessage

ChatMessage class

A chat completion message generated by the model.

public class ChatMessage

Constructors

NameDescription
ChatMessage()Initializes a new instance of the ChatMessage class.
ChatMessage(string, string)Initializes a new instance of the ChatMessage class.

Properties

NameDescription
Content { get; set; }Gets or sets the contents of the message.
Name { get; set; }Gets or sets an optional name for the participant. Provides the model information to differentiate between participants of the same role.
Role { get; set; }Gets or sets the role of the messages author.
ToolCallId { get; set; }Gets or sets tool call that this message is responding to.
ToolCalls { get; set; }Gets or sets the tool calls generated by the model, such as function calls.

Methods

NameDescription
static FromAssistant(string)Creates a new ChatMessage object representing an assistant message.
static FromSystem(string)Creates a new ChatMessage object representing a system message.
static FromUser(string)Creates a new ChatMessage object representing a user message.

See Also