AI-Studio/app/MindWork AI Studio/Provider/OpenAI/ChatCompletionDelta.cs

17 lines
401 B
C#
Raw Normal View History

using System.Text.Json;
using System.Text.Json.Serialization;
2025-09-03 08:08:04 +00:00
namespace AIStudio.Provider.OpenAI;
/// <summary>
/// The delta text of a choice.
/// </summary>
public sealed record ChatCompletionDelta
2025-09-03 08:08:04 +00:00
{
[JsonPropertyName("content")]
public JsonElement? RawContent { get; init; }
[JsonIgnore]
public string Content => ChatCompletionContent.GetText(this.RawContent) ?? string.Empty;
}