using Microsoft.TypeSpec.Generator.Customizations; using System.Collections.Generic; namespace OpenAI.Chat; /// /// Represents a chat message of the system role as supplied to a chat completion request. A system message is /// generally supplied as the first message to a chat completion request and guides the model's behavior across future /// assistant role response messages. These messages may help control behavior, style, tone, and /// restrictions for a model-based assistant. Developer messages replace system messages for o1 models and newer. /// [CodeGenType("ChatCompletionRequestSystemMessage")] [CodeGenVisibility(nameof(SystemChatMessage), CodeGenVisibility.Internal)] [CodeGenSuppress("SystemChatMessage", typeof(ChatMessageContent))] public partial class SystemChatMessage : ChatMessage { /// /// Creates a new instance of using a collection of content items. /// For system messages, these can only be of type text. /// /// /// The collection of content items associated with the message. /// public SystemChatMessage(IEnumerable contentParts) : this(content: new(contentParts), role: ChatMessageRole.System, participantName: null, patch: default) { } /// /// Creates a new instance of using a collection of content items. /// For system messages, these can only be of type text. /// /// /// The collection of content items associated with the message. /// public SystemChatMessage(params ChatMessageContentPart[] contentParts) : this(content: new(contentParts), role: ChatMessageRole.System, participantName: null, patch: default) { Argument.AssertNotNullOrEmpty(contentParts, nameof(contentParts)); } /// /// Creates a new instance of with a single item of text content. /// /// The text content of the message. public SystemChatMessage(string content) : this(content: new([content]), role: ChatMessageRole.System, participantName: null, patch: default) { Argument.AssertNotNull(content, nameof(content)); } /// /// An optional name for the participant. /// [CodeGenMember("Name")] public string ParticipantName { get; set; } }