openai/openai-dotnet
Publicmirrored from https://github.com/openai/openai-dotnetAvailable
OpenAI/src/Generated/Models/Chat/ChatCompletion.cs
62lines · modecode
| 1 | // <auto-generated/> |
| 2 | |
| 3 | #nullable disable |
| 4 | |
| 5 | using System; |
| 6 | using System.ClientModel.Primitives; |
| 7 | using System.Collections.Generic; |
| 8 | using System.ComponentModel; |
| 9 | using System.Diagnostics.CodeAnalysis; |
| 10 | using System.Linq; |
| 11 | using System.Text.Json.Serialization; |
| 12 | using OpenAI; |
| 13 | |
| 14 | namespace OpenAI.Chat |
| 15 | { |
| 16 | public partial class ChatCompletion |
| 17 | { |
| 18 | [Experimental("SCME0001")] |
| 19 | private JsonPatch _patch; |
| 20 | |
| 21 | internal ChatCompletion(string id, IEnumerable<InternalCreateChatCompletionResponseChoice> choices, DateTimeOffset createdAt, string model) |
| 22 | { |
| 23 | Id = id; |
| 24 | Choices = choices.ToList(); |
| 25 | CreatedAt = createdAt; |
| 26 | Model = model; |
| 27 | } |
| 28 | |
| 29 | #pragma warning disable SCME0001 // Type is for evaluation purposes only and is subject to change or removal in future updates. |
| 30 | internal ChatCompletion(string id, IReadOnlyList<InternalCreateChatCompletionResponseChoice> choices, DateTimeOffset createdAt, string model, ChatServiceTier? serviceTier, string systemFingerprint, string @object, ChatTokenUsage usage, in JsonPatch patch) |
| 31 | { |
| 32 | // Plugin customization: ensure initialization of collections |
| 33 | Id = id; |
| 34 | Choices = choices ?? new ChangeTrackingList<InternalCreateChatCompletionResponseChoice>(); |
| 35 | CreatedAt = createdAt; |
| 36 | Model = model; |
| 37 | ServiceTier = serviceTier; |
| 38 | SystemFingerprint = systemFingerprint; |
| 39 | Object = @object; |
| 40 | Usage = usage; |
| 41 | _patch = patch; |
| 42 | _patch.SetPropagators(PropagateSet, PropagateGet); |
| 43 | } |
| 44 | #pragma warning restore SCME0001 // Type is for evaluation purposes only and is subject to change or removal in future updates. |
| 45 | |
| 46 | [JsonIgnore] |
| 47 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 48 | [Experimental("SCME0001")] |
| 49 | public ref JsonPatch Patch => ref _patch; |
| 50 | |
| 51 | public string Id { get; } |
| 52 | |
| 53 | public string Model { get; } |
| 54 | |
| 55 | [Experimental("OPENAI001")] |
| 56 | public ChatServiceTier? ServiceTier { get; } |
| 57 | |
| 58 | public string SystemFingerprint { get; } |
| 59 | |
| 60 | public ChatTokenUsage Usage { get; } |
| 61 | } |
| 62 | } |
| 63 | |