Record Class OpenAiApi.ChatCompletion.Choice
java.lang.Object
java.lang.Record
org.springframework.ai.openai.api.OpenAiApi.ChatCompletion.Choice
- Record Components:
finishReason- The reason the model stopped generating tokens.index- The index of the choice in the list of choices.message- A chat completion message generated by the model.logprobs- Log probability information for the choice.
- Enclosing class:
OpenAiApi.ChatCompletion
public static record OpenAiApi.ChatCompletion.Choice(OpenAiApi.ChatCompletionFinishReason finishReason, Integer index, OpenAiApi.ChatCompletionMessage message, OpenAiApi.LogProbs logprobs)
extends Record
Chat completion choice.
- Author:
- Christian Tzolov, Michael Lavelle, Mariusz Bernacki, Thomas Vitale, David Frizelle, Alexandros Pappas, Filip Hrisafov
-
Constructor Summary
ConstructorsConstructorDescriptionChoice(OpenAiApi.ChatCompletionFinishReason finishReason, Integer index, OpenAiApi.ChatCompletionMessage message, OpenAiApi.LogProbs logprobs) Creates an instance of aChoicerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of thefinishReasonrecord component.final inthashCode()Returns a hash code value for this object.index()Returns the value of theindexrecord component.logprobs()Returns the value of thelogprobsrecord component.message()Returns the value of themessagerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Choice
public Choice(OpenAiApi.ChatCompletionFinishReason finishReason, Integer index, OpenAiApi.ChatCompletionMessage message, OpenAiApi.LogProbs logprobs) Creates an instance of aChoicerecord class.- Parameters:
finishReason- the value for thefinishReasonrecord componentindex- the value for theindexrecord componentmessage- the value for themessagerecord componentlogprobs- the value for thelogprobsrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
finishReason
Returns the value of thefinishReasonrecord component.- Returns:
- the value of the
finishReasonrecord component
-
index
-
message
-
logprobs
-