namespace AIStudio.Chat; /// /// A block of content in a chat thread. Might be any type of content, e.g., text, image, voice, etc. /// public class ContentBlock { /// /// Time when the content block was created. /// public DateTimeOffset Time { get; init; } /// /// Type of the content block, e.g., text, image, voice, etc. /// public ContentType ContentType { get; init; } = ContentType.NONE; /// /// The content of the block. /// public IContent? Content { get; set; } /// /// The role of the content block in the chat thread, e.g., user, AI, etc. /// public ChatRole Role { get; set; } = ChatRole.NONE; /// /// Should the content block be hidden from the user? /// public bool HideFromUser { get; init; } public ContentBlock DeepClone() => new() { Time = this.Time, ContentType = this.ContentType, Content = this.Content?.DeepClone(), Role = this.Role, HideFromUser = this.HideFromUser, }; }