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

25 lines
693 B
C#
Raw Normal View History

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")]
public JsonElement? RawContent { get; init; }
[JsonIgnore]
public string Content => ChatCompletionContent.GetText(this.RawContent) ?? string.Empty;
2026-09-10 15:37:43 +02: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 15:48:07 +02:00
}