2026-09-04 13:48:07 +00:00
|
|
|
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>
|
2026-09-04 13:48:07 +00:00
|
|
|
public sealed record ChatCompletionDelta
|
2025-09-03 08:08:04 +00:00
|
|
|
{
|
2026-09-04 13:48:07 +00:00
|
|
|
[JsonPropertyName("content")]
|
|
|
|
|
public JsonElement? RawContent { get; init; }
|
|
|
|
|
|
|
|
|
|
[JsonIgnore]
|
|
|
|
|
public string Content => ChatCompletionContent.GetText(this.RawContent) ?? string.Empty;
|
2026-09-10 13:37:43 +00:00
|
|
|
|
|
|
|
|
public string? ReasoningContent { get; init; }
|
|
|
|
|
|
|
|
|
|
public string? Reasoning { get; init; }
|
|
|
|
|
|
|
|
|
|
public IList<JsonElement>? ReasoningDetails { get; init; }
|
|
|
|
|
|
|
|
|
|
[JsonIgnore]
|
|
|
|
|
public string Thinking => ThinkingContent.Get(this.ReasoningContent, this.Reasoning, this.ReasoningDetails);
|
2026-09-04 13:48:07 +00:00
|
|
|
}
|