Choice Class
- java.
lang. Object - com.
azure. ai. openai. models. Choice
- com.
Implements
public final class Choice
implements JsonSerializable<Choice>
The representation of a single prompt completion as part of an overall 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 Choice |
fromJson(JsonReader jsonReader)
Reads an instance of Choice from the Json |
Content |
getContentFilterResults()
Get the content |
Completions |
getFinishReason()
Get the finish |
int |
getIndex()
Get the index property: The ordered index associated with this completions choice. |
Completions |
getLogprobs()
Get the logprobs property: The log probabilities model for tokens associated with this completions choice. |
String |
getText()
Get the text property: The generated text for a given completions prompt. |
Json |
toJson(JsonWriter jsonWriter) |
Methods inherited from java.lang.Object
Method Details
fromJson
public static Choice fromJson(JsonReader jsonReader)
Reads an instance of Choice 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:
getFinishReason
public CompletionsFinishReason getFinishReason()
Get the finishReason property: Reason for finishing.
Returns:
getIndex
public int getIndex()
Get the index property: The ordered index associated with this completions choice.
Returns:
getLogprobs
public CompletionsLogProbabilityModel getLogprobs()
Get the logprobs property: The log probabilities model for tokens associated with this completions choice.
Returns:
getText
public String getText()
Get the text property: The generated text for a given completions prompt.
Returns:
toJson
Applies to
Azure SDK for Java