Class OpenAIRequestResponse.Choice

java.lang.Object
com.developer.nefarious.zjoule.plugin.chat.openai.OpenAIRequestResponse.Choice
Enclosing class:
OpenAIRequestResponse

public static class OpenAIRequestResponse.Choice extends Object
Represents a single choice in the response from the OpenAI API. A choice contains the generated message, its index, and the reason why the generation finished.
  • Constructor Details

    • Choice

      public Choice()
  • Method Details

    • getFinishReason

      public String getFinishReason()
      Retrieves the reason why the response generation finished.
      Returns:
      the finish reason as a String.
    • setFinishReason

      public void setFinishReason(String finishReason)
      Sets the reason why the response generation finished.
      Parameters:
      finishReason - the finish reason as a String.
    • getIndex

      public int getIndex()
      Retrieves the index of this choice in the response.
      Returns:
      the index as an int.
    • setIndex

      public void setIndex(int index)
      Sets the index of this choice in the response.
      Parameters:
      index - the index as an int.
    • getMessage

      public OpenAIChatMessage getMessage()
      Retrieves the message generated by the OpenAI model for this choice.
      Returns:
      the OpenAIChatMessage.
    • setMessage

      public void setMessage(OpenAIChatMessage message)
      Sets the message generated by the OpenAI model for this choice.
      Parameters:
      message - the OpenAIChatMessage.