Record Class ChatChunkResponse.Choice
java.lang.Object
java.lang.Record
io.github.stefanbratanov.jvm.openai.ChatChunkResponse.Choice
- Enclosing class:
- ChatChunkResponse
public static record ChatChunkResponse.Choice(ChatChunkResponse.Choice.Delta delta, int index, Logprobs logprobs, String finishReason)
extends Record
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
A chat completion delta generated by streamed model responses. -
Constructor Summary
ConstructorsConstructorDescriptionChoice
(ChatChunkResponse.Choice.Delta delta, int index, Logprobs logprobs, String finishReason) Creates an instance of aChoice
record class. -
Method Summary
Modifier and TypeMethodDescriptiondelta()
Returns the value of thedelta
record component.final 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.int
index()
Returns the value of theindex
record component.logprobs()
Returns the value of thelogprobs
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
Choice
public Choice(ChatChunkResponse.Choice.Delta delta, int index, Logprobs logprobs, String finishReason) Creates an instance of aChoice
record class.- Parameters:
delta
- the value for thedelta
record componentindex
- the value for theindex
record componentlogprobs
- the value for thelogprobs
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. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
delta
Returns the value of thedelta
record component.- Returns:
- the value of the
delta
record component
-
index
public int index()Returns the value of theindex
record component.- Returns:
- the value of the
index
record component
-
logprobs
Returns the value of thelogprobs
record component.- Returns:
- the value of the
logprobs
record component
-
finishReason
Returns the value of thefinishReason
record component.- Returns:
- the value of the
finishReason
record component
-