mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-05-20 20:32:14 +00:00
29 lines
879 B
C#
29 lines
879 B
C#
using System.Text.Json.Serialization;
|
|
|
|
namespace AIStudio.Provider.OpenAI;
|
|
|
|
/// <summary>
|
|
/// The OpenAI's legacy chat completion request model.
|
|
/// </summary>
|
|
/// <param name="Model">Which model to use for chat completion.</param>
|
|
/// <param name="Messages">The chat messages.</param>
|
|
/// <param name="Stream">Whether to stream the chat completion.</param>
|
|
public record ChatCompletionAPIRequest(
|
|
string Model,
|
|
IList<IMessageBase> Messages,
|
|
bool Stream
|
|
)
|
|
{
|
|
public ChatCompletionAPIRequest() : this(string.Empty, [], true)
|
|
{
|
|
}
|
|
|
|
public IList<object>? Tools { get; init; }
|
|
|
|
public bool? ParallelToolCalls { get; init; }
|
|
|
|
// Attention: The "required" modifier is not supported for [JsonExtensionData].
|
|
[JsonExtensionData]
|
|
public IDictionary<string, object> AdditionalApiParameters { get; init; } = new Dictionary<string, object>();
|
|
}
|