Files
anthropic-client/src/AnthropicClient/Models/JsonDelta.cs
T

30 lines
772 B
C#
Raw Normal View History

2024-06-28 10:54:00 -05:00
using System.Text.Json.Serialization;
namespace AnthropicClient.Models;
2024-06-29 22:20:55 -05:00
/// <summary>
/// Represents a JSON delta.
/// </summary>
2024-06-28 10:54:00 -05:00
public class JsonDelta : ContentDelta
{
2024-06-29 22:20:55 -05:00
/// <summary>
/// Gets the partial JSON.
/// </summary>
2024-06-28 10:54:00 -05:00
[JsonPropertyName("partial_json")]
public string PartialJson { get; init; } = string.Empty;
[JsonConstructor]
internal JsonDelta() : base(ContentDeltaType.JsonDelta)
{
}
2024-06-29 22:20:55 -05:00
/// <summary>
/// Initializes a new instance of the <see cref="JsonDelta"/> class.
/// </summary>
/// <param name="partialJson">The partial JSON.</param>
/// <returns>A new instance of the <see cref="JsonDelta"/> class.</returns>
2024-06-28 10:54:00 -05:00
public JsonDelta(string partialJson) : base(ContentDeltaType.JsonDelta)
{
PartialJson = partialJson;
}
}