// <auto-generated/>

#nullable disable

using System;
using System.Collections.Generic;
using System.Linq;
using OpenAI;

namespace OpenAI.Chat
{
    public partial class ChatTokenLogProbabilityDetails
    {
        private protected IDictionary<string, BinaryData> _additionalBinaryDataProperties;

        internal ChatTokenLogProbabilityDetails(string token, float logProbability, ReadOnlyMemory<byte>? utf8Bytes, IEnumerable<ChatTokenTopLogProbabilityDetails> topLogProbabilities)
        {
            Token = token;
            LogProbability = logProbability;
            Utf8Bytes = utf8Bytes;
            TopLogProbabilities = topLogProbabilities.ToList();
        }

        internal ChatTokenLogProbabilityDetails(string token, float logProbability, ReadOnlyMemory<byte>? utf8Bytes, IReadOnlyList<ChatTokenTopLogProbabilityDetails> topLogProbabilities, IDictionary<string, BinaryData> additionalBinaryDataProperties)
        {
            // Plugin customization: ensure initialization of collections
            Token = token;
            LogProbability = logProbability;
            Utf8Bytes = utf8Bytes;
            TopLogProbabilities = topLogProbabilities ?? new ChangeTrackingList<ChatTokenTopLogProbabilityDetails>();
            _additionalBinaryDataProperties = additionalBinaryDataProperties;
        }

        public string Token { get; }

        internal IDictionary<string, BinaryData> SerializedAdditionalRawData
        {
            get => _additionalBinaryDataProperties;
            set => _additionalBinaryDataProperties = value;
        }
    }
}
