mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-09-27 08:33:38 +00:00
26 lines
693 B
C#
26 lines
693 B
C#
using System.Text.Json;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace AIStudio.Provider.OpenAI;
|
|
|
|
/// <summary>
|
|
/// The delta text of a choice.
|
|
/// </summary>
|
|
public sealed record ChatCompletionDelta
|
|
{
|
|
[JsonPropertyName("content")]
|
|
public JsonElement? RawContent { get; init; }
|
|
|
|
[JsonIgnore]
|
|
public string Content => ChatCompletionContent.GetText(this.RawContent) ?? string.Empty;
|
|
|
|
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);
|
|
}
|