using System.Text.Json.Serialization;
using AnthropicClient.Utils;
namespace AnthropicClient.Models;
///
/// Represents text content that is part of a chat message.
///
public class TextContent : Content
{
///
/// Gets the text of the content.
///
public string Text { get; init; } = string.Empty;
[JsonConstructor]
internal TextContent() : base(ContentType.Text)
{
}
///
/// Initializes a new instance of the class.
///
/// The text of the content.
/// Thrown when the text is null.
/// A new instance of the class.
public TextContent(string text) : base(ContentType.Text)
{
ArgumentValidator.ThrowIfNull(text, nameof(text));
Text = text;
}
}