Files
AI-Studio/app/MindWork AI Studio/Provider/OpenAI/TextMessage.cs
T

22 lines
873 B
C#
Raw Normal View History

2024-05-04 11:11:23 +02:00
namespace AIStudio.Provider.OpenAI;
/// <summary>
2025-12-30 18:30:32 +01:00
/// Standard text-based chat message model.
2024-05-04 11:11:23 +02:00
/// </summary>
/// <param name="Content">The text content of the message.</param>
/// <param name="Role">The role of the message.</param>
2025-12-28 14:10:20 +01:00
public record TextMessage(string Content, string Role) : IMessage<string>
{
//
// The properties of the parameters, declared again to be settable. The source generation of System.Text.Json
// sets every init-only property while it creates the object, also one missing in the JSON, so its value from
// the parameterless constructor would get lost. Keep them first and in the order of the parameters, which is
// the order they get written in:
//
public string Content { get; set; } = Content;
public string Role { get; set; } = Role;
2025-12-28 14:10:20 +01:00
public TextMessage() : this(string.Empty, string.Empty)
{
}
}