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