Record Class MoonshotApi.ChatCompletion.Choice
java.lang.Object
java.lang.Record
org.springframework.ai.moonshot.api.MoonshotApi.ChatCompletion.Choice
- Record Components:
index
- The index of the choice in the list of choices.message
- A chat completion message generated by the model.finishReason
- The reason the model stopped generating tokens.
- Enclosing class:
- MoonshotApi.ChatCompletion
public static record MoonshotApi.ChatCompletion.Choice(Integer index, MoonshotApi.ChatCompletionMessage message, MoonshotApi.ChatCompletionFinishReason finishReason)
extends Record
Chat completion choice.
-
Constructor Summary
ConstructorsConstructorDescriptionChoice
(Integer index, MoonshotApi.ChatCompletionMessage message, MoonshotApi.ChatCompletionFinishReason finishReason) Creates an instance of aChoice
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.Returns the value of thefinishReason
record component.final int
hashCode()
Returns a hash code value for this object.index()
Returns the value of theindex
record component.message()
Returns the value of themessage
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
Choice
public Choice(Integer index, MoonshotApi.ChatCompletionMessage message, MoonshotApi.ChatCompletionFinishReason finishReason) Creates an instance of aChoice
record class.- Parameters:
index
- the value for theindex
record componentmessage
- the value for themessage
record componentfinishReason
- the value for thefinishReason
record component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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)
. -
index
Returns the value of theindex
record component.- Returns:
- the value of the
index
record component
-
message
Returns the value of themessage
record component.- Returns:
- the value of the
message
record component
-
finishReason
Returns the value of thefinishReason
record component.- Returns:
- the value of the
finishReason
record component
-