Class ChatTokenLogProbabilityInfo

java.lang.Object
com.azure.ai.openai.models.ChatTokenLogProbabilityInfo
All Implemented Interfaces:
com.azure.json.JsonSerializable<ChatTokenLogProbabilityInfo>

public final class ChatTokenLogProbabilityInfo extends Object implements com.azure.json.JsonSerializable<ChatTokenLogProbabilityInfo>
A representation of the log probability information for a single message content token.
  • Method Details

    • getToken

      public String getToken()
      Get the token property: The message content token.
      Returns:
      the token value.
    • getLogprob

      public double getLogprob()
      Get the logprob property: The log probability of the message content token.
      Returns:
      the logprob value.
    • getBytes

      public List<Integer> getBytes()
      Get the bytes property: A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be null if there is no bytes representation for the token.
      Returns:
      the bytes value.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<ChatTokenLogProbabilityInfo>
      Throws:
      IOException
    • fromJson

      public static ChatTokenLogProbabilityInfo fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of ChatTokenLogProbabilityInfo from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of ChatTokenLogProbabilityInfo if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IllegalStateException - If the deserialized JSON object was missing any required properties.
      IOException - If an error occurs while reading the ChatTokenLogProbabilityInfo.