Class Choice

java.lang.Object
com.azure.ai.openai.models.Choice

public final class Choice extends Object
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 Details

    • getText

      public String getText()
      Get the text property: The generated text for a given completions prompt.
      Returns:
      the text value.
    • getIndex

      public int getIndex()
      Get the index property: The ordered index associated with this completions choice.
      Returns:
      the index value.
    • getLogprobs

      public CompletionsLogProbabilityModel getLogprobs()
      Get the logprobs property: The log probabilities model for tokens associated with this completions choice.
      Returns:
      the logprobs value.
    • getFinishReason

      public CompletionsFinishReason getFinishReason()
      Get the finishReason property: Reason for finishing.
      Returns:
      the finishReason value.