Class Choice

java.lang.Object
nl.dannyj.mistral.models.completion.Choice

public class Choice extends Object
Represents a choice in a chat completion response. A choice contains the generated assistant message and the reason the generation finished.
  • Constructor Details

    • Choice

      public Choice(int index, AssistantMessage message, FinishReason finishReason)
      Creates a new Choice instance.
      Parameters:
      index - The index of the choice. Starts at 0.
      message - The message that was generated.
      finishReason - Reason for the completion to finish.
    • Choice

      public Choice()
  • Method Details

    • getIndex

      public int getIndex()
      The index of the choice. Starts at 0.
      Returns:
      the index of the choice
    • getMessage

      public AssistantMessage getMessage()
      The message that was generated.
      Returns:
      the assistant message that was generated
    • getFinishReason

      public FinishReason getFinishReason()
      Reason for the completion to finish.
      Returns:
      the reason for the completion to finish
    • toString

      public String toString()
      Overrides:
      toString in class Object