2025-09-03 10:08:04 +02:00
|
|
|
namespace AIStudio.Provider.OpenAI;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Data model for a choice made by the AI.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="Index">The index of the choice.</param>
|
|
|
|
|
/// <param name="Delta">The delta text of the choice.</param>
|
|
|
|
|
public record ChatCompletionChoice(int Index, ChatCompletionDelta Delta)
|
|
|
|
|
{
|
2026-11-03 07:59:30 +01:00
|
|
|
//
|
|
|
|
|
// The properties of the parameters, declared again to be settable. The source generation of System.Text.Json
|
|
|
|
|
// sets every init-only property while it creates the object, also one missing in the JSON, so its value from
|
|
|
|
|
// the parameterless constructor would get lost. Keep them first and in the order of the parameters:
|
|
|
|
|
//
|
|
|
|
|
public int Index { get; set; } = Index;
|
|
|
|
|
public ChatCompletionDelta Delta { get; set; } = Delta;
|
|
|
|
|
|
2026-09-04 15:48:07 +02:00
|
|
|
public ChatCompletionChoice() : this(0, new())
|
2025-09-03 10:08:04 +02:00
|
|
|
{
|
|
|
|
|
}
|
2026-09-04 15:48:07 +02:00
|
|
|
}
|