Package com.azure.ai.openai.models
Class ChatTokenLogProbabilityResult
java.lang.Object
com.azure.ai.openai.models.ChatTokenLogProbabilityResult
- All Implemented Interfaces:
com.azure.json.JsonSerializable<ChatTokenLogProbabilityResult>
public final class ChatTokenLogProbabilityResult
extends Object
implements com.azure.json.JsonSerializable<ChatTokenLogProbabilityResult>
A representation of the log probability information for a single content token, including a list of most likely
tokens if 'top_logprobs' were requested.
-
Method Summary
Modifier and TypeMethodDescriptionfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of ChatTokenLogProbabilityResult from the JsonReader.getBytes()Get the bytes property: A list of integers representing the UTF-8 bytes representation of the token.doubleGet the logprob property: The log probability of the message content token.getToken()Get the token property: The message content token.Get the topLogprobs property: The list of most likely tokens and their log probability information, as requested via 'top_logprobs'.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Method Details
-
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
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.
-
getTopLogprobs
Get the topLogprobs property: The list of most likely tokens and their log probability information, as requested via 'top_logprobs'.- Returns:
- the topLogprobs value.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<ChatTokenLogProbabilityResult>- Throws:
IOException
-
fromJson
public static ChatTokenLogProbabilityResult fromJson(com.azure.json.JsonReader jsonReader) throws IOException Reads an instance of ChatTokenLogProbabilityResult from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of ChatTokenLogProbabilityResult 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 ChatTokenLogProbabilityResult.
-