ChatChoice Class
- java.
lang. Object - com.
azure. ai. openai. models. ChatChoice
- com.
Implements
public final class ChatChoice
implements JsonSerializable<ChatChoice>
The representation of a single prompt completion as part of an overall chat completions request. Generally, `n` choices are generated per provided prompt with a default value of 1. Token limits and other settings may limit the number of choices generated.
Method Summary
Modifier and Type | Method and Description |
---|---|
static
Chat |
fromJson(JsonReader jsonReader)
Reads an instance of Chat |
Content |
getContentFilterResults()
Get the content |
Chat |
getDelta()
Get the delta property: The delta message content for a streaming response. |
Azure |
getEnhancements()
Get the enhancements property: Represents the output results of Azure OpenAI enhancements to chat completions, as configured via the matching input provided in the request. |
Completions |
getFinishReason()
Get the finish |
int |
getIndex()
Get the index property: The ordered index associated with this chat completions choice. |
Chat |
getLogprobs()
Get the logprobs property: The log probability information for this choice, as enabled via the 'logprobs' request option. |
Chat |
getMessage()
Get the message property: The chat message for a given chat completions prompt. |
Json |
toJson(JsonWriter jsonWriter) |
Methods inherited from java.lang.Object
Method Details
fromJson
public static ChatChoice fromJson(JsonReader jsonReader)
Reads an instance of ChatChoice from the JsonReader.
Parameters:
Returns:
Throws:
getContentFilterResults
public ContentFilterResultsForChoice getContentFilterResults()
Get the contentFilterResults property: Information about the content filtering category (hate, sexual, violence, self_harm), if it has been detected, as well as the severity level (very_low, low, medium, high-scale that determines the intensity and risk level of harmful content) and if it has been filtered or not.
Returns:
getDelta
public ChatResponseMessage getDelta()
Get the delta property: The delta message content for a streaming response.
Returns:
getEnhancements
public AzureChatEnhancements getEnhancements()
Get the enhancements property: Represents the output results of Azure OpenAI enhancements to chat completions, as configured via the matching input provided in the request. This supplementary information is only available when using Azure OpenAI and only when the request is configured to use enhancements.
Returns:
getFinishReason
public CompletionsFinishReason getFinishReason()
Get the finishReason property: The reason that this chat completions choice completed its generated.
Returns:
getIndex
public int getIndex()
Get the index property: The ordered index associated with this chat completions choice.
Returns:
getLogprobs
public ChatChoiceLogProbabilityInfo getLogprobs()
Get the logprobs property: The log probability information for this choice, as enabled via the 'logprobs' request option.
Returns:
getMessage
public ChatResponseMessage getMessage()
Get the message property: The chat message for a given chat completions prompt.
Returns: