Class OpenAIRequestResponse.Choice
java.lang.Object
com.developer.nefarious.zjoule.plugin.chat.openai.OpenAIRequestResponse.Choice
- Enclosing class:
OpenAIRequestResponse
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the reason why the response generation finished.int
getIndex()
Retrieves the index of this choice in the response.Retrieves the message generated by the OpenAI model for this choice.void
setFinishReason
(String finishReason) Sets the reason why the response generation finished.void
setIndex
(int index) Sets the index of this choice in the response.void
setMessage
(OpenAIChatMessage message) Sets the message generated by the OpenAI model for this choice.
-
Constructor Details
-
Choice
public Choice()
-
-
Method Details
-
getFinishReason
Retrieves the reason why the response generation finished.- Returns:
- the finish reason as a
String
.
-
setFinishReason
Sets the reason why the response generation finished.- Parameters:
finishReason
- the finish reason as aString
.
-
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 anint
.
-
getMessage
Retrieves the message generated by the OpenAI model for this choice.- Returns:
- the
OpenAIChatMessage
.
-
setMessage
Sets the message generated by the OpenAI model for this choice.- Parameters:
message
- theOpenAIChatMessage
.
-